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]
Other format: [Raw text]

Re: Escaping newlines in an XSL file


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


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