Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using external XSD with xmltocursor()
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00775682
Message ID:
00776025
Views:
17
Hi Paul,

To make sure that the XMLTOCURSOR() function will work with an external XSD file, the xsi:noNamespaceSchemaLocation attribute must exist at the root node of your instance document. Please, take a look at the following code and pay attention to the XML data generated by the CURSORTOXML() function.
CREATE CURSOR Customers (ID Integer, Name Char(30))
INSERT INTO Customers VALUES (1, "Fabio")
INSERT INTO Customers VALUES (2, "Vazquez")

*-- We Create the XML and XSD files from the data
CURSORTOXML("Customers", "Data.xml", 1, 0+512, 0, "Schema.xsd")

*-- Notice the "xsi:noNamespaceSchemaLocation" attribute on the root node
MODIFY FILE "Data.xml"

*-- We read the data from an XML file with a external schema
XMLTOCURSOR("Data.xml", "NewCust", 512)

BROWSE
Thanks!
-----
Fabio Vazquez
http://www.fabiovazquez.com
Previous
Reply
Map
View

Click here to load this message in the networking platform