Writing DTD to XML file

admin

Administrator
Staff member
I am trying to insert DTD code directly into an XML file using XML DOM from an ASP page.

As an example, to create the processing instruction I did the following and it works fine...
'Create the xml processing instruction.
Set objPI = objDom.createProcessingInstruction("xml", _
"version='1.0' encoding='Windows-1252' standalone='yes'")

'Append the processing instruction to the XML document.
objDom.insertBefore objPI, objDom.childNodes(0)

...I was hoping that there would be a similar create statement for creating and then inserting the following DTD in the XML file right after the processing instruction...

<!DOCTYPE AnswerSet [
<!ELEMENT AnswerSet (Answer*)>
<!ELEMENT Answer (TextValue | NumValue | DateValue | TFValue | MCValue | ClauseLibValue | DBValue | RptValue)>

<!-- and the DTD continues... -->
<!ATTLIST DBColumn name CDATA #REQUIRED>]>

I am new to XML DOM and VBScript and would appreciate it if anyone could tell me how I may go about doing this or how I may create a node of type NODE_DOCUMENT_TYPE(10).

Thanks for your help!
 
Top