Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface DOMConfiguration
DOMConfiguration
interface represents the configuration
of a document and maintains a table of recognized parameters. Using the
configuration, it is possible to change
Document.normalizeDocument()
behavior, such as replacing the
CDATASection
nodes with Text
nodes or
specifying the type of the schema that must be used when the validation
of the Document
is requested. DOMConfiguration
objects are also used in [DOM Level 3 Load and Save]
in the DOMParser
and DOMSerializer
interfaces.
The parameter names used by the DOMConfiguration
object
are defined throughout the DOM Level 3 specifications. Names are
case-insensitive. To avoid possible conflicts, as a convention, names
referring to parameters defined outside the DOM specification should be
made unique. Because parameters are exposed as properties in the , names
are recommended to follow the section 5.16 Identifiers of [Unicode] with the addition of the character '-' (HYPHEN-MINUS) but it is not
enforced by the DOM implementation. DOM Level 3 Core Implementations are
required to recognize all parameters defined in this specification. Some
parameter values may also be required to be supported by the
implementation. Refer to the definition of the parameter to know if a
value must be supported or not.
Note: Parameters are similar to features and properties used in SAX2 [SAX].
The following list of parameters defined in the DOM:
"canonical-form"
true
DocumentType
true
false
false
true
false
"cdata-sections"
true
CDATASection
false
CDATASection
Text
Text
Text
"check-character-normalization"
true
DOMError.type
false
"comments"
true
Comment
false
Comment
"datatype-normalization"
true
true
false
Note:XML 1.0
false
"element-content-whitespace"
true
false
Text
[element content whitespace]Text.isElementContentWhitespace
Text
"entities"
true
EntityReference
false
EntityReference
Text
Node.normalize
unexpanded entity referencesNote:Entity
"error-handler"
DOMErrorHandler
DOMErrorHandler
DOMErrorHandler
DOMError.relatedData
DOMError.relatedData
Document
"infoset"
true
false
true
getParameter
true
false
infoset
false
"namespaces"
true
false
"namespace-declarations"
false
true
false
Node.prefix
false
"normalize-characters"
true
false
"schema-location"
DOMString
nonterminal
production SXML 1.0schema-type
schemaLocation
import
targetNamespace
targetNamespace
null
Note:"schema-location"
Document.documentURI
"schema-type"
DOMString
null
Note:XML Schema Part 1"http://www.w3.org/2001/XMLSchema"
XML 1.0"http://www.w3.org/TR/REC-xml"
"split-cdata-sections"
true
DOMError.type
"cdata-sections-splitted"
DOMError.relatedData
CDATASection
false
CDATASection
"validate"
true
true
Attr.specified
equals to false
, as specified in
the description of the Attr
interface;
Text.isElementContentWhitespace
for all
Text
nodes;
Attr.isId
for all Attr
nodes;
Element.schemaTypeInfo
and Attr.schemaTypeInfo
.
Note:true
false
true
false
true
"validate-if-schema"
true
true
Note:true
false
false
true
"well-formed"
true
Document.xmlVersion
Node.nodeName
contains invalid characters according to its
node type and generate a DOMError
of type
"wf-invalid-character-in-node-name"
, with a
DOMError.SEVERITY_ERROR
severity, if necessary;
Attr
, Element
,
Comment
, Text
, CDATASection
nodes
for invalid characters and generate a DOMError
of type
"wf-invalid-character"
, with a
DOMError.SEVERITY_ERROR
severity, if necessary;
ProcessingInstruction
nodes for invalid
characters and generate a DOMError
of type
"wf-invalid-character"
, with a
DOMError.SEVERITY_ERROR
severity, if necessary;
false
The resolution of the system identifiers associated with entities is
done using Document.documentURI
. However, when the feature
"LS" defined in [DOM Level 3 Load and Save]
is supported by the DOM implementation, the parameter
"resource-resolver" can also be used on DOMConfiguration
objects attached to Document
nodes. If this parameter is
set, Document.normalizeDocument()
will invoke the resource
resolver instead of using Document.documentURI
.
See also the Document Object Model (DOM) Level 3 Core Specification.
Method Summary | |
boolean |
|
Object |
|
DOMStringList |
|
void |
|
public boolean canSetParameter(String name, Object value)
Check if setting a parameter to a specific value is supported.
- Parameters:
name
- The name of the parameter to check.value
- An object. ifnull
, the returned value istrue
.
- Returns:
true
if the parameter could be successfully set to the specified value, orfalse
if the parameter is not recognized or the requested value is not supported. This does not change the current value of the parameter itself.
public Object getParameter(String name) throws DOMException
Return the value of a parameter if known.
- Parameters:
name
- The name of the parameter.
- Returns:
- The current object associated with the specified parameter or
null
if no object has been associated or if the parameter is not supported.
- Throws:
DOMException
- NOT_FOUND_ERR: Raised when the parameter name is not recognized.
public DOMStringList getParameterNames()
The list of the parameters supported by thisDOMConfiguration
object and for which at least one value can be set by the application. Note that this list can also contain parameter names defined outside this specification.
public void setParameter(String name, Object value) throws DOMException
Set the value of a parameter.
- Parameters:
name
- The name of the parameter to set.value
- The new value ornull
if the user wishes to unset the parameter. While the type of the value parameter is defined asDOMUserData
, the object type must match the type defined by the definition of the parameter. For example, if the parameter is "error-handler", the value must be of typeDOMErrorHandler
.
- Throws:
DOMException
- NOT_FOUND_ERR: Raised when the parameter name is not recognized.
NOT_SUPPORTED_ERR: Raised when the parameter name is recognized but the requested value cannot be set.
TYPE_MISMATCH_ERR: Raised if the value type for this parameter name is incompatible with the expected value type.