Static errors are detected before execution starts. It means that they can be found before the source XML document is available. If a stylesheet contains a static error it can be never executed.
In this example xsl:value-of element is a child of xsl:stylesheet. and so a static error is detected. Different types of errors have different error codes. In this case the code "XTSE0010" is used which signals that an XSLT-defined element is used in a context where it is not permitted. These codes are given in the XSLT 2.0 specification but an XSLT implementation is not required to signal errors using these codes.
|
XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/> <xsl:value-of select="/aaa"/> </xsl:stylesheet> |
|
|
XML
<aaa/> |
Output
Error:error - XTSE0010
Element xsl:value-of must not appear directly within xsl:stylesheet Failed to compile stylesheet. 1 error detected.
|
| Previous chapter: | Built in Types |
| Next chapter: | Use When |
| Previous page: | - - - |
| Next page: | Type errors |