• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is "NewDataSet" in XSD file?

 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using a XSD generator from an XML. Below is my XML and XSD generated from the XSD generator.
I'm confused about this part in XSD:
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="MYDATA" />
</xs:choice>
</xs:complexType>
</xs:element>
Can someone please advice what does the above mean?

XML:


XSD generated:
 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It’s an artifact of the .NET DataSet.WriteXmlSchema() method, when used like this, where input.xml is your file:This is probably not the best place to ask about .NET, unless you’re lucky.
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the same tool:

If the XML is this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<MYDATA>
<FEED1 test1="1" test2="2" test3="3" />
</MYDATA>

The XSD will be like this without the NewDataSet. Why is that?
<?xml version="1.0"?>
<!-- Generated using Flame-Ware Solutions XML-2-XSD v2.0 at http://www.flame-ware.com/Products/XML-2-XSD/ -->
<xs:schema id="MYDATA" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="MYDATA" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="FEED1">
<xs:complexType>
<xs:attribute name="test1" type="xs:string" />
<xs:attribute name="test2" type="xs:string" />
<xs:attribute name="test3" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
 
Carey Evans
Ranch Hand
Posts: 225
Debian Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the .NET library doesn’t like attaching its msdata:IsDataSet attribute to a sequence, only a choice, which is why it’s making up an extra element in your first sample.

By the way, please Be Forthright When Cross Posting to Other Sites. I saw the same question at http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_24103840.html.
 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Carey.
Will do that next time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic