DOMParser
and DOMSerializer
interfaces. The parameter names used by the DOMConfiguration
object are defined throughout the DOM Level 3 specifications. Names are case-insensitives. 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
false
: "entities ", "normalize-characters", "cdata-sections".This forces the following parameters to true
: "namespaces", "namespace-declarations", " well-formed", "whitespace-in-element-content".Other parameters are not changed unless explicitly specified in the description of the parameters. In addition, the DocumentType
node is removed from the tree if any and superfluous namespace declarations are removed from each element. Note that querying this parameter with getParameter
cannot return true
unless it has been set to true
and the parameters described above are appropriately set.false
"cdata-sections"
true
CDATASection
nodes in the document.false
CDATASection
nodes in the document into Text
nodes. The new Text
node is then combined with any adjacent Text
node."check-character-normalization"
true
false
"comments"
true
Comment
nodes in the document.false
Comment
nodes in the document."datatype-normalization"
true
true
. Having this parameter activated when "validate" is false
has no effect and no schema-normalization will happen. Note: Since the document contains the result of the XML 1.0 processing, this parameter does not apply to attribute value normalization as defined in section 3.3.3 of [XML 1.0] and is only meant for schema languages other than Document Type Definition (DTD).
false
"entities"
true
EntityReference
and Entity
nodes in the document.false
EntityReference
and Entity
nodes from the document, putting the entity expansions directly in their place. Text
nodes are normalized, as defined in Node.normalize
. Only EntityReference
nodes to non-defined entities are kept in the document, with their associated Entity
nodes if any. "error-handler"
DOMErrorHandler
object. If an error is encountered in the document, the implementation will call back the DOMErrorHandler
registered using this parameter. When called, DOMError.relatedData
will contain the closest node to where the error occurred. If the implementation is unable to determine the node where the error occurs, DOMError.relatedData
will contain the Document
node. Mutations to the document from within an error handler will result in implementation dependent behavior. "infoset"
true
false
: " validate-if-schema", "entities", "datatype-normalization", "cdata-sections ".This forces the following parameters to true
: " namespace-declarations", "well-formed", "whitespace-in-element-content", " comments", "namespaces".Other parameters are not changed unless explicitly specified in the description of the parameters. Note that querying this parameter with getParameter
returns true
only if the individual parameters specified above are appropriately set.false
infoset
to false
has no effect."namespaces"
true
false
"namespace-declarations"
true
false
Node.prefix
) are retained even if this parameter is set to false
."normalize-characters"
true
false
"schema-location"
DOMString
object containing a list of URIs, separated by whitespaces (characters matching the nonterminal production S defined in section 2.3 [XML 1.0]), that represents the schemas against which validation should occur, i.e. the current schema. The types of schemas referenced in this list must match the type specified with schema-type
, otherwise the behavior of an implementation is undefined. The schemas specified using this property take precedence to the schema information specified in the document itself. For namespace aware schema, if a schema specified using this property and a schema specified in the document instance (i.e. using the schemaLocation
attribute) in a schema document (i.e. using schema import
mechanisms) share the same targetNamespace
, the schema specified by the user using this property will be used. If two schemas specified using this property share the same targetNamespace
or have no namespace, the behavior is implementation dependent. If no location has been provided, this parameter is null
. Note: It is illegal to set the "schema-location"
parameter if the "schema-type" parameter value is not set. It is strongly recommended that Document.documentURI
will be set so that an implementation can successfully resolve any external entities referenced.
"schema-type"
DOMString
object containing an absolute URI and representing the type of the schema language used to validate a document against. Note that no lexical checking is done on the absolute URI. If this parameter is not set, a default value may be provided by the implementation, based on the schema languages supported and on the schema language used at load time. If no value is provided, this parameter is null
. Note: For XML Schema [XML Schema Part 1] , applications must use the value "http://www.w3.org/2001/XMLSchema"
. For XML DTD [XML 1.0], applications must use the value "http://www.w3.org/TR/REC-xml"
. Other schema languages are outside the scope of the W3C and therefore should recommend an absolute URI in order to use this method.
"split-cdata-sections"
true
DOMError.type
equals to "cdata-sections-splitted"
and DOMError.relatedData
equals to the first CDATASection
node in document order resulting from the split.false
CDATASection
contains an unrepresentable character."validate"
true
true
. This parameter will reevaluate: Attr.specified
equals to false
, as specified in the description of the Attr
interface; Text.isWhitespaceInElementContent()
for all Text
nodes; Attr.isId()
for all Attr
nodes; Element.schemaTypeInfo
and Attr.schemaTypeInfo
. Note: "validate-if-schema" and "validate" are mutually exclusive, setting one of them to true
will set the other one to false
. Applications should also consider setting the parameter "well-formed" to true
, which is the default for that option, when validating the document.
false
true
. "validate-if-schema"
true
true
. Note: "validate-if-schema" and "validate" are mutually exclusive, setting one of them to true
will set the other one to 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"
if necessary; Attr
, Element
, Comment
, Text
, CDATASection
nodes for invalid characters and generate a DOMError
of type "wf-invalid-character"
if necessary; ProcessingInstruction
nodes for invalid characters and generate a DOMError
of type "wf-invalid-character"
if necessary; false
"whitespace-in-element-content"
true
false
Text
nodes that contain whitespaces in element content. The implementation is expected to use the method Text.isWhitespaceInElementContent
to determine if a Text
node should be discarded or not. 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 entity resolver instead of using Document.documentURI
.
See also the Document Object Model (DOM) Level 3 Core Specification. @since DOM Level 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|