This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: document.write & copy-of


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]