Namespace support

The primary enhancement to the DOM standard provided by this release concerns its support for namespaces. A number of new methods have been added to access and create elements and attributes that use the Namespaces standard. This support also ensures that elements that are moved from one part of a DOM structure to another part of the structure retain their namespace identity. Methods with names ending '…NS' are used to create, access and modify elements and attributes without needing to know the namespace prefixes used.

Consider the following document fragment, which declares the prefix 'H' for the HTML 4.0 namespace, and includes a Span element with a Style attribute. This fragment is referenced in numerous examples below, ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.