xsl-list
[Top] [All Lists]

Re: [xsl] lookaheads in XSLT2 regexes

2010-03-01 05:00:23
On Fri, Feb 26, 2010 at 18:21, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
If you're completely stuck, there's an undocumented, largely untested, and
completely non-conformant option in Saxon - if the flags attribute starts
with "!", you can use full Java regular expression syntax in the regex
attribute. This may not work perfectly, for example it may disrupt the
counting of captured groups in regex-group().

This sounds like just what I want.  It isn't for a production system,
and one step in a pipeline of transformations for a one-off
conversion.  However I have a problem:  When I put ! into the flags
attribute of analyze-string I get the following error:

 FORX0001: Invalid character '!' in regular expression flags

from:

 <xsl:analyze-string select="$str" regex="{$abbr[1]}" flags="!">

This is with: Saxon-HE 9.2.0.6J and Java(TM) SE Runtime Environment
(build 1.6.0_14-b08)

Any suggestions what I'm doing wrong.  (I didn't even notice the
@flags attribute before, so at least have learned something new
today.)

Many thanks,

-James

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