xsl-list
[Top] [All Lists]

Re: Arrays

2005-01-20 07:03:53


        <xsl:analyze-string select="$in" regex="\n">

beware on non-unix systems the end of line might be (will be) something
other than \n. On windows this would produce a spare \r at the end of
each line and an extra cell element containing that character in the
output, on a mac the whole thing would come out as one line.

I made a suggestion to the official comments list that unparsed-text()
ought to normalize line endings in the same way as an XML parser. this
was turned down, but they did add a new example highlighting the
problem. (\r|\n)+ (any non-empty sequence of #10 or #13) will do here,
although you have to work a bit harder if you want to pick up possibly
empty lines, ie detect two \n as an empty line (two unix style ends of
line) but \r\n as a single  windows-style end of line

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>