I have a simple XML file, the contents of which are below. I have
validated this XML file with Microsofts online validator and it
validates successfully.
I .ReadXml() this data into a DataSet in C#.NET
On about 2/3 the machines I try this on I get a DataSet constructed of 2
tables, appropriate type columes and ROWS OF DATA from the XML.
On about 1/3 the machines I try this on I get a DataSet constructed of 2
tables, appropriate type columes and 0 ROWS OF DATA. Just empty tables.
Wth?
I cannot find any rhyme or reason to the machines' setups to account for
this. Works on some XP's, not others. Works on some Windows 2000's, not
others. I have 2 Windows 2000 machines in particular that are nearly
identical from all I can tell... .NET 1.1, latest XML parser, latest
MDAC, yet .ReadXml() produces a built and populated dataset on one
machine, and a built but no-row dataset on the other.
Frustrating.
Here's the XML.
<?xml version="1.0"?>
<root xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:a="urn:Config">
<!-- schema starts here -->
<xs:schema targetNamespace='urn:Config'>
<xs:element name='Config'>
<xs:complexType>
<xs:sequence>
<xs:element name="ObServerConfig">
<xs:complexType>
<xs:sequence>
<xs:element name='mailServerIp' type='xs:string' />
<xs:element name='mailFrom' type='xs:string' />
<xs:element name='timeOut' type='xs:integer' />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="server" maxOccurs='unbounded'>
<xs:complexType>
<xs:sequence>
<xs:element name='url' type='xs:string' />
<xs:element name='email' type='xs:string' />
<xs:element name='enabled' type='xs:boolean' />
<xs:element name='notify'>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="up|down|both" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<!-- schema ends here -->
<!-- configuration XML starts here -->
<a:Config>
<ObServerConfig>
<mailServerIp>127.0.0.1</mailServerIp>
<mailFrom>me@here.com</mailFrom>
<timeOut>5</timeOut>
</ObServerConfig>
<server>
<url>http://www.cnn.com</url>
<email>te**@nowhere.com</email>
<enabled>true</enabled>
<notify>down</notify>
</server>
<server>
<url>http://www.yahoo.com</url>
<email>so*****@there.com</email>
<enabled>true</enabled>
<notify>both</notify>
</server>
</a:Config>
<!-- configuration XML ends here -->
</root>