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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Jack TanSubject: Java exception when apply regular expression
Author: Jack Tan
Date: 28 Feb 2007 07:36 PM
I tested a small XQUERY program in the Stylus Studio 2006 Enterprise, build 653g.
In the scenarion using internal XQUERY processor all went smoothly. When switched to Saxon 8.7.1 it reports error:

error 719, FORX0002: Errot at character 1 in regular expressio "\x11|\\n" invalid escape sequence.

the offended line is:

...
fn:replace($var/name,"\x22|\\n"," ")
...

I simply want to replace "" and new lines in a string.

Why Saxon differs from the internal processor? What is wrong?

any pointers to relevant documentation suummarizing a correct course of action?

Thx

Jack

Postnext
(Deleted User) Subject: Java exception when apply regular expression
Author: (Deleted User)
Date: 05 Mar 2007 11:42 AM
Originally Posted: 05 Mar 2007 11:43 AM
Hi Jack,
the correct regex would be """|\n"

Hope this helps,
Alberto

Postnext
Jack TanSubject: Java exception when apply regular expression
Author: Jack Tan
Date: 05 Mar 2007 02:41 PM
Thx,

Where can I find a document describing a difference between internal processor and Saxon? and when/why one should be used ?

Jack

Postnext
(Deleted User) Subject: Re: Java exception when apply regular expression
Author: (Deleted User)
Date: 06 Mar 2007 03:07 AM
Hi Jack,
the syntax of the regular expressions used in XQuery and XSLT is
described in the specs
(http://www.w3.org/TR/xpath-functions/#regex-syntax) that in turn is
based on the syntax described by the XMLSchema specs
(http://www.w3.org/TR/xmlschema-2/#regexs). There it's explained that
the only characters that need to be escaped are new lines, tab, and
the special characters \|.-^?*+{}()[].
This means that the regex you are specifying is: "|\n
As you need to insert this string inside an XQuery string literal,
you can choose to wrap it inside single quotes ('"|\n') or double
quotes, escaping the quote by duplicating it ("""|\n").
This is the official regex syntax, that both processor supports; the
internal processor also allows the usage of the syntax \xAA to
represent characters, but that is an implementation-specific extension.

Hope this helps,
Alberto

Posttop
Jack TanSubject: Re: Java exception when apply regular expression
Author: Jack Tan
Date: 07 Mar 2007 01:37 PM
Alberto,

It seems that the safest way in defining scenario is to avoid the default internal processor ;-)

Thanks for help,

Jack

   
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.