Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XMLTOCUSRSOR and negative numbers
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00882310
Message ID:
00882312
Vues:
14
Hi Bo,

What about doing it in two steps?
...
* Create cursor with proper field types by replacing '-' with '0'
XMLTOCURSOR(STRTRAN(cXML, "-", "0"), "crsXml")
* Actual XML conversion into already created cursor
SELECT crsXml
ZAP
XMLTOCURSOR(cXML, "crsXml",8192)
?"number1:", VARTYPE(number1)	&& "N"
?"number2:", VARTYPE(number2)	&& "N"
>When I use the XMLTOCURSOR function and the XML contains a negative number, it creates a field type of character instead of number. What is the easiest way of getting around this?
>
>I know the element names and data types of the XML, but not necessarily the precision of the number types. I guess I could create an external schema but where do you find the schema specifications?
>
>
>
** Sample:
>
>LOCAL cXML
>** Create sample XML
>TEXT TO cXML NOSHOW
><data>
>	<record>
>		<number1> 100.00</number1>
>		<number2>-100.00</number2>
>	</record>
></data>
>ENDTEXT
>
>XMLTOCURSOR(cXML)
>?"number1:", VARTYPE(number1)	&& "N"
>?"number2:", VARTYPE(number2)	&& "C"
>
>
>Thanks,
>Bo Durban
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform