This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: stripping leading and trailing newlines from xml
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 8 Aug 2002 14:31:46 -0600 (MDT)
- Subject: Re: [xsl] stripping leading and trailing newlines from xml
- Reply-to: xsl-list at lists dot mulberrytech dot com
Aparna Konduri wrote:
> Is there a way to just strip leading and trailing newlines from
> xml using xsl or javascript?
XSLT has somewhat unintuitive rules for how it handles whitespace
and newlines. You did not provide an example of what you want to
accomplish, so I guess you meant extraneous whitespace.
An identity transform as discussed in the XSLT spec under "Copying"
(xsl:copy), with the addition of
<xsl:strip-space elements="*"/>
<xsl:output method="xml" indent="no"/>
is probably what you want.
- 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