Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with XMLAdapter ToCursor method
Message
 
 
To
14/02/2008 17:32:32
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
01292823
Message ID:
01292832
Views:
7
XMLAdapter requires XML schema in order to create XmlTables.
It's easy to post XML. Just inclose it into < pre> < /pre> tags (w/o spaces.). For example,
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
	<cd>
		<title>Empire Burlesque</title>
		<artist>Bob Dylan</artist>
		<country>USA</country>
		<company>Columbia</company>
		<price>10.90</price>
		<year>1985</year>
	</cd>
	<cd>
		<title>Hide your heart</title>
		<artist>Bonnie Tyler</artist>
		<country>UK</country>
		<company>CBS Records</company>
		<price>9.90</price>
		<year>1988</year>
	</cd>

</catalog>
>I am trying to get some XML data into a cursor. I create an XMLAdapter object using something like this:
>
>cxml='res.xml'
>o = NEWOBJECT('XMLAdapter')
>IF VARTYPE(o)='O'
> x=o.LoadXML(cXML,.t.)
> o.Tables(1).ToCursor()
>endif
>
>This produces an error on the line o.tables(1).ToCursor() -> "Index or expression does not match an existing member of the collection". When I examine the object o the tables collection is empty. I have never worked with XMLAdapter before and the help is somewhat lacking. There is no XSD file and the XML data looks like this -(Sorry the XML is so ugly- it is incredibly difficult to post XML data here.)
>
<snip>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform