Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need simple sample about CursorToXml() , XmlToCursor()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00830206
Message ID:
00830214
Vues:
19
i've found somethings but i've new questions...
* creating xml file...
cFile = "c:\vfptemp\EmployeeXML.xml"
OPEN DATABASE (_samples+"\northwind\northwind")
SELECT employeeid, lastname ;
FROM Employees;
INTO CURSOR curEmployees
oAdapter = CREATEOBJECT("XMLAdapter")
oAdapter.AddTableSchema("curEmployees")
oAdapter.ToXML(cFile,,.T.) 

* showing xml file 
cFile = "c:\vfptemp\employeexml.xml"
oAdapter = CREATEOBJECT("XMLAdapter")
oAdapter.LoadXML(cFile,.T.)
oAdapter.Tables(1).ToCursor()
BROWSE

* created xml file

<?xml version = "1.0" encoding="Windows-1252" 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="curEmployees" minOccurs="0" maxOccurs="unbounded">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element name="employeeid" type="xsd:int"/>
								<xsd:element name="lastname">
									<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>
	<curEmployees>
		<employeeid>1</employeeid>
		<lastname>Davolio</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>2</employeeid>
		<lastname>Fuller</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>3</employeeid>
		<lastname>Leverling</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>4</employeeid>
		<lastname>Peacock</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>5</employeeid>
		<lastname>Buchanan</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>6</employeeid>
		<lastname>Suyama</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>7</employeeid>
		<lastname>King</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>8</employeeid>
		<lastname>Callahan</lastname>
	</curEmployees>
	<curEmployees>
		<employeeid>9</employeeid>
		<lastname>Dodsworth</lastname>
	</curEmployees>
</VFPDataSet>
MY QUESTION : with two sample above we can create and load xml files , but i wantto know that , these xml files creating by vfp ,sometimes we can to come acrros xml files created by vb,delphi or c++ etc. When we want to load these xml files they wont be include , xsd etc.. tags in xml files . How is the best way to load xml files to vfp cursors which created from any programming languages ?

TIA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform