Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I'm a complete idiot about this topic
Message
De
17/06/2009 12:14:54
 
 
À
17/06/2009 11:05:51
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
01406387
Message ID:
01406609
Vues:
88
Dorris,

Your code does not make much sense to me. The schema and the data are both the same file
[ the extension of a schema is normally .xsd ]


Can you zip up both both the schema you posted yesterday and the xml file you're trying to load and email them to GregoryAdam at hotmail com ?

I'll see what I can do - dunno whether I'll succeed though




>That worked but as that xml had no data in it, I switched to one that does. It's a basic Decode table.
>
>This code works, except that I end up with 2 fields and no data rows
>
>
>
>LOCAL oxml as XMLAdapter
>oxml = NEWOBJECT("xmladapter")
>oxml.XMLSchemaLocation = 'c:\cmbhs\caredecodetables.xml'
>oxml.LoadXML("c:\cmbhs\CareDecodetables.xml",.t.,.t.)
>?oXML.Tables.Item(1).Fields.Item(1).DataType	&& returns 'M'
>?oxml.Tables.Count		&& returns 1
>oxml.tables.Item(1).tocursor	&& creates cursor named 'cmbhscodetables'
>
>
>
>here is the first part of the xml
>
>
><?xml version="1.0"?><xs:schema targetNamespace="http://CMBHSSchemas.MHCenter.CareDecodeTables" 
>      xmlns="http://CMBHSSchemas.MHCenter.CareDecodeTables" 
>  xmlns:b="http://schemas.microsoft.com/BizTalk/2003" 
>  xmlns:xs="http://www.w3.org/2001/XMLSchema">
>  <xs:element name="CMBHSCodeTables">
>    <xs:complexType>
>      <xs:sequence>
>        <xs:element name="texas_zipcode" type="texas_zipcode"/>
>        <xs:element name="presenting_problem" type="presenting_problem"/>
>      </xs:sequence>
>    </xs:complexType>
>  </xs:element>
>
>  <xs:simpleType name="presenting_problem">
>    <xs:restriction base="xs:string">
>      <xs:enumeration value="1"/>
>      <!-- 1 MH (Mental Health) -->
>      <xs:enumeration value="2"/>
>      <!-- 2 MR (Mental Retardation) -->
>      <xs:enumeration value="3"/>
>      <!-- 3 ECI/DD (Early Childhood Intervention/Developmentally Delayed)-->
>      <xs:enumeration value="4"/>
>      <!-- 4 SA (Substance Abuse) -->
>      <xs:enumeration value="5"/>
>      <!-- 5 Related Condition - MR -->
>    </xs:restriction>
>  </xs:simpleType>
>  <xs:simpleType name="texas_zipcode">
>    <xs:restriction base="xs:string">
>  <xs:enumeration value="75973"/>
>  <xs:enumeration value="75973"/>
>
>
>
>I figure you didn't want to see a million lines of Texas' zipcodes
>
>Question is, how do I get the data to load? Am I incorrect in expecting the LoadXML to do it all in one pass?
>
>
>
>>>ok, using the minimal code from their examples
>>>
>>>
>>>LOCAL oxml as XMLAdapter
>>>oxml = NEWOBJECT("xmladapter")
>>>oxml.LoadXML("c:\cmbhs\cmbhsadultuniformassessment.xml")
>>>?oXMLAdapter.Tables.Item(1).Fields.Item(1).DataType
>>>
>>>
>>>It still fails on the "c:references tag"
>>>
>>>
>>
>>
>>Dorris,
>>
>>If the file you posted earlier is the schema
>>
>>try the following
>>
>>if it does not work, post the contents of c:\cmbhs\cmbhsadultuniformassessment.xml
>>
>>
>>>LOCAL oxml as XMLAdapter
>>>oxml = NEWOBJECT("xmladapter")
>>
>>oxml.XMLSchemaLocation = 'The file you posted earlier'
>>
>>
>>>oxml.LoadXML("c:\cmbhs\cmbhsadultuniformassessment.xml", .t., .t.)
>>>?oxml .Tables.Item(1).Fields.Item(1).DataType
>>
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform