This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Escaping newlines in an XSL file
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 4 Jun 2002 13:12:38 -0600 (MDT)
- Subject: Re: [xsl] Escaping newlines in an XSL file
- Reply-to: xsl-list at lists dot mulberrytech dot com
ROBERTS Jeff wrote:
> > My problem is that if I break up the second line in the above code so that
> > there is one element per line (for readability)
> >
> > e.g.
> >
> > <xsl:value-of select="child::ELEMENT_1"/>,
> > <xsl:value-of select="child::ELEMENT_2"/>,
> > ...
> > <xsl:value-of select="child::ELEMENT_n"/>
> >
> > Then XSL will output the newlines found after each comma to the resulting
> > file.
> >
> > Does anyone know a way I can break up the line above without having XSL
> > treat the New Lines as significant ?
You can do it this way:
<xsl:value-of select="ELEMENT_1"/><xsl:text>,</xsl:text>
or use the Tennison method, where xsl:text is essentially a no-op:
<xsl:value-of select="ELEMENT_1"/>,<xsl:text/>
Note you don't need to specify the child:: axis, as that is the default.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list