Name

DOMConfiguration(3)

Synopsis

This interface is accessible through the domConfig attribute of a given DOM Document object. This object is essentially a list of configuration options that affect how documents are loaded, saved, and validated by the DOM implementation. By using the setParameter( ) method to modify these options, it is possible to change the behavior of the Document.normalize( ) method. For example, by setting the "entities" parameter to false, subsequent calls to the Document.normalize( ) method would cause all EntityReference nodes to be replaced with their replacement text and coalesced with adjacent Text nodes. The following table lists the valid parameters for the DOMConfiguration object:

Parameter name

Value

Meaning

canonical-form

true

Canonicalize the document per the Canonical XML specification. Duplicate namespace declarations are removed, and other changes are made to reduce the document to its simplest possible form. Setting this parameter to true automatically sets the following parameters:

cdata-sections: false

element-content-whitespace: true

entities: false

namespace-declarations: true

namespaces: true

normalize-characters: false

well-formed: true

 

false[1]

Do not canonicalize.

cdata-sections

true[1]

Keep CDataSection nodes intact.

 

false

Transform CDataSection nodes into Text nodes and coalesce redundant Text nodes as necessary.

check-character-normalization

true

Check that the characters in the document are fully normalized per Appendix B of the XML ...

Get XML in a Nutshell, 3rd 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.