Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to convert XSD to a table structure?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01025314
Message ID:
01028155
Vues:
39
This message has been marked as the solution to the initial question of the thread.
Hi Dawa,

>I don't have "Start Menu\Programs\MSXML 4.0\Microsoft XML 4.0 Parser SDK" menu item at all anywhere under "Start Menu".
>

Check installation folder for MSXML SDK. On my system I have C:\Program Files\MSXML 4.0\doc folder, which contains xmlsdk.chm file. If it is not there, you may need to rerun setup, perhaps help file installation is optional and you didn't chose to install it.


>Based on your sample, I tried to read my XSD as follows:
>
>oDom=CREATEOBJECT("Msxml2.DOMDocument.4.0")
>m.odom.load("abcroot.xsd")
>oCache=CREATEOBJECT("Msxml2.XMLSchemaCache.4.0")
>m.ocache.add("http://www.myserver.com/abc",m.odom.documentElement)
>oSchema = m.ocache.getSchema("http://www.myserver.com/abc")
>
>I am getting an error at this line:
oSchema=oCache.getSchema("http://www.myserver.com/abc")
when I apply it to my schema file. My schema has a namespaceURI. The error says "OLE Error code 0x80020003: Member not found".
>

I don't know why you are getting this error. The following code uses XML Schema with a Namespace, it doesn't report any error for me:
CLEAR
CLOSE TABLES ALL 

TEXT TO cSomeSchema NOSHOW
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<xsd:schema id="VFPDataSet" targetNamespace="SomeNamespace" xmlns="SomeNamespace" 
		xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
		xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" 
		attributeFormDefault="qualified" elementFormDefault="qualified">
	<xsd:element name="VFPDataSet" msdata:IsDataSet="true">
		<xsd:complexType>
			<xsd:choice maxOccurs="unbounded">
				<xsd:element name="someTable" minOccurs="0" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="somefield">
								<xsd:simpleType>
									<xsd:restriction base="xsd:string">
										<xsd:maxLength value="15"/>
									</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>
ENDTEXT 

cSchemaFileName=SYS(5)+CURDIR()+"schema.xsd"
STRTOFILE(cSomeSchema, cSchemaFileName)

oDom=CREATEOBJECT("Msxml2.DOMDocument.4.0")
oDom.load(cSchemaFileName)
oCache=CREATEOBJECT("Msxml2.XMLSchemaCache.4.0")
oCache.add("SomeNamespace",oDom.documentElement)
oSchema=oCache.getSchema("SomeNamespace")
?oSchema.targetNamespace
oVFPDataSet=oSchema.elements(0)
?oVFPDataSet.namespaceURI,oVFPDataSet.name
oSomeTable=oVFPDataSet.type.contentModel.particles(0)
?oSomeTable.namespaceURI,oSomeTable.name
oSomefield=oSomeTable.type.contentModel.particles(0)
?oSomefield.namespaceURI,oSomefield.name, ;
	oSomefield.type.baseTypes(0).name, oSomefield.type.maxLength
Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform