xsl-list
[Top] [All Lists]

Re: [xsl] tokenizing comma separated string with quotes

2007-02-22 06:03:29
On 2/22/07, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

> is there a modification to the regex to not include the surrounding
 quotes?

 <xsl:variable name="regex">
     <xsl:text>\s*"(([^"]*)"|([^,]+))\s*</xsl:text>
   </xsl:variable>

then use
<xsl:value-of select="concat(regex-group(2),regex-group(3))"/>

Only one of the groups will be non-empty, but concating them together is
probably easier than testing which group you need.

Thanks David, I'll take it from that there's no straightforward
modification to the regex...

This is one of the problems that looks straightforward to start with
but is actually much more complicated.

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