Click to return to the XML (Extensible Markup Language) home page    
IXMLDOMDocument::parseErr...     IXMLDOMDocument::readySta...     IXMLDOMDocument Interface    
Web Workshop  |  XML (Extensible Markup Language)

IXMLDOMDocument::get_preserveWhiteSpace Method


Indicates whether to preserve all white space in the XML document.

Visual Basic Syntax

boolValue = oXMLDOMDocument.preserveWhiteSpace

C/C++ Syntax

HRESULT get_preserveWhiteSpace(
    VARIANT_BOOL *isPreserving);

Parameters

isPreserving
[out] Value that indicates whether default processing preserves white space.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if isPreserving is null.

See Also

White space handling


IXMLDOMDocument::put_preserveWhiteSpace Method


Sets the value of the preserveWhiteSpace property.

Visual Basic Syntax

objXMLDOMDocument.preserveWhiteSpace = boolValue

C/C++ Syntax

HRESULT put_preserveWhiteSpace(
    VARIANT_BOOL isPreserving);

Parameters

isPreserving
[in] Value that indicates whether default processing preserves white space.

C/C++ Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

This property is initialized to false.

The preserveWhiteSpace property specifies the default white space handling when xml:space is set to "default." When preserveWhiteSpace is true, all white space is preserved, regardless of the xml:space settings in the document. When preserveWhiteSpace is false, the values of the xml:space attribute specified in the document determine whether white space is preserved or not.

The xml property does not preserve white space exactly as it appeared in the original document. Instead, the object model replaces white space present in the original document with a single newline character in the representation returned by the xml property. Similarly, the text property contains a representation without the leading and trailing spaces and replaces multiple intervening white space characters between words with a single space character.

The text and xml properties preserve white space when the user has set the preserveWhiteSpace property to true and when xml:space on the XML element has the value preserve.

See Also

White space handling


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.