Re: [xsl] Strip CRLF/newline only

Subject: Re: [xsl] Strip CRLF/newline only
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 24 Oct 2001 14:06:22 -0600 (MDT)
Hunsberger, Peter wrote:
>         <person>
>             <name>
>                 <last/>, <first/>
>             </name>
>             <dateofbirth/>
>             <address>
>                 <addr1/>, <city/>, <state/>
>             </address>
>         </person>
> 
> In the text nodes there are significant spaces (the ones following the
> commas) that I want to preserve.  I don't want the extension to see the
> newline/CRLF's.  I assume this is a filter, but what's it look like?

The spaces following the commas will be preserved in the text nodes by
default. You don't need to do anything special. For example, between the
'addr1' and 'city' element nodes there is a text node containing ', '.

Just prior to the 'addr1' element node there is a text node containing a
linefeed followed by a number of spaces. This one, since it is only 
whitespace, can be affected by xsl:strip-space or xsl:preserve-space, but 
by default, if it's in a source document, it won't be stripped either.

I suspect that if you are having difficulty with the spaces after the 
commas, there must be something else going on that you didn't mention.
What are you trying to do, and where & how are you obtaining unexpected 
results?

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread