Recoverable XSLT Errors
The W3C XSL Transformations (XSLT) Version 1.0 Recommendation includes areas in which the implementation provider may decide how to handle a situation. These areas are considered to be discretionary behavior. For example, in section 7.3 Creating Processing Instructions, the XSLT 1.0 recommendation states that it is an error if instantiating the content of
xsl:processing-instruction creates nodes other than text nodes. For some problems, the XSLT 1.0 recommendation indicates what decision should be made if the processor decides to recover from the error. For the problem given in section 7.3, the W3C says that the implementation can recover from this error by ignoring the nodes and their content.
The following table lists each of the discretionary behaviors allowed by the XSLT 1.0 recommendation, and how these behaviors are handled by the XslCompiledTransform class.
Error indicates that an exception is raised for this condition.
The section references can be found in the W3C XSL Transformations (XSLT) Version 1.0 Recommendation and the W3C XSL Transformations (XSLT) Version 1.0 Specification Errata.
|XSLT condition||Section||XslCompiledTransform behavior|
|A text node matches both ||3.4||Recover|
|A source node matches more than one template rule.||5.5||Recover|
|A namespace URI is declared to be an alias for multiple namespace URIs, all having the same import precedence.||7.1.1||Recover|
|The ||7.1.2, 7.1.3||Error*|
|Two attribute sets with the same import and expanded-name have an attribute in common and there is no other attribute set containing the common attribute having the same name with higher importance.||7.1.4||Recover|
|Adding an attribute to an element after children have been added to it.||7.1.3||Error*|
|Creating an attribute with the name 'xmlns'||7.1.3||Error*|
|Adding an attribute to a node that is not an element.||7.1.3||Error*|
|Creating nodes other than text nodes during the instantiation of the content of the ||7.1.3||Error*|
|Instantiating the content of ||7.3||Error*|
|The result of instantiating the content of the ||7.3||Recover|
|The result of instantiating the content of the ||7.4||Recover|
|The result of instantiating the content of the ||7.4||Error*|
|The template within a variable-binding element returns an attribute node or a namespace node.||11.2||Error*|
|There is an error retrieving the resource from the URI passed into the document function.||12.1||Error|
|The URI reference in the document function contains a fragment identifier and there is an error processing the fragment identifier.||12.1||Recover*|
|There are multiple attributes with the same name, but different values, that are not named cdata-section elements in ||16||Recover|
|The processor does not support the encoding in the ||16.1||Recover|
|Disabling output escaping for a text node that is used for something other than a text node in the result tree.||16.4||Recover*|
|Converting a result tree fragment to a number or string if the result tree fragment contains a text node with output escaping enabled.||16.4||Recover*|
|Output escaping is disabled for a character that cannot be represented in the encoding that the XSLT processor is using for output.||16.4||Recover*|
|Adding a namespace node to an element after children have been added to it or after attributes have been added to it.||errata 25||Error*|
|The ||errata 24||Recover|
|The second argument node-set to the document function is empty and the URI reference is relative.||errata 14||Recover|
* This behavior is different than that of the XslTransform class. For more information, see Implementation of Discretionary Behaviors in the XslTransform Class.