Problem of the day:
I have an external DTD and I must build XML documents that conform to that DTD. I can not, as in all of the stuff in Rick's wwXML classlib, build my own DTD on the fly from the content of what I am sending. This is because the order of tags inside the document is significant when using a validating XML parser.
So the question is how do I get XMLDOM to just load a DTD and populate the tree with empty nodes that I can then fill in with values from my objects? Everything I've found so far only talks about loading some existing xml file/string
for the something.dtd:
<!ELEMENT something (itema,itemb)>
<!ELEMENT itema (x1?,x2?)>
<!ELEMENT x1 (#PCDATA)>
<!ELEMENT x2 (#PCDATA)>
<!ELEMENT itemb (#PCDATA)>
this xml document is valid:
<?xml version="1.0"?>
<!DOCTYPE something SYSTEM "something.dtd">
<something>
<itema>
<x1>Test</x1>
<x2>1</x2>
</itema>
<itemb>more junk</itemb>
</something>
this xml document is invalid because things are out of order:
<?xml version="1.0"?>
<!DOCTYPE something SYSTEM "something.dtd">
<something>
<itemb>one error</itemb>
<itema>
<x2>and another</x2>
<x1>error</x1>
</itema>
</something>