XML technologies / XML / XML in a Nutshell / DOM reference / Object reference / DOMConfiguration
(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)
This interface is accessed through the domConfig attribute of a given DOM-Document object. It is essentially a list of configuration options controlling how DOM implementations load, save, and validate documents. Using the method setParameter( ) to change these options lets you influence the behavior of the method Document.normalize( ). For example, if you set the parameter "entities" to false, subsequent calls to the method Document.normalize( ) cause all EntityReference nodes to be replaced with their replacement text and merged with adjacent text nodes. The following table lists valid parameters for the DOMConfiguration object:
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
* Indicates the parameter’s default value. Parameters without a default value are optional.
Attribute
The object DOMConfiguration has the following attribute:
parameterNames: DOMStringList(3)
Returns a list of parameters supported by the DOMConfiguration object. It may include parameters outside the DOM Recommendation. Read-only.
Java binding
public DOMStringList getParameterNames( );
Methods
The object DOMConfiguration defines the following methods:
canSetParameter: name, value(3)
Returns true, if the parameter name would accept the specified value value. This is essentially equivalent to calling setParameter( ), without changing the parameter’s value.
Arguments
The name of a valid parameter (from the
parameterNameslist) to test.value: DOMUserData
The potential value to test.
Java binding
public boolean canSetParameter(String name, Object value);
getParameter: name(3)
Returns the value of the specified parameter if known. The return value has type DOMUserData and is null, if no value is assigned to the parameter or the parameter is not recognized.
Argument
name: DOMString
The name of a valid parameter (from the
parameterNameslist) to query.
Exception
NOT_FOUND_ERR
Raised if the specified parameter name is not recognized.
Java binding
public Object getParameter(String name) throws DOMException;
setParameter: name, value(3)
Attempts to set the specified parameter to the specified value.
Arguments
name: DOMString
The name of a valid parameter (from the
parameterNameslist) to set.value: DOMUserData
The new value for the parameter.
Exceptions
NOT_FOUND_ERR
Raised if the specified parameter name is not recognized.
NOT_SUPPORTED_ERR
Raised if the parameter is recognized but not supported.
TYPE_MISMATCH_ERR
Raised if this parameter’s value is incompatible with the expected type (for example, when attempting to set the parameter
error-handlerto an object that does not implement the interfaceDOMErrorHandler).
Java binding
public void setParameter(String name, Object value) throws DOMException;
Copyright © 2005 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "XML in a Nutshell" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de