SUMMARY
There is a great deal of support for XML and related technologies in JavaScript. Unfortunately, because of an early lack of specifications, there are several different implementations for common functionality. DOM Level 2 provides an API for creating empty XML documents but not for parsing or serialization. Browsers implemented two new types to deal with XML parsing and serialization as follows:
- The
DOMParser
type is a simple object that parses an XML string into a DOM document. - The
XMLSerializer
type performs the opposite operation, serializing a DOM document into an XML string.
DOM Level 3 introduced a specification for an XPath API that has been implemented by all major browsers. The API enables JavaScript to run any XPath query against a DOM document and retrieve the result regardless of its data type.
The last related technology is XSLT, which has no public specification defining an API for its usage. Firefox created the XSLTProcessor
type to handle transformations via JavaScript...