XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
David CorleySubject: Can someone tell me if this is a disallowed regex construct?
Author: David Corley
Date: 22 Nov 2006 05:37 PM
Originally Posted: 22 Nov 2006 05:32 PM
I'm using oXygen 8.0 with Saxon 8.8b with the following line:
<xsl:analyze-string select="current-grouping-key()" regex="(?=[^\\]+$).+$" flags="i">

But saxon is throwing an error to oxygen saying:
"F Error in regular expression: net.sf.saxon.trans.DynamicError: Error at character 1 in regular expression "(?=[^\\]+$).+$": expected ())"

I'm assuming it's because my regex is using a disallowed construct, but can someone tell me what I'm doing wrong, so I can try and work around it?

Thanks in advance ;-D

Dave

PS. I should add that what I'm trying to do is take a string of the form

"xxxxx\nnnnnnnn\mmmmmmm\vvvvv.java"
and extract
"vvvvv"
from it
If you can offer a working regex solution that is xpath 2.0 compliant I would be extremely grateful, but an answer to the main question above is more important.

Postnext
(Deleted User) Subject: Can someone tell me if this is a disallowed regex construct?
Author: (Deleted User)
Date: 23 Nov 2006 07:29 AM
Hi Dave,
this is the forum for the users of Stylus Studio; you should turn your question to either oXygen or Saxon vendors.

Alberto

Postnext
David CorleySubject: Can someone tell me if this is a disallowed regex construct?
Author: David Corley
Date: 23 Nov 2006 07:37 AM
Hey Alberto,
I appreciate that fact, but because the question I was asking was regarding XSLT + Regex specifically (The problem has nothing to do with Oxygen, and I'm nearly certain it's not Saxon's fault either), I was hoping someone here might be able to help.
Sorry if I'm intruding.

Posttop
James DurningSubject: Can someone tell me if this is a disallowed regex construct?
Author: James Durning
Date: 23 Nov 2006 04:29 PM
Originally Posted: 23 Nov 2006 04:23 PM
http://www.w3.org/TR/xpath-functions/#regex-syntax

The ? is a reluctant qualifier, and you are qualifying nothing with it.

If you know your string matches, you could use tokenize instead. eg something like:
<xsl:value-of select="substring-before((tokenize(current-grouping-key(),'\'))[last()], '.'"/>

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.