Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

IDOMDocument Interface


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!

Back to topBack to top

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

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site