RE: document.write & copy-of

Subject: RE: document.write & copy-of
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Fri, 27 Oct 2000 12:26:52 +0100
> But what is the purpose of empty <xsl:text /> instructions?

An empty <xsl:text/> instruction splits a text node into two, typically
making one of them a whitespace-only node that will be stripped from the
stylesheet.

Useful e.g. in
<xsl:attribute>
<xsl:text/>[<xsl:value-of select="$x"/>]<xsl:text/>
</xsl:attribute>

to prevent newlines in the output. You can't put an <xsl:text> element
around the <xsl:value-of>, it's not allowed to contain child elements, and
the alternative of

<xsl:text>[</xsl:text><xsl:value-of select="$x"/><xsl:text>]</xsl:text>

is even uglier.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread