Erik and Rick,
I think I'm about to give up on DTDs, even with a shell XML document loaded that has the DTD and the topmost structure of the DTD it's possible to add nodes to the DOM tree that do not conform to the DTD. Using AppendChild() can alter the order of the elements.
So my options are:
1) load a XML document that has the proper structure but empty data and then fill the data values. This means that I have to keep a separate .xml in parallel to the .dtd.
2) Just scrap the idea of making a generic method of constucting the XML document and just hardcode it instead. This is no worse than keeping the parallel .xml upto date. And this would be faster constructing the document too.
We don't want to include the DTD in the document to reduce network traffic. Once we have the client and server talking to each other a validating DTD is totally unnecessary anyway. The code will be buried inside the class so the enduser app need not concern itself with the XML detail.
>AFAIK, it doesn't do this. How would it deal with optional nodes? And Attribute heavy documents?
>
>If you find a wayt to do this, directly or indirectly, please post it.