M
Mark
Wow, what an unexpected hassle. I am having a really wierd and nasty problem
with an XML DataSet and the behaviour is variable according to which version
of the .NET CF you run it under, and unfortunately the bad behaviour is
under the latest version, not the oldest.
Here's the scenario:
I have an XSD and an XML that I load as follows:
Dim ds As New DataSet("My_Data")
'-----------------------------
' Read in the schema
'-----------------------------
theFile = "\Program Files\Test\My_Schema.xsd"
Dim fsXSD As New System.IO.FileStream(theFile, FileMode.Open,
FileAccess.Read)
Dim xtrXSD As New Xml.XmlTextReader(fsXSD)
ds.ReadXmlSchema(xtrXSD)
'----------------------------
' Read in the file
'----------------------------
theFile = "\Program Files\Test\My_Example.xml"
Dim fsXML As New System.IO.FileStream(theFile, FileMode.Open)
Dim xtrXML As New Xml.XmlTextReader(fsXML)
ds.ReadXml(xtrXML)
At one point in the XML file I have a set of elements like this
<Action Type="INCOME" Description="Salary 1" Amount="3500"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Annual Bonus" Amount="18000"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Salary2" Amount="4500"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Investment Income" Amount="10000"
Frequency="Yearly" Include="?" />
When this runs under .NET CF Version [1.0.3316.0], I wind up with every
second element if I load the Schema, and ALL of the elements if I don't load
the Schema. Also, If I change the elements to be <Action .... ></Action>
instead of <Action ... /> I get all of the elements loaded regardless of
whether the schema is loaded or not.
When this runs under .NET CF Version [1.0.2268.0], I wind up with every
element regardless of whether I load the Schema or not.
I can't really expect to be able to tell my users to downgrade their version
of .NET CF, now can I
Anyone with a helpfull suggestion on this would clearly take on legend
status in my eyes.
Thanks for taking the time to read this.
with an XML DataSet and the behaviour is variable according to which version
of the .NET CF you run it under, and unfortunately the bad behaviour is
under the latest version, not the oldest.
Here's the scenario:
I have an XSD and an XML that I load as follows:
Dim ds As New DataSet("My_Data")
'-----------------------------
' Read in the schema
'-----------------------------
theFile = "\Program Files\Test\My_Schema.xsd"
Dim fsXSD As New System.IO.FileStream(theFile, FileMode.Open,
FileAccess.Read)
Dim xtrXSD As New Xml.XmlTextReader(fsXSD)
ds.ReadXmlSchema(xtrXSD)
'----------------------------
' Read in the file
'----------------------------
theFile = "\Program Files\Test\My_Example.xml"
Dim fsXML As New System.IO.FileStream(theFile, FileMode.Open)
Dim xtrXML As New Xml.XmlTextReader(fsXML)
ds.ReadXml(xtrXML)
At one point in the XML file I have a set of elements like this
<Action Type="INCOME" Description="Salary 1" Amount="3500"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Annual Bonus" Amount="18000"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Salary2" Amount="4500"
Frequency="Monthly" Include="?"/>
<Action Type="INCOME" Description="Investment Income" Amount="10000"
Frequency="Yearly" Include="?" />
When this runs under .NET CF Version [1.0.3316.0], I wind up with every
second element if I load the Schema, and ALL of the elements if I don't load
the Schema. Also, If I change the elements to be <Action .... ></Action>
instead of <Action ... /> I get all of the elements loaded regardless of
whether the schema is loaded or not.
When this runs under .NET CF Version [1.0.2268.0], I wind up with every
element regardless of whether I load the Schema or not.
I can't really expect to be able to tell my users to downgrade their version
of .NET CF, now can I
Anyone with a helpfull suggestion on this would clearly take on legend
status in my eyes.
Thanks for taking the time to read this.