XML document comforming to a Schema or DTD

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I've an XML document that is an output file from a VB.Net application. My
question is, how do i get the XML document that is produced to conform to a
Schema or a DTD before it is outputted from the application.

Any help will be much appreciated......

Thanks,

Ish..
 
There is no magic button to press to achieve this. From the limited info you
gave it appears you have two possible solutions.

1. Change the code. It's outputting stuff that isn't schema compliant (don't
use DTD's - use schemas) so that makes your code buggy/wrong/inappropriate -
fix it.

2. Use XML Serialization. This is a big topic that I can't go into in detail
here. To summarize it though you would take your schema and from that
produce an object model that using XML serialization can serialize the
object model to and from XML, compliant with your schema. Keith Ballinger's
excellent book Web Service Essentials covers this in great detail.

Alternatively of course you may have code that otuputs adequate XML, but you
now want to "map" it to a different schema. If that's the case just look up
XSLT transformations.

Good luck
 
Back
Top