Share via


XML Core Services and Document Object Model

The XML Core Services and Document Object Model (DOM) feature provides a set of application programming interfaces (APIs) that allow you to access and manipulate an XML document. This feature is based on the Microsoft® XML Parser (MSXML) version 3.0 SP1.

With DOM, applications can work with XML document structures and information as program structures rather than as text streams. By using the built-in facilities of the DOM API in this implementation, applications and scripts can read and manipulate the program structures without understanding the details of XML syntax.

The following list shows the functionality that this feature provides:

  • Loads or creates a document
  • Performs Document Type Definition (DTD) validation or schema validation
  • Gathers errors
  • Accesses and manipulates the information and structures contained within the document
  • Caches the schema in memory
  • Saves the document back out to an XML file

The DOM uses a tree-like hierarchy of nodes in an XML document. These nodes represent document content and structures and may contain, or be contained by, other nodes. Much of your work with XML processing requires navigating this tree structure to find or modify the information it contains. When you work with XML, you need to think of information in terms of nested containers and be sure that information is put into or retrieved from the right container.

The DOM treats nodes as generic objects. This makes it possible for you to create a script that loads a document and traverses all of the nodes. The script then reports what it finds in the tree.

The DOM APIs enable applications to traverse the tree and manipulate its nodes. Each node is defined as a specific node type, according to the XML DOM Enumerated Constants, which also define valid parent and child nodes for each node type. For the majority of XML documents, the most common node types are element, attribute, and text. Attributes occupy a special place in the model because they are not considered child nodes of a parent and are treated more like properties of elements. An additional API, the IXMLDOMNamedNodeMap, is provided for attributes. For information about XML DOM Enumerated Constants, see XML DOM Enumerated Constants. For information about the API IXMLDOMNamedNodeMap, see IXMLDOMNamedNodeMap.

You access the DOM APIs using COM interfaces. The following list shows some of the key interfaces exposed by the XML DOM:

The XML parser on Windows CE is componentized into various XML technologies, which may or may not be included in your device, depending on the features selected by the device manufacturer. For a more information about the technologies making up the XML parser, see XML Parser Architecture for Windows CE. For a more information about the APIs and XML features not supported by XML on Windows CE, see XML for Windows CE. For more information about XML, see this Microsoft Web site.

See Also

XML DOM Enumerated Constants

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.