Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
The IDOMDocument object represents the top node of the tree.
Remarks
The IDOMDocument object represents the top node in the XML document tree. This object exposes all the properties and methods of the IDOMNode object and provides additional methods and properties specific to the document node type.
Don't confuse this object with the "DOMDocument" object that is created using the identifier "Microsoft.XMLDOM". The "DOMDocument" object represents the IXMLDOMDocument object.
In addition to the DOM interfaces, IDOMDocument implements a number of standard OLE interfaces: IPersistStreamInit, IPersistMoniker, IObjectSafety, IObjectWithSite, IOleCommandTarget, IMarshal, and IConnectionPointContainer.
When object-creation methods (such as createElement) are used on the document, nodes are created in the context of the document (the ownerDocument property of the node points to the document) but the node is not part of the document tree. The node is only part of the document tree when it is explicitly added to the tree by calling insertBefore, replaceChild, or appendChild (or, for attributes, setAttributeNode).
White Space Within Your XML Document
Within a mixed content model (a content model that allows both elements and text nodes), XML considers white space to be significant and preserves all white space characters (such as the space, tab, and line-feed characters). When white space separates two different elements, the XML Document Object Model (DOM) tree representation includes the two element nodes and a text node that contains the separating white space.
In other content models, however, the XML DOM collapses white space. To override the default and preserve white space, you must specify the following attribute at the point within the document tree above the text you want to preserve:
xml:space="preserve"For example, to preserve white space in the mytag element and all its child elements, use the following XML:
<mytag xml:space="preserve"> ... </mytag>
Members
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.