theresatan
Programmer
Hi:
I wrote a script to import xml data to sql server 2000, every thing works fine when the data file like this:
<ROOT>
<Customers>
<CustomerID>1111</CustomerID>
<CompanyName>Sean Chai</CompanyName>
<City>NY</City>
</Customers>
<Customers>
<CustomerID>1112</CustomerID>
<CompanyName>Tom Johnston</CompanyName>
<City>LA</City>
</Customers>
</ROOT>
But it return Null value for all the fiels when data file like that:
<ROOT>
<Customers CustomerID="1111" CompanyName="Sean Chai" City="NY" >
</Customers>
<Customers CustomerID="1112" CompanyName="Tom Johnston" City="LA" >
</Customers>
</ROOT>
Following is my xsd file:
<xsd:schema xmlns:xsd=" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Customers" sql:relation="Cust" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CustomerID" type="xsd:integer" />
<xsd:element name="CompanyName" type="xsd:string" />
<xsd:element name="City" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Any idea to fix it?
I need it work for the second xml format
Thank you very much.
Theresa
I wrote a script to import xml data to sql server 2000, every thing works fine when the data file like this:
<ROOT>
<Customers>
<CustomerID>1111</CustomerID>
<CompanyName>Sean Chai</CompanyName>
<City>NY</City>
</Customers>
<Customers>
<CustomerID>1112</CustomerID>
<CompanyName>Tom Johnston</CompanyName>
<City>LA</City>
</Customers>
</ROOT>
But it return Null value for all the fiels when data file like that:
<ROOT>
<Customers CustomerID="1111" CompanyName="Sean Chai" City="NY" >
</Customers>
<Customers CustomerID="1112" CompanyName="Tom Johnston" City="LA" >
</Customers>
</ROOT>
Following is my xsd file:
<xsd:schema xmlns:xsd=" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="Customers" sql:relation="Cust" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="CustomerID" type="xsd:integer" />
<xsd:element name="CompanyName" type="xsd:string" />
<xsd:element name="City" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Any idea to fix it?
I need it work for the second xml format
Thank you very much.
Theresa