Program with DOM in JScript

 

This tutorial is intended for JScript programmers interested in writing XML applications using the DOM APIs as implemented in Microsoft XML Core Services (MSXML). It includes a series of simple examples written in Microsoft JScript and tested using Notepad and Windows Scripting Host. The objective is to provide a quick and practical orientation, so that you can start to write your own XML applications.

Each demonstration is a self-contained application that you can build and run independently. Each demonstration provides complete source code, the expected output, any required resource files, and instructions for building and running the sample application.

These demonstrations are task-oriented, and are simplified for clarity. Therefore, their implementation is not always optimized and might not represent the best coding practice.

This tutorial consists of the following demonstrations.

How Do I? Description
Set Up My JScript Project Discusses the requirements for using MSXML, and describes how to install the MSXML components.
Instantiate an XML DOM Object (JScript) Demonstrates two ways to instantiate an XML DOM object in JScript.
Load an XML File into a DOM Object (JScript) Demonstrates how to create an XML DOM instance and load its content from an external XML data file.
Serialize an XML DOM Object to a File (JScript) Demonstrates how to serialize an XML DOM object in a text file.
Perform XSL Transformations (JScript) Demonstrates how to perform XSL Transformations (XSLT).
Create an XML DOM Object Dynamically (JScript) Demonstrates how to create an XML DOM object programmatically, including processing instructions, comments, elements, attributes, CDATA sections and text nodes.
Query XML DOM Nodes (JScript) Demonstrates how to query a DOM node or node-set using XPath expressions.
Make XML Requests Over HTTP (JScript) Demonstrates how to perform client requests of XML data from a web server.
Validate XML (JScript) Demonstrates how to validate XML documents against an XML schema as well as how to validate document node fragments.