xsl-list
[Top] [All Lists]

RE: [xsl] csv to xml converter bug

2007-07-10 08:17:02
I gave up dirty hacks long ago  (and as you've said yourself, 
that was a dirty hack).

I wash my hacks in Persil.

Haven't worked out the detail, but it seems to me that if you add a trailing
comma at the end of the string, you can then do

<xsl:analyze-string select="concat($in, ',')" regex='("[^"]*"|[^,]*),'>
  <xsl:matching-substring>
    <token><xsl:value-of select="regex-group(1)"/></token>
  </xsl:matching-substring>
</xsl:analyze-string> 

Doesn't strip the quotes off, but that part's easy.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
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>
--~--