Click to Rate and Give Feedback
MSDN
MSDN Library
MSXML
DOM
DOM Reference
XML DOM Properties
 ProhibitDTD Property

  Switch on low bandwidth view
ProhibitDTD Property

Specifies whether to prohibit (true) or allow (false) the inclusion of a DTD in the XML DOM document.

This property is supported in MSXML 3.0 SP5, 4.0 SP3, 5.0 SP2, and 6.0. The default value is false for 3.0, 4.0, and 5.0. The default value is true for 6.0.

This property has security implications. For more information, see MSXML Security Overview and DOM Security.

Script Syntax

domObj.setProperty(strProp, vBool);
vBool = domObj.getProperty(strProp);

Visual Basic Syntax

domObj.setProperty(strProp, vBool)
vBool = domObj.getProperty(strProp)

C\C++ Syntax

HRESULT setProperty(BSTR strProp, VARIANT vBool);
HRESULT getProperty(BSTR strProp, VARIANT* vBool);

Parameters

strProp

A BSTR string whose value is "ProhibitDTD".

vBool

A VARIANT_BOOL value of true or false.

Remarks

This property allows you to prohibit DTD use and can help prevent a denial of service attack in some situations. For example, an application might hang if a large number of entity references are included with the DTD and require resolution when the document XML is parsed and loaded.

Setting this property to true will prohibit DTDs and result in a parse error of "Invalid at the top level of the document" (XML_E_INVALIDATROOTLEVEL, 0xE52D) whenever a DTD is included.

This property is not copied when a DOMDocument object is cloned.

The following shows how this property is set in JScript:

dom.setProperty("ProhibitDTD", true);  //for JScript

For Visual Basic or VBScript, the following is the correct syntax:

dom.setProperty "ProhibitDTD", True 'for VB/VBScript

Versioning

This property is supported in MSXML 3.0 SP5, 4.0 SP3, 5.0 SP2, and 6.0. The default value is false for 3.0, 4.0, and 5.0. The default value is true for 6.0.

Applies to

Interface: IXMLDOMDocument2

Methods: setProperty | getProperty

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker