Sign In/My Account | View Cart  
advertisement

Article:
 Grouping With XSLT 2.0
Subject: Last template example is incorrect
Date: 2003-11-09 13:23:33
From: TT Online

The last template (the group-ending-with example) will not copy the file elements correctly. It will just concatenate all attribute values of the 'file' element.


I assume the author meant to use xsl:copy-of here.



Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Last template example is incorrect
    2003-11-09 14:36:03 Bob DuCharme [Reply]


    I realized that my full example for the last one had this template rule in it, which makes it work as-is:


    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>


    There was also no output="text" at the top.


    I try to only show the code that matters in an example, but I was apparently slashing too much here. You can see it work in the zip file of examples as grouping5.xsl. Until the link from the article to the zip file is fixed, you can get a copy at www.snee.com/bob/temp/trxml42code.zip.


    Bob



Sponsored By: