E
Etai Margolin
Hi,
The following works with NETCF 1.1 & SP1, but not in SP2:
I'm creating a dataset with a schema and then loading an
XML document (which matches the schema) into it. With
NETCF 1.1 SP2, the dataset is always missing certain
elements. I've narrowed it down to a minimal schema and
XML but always the same element is missing.
here are the relevant pieces of code:
DataSet dsTaskData = new DataSet();
dsTaskData.ReadXmlSchema(@"\Schema.xml");
StringReader sr = new StringReader(txtInput.Text);
XmlReader rdr = new XmlTextReader(sr);
dsTaskData.ReadXml(rdr);
-----------
The Schema:
-----------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:complexType name="TTask">
<xsd:all>
<xsd:element name="taskId"
type="xsd:string" minOccurs="0"/>
<xsd:element name="taskStatus"
type="xsd:int" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="NewDataSet"
msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="TTask"
type="TTask" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--------------
The input XML:
--------------
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
---------------------
The Dataset.GetXml():
---------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
</TTask>
</NewDataSet>
As you can see, the missing element is of type int. I've
also tried changing it to string but get the same result.
Any ideas, anyone?
Etai.
The following works with NETCF 1.1 & SP1, but not in SP2:
I'm creating a dataset with a schema and then loading an
XML document (which matches the schema) into it. With
NETCF 1.1 SP2, the dataset is always missing certain
elements. I've narrowed it down to a minimal schema and
XML but always the same element is missing.
here are the relevant pieces of code:
DataSet dsTaskData = new DataSet();
dsTaskData.ReadXmlSchema(@"\Schema.xml");
StringReader sr = new StringReader(txtInput.Text);
XmlReader rdr = new XmlTextReader(sr);
dsTaskData.ReadXml(rdr);
-----------
The Schema:
-----------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:complexType name="TTask">
<xsd:all>
<xsd:element name="taskId"
type="xsd:string" minOccurs="0"/>
<xsd:element name="taskStatus"
type="xsd:int" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:element name="NewDataSet"
msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="TTask"
type="TTask" />
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
--------------
The input XML:
--------------
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
---------------------
The Dataset.GetXml():
---------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
</TTask>
</NewDataSet>
As you can see, the missing element is of type int. I've
also tried changing it to string but get the same result.
Any ideas, anyone?
Etai.