Share via


MaxXMLSize Property

 

Limits the size of an XML document to be loaded into a DOM object. A zero (0) value means no limits on the size of an XML document. A non-zero value specifies the maximum size in blocks of 1024 characters. For ASCII, the block size is one KiloByte (KB).

This property is supported in MSXML 3.0 and 6.0. The default value is 0.

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

JScript Syntax

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

Visual Basic Syntax

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

C\C++ Syntax

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

Parameters

strProp
A BSTR string whose value is "MaxXMLSize".

strVal
An integer of the VARIANT type.

Remarks

When the DOM object is cloned, the value of this property is not propagated to the cloned object. You must reset this property on the clone, if desired. However, for MSXML 4.0 SP3, when the DOM object is cloned, the value of this property is propagated to the cloned object.

When the size of an XML document exceeds the limit set by this property, a load error will result when the document is parsed. Check the parseError property on the DOM for a more detailed error message. These error messages can differ depending on when the document was parsed (for example, in the load method on DOM as opposed to in the document function in an XSLT style sheet, and so on).

The maximum value of this property is 4194303 (i.e., 2 ^ 22 - 1). Setting this property to a value greater than this maximum value or to a negative value will result in an error. For more information, check the parseError property.

If the NewParser Property is set to True, the size refers to the size of the loaded XML, so entities contribute to this size only once. The old parser reparses entities and therefore the reported size of the loaded XML may be as much as double the actual size. Thus for instance, if the main document is 800 characters and the external entity is also 800 characters, the parser considers the total size of the document to be 1600 characters.

Versioning

This property is supported in MSXML 3.0 and 6.0. The default value is 0.

Applies to

Interface: IXMLDOMDocument2

Methods: setProperty | getProperty