Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLAdapter not working?
Message
From
09/06/2003 13:20:33
 
 
To
09/06/2003 10:09:01
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00797955
Message ID:
00798035
Views:
30
This message has been marked as the solution to the initial question of the thread.
Hi Kris,

As Doug said, XMLAdapter doesn't support this type of XML schema, but you can populate Tables collection manually:
CLOSE DATABASES all
CLEAR

TEXT TO cXML NOSHOW
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stuff [
	<!ELEMENT stuff (note+)>
	<!ELEMENT note (to, from, heading, body, saveonexit)>
	<!ELEMENT to (#PCDATA)>
	<!ELEMENT from (#PCDATA)>
	<!ELEMENT heading (#PCDATA)>
	<!ELEMENT body (#PCDATA)>
	<!ELEMENT saveonexit (#PCDATA)>
]>
<stuff>
	<note>
		<to>Tove</to>
		<from>Jani</from>
		<heading>Reminder</heading>
		<body>Don't forget me this weekend!</body>
		<saveonexit>True</saveonexit>
	</note>
</stuff>
ENDTEXT

LOCAL loXML as XMLAdapter

loXML = CREATEOBJECT("XMLAdapter")

loXML.LoadXML(cXML,.f.,.t.)
? loXML.Tables.Count

CREATE CURSOR note (to c(10),from c(10),heading c(15),body c(50),saveonexit L)

loXML.AddTableSchema("note",.T.,STRCONV("note",5))
loXML.XMLName=STRCONV("stuff",5)

USE IN note

loXML.Tables(1).ToCursor()
SELECT note
list

return
Thanks,
Aleksey.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform