27 January 2004

Appendix A: Validation Outcomes

Editor:
Ben Chang, Oracle

Table of contents

A.1 The nodeValidity and validateDocument methods

The following table describes all possible validation outcomes of the NodeEditVAL.nodeValidity(valType) method.

Validation Type Validity outcome
VAL_TRUE VAL_FALSE VAL_UNKNOWN
VAL_WF The node is well-formed. The node is not well-formed. Not applicable.
VAL_NS_WF The node is well-formed. Processor must take into account all the in-scope namespace declarations. The node is not namespace well-formed. Processor must take into account all the in-scope namespace declarations. Not applicable.
VAL_NS_WF The node is well-formed. Processor must take into account all namespace declarations in scope. The node is not namespace well-formed. Processor must take into account all the in-scope namespace declarations. Not applicable.
VAL_SCHEMA The node is valid: it complies with all the constraints expressed in the schema. The node fails to comply to all the constraints expressed in the schema. If the schema is an XML Schema, PSVI [validity] property value is unknown.
VAL_INCOMPLETE The node is valid: it complies with the VAL_INCOMPLETE definition. The node is invalid with regard to the VAL_INCOMPLETE definition. If the schema is an XML Schema, PSVI [validity] property value is unknown.

The following table describes the outcome of the DocumentEditVAL.validateDocument() and NodeEditVAL.nodeValidity(valType) methods, with the latter called on the DocumentEditVAL node with validationType NodeEditVAL.VAL_SCHEMA.

Methods Validity outcome
VAL_TRUE VAL_FALSE VAL_UNKNOWN
validateDocument and nodeValidity, called on the Document node with validationType VAL_SCHEMA. If the schema is a DTD, then the document valid constraint is satisfied. If the schema is an XML Schema, then the document validity is the same as the validity of the validation root, i.e., documentElement: PSVI [validity] valid. Fails to satisfy the constraints defined. If the schema is an XML Schema, then schema is not found or the declaration for the validation root is not found: PSVI [validity] unknown.

The following table describes outcomes for the NodeEditVAL.nodeValidity(valType) method called with the validationType NodeEditVAL.VAL_SCHEMA:

Node types Validity outcome
VAL_TRUE VAL_FALSE VAL_UNKNOWN
Element If the schema is a DTD, then element and attribute validity constraints, including attribute validity constraint defined below are satisfied. If the schema is an XML Schema, then PSVI [validity] valid. Fails to satisfy the constraints defined. If the schema is an XML Schema, then PSVI [validity] unknown.
Attr If the schema is a DTD, then all validity constraints defined in section 3.3.1, "Attribute Type", required and fixed attribute are satisfied. If the schema is an XML Schema, then PSVI [validity] valid. Fails to satisfy the constraints defined. If the schema is an XML Schema, then PSVI [validity] unknown.
Text The node is well-formed. The node is not well-formed. If no parent node is found.
CDATASection The node is well-formed. The node is not well-formed. If no parent node is found.
ProcessingInstruction The node is well-formed. The node is not well-formed. If no parent node is found.
Comment The node is well-formed. The node is not well-formed. If no parent node is found.
EntityReference Entity is declared. Entity is not declared. Not applicable.
Entity Implementation-specific. Implementation-specific. Implementation-specific.
Notation Implementation-specific. Implementation-specific. Implementation-specific.
DocumentType Implementation-specific. Implementation-specific. Implementation-specific.
DocumentFragment Not applicable. Not applicable. Not applicable.

A.2 Other validation operations

The table below describes validation outcomes from can* validation operations, such as NodeEditVAL.canRemoveChild(), or ElementEditVAL.canSetAttributeNS, CharacterDataEditVAL.canAppendData(). All these operations attempt to validate with validityType NodeEditVAL.VAL_INCOMPLETE.

VAL_TRUE VAL_FALSE VAL_UNKNOWN
If the associated operation is performed, then the node would be valid with regards to the VAL_INCOMPLETE definition or if there is no schema found. If the associated operation is performed, then the node would be invalid with regards to the VAL_INCOMPLETE definition. Not applicable.

Note: If the document includes more than one type of schema, e.g., DTD and XML Schema, and the DOMConfiguration "schema-type" parameter is not specified, the validation outcome for NodeEditVAL.VAL_INCOMPLETE and NodeEditVAL.VAL_SCHEMA is implementation-specific.