Re: [xsl] Template-matching nodes from input vs nodes in variable based on their position

Subject: Re: [xsl] Template-matching nodes from input vs nodes in variable based on their position
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Jun 2015 08:12:20 -0000
Jorge . chocolate.camera@xxxxxxxxx wrote:
On Wed, Jun 17, 2015 at 9:18 PM, Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
Try
   as="document-node()"

It won't work:


     Error at xsl:variable on line 5 column 51 of stylesheet.xsl:
       XTTE0570: Required item type of value of variable $FOO is
       document-node(); supplied value has item type element()
     Failed to compile stylesheet. 1 error detected.


Sorry, I forgot one detail, if you want to have an "as" attribute spelled out then you need to write it as

        <xsl:variable name="FOO" as="document-node()">
          <xsl:document>
            <page>Page number 1</page>
            <page>Page number 2</page>
            <page>Page number 3</page>
            <page>Page number 4</page>
            <page>Page number 5</page>
            <page>Page number 6</page>
            <page>Page number 7</page>
          </xsl:document>
        </xsl:variable>


See http://xsltransform.net/pPqsHU1 for a working sample.


Current Thread