Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parsing XML with DOM
Message
From
20/11/2004 18:52:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/11/2004 18:07:47
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
00962465
Message ID:
00963254
Views:
7
>Thanks Cetin,
>
>See my recent reply to Martin Jindra for a more complete explanation of my problem. The simple xmltocursor errors out with a parse error even if I split up the file because the format is inconsistant. So as much as I don't want to it looks like I will have to use DOM unless I can figure out this schema thing. I'm currently using VFP 7.0 (anxiously waiting for release 9) so the xmladaptor is not an option yet.
>
>Thanks again
>
>- Don

Don,
For now I can at least supply a schema.
<?xml version="1.0"?>
<xs:schema id="tvData" targetNamespace="http://tempuri.org/myTVlisting.xsd" xmlns:mstns="http://tempuri.org/myTVlisting.xsd" xmlns="http://tempuri.org/myTVlisting.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:element name="tvData" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
    <xs:complexType>
      <xs:choice maxOccurs="unbounded">
        <xs:element name="stations">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="station" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="callSign" type="xs:string" minOccurs="0" msdata:Ordinal="0" />
                    <xs:element name="name" type="xs:string" minOccurs="0" msdata:Ordinal="1" />
                    <xs:element name="affiliate" type="xs:string" minOccurs="0" msdata:Ordinal="2" />
                  </xs:sequence>
                  <xs:attribute name="id" form="unqualified" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="schedules">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="schedule" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="part" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:attribute name="number" form="unqualified" type="xs:string" />
                        <xs:attribute name="total" form="unqualified" type="xs:string" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="program" form="unqualified" type="xs:string" />
                  <xs:attribute name="station" form="unqualified" type="xs:string" />
                  <xs:attribute name="time" form="unqualified" type="xs:string" />
                  <xs:attribute name="duration" form="unqualified" type="xs:string" />
                  <xs:attribute name="tvRating" form="unqualified" type="xs:string" />
                  <xs:attribute name="stereo" form="unqualified" type="xs:string" />
                  <xs:attribute name="closeCaptioned" form="unqualified" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="programs">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="program" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="title" type="xs:string" minOccurs="0" msdata:Ordinal="0" />
                    <xs:element name="description" type="xs:string" minOccurs="0" msdata:Ordinal="1" />
                    <xs:element name="mpaaRating" type="xs:string" minOccurs="0" msdata:Ordinal="2" />
                    <xs:element name="starRating" type="xs:string" minOccurs="0" msdata:Ordinal="3" />
                    <xs:element name="runTime" type="xs:string" minOccurs="0" msdata:Ordinal="4" />
                    <xs:element name="year" type="xs:string" minOccurs="0" msdata:Ordinal="5" />
                    <xs:element name="series" type="xs:string" minOccurs="0" msdata:Ordinal="6" />
                    <xs:element name="advisories" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="advisory" nillable="true" minOccurs="0" maxOccurs="unbounded">
                            <xs:complexType>
                              <xs:simpleContent msdata:ColumnName="advisory_Text" msdata:Ordinal="0">
                                <xs:extension base="xs:string">
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="id" form="unqualified" type="xs:string" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform