IDOMConfiguration Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The DOMConfiguration
interface represents the configuration
of a document and maintains a table of recognized parameters.
[Android.Runtime.Register("org/w3c/dom/DOMConfiguration", "", "Org.W3c.Dom.IDOMConfigurationInvoker")]
public interface IDOMConfiguration : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("org/w3c/dom/DOMConfiguration", "", "Org.W3c.Dom.IDOMConfigurationInvoker")>]
type IDOMConfiguration = interface
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Attributes
- Implements
Remarks
The 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. <p ><b>Note:</b> Parameters are similar to features and properties used in SAX2 [SAX].
The following list of parameters defined in the DOM: <dl> <dt> "canonical-form"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>] Canonicalize the document according to the rules specified in [Canonical XML], such as removing the DocumentType
node (if any) from the tree, or removing superfluous namespace declarations from each element. Note that this is limited to what can be represented in the DOM; in particular, there is no way to specify the order of the attributes in the DOM. In addition, Setting this parameter to true
will also set the state of the parameters listed below. Later changes to the state of one of those parameters will revert "canonical-form" back to false
. Parameters set to false
: "entities", " normalize-characters", "cdata-sections". Parameters set to true
: "namespaces", "namespace-declarations", "well-formed", "element-content-whitespace". Other parameters are not changed unless explicitly specified in the description of the parameters.</dd> <dt> false
</dt> <dd>[<em>required</em>] (<em>default</em>)Do not canonicalize the document.</dd> </dl></dd> <dt>"cdata-sections"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>] (<em>default</em>)Keep CDATASection
nodes in the document.</dd> <dt>false
</dt> <dd>[<em>required</em>]Transform CDATASection
nodes in the document into Text
nodes. The new Text
node is then combined with any adjacent Text
node.</dd> </dl></dd> <dt> "check-character-normalization"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>] Check if the characters in the document are fully normalized, as defined in appendix B of [XML 1.1]. When a sequence of characters is encountered that fails normalization checking, an error with the DOMError.type
equals to "check-character-normalization-failure" is issued. </dd> <dt>false
</dt> <dd>[<em>required</em>] (<em>default</em>)Do not check if characters are normalized.</dd> </dl></dd> <dt>"comments"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>] (<em>default</em>)Keep Comment
nodes in the document.</dd> <dt>false
</dt> <dd>[<em>required</em>]Discard Comment
nodes in the document.</dd> </dl></dd> <dt> "datatype-normalization"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>] Expose schema normalized values in the tree, such as XML Schema normalized values in the case of XML Schema. Since this parameter requires to have schema information, the "validate" parameter will also be set to true
. Having this parameter activated when "validate" is false
has no effect and no schema-normalization will happen. <p ><b>Note:</b> 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). </dd> <dt> false
</dt> <dd>[<em>required</em>] (<em>default</em>) Do not perform schema normalization on the tree. </dd> </dl></dd> <dt> "element-content-whitespace"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>required</em>] (<em>default</em>)Keep all whitespaces in the document.</dd> <dt>false
</dt> <dd>[<em>optional</em>] Discard all Text
nodes that contain whitespaces in element content, as described in [element content whitespace]. The implementation is expected to use the attribute Text.isElementContentWhitespace
to determine if a Text
node should be discarded or not.</dd> </dl></dd> <dt>"entities"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>] (<em>default</em>)Keep EntityReference
nodes in the document.</dd> <dt> false
</dt> <dd>[<em>required</em>] Remove all EntityReference
nodes from the document, putting the entity expansions directly in their place. Text
nodes are normalized, as defined in Node.normalize
. Only unexpanded entity references are kept in the document. </dd> </dl> <p ><b>Note:</b> This parameter does not affect Entity
nodes. </dd> <dt> "error-handler"
</dt> <dd>[<em>required</em>] Contains a DOMErrorHandler
object. If an error is encountered in the document, the implementation will call back the DOMErrorHandler
registered using this parameter. The implementation may provide a default DOMErrorHandler
object. 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. </dd> <dt>"infoset"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>]Keep in the document the information defined in the XML Information Set [XML Information Set] .This forces the following parameters to false
: " validate-if-schema", "entities", "datatype-normalization", "cdata-sections ".This forces the following parameters to true
: " namespace-declarations", "well-formed", "element-content-whitespace", " 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.</dd> <dt>false
</dt> <dd>Setting infoset
to false
has no effect.</dd> </dl></dd> <dt>"namespaces"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in . </dd> <dt>false
</dt> <dd>[<em>optional</em>] Do not perform the namespace processing. </dd> </dl></dd> <dt> "namespace-declarations"
</dt> <dd> This parameter has no effect if the parameter "namespaces" is set to false
. <dl> <dt>true
</dt> <dd>[<em>required</em>] (<em>default</em>) Include namespace declaration attributes, specified or defaulted from the schema, in the document. See also the sections "Declaring Namespaces" in [XML Namespaces] and [XML Namespaces 1.1] .</dd> <dt>false
</dt> <dd>[<em>required</em>]Discard all namespace declaration attributes. The namespace prefixes ( Node.prefix
) are retained even if this parameter is set to false
.</dd> </dl></dd> <dt>"normalize-characters"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>] Fully normalized the characters in the document as defined in appendix B of [XML 1.1]. </dd> <dt> false
</dt> <dd>[<em>required</em>] (<em>default</em>)Do not perform character normalization.</dd> </dl></dd> <dt>"schema-location"
</dt> <dd>[<em>optional</em>] Represent a 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
. <p ><b>Note:</b> The "schema-location"
parameter is ignored unless the "schema-type" parameter value is set. It is strongly recommended that Document.documentURI
will be set so that an implementation can successfully resolve any external entities referenced. </dd> <dt> "schema-type"
</dt> <dd>[<em>optional</em>] Represent a 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
. <p ><b>Note:</b> 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. </dd> <dt>"split-cdata-sections"
</dt> <dd> <dl> <dt> true
</dt> <dd>[<em>required</em>] (<em>default</em>)Split CDATA sections containing the CDATA section termination marker ']]>'. When a CDATA section is split a warning is issued with a DOMError.type
equals to "cdata-sections-splitted"
and DOMError.relatedData
equals to the first CDATASection
node in document order resulting from the split.</dd> <dt> false
</dt> <dd>[<em>required</em>]Signal an error if a CDATASection
contains an unrepresentable character.</dd> </dl></dd> <dt>"validate"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>] Require the validation against a schema (i.e. XML schema, DTD, any other type or representation of schema) of the document as it is being normalized as defined by [XML 1.0]. If validation errors are found, or no schema was found, the error handler is notified. Schema-normalized values will not be exposed according to the schema in used unless the parameter "datatype-normalization" is true
. This parameter will reevaluate: <ul> <li> Attribute nodes with Attr.specified
equals to false
, as specified in the description of the Attr
interface; </li> <li> The value of the attribute Text.isElementContentWhitespace
for all Text
nodes; </li> <li> The value of the attribute Attr.isId
for all Attr
nodes; </li> <li> The attributes Element.schemaTypeInfo
and Attr.schemaTypeInfo
. </li> </ul> <p ><b>Note:</b> "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. </dd> <dt>false
</dt> <dd>[<em>required</em>] (<em>default</em>) Do not accomplish schema processing, including the internal subset processing. Default attribute values information are kept. Note that validation might still happen if "validate-if-schema" is true
. </dd> </dl></dd> <dt>"validate-if-schema"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>optional</em>]Enable validation only if a declaration for the document element can be found in a schema (independently of where it is found, i.e. XML schema, DTD, or any other type or representation of schema). If validation is enabled, this parameter has the same behavior as the parameter "validate" set to true
. <p ><b>Note:</b> "validate-if-schema" and "validate" are mutually exclusive, setting one of them to true
will set the other one to false
. </dd> <dt>false
</dt> <dd>[<em>required</em>] (<em>default</em>) No schema processing should be performed if the document has a schema, including internal subset processing. Default attribute values information are kept. Note that validation must still happen if "validate " is true
. </dd> </dl></dd> <dt>"well-formed"
</dt> <dd> <dl> <dt>true
</dt> <dd>[<em>required</em>] (<em>default</em>) Check if all nodes are XML well formed according to the XML version in use in Document.xmlVersion
: <ul> <li> check if the attribute 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; </li> <li> check if the text content inside 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; </li> <li> check if the data inside ProcessingInstruction
nodes for invalid characters and generate a DOMError
of type "wf-invalid-character"
, with a DOMError.SEVERITY_ERROR
severity, if necessary; </li> </ul></dd> <dt> false
</dt> <dd>[<em>optional</em>] Do not check for XML well-formedness. </dd> </dl></dd> </dl>
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.
Added in DOM Level 3.
Java documentation for org.w3c.dom.DOMConfiguration
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Properties
Handle |
Gets the JNI value of the underlying Android object. (Inherited from IJavaObject) |
JniIdentityHashCode |
Returns the value of |
JniManagedPeerState |
State of the managed peer. (Inherited from IJavaPeerable) |
JniPeerMembers |
Member access and invocation support. (Inherited from IJavaPeerable) |
ParameterNames |
The list of the parameters supported by this
|
PeerReference |
Returns a JniObjectReference of the wrapped Java object instance. (Inherited from IJavaPeerable) |
Methods
CanSetParameter(String, Object) |
Check if setting a parameter to a specific value is supported. |
Disposed() |
Called when the instance has been disposed. (Inherited from IJavaPeerable) |
DisposeUnlessReferenced() |
If there are no outstanding references to this instance, then
calls |
Finalized() |
Called when the instance has been finalized. (Inherited from IJavaPeerable) |
GetParameter(String) |
Return the value of a parameter if known. |
SetJniIdentityHashCode(Int32) |
Set the value returned by |
SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from IJavaPeerable) |
SetParameter(String, Object) |
Set the value of a parameter. |
SetPeerReference(JniObjectReference) |
Set the value returned by |
UnregisterFromRuntime() |
Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations. (Inherited from IJavaPeerable) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |