how to add DTD text in xmldocument

I want's to add this

<!DOCTYPE root [
<!ELEMENT root ANY>
<!ELEMENT Person ANY>
<!ELEMENT Customer EMPTY>
<!ELEMENT Team EMPTY>
<!ATTLIST Person SSN ID #REQUIRED>
<!ATTLIST Customer id IDREF #REQUIRED >
<!ATTLIST Team members IDREFS #REQUIRED>]>

for validating my xmldocument which i create at runtime.

How Could I add it in the start of my xmldocument




Answer this question

how to add DTD text in xmldocument

  • Yacine Benahmed

    Thanks I have already use it and it is working qutie nicely.

    Now If For instance I don't know the type of validation that is it could be XSD or DTD how could I insert generic validation that is extract it from some file(could be xsd or dtd)

    And add it in my generated document



  • Deepak Makhija

    Hi Kamili47,

    Use the CreateDocumentType() method of the XmlDocument class and create the DocumentType object, set it's inner text. Then append the object to the document using the AppendChild() method.

    Hope thats what your looking for.



  • how to add DTD text in xmldocument