[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] unparsed-text and normalize-space when parsing CSV fil
Hi, I ran into a strange issue where I was running transforms on a Windows platform, but under Cygwin. I was trying to parse a csv file. 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> and then parse the file like this: <xsl:variable name="lines" select="tokenize($csv, $nl)" as="xs:string+" /> but it turns out that this does not really solve the issue of mixed-source line endings since one or the other could have been edited on a different file system. So I think this is a common issue of parsing these kinds of files. I was able to rely on normalize-space() to remove an extra CR, but that function could make unwanted changes to other content. Anyone recommend a safe way for this? Thank you, Hank -- Hank Ratzesberger XMLWerks.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|