[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Copy vs copy-of (was: How to delete empty element tag fr
Topher, > How would your sample below be different from > <xsl:template match="*" mode="copy-unless-empty"> > <xsl:if test="node()"> > <xsl:copy-of select="."/> > </xsl:if> > </xsl:template> >> <xsl:template match="*" mode="copy-unless-empty"> >> <xsl:if test="node()"> >> <xsl:copy> >> <xsl:copy-of select="@*"/> >> <xsl:value-of select="."/> >> </xsl:copy> >> </xsl:if> >> </xsl:template> There might be a difference if the element that's being matched has non-text children. For example: <p>Copy me and forget my <em>emphasis</em>.</p> would remain as it is under the first template, but under the second it would become: <p>Copy me and forget my emphasis.</p> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|