[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to preserve whitespace in the stylesheet?
> From: Robert Nicholson [mailto:robert@xxxxxxxxxxxx] > > I have the following template rule > > <xsl:template name="separated-list"> > <xsl:param name="nodes"/> > <xsl:param name="separator"/> > <xsl:for-each select="$nodes"> > <xsl:value-of select="."/> > <xsl:if test="position() != last()"> > <xsl:value-of select="$separator"/> > </xsl:if> > </xsl:for-each> > </xsl:template> > > Sometimes separator is "," and other times it's a <BR> If the separator is a node-set containing a single <BR/> element, then <xsl:value-of> will output nothing (the string value of an empty element). Try using <xsl:copy-of> instead. > also, where is it documented exactly why you cannot do > > <xsl:text><BR/><xsl:text>? > The fact that the <xsl:text> element can contain only #PCDATA is documented in XSLT Appendix B. The reasons why are not documented (they never are!), but given that the purpose of xsl:text is to output text nodes, it wouldn't make very much sense to have anything else in there. Mike Kay 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
|