A
austris.bahanovskis
Hi,
I must apollgize beforehand for the basic question but i was strugling
to get my code fixed. I also must admit that this is my first .xml
attempt and i failed to find answers on MS support site or searching
this group.
So, i can't get the schema right for this datafile.
Data file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<country xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="country2.xsd">
<entry>
<name>China</name>
<population>22.2</population>
<continent>Asia</continent>
</entry>
<entry>
<name>France</name>
<population>12</population>
<continent>Europe</continent>
</entry>
</country>
And this is the schema (i'm sure i'm getting the ComplexType/child/
parent tags wrong):
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="country" type="Country"/>
<xs:complexType name="Country">
<xs:sequence>
<xs:element name="entry" type="Entry"/>
<xs:complexType name="Entry">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="population" type="xs:decimal"/>
<xs:element name="continent" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:sequence>
</xs:complexType>
</xs:schema>
I just haven't figured out the logic behind grouping the elements in
the schema file - any advise would be greatly appreciated.
Thanks!
A.
I must apollgize beforehand for the basic question but i was strugling
to get my code fixed. I also must admit that this is my first .xml
attempt and i failed to find answers on MS support site or searching
this group.
So, i can't get the schema right for this datafile.
Data file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<country xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="country2.xsd">
<entry>
<name>China</name>
<population>22.2</population>
<continent>Asia</continent>
</entry>
<entry>
<name>France</name>
<population>12</population>
<continent>Europe</continent>
</entry>
</country>
And this is the schema (i'm sure i'm getting the ComplexType/child/
parent tags wrong):
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="country" type="Country"/>
<xs:complexType name="Country">
<xs:sequence>
<xs:element name="entry" type="Entry"/>
<xs:complexType name="Entry">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="population" type="xs:decimal"/>
<xs:element name="continent" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:sequence>
</xs:complexType>
</xs:schema>
I just haven't figured out the logic behind grouping the elements in
the schema file - any advise would be greatly appreciated.
Thanks!
A.