By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Writing valid XML document based on Schema

P: n/a
Does anyone have a best practices recommendation on writing a valid
XML document based on a 3rd party XML schema?

I have a working solution but I would like to know if anyone has a
better approach.
My solution:
1) Pull the data from the database into datatables (in my case, this
is DB2).
2) Validate all required data columns (I've written a method that
iterates through all the datatables rows and throws an exception if
anything would invalidate the resulting XML file).
3) Using the XmlWriter class, write the XML file.

What complicates the logic is that the source data is spread over
multiple DB2 tables and the resulting XML document can contain
multiple instances of several types.

Regards,
Thomas

May 8 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Thomas" <th***@northstate.netwrote in message
news:11**********************@w5g2000hsg.googlegro ups.com...
Does anyone have a best practices recommendation on writing a valid
XML document based on a 3rd party XML schema?

I have a working solution but I would like to know if anyone has a
better approach.
My solution:
1) Pull the data from the database into datatables (in my case, this
is DB2).
2) Validate all required data columns (I've written a method that
iterates through all the datatables rows and throws an exception if
anything would invalidate the resulting XML file).
3) Using the XmlWriter class, write the XML file.

What complicates the logic is that the source data is spread over
multiple DB2 tables and the resulting XML document can contain
multiple instances of several types.
How about validating the resulting document against the schema?
--
John Saunders [MVP]
May 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.