Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use XML as data source
Message
From
10/05/2005 03:49:44
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Use XML as data source
Miscellaneous
Thread ID:
01012369
Message ID:
01012369
Views:
54
Hi,
Any sample code to use XMLAdapter and CursorAdapter to access and update XML data source?

I tried the following but it doesn't work!
CA=CREATEOBJECT("CURSORADAPTER")
xa=CREATEOBJECT("xmladapter")
xa.LoadXML("myxml",.T.)
ca.SelectCmd="www.table.item(1)"
?ca.CursorFill()    && RETURN .F. , Invalid at top level of document

XML - myxml
--------

<?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
<VFPDataSet>
	<xsd:schema id="VFPDataSet" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
		<xsd:element name="VFPDataSet" msdata:IsDataSet="true">
			<xsd:complexType>
				<xsd:choice maxOccurs="unbounded">
					<xsd:element name="aaa" minOccurs="0" maxOccurs="unbounded">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="ckey">
									<xsd:simpleType>
										<xsd:restriction base="xsd:string">
											<xsd:maxLength value="10"/>
										</xsd:restriction>
									</xsd:simpleType>
								</xsd:element>
								<xsd:element name="cclassname">
									<xsd:simpleType>
										<xsd:restriction base="xsd:string">
											<xsd:maxLength value="10"/>
										</xsd:restriction>
									</xsd:simpleType>
								</xsd:element>
								<xsd:element name="cclasslibrary">
									<xsd:simpleType>
										<xsd:restriction base="xsd:string">
											<xsd:maxLength value="20"/>
										</xsd:restriction>
									</xsd:simpleType>
								</xsd:element>
							</xsd:sequence>
						</xsd:complexType>
					</xsd:element>
				</xsd:choice>
				<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="lax"/>
			</xsd:complexType>
		</xsd:element>
	</xsd:schema>
	<aaa>
		<ckey>0000000000</ckey>
		<cclassname>aaaa</cclassname>
		<cclasslibrary>aaaa</cclasslibrary>
	</aaa>
	<aaa>
		<ckey>1111111111</ckey>
		<cclassname>BBBB</cclassname>
		<cclasslibrary/>
	</aaa>
</VFPDataSet>
Beside, how to update changes back to the XML data source?

Thank you
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Next
Reply
Map
View

Click here to load this message in the networking platform