Using the DOMConfiguration
users can change behavior
of the DOMParser
, DOMSerializer
and
Document.normalizeDocument()
. If a DOM
implementation supports XML Schemas and DTD validation, the table
below defines behavior of such implementation following various
parameter settings on the DOMConfiguration
. Errors
are effectively reported only if a DOMErrorHandler
object is attached to the "error-handler" parameter.
"schema-type" | "validate" | "validate-if-schema" | Instance schemas, i.e. the current schema | Outcome | Other parameters |
---|---|---|---|---|---|
null |
true |
false | DTD and XML Schema | Implementation dependent |
The outcome of setting the "datatype-normalization",
"element-content-whitespace"
or "namespaces" parameters
to true or false is implementation
dependent.
|
false |
true | ||||
null |
true |
false | none | Report an error |
Setting the "datatype-normalization"
to true or false has no effect on
the DOM.
|
false |
true | No error is reported | |||
null |
true |
false | DTD | Validate against DTD |
Setting the "datatype-normalization"
to true or false has no effect on
the DOM. |
false |
true | ||||
null |
true |
false | XML Schema | Validate against XML Schema |
The outcome of setting the "namespaces" to
false is implementation dependent (likely to be
an error). Setting the "element-content-whitespace"
to false does not have any effect on the DOM.
|
false |
true | ||||
"http://www.w3.org/TR/REC-xml" |
true |
false | DTD or XML Schema or both | If DTD is found, validate against DTD. Otherwise, report an error. |
Setting the "datatype-normalization"
to true or false has no effect on
the DOM.
|
false |
true | If DTD is found, validate against DTD. | |||
"http://www.w3.org/2001/XMLSchema" |
true |
false | DTD or XML Schema or both | If XML Schema is found, validate against the schema. Otherwise, report an error. |
Setting the "datatype-normalization"
to true exposes XML Schema normalized values in the
DOM. The outcome of setting the "namespaces" to
false is implementation dependent (likely to be
an error).
|
false |
true | If XML Schema is found, validate against the schema. | |||
"http://www.w3.org/2001/XMLSchema" or
"http://www.w3.org/TR/REC-xml"
|
false |
false | DTD or XML Schema or both | If XML Schema is found, it is ignored. DOM implementations may use information available in the DTD to perform entity resolution. |
Setting the "datatype-normalization"
to true of false has no effect on
the DOM.
|
Note:
If an error has to be reported, as specified in the "Outcome"
column above, the DOMError.type
is
"no-schema-available"
.