xsl-list
[Top] [All Lists]

Re: [xsl] unparsed-text and normalize-space when parsing CSV files

2014-12-05 18:22:18
Thanks Ken.  Lots of clues.  And that makes complete sense for the
parser to normalize line endings (did not know that). --Hank

On Fri, Dec 5, 2014 at 1:25 PM, G. Ken Holman 
g(_dot_)ken(_dot_)holman(_at_)gmail(_dot_)com
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
At 2014-12-05 19:36 +0000, Hank Ratzesberger xml(_at_)xmlwerks(_dot_)com 
wrote:

I was trying to parse a csv file.


Perhaps you can get some clues from:

  http://www.CraneSoftwrights.com/resources/#csv

That runs either as a standalone stylesheet for command-line use or as an
imported stylesheet to be called.

The problem was that I was defining a variable for the newline, which
I expected would match the native system:

<xsl:variable name="nl">
    <xsl:text>
</xsl:text>
</xsl:variable>


That won't match the native system because the end-of-line sequence of the
stylesheet is translated into &#xa; on the way into the parsed XDM tree and
so only &#xa; will be put out when done.

I hope this helps.

. . . . . . Ken


--
Check our site for free XML, XSLT, XSL-FO and UBL developer resources |
Free 5-hour lecture:  http://www.CraneSoftwrights.com/links/video.htm |
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/ |
G. Ken Holman                    
mailto:gkholman(_at_)CraneSoftwrights(_dot_)com |
Google+ profile:       http://plus.google.com/+GKenHolman-Crane/about |
Legal business disclaimers:     http://www.CraneSoftwrights.com/legal |


---
This email is free from viruses and malware because avast! Antivirus
protection is active.
http://www.avast.com





-- 
Hank Ratzesberger
XMLWerks.com
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

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