missing elements in XML when loading into dataset with schema

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.
 
I

Ilya Tumanov [MS]

Just a small addition to Mark's replay...

The workaround would be to add DataSet element as follows:

<DataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</DataSet>

The XML saved from DataSet would have it automatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Mark Ihimoyan [MSFT]" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with schema
Date: Thu, 9 Sep 2004 10:54:12 -0700
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
X-Original-NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
Message-ID: <[email protected]>
X-Trace: news.microsoft.com 1094752472 157.59.244.123 (9 Sep 2004 10:54:32 -0700)
X-Original-Trace: 9 Sep 2004 10:54:32 -0700, markih2.redmond.corp.microsoft.com
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!m
srtrans!news.microsoft.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:60976
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This is a know inssue with the XmlDataLoader in SP2. It is however being
fixed in SP3.
See the link below.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=427d01c47320$34
7c5e10%24a401280a%40phx.gbl&rnum=10&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUT
F-8%26q%3Dreadxml%2BSP2%26meta%3D

SP3 beta can be obtained by following instructions listed here:
http://blogs.msdn.com/onoj/articles/178293.aspx

HTH,
Thanks.

Etai Margolin said:
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.
 
E

Etai Margolin

Thanks Ilya, this solved it. Unfortunately it only got me as far as the next
bug :-(

What happens now is (using the same schema):

XML:
-------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice/>
<payment/>
<completionDetails/>
</completion>
</TTask>
</NewDataSet>

Dataset.GetXml() returns:
-------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</NewDataSet>

This was also tested with SP3Beta and returns a valid XML:
-------------------------------------------------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice />
<payment />
<completionDetails />
</completion>
</TTask>
</NewDataSet>


Do you know of a workaround to get this to work with SP2 as well?

Thanks,

Etai.






"Ilya Tumanov [MS]" said:
Just a small addition to Mark's replay...

The workaround would be to add DataSet element as follows:

<DataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</DataSet>

The XML saved from DataSet would have it automatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Mark Ihimoyan [MSFT]" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with schema
Date: Thu, 9 Sep 2004 10:54:12 -0700
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
X-Original-NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
Message-ID: <[email protected]>
X-Trace: news.microsoft.com 1094752472 157.59.244.123 (9 Sep 2004 10:54:32 -0700)
X-Original-Trace: 9 Sep 2004 10:54:32 -0700, markih2.redmond.corp.microsoft.com
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!m
srtrans!news.microsoft.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:60976
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This is a know inssue with the XmlDataLoader in SP2. It is however being
fixed in SP3.
See the link below.
http://groups.google.com/[email protected]&rnum=10&prev=/groups?hl=en&lr=&ie=UT
F-8%26q%3Dreadxml%2BSP2%26meta%3D

SP3 beta can be obtained by following instructions listed here:
http://blogs.msdn.com/onoj/articles/178293.aspx

HTH,
Thanks.
 
I

Ilya Tumanov [MS]

Are you sure you're using the same schema and not using inference?

If you do, SP2 result is correct and matching desktop and SP3.

You see, nothing besides table TTask with columns taskID and taskStatus are
in the schema and whatever's is not on it is ignored.



If you going to change the schema, few tips:



1. Use related tables, not nested tables.

2. Use unique not null primary/foreign keys in _every_ table.

3. Map all columns as attribute except for primary/foreign key column.



Also, avoid handcrafting the XML. Use VS desktop tools to enter test data or
write a program to do that.



Best regards,



Ilya



Etai Margolin said:
Thanks Ilya, this solved it. Unfortunately it only got me as far as the
next
bug :-(

What happens now is (using the same schema):

XML:
-------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice/>
<payment/>
<completionDetails/>
</completion>
</TTask>
</NewDataSet>

Dataset.GetXml() returns:
-------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</NewDataSet>

This was also tested with SP3Beta and returns a valid XML:
-------------------------------------------------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice />
<payment />
<completionDetails />
</completion>
</TTask>
</NewDataSet>


Do you know of a workaround to get this to work with SP2 as well?

Thanks,

Etai.






"Ilya Tumanov [MS]" said:
Just a small addition to Mark's replay...

The workaround would be to add DataSet element as follows:

<DataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</DataSet>

The XML saved from DataSet would have it automatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Mark Ihimoyan [MSFT]" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with schema
Date: Thu, 9 Sep 2004 10:54:12 -0700
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
X-Original-NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
Message-ID: <[email protected]>
X-Trace: news.microsoft.com 1094752472 157.59.244.123 (9 Sep 2004 10:54:32 -0700)
X-Original-Trace: 9 Sep 2004 10:54:32 -0700, markih2.redmond.corp.microsoft.com
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!m
srtrans!news.microsoft.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:60976
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This is a know inssue with the XmlDataLoader in SP2. It is however
being
fixed in SP3.
See the link below.
http://groups.google.com/[email protected]&rnum=10&prev=/groups?hl=en&lr=&ie=UT
F-8%26q%3Dreadxml%2BSP2%26meta%3D

SP3 beta can be obtained by following instructions listed here:
http://blogs.msdn.com/onoj/articles/178293.aspx

HTH,
Thanks.

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.
 
E

Etai Margolin

sorry, that wasn't the entire schema. here is the right one:

<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:complexType name="TTask">
<xsd:all>
<xsd:element name="taskId" type="xsd:string" minOccurs="0"/>
<xsd:element name="taskStatus" type="xsd:int" minOccurs="0"/>
<xsd:element name="completion" type="_TTTask_completion" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="_TTTask_completion">
<xsd:all>
<xsd:element name="invoice" type="TInvoiceDetails" minOccurs="0"/>
<xsd:element name="payment" type="TPaymentDetails" minOccurs="0"/>
<xsd:element name="completionDetails" type="TCompletion" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TInvoiceDetails">
<xsd:all>
<xsd:element name="laborAmount" type="xsd:string" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TPaymentDetails">
<xsd:all>
<xsd:element name="paymentMethod" type="xsd:string" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TCompletion">
<xsd:all>
<xsd:element name="completionCode" type="xsd:int" minOccurs="0"/>
</xsd:all>
</xsd:complexType>




Ilya Tumanov said:
Are you sure you're using the same schema and not using inference?

If you do, SP2 result is correct and matching desktop and SP3.

You see, nothing besides table TTask with columns taskID and taskStatus are
in the schema and whatever's is not on it is ignored.



If you going to change the schema, few tips:



1. Use related tables, not nested tables.

2. Use unique not null primary/foreign keys in _every_ table.

3. Map all columns as attribute except for primary/foreign key column.



Also, avoid handcrafting the XML. Use VS desktop tools to enter test data or
write a program to do that.



Best regards,



Ilya



Etai Margolin said:
Thanks Ilya, this solved it. Unfortunately it only got me as far as the
next
bug :-(

What happens now is (using the same schema):

XML:
-------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice/>
<payment/>
<completionDetails/>
</completion>
</TTask>
</NewDataSet>

Dataset.GetXml() returns:
-------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</NewDataSet>

This was also tested with SP3Beta and returns a valid XML:
-------------------------------------------------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice />
<payment />
<completionDetails />
</completion>
</TTask>
</NewDataSet>


Do you know of a workaround to get this to work with SP2 as well?

Thanks,

Etai.






"Ilya Tumanov [MS]" said:
Just a small addition to Mark's replay...

The workaround would be to add DataSet element as follows:

<DataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</DataSet>

The XML saved from DataSet would have it automatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Mark Ihimoyan [MSFT]" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with schema
Date: Thu, 9 Sep 2004 10:54:12 -0700
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
X-Original-NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
Message-ID: <[email protected]>
X-Trace: news.microsoft.com 1094752472 157.59.244.123 (9 Sep 2004
10:54:32 -0700)
X-Original-Trace: 9 Sep 2004 10:54:32 -0700,
markih2.redmond.corp.microsoft.com
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s ul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!m
srtrans!news.microsoft.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:60976
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

This is a know inssue with the XmlDataLoader in SP2. It is however
being
fixed in SP3.
See the link below.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=427d01c47320$34 7c5e10%24a401280a%40phx.gbl&rnum=10&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUT
F-8%26q%3Dreadxml%2BSP2%26meta%3D

SP3 beta can be obtained by following instructions listed here:
http://blogs.msdn.com/onoj/articles/178293.aspx

HTH,
Thanks.

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.
 
I

Ilya Tumanov [MS]

I see... That's another known bug.

Workaround is simple - add some data to your tables.
It makes little sense to have rows with all columns set to NULL.

Since you have relations, it's simply prohibited as all NULL rows are
indistinguishable and it would be impossible to find related rows.
You have to have a not null primary key or your database will not work. As
soon as you change that, it would load just fine.

Best regards.

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: "Etai Margolin" <[email protected]>
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with schema
Date: Mon, 13 Sep 2004 15:07:28 +0300
Lines: 290
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: eitank.il.orsus.org 212.199.114.167
Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:61097
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

sorry, that wasn't the entire schema. here is the right one:

<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:complexType name="TTask">
<xsd:all>
<xsd:element name="taskId" type="xsd:string" minOccurs="0"/>
<xsd:element name="taskStatus" type="xsd:int" minOccurs="0"/>
<xsd:element name="completion" type="_TTTask_completion" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="_TTTask_completion">
<xsd:all>
<xsd:element name="invoice" type="TInvoiceDetails" minOccurs="0"/>
<xsd:element name="payment" type="TPaymentDetails" minOccurs="0"/>
<xsd:element name="completionDetails" type="TCompletion" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TInvoiceDetails">
<xsd:all>
<xsd:element name="laborAmount" type="xsd:string" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TPaymentDetails">
<xsd:all>
<xsd:element name="paymentMethod" type="xsd:string" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TCompletion">
<xsd:all>
<xsd:element name="completionCode" type="xsd:int" minOccurs="0"/>
</xsd:all>
</xsd:complexType>




Ilya Tumanov said:
Are you sure you're using the same schema and not using inference?

If you do, SP2 result is correct and matching desktop and SP3.

You see, nothing besides table TTask with columns taskID and taskStatus are
in the schema and whatever's is not on it is ignored.



If you going to change the schema, few tips:



1. Use related tables, not nested tables.

2. Use unique not null primary/foreign keys in _every_ table.

3. Map all columns as attribute except for primary/foreign key column.



Also, avoid handcrafting the XML. Use VS desktop tools to enter test
data
or
write a program to do that.



Best regards,



Ilya



Etai Margolin said:
Thanks Ilya, this solved it. Unfortunately it only got me as far as the
next
bug :-(

What happens now is (using the same schema):

XML:
-------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice/>
<payment/>
<completionDetails/>
</completion>
</TTask>
</NewDataSet>

Dataset.GetXml() returns:
-------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</NewDataSet>

This was also tested with SP3Beta and returns a valid XML:

-------------------------------------------------------------------------
<NewDataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
<completion>
<invoice />
<payment />
<completionDetails />
</completion>
</TTask>
</NewDataSet>


Do you know of a workaround to get this to work with SP2 as well?

Thanks,

Etai.






Just a small addition to Mark's replay...

The workaround would be to add DataSet element as follows:

<DataSet>
<TTask>
<taskId>1</taskId>
<taskStatus>1</taskStatus>
</TTask>
</DataSet>

The XML saved from DataSet would have it automatically.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Mark Ihimoyan [MSFT]" <[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
References: <[email protected]>
Subject: Re: missing elements in XML when loading into dataset with
schema
Date: Thu, 9 Sep 2004 10:54:12 -0700
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
X-Original-NNTP-Posting-Host: markih2.redmond.corp.microsoft.com
Message-ID: <[email protected]>
X-Trace: news.microsoft.com 1094752472 157.59.244.123 (9 Sep 2004
10:54:32 -0700)
X-Original-Trace: 9 Sep 2004 10:54:32 -0700,
markih2.redmond.corp.microsoft.com
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!mhttp://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=427d01c47320%24347c5e10%24a401280a%40phx.gbl&rnum=10&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top