Create valid XML

  • Thread starter Thread starter Ludwig
  • Start date Start date
L

Ludwig

If I have an XSD, and I have to create an XmlDocument from scratch; do
I have to create the XmlDocument and then validate it using the xsd;
or is there a better way to create an XmlDocument to make sure that's
it's correct?

in other words: how do I have to create an XmlDocument if I have the
XSD?

thanks
 
Ludwig said:
If I have an XSD, and I have to create an XmlDocument from scratch; do
I have to create the XmlDocument and then validate it using the xsd;
or is there a better way to create an XmlDocument to make sure that's
it's correct?

in other words: how do I have to create an XmlDocument if I have the
XSD?
Hi,

Why do you not using xsd.exe class generator, from the visual studio tools
for this case?

D
 
Hi,

Why do you not using xsd.exe class generator, from the visual studio tools
for this case?

D

Oh :) Thanks :) So I can use xsd.exe to generate source code that
corresponds to the schema, didn't know that.

Thanks again, you probably saved me a lot of time!
 
Yeah, if you have an existing xml document.

You use that command line tool. and it will reverse engineer it.

Be careful, because DataSet xml is usually Element based.

<MyDataSet>
<Author>
<ID>123</ID>
<LastName>Smith</LastName>
<FirstName>John</FirstName>
</Author>

<Author>
<ID>234</ID>
<LastName>Jones</LastName>
<FirstName>Mary</FirstName>
</Author>

</MyDataSet>

(and not)

<MyDataSet>
<Author ID='123' LastName='Smith' FirstName='John'/>
</MyDataSet>
which is very attribute based.

DataSet's also like tables that relate and NOT nested values.


Sometimes you may want to transform your original xml into a more friendly
type DataSet xml.
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!148.entry

...
 
Yeah, if you have an existing xml document.

You use that command line tool. and it will reverse engineer it.

Be careful, because DataSet xml is usually Element based.

<MyDataSet>
<Author>
<ID>123</ID>
<LastName>Smith</LastName>
<FirstName>John</FirstName>
</Author>

<Author>
<ID>234</ID>
<LastName>Jones</LastName>
<FirstName>Mary</FirstName>
</Author>

</MyDataSet>

(and not)

<MyDataSet>
<Author ID='123' LastName='Smith' FirstName='John'/>
</MyDataSet>
which is very attribute based.

DataSet's also like tables that relate and NOT nested values.


Sometimes you may want to transform your original xml into a more friendly
type DataSet xml.
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!148.entry

..

What do you mean? I have an XSD, and I use XSD.EXE to generate the
classes. I then use these classes to create the data and serialize it
into xml. I don't have a dataset?
 
Ok...

Ignore what I said.


Some people use the xsd.exe to reverse engineer a dataset.


Sorry for the confusion.
 
Back
Top