Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Contains the XML representation of the node and all its descendants.

Script Syntax

Copy Code
strValue = oXMLDOMNode.xml;

Remarks

Script Parameters

None.

Script Return Value

String. XML representation of this node and all its descendants.

C/C++ Syntax

Copy Code
HRESULT get_xml(
  BSTR* 
xmlString
);

Remarks

C/C++ Parameters

xmlString

[out, retval] XML representation of this node and all its descendants.

C/C++ Return Values

S_OK

Value returned if successful.

E_INVALIDARG

Value returned if xmlStringis Null.

Requirements

Header msxml2.h, msxml2.idl
Windows Embedded CE Windows CE .NET 4.0 and later

General Remarks

Note that the xmlproperty always returns a Unicode string. That is, the xmlproperty for DOMDocumentconverts the document from its original encoding to Unicode. As a result, the original encoding attribute is removed. For example, <?xml version="1.0" encoding="UTF-8"?>appears in the xmlproperty as follows.

Copy Code
<?xml version="1.0"?>

If the original encoding was not removed by the xmlproperty, the following line returns an error indicating the parser cannot switch from Unicode to UTF-8 encoding.

Copy Code
xmlDoc.loadxml(xmlDoc.xml);

If you use the save Method, the original encoding is preserved. For example, if you load a document in Microsoft® Windows® 1252 encoding, it will be saved in that format.

This value depends on the value of the nodeTypeproperty.

Value Description

NODE_ATTRIBUTE, NODE_CDATA_SECTION, NODE_COMMENT, NODE_DOCUMENT, NODE_ELEMENT, NODE_ENTITY, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION, NODE_TEXT

Returns the string representation of the node and all its descendants.

NODE_DOCUMENT_FRAGMENT

Returns the string representation of all descendant nodes of the document fragment.

NODE_DOCUMENT_TYPE

Returns the string representation of the <!DOCTYPE ...> declaration, including the internal subset if specified.

NODE_ENTITY_REFERENCE

Returns the string representation of the entity reference. Although the entity reference has children, they are not returned.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

This property is read-only, and applies to the following objects and interfaces:

IXMLDOMAttribute, IXMLDOMCDATASection, IXMLDOMCharacterData, IXMLDOMComment, DOMDocument, IXMLDOMDocumentFragment, IXMLDOMDocumentType, IXMLDOMElement, IXMLDOMEntity, IXMLDOMEntityReference, IXMLDOMNode, IXMLDOMNotation, IXMLDOMProcessingInstruction, IXMLDOMText, and IXTLRuntime

See Also