Re: [xsl] why do I get duplicate <HTML> after xsl:copy ?

Subject: Re: [xsl] why do I get duplicate <HTML> after xsl:copy ?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Jun 2005 17:18:12 +0100
  I apply the same logic in the next block

  <xsl:template match="BODY">
        <xsl:copy>
            <xsl:copy-of select="."/>
            <xsl:apply-templates select="TABLE | TABLE/TR | TABLE/TR/TD"/>
        </xsl:copy>
   </xsl:template>

  Then why doesnt the result contain duplicate <BODY> tags ?

presumably this template is never applied.
If it were applied it would mangle your table elements as you process
separately all TABLE TR and TD elements, so teh result of processing
these elements would all come out at the same level, not contained one
within the other.

If you only want to process TABLE children of BODY then you want



            <xsl:apply-templates select="TABLE"/>

And of again you don't want <xsl:copy-of select="."/> unless you want
the entire input BODY copied with no change.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread