Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
The IDOMDocument node represents the top node of the tree.
IDOMDocument Methods
createAttribute Creates a new attribute with the specified name. createCDATASection Creates a CDATA section node that contains the supplied data. createComment Creates a comment node that contains the supplied data. createDocumentFragment Creates an empty document fragment object. createElement Creates an element node using the specified name. createEntityReference Creates a new entity reference object. createProcessingInstruction Creates a ProcessingInstruction node that contains the supplied target and data. createTextNode Creates a text node that contains the supplied data. doctype Contains the document type node that specifies the DTD for this document. documentElement Contains the root element of the document. getElementsByTagName Returns a collection of elements that have the specified name. implementation Contains a pointer to the IDOMImplementation object for this document.
Remarks
IDOMDocument is the top node in the tree. It inherits all the methods on the IDOMNode interface and provides additional methods and properties specific to the document node type.
In addition to the DOM interfaces, IDOMDocument implements a number of standard OLE interfaces: IPersistStreamInit, IPersistMoniker, IObjectSafety, IObjectWithSite, IOleCommandTarget, IMarshal, and IConnectionPointContainer.
When the 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).
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>
Interface Information
Implementation Msxml.dll Inherits from IDOMNode Header and IDL files Msxml.h, Dom.idl Minimum availability Internet Explorer 5 Beta Minimum operating systems Windows 95, Windows NT
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.