Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLDOM building a valid document for an external DTD
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
XMLDOM building a valid document for an external DTD
Miscellaneous
Thread ID:
00344636
Message ID:
00344636
Views:
63
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>
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Next
Reply
Map
View

Click here to load this message in the networking platform