aspose file tools*
The moose likes XML and Related Technologies and the fly likes What is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "What is "NewDataSet" in XSD file?" Watch "What is "NewDataSet" in XSD file?" New topic
Author

What is "NewDataSet" in XSD file?

Susan Smith
Ranch Hand

Joined: Oct 13, 2007
Posts: 223
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

Joined: May 27, 2008
Posts: 225

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

Joined: Oct 13, 2007
Posts: 223
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

Joined: May 27, 2008
Posts: 225

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

Joined: Oct 13, 2007
Posts: 223
Thanks, Carey.
Will do that next time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is "NewDataSet" in XSD file?
 
Similar Threads
How to convert from sql to xml
Is there a java API to generate xml with an inline schema definition
is there any way to add inline schema with xml using jaxb
XML schema fails to load
Webservice Design