tests/misc/error-code/error-code-011.xsl
changeset 895 c964d5bbd00e
parent 894 0fc26a1f66f4
child 896 b99b90a57a1c
equal deleted inserted replaced
894:0fc26a1f66f4 895:c964d5bbd00e
     1 <?xml version="1.0"?> 
       
     2 
       
     3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
       
     4 xmlns:xs="http://www.w3.org/2001/XMLSchema">
       
     5 
       
     6   <!-- PURPOSE: Test declaring a variable with incorrect type "element/attribute of type X". -->
       
     7 <?spec xslt#errors?><?error XTSE0010?>
       
     8 
       
     9 <xsl:variable name="tree">
       
    10   <e1><xsl:attribute name="id" type="xs:ID">A001</xsl:attribute></e1>
       
    11   <e2 xsl:type="xs:NMTOKEN">A002</e2>
       
    12 </xsl:variable>
       
    13 
       
    14 <xsl:variable name="v1" select="$tree/e1/@id" as="attribute(*, xs:ID)"/>
       
    15 <xsl:variable name="v2" select="$tree/e2" as="element(*, xs:NMTOKEN)"/>            
       
    16 <xsl:variable name="v3" select="$tree/e2" as="element(*, xs:integer)"/>    
       
    17   <xsl:template match="/">
       
    18     <out val="{($v1, $v2, $v3)}"/>
       
    19   </xsl:template>
       
    20 
       
    21 </xsl:stylesheet>