Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Inspecting a DTD using MS DOM Doctype object

I am creating XML files, using the MSXML DOM. I have a DTD that is used with
every XML file. I create a base XML file with a DOCTYPE based on the DTD.
I then create my nodes - manually right now and match to an ADO recordset
for values. However, some nodes that I create may have child nodes that need
creating. I would like to use the DTD to tell me the node names (they are
specified in the DTD of course). I have been unsuccessfully trying to use
the DocType object of the DOM to do this.

Does anyone have a suggestion? I basically want to inspect the DTD for a
node and see if any child nodes are required.

eg <!ELEMENT myelement (mysubelement1 , mysubelement2)> i would look for
myelement and get back the 2 subelements - mysubelement1 and mysubelement2
[817 byte] By [SteveK] at [2007-11-9 15:27:45]