• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is "NewDataSet" in XSD file?

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Ranch Hand
Posts: 225
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Debian Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Carey.
Will do that next time.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic