Microsoft XML SDK 2.6 - XML Reference

doctype Property

Contains the document type node that specifies the DTD for this document.

objXMLDOMDocumentType = oXMLDOMDocument.doctype

Remarks

Object. The property is read-only. For XML, it points to the node of type _TYPE that specifies the DTD. It returns Null for XML documents without a DTD and for HTML documents.

An XML document can contain a document type declaration before the first element in the document. It starts with the tag <!DOCTYPE> and can specify an external DTD.

Example

The following VBScript example creates an XMLDOMDocumentType object, and then displays the name property of the object:

Dim xmlDoc
Dim MyDocType
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set MyDocType = xmlDoc.doctype
MsgBox (mydoctype.name)

See Also

XMLDOMDocumentType Object

Applies To: DOMDocument Object