[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to call extension function from xpath multiple

Subject: RE: How to call extension function from xpath multiple times?
From: "Manpreet Singh" <singhm@xxxxxxxxxxx>
Date: Wed, 5 Jan 2005 12:10:05 +0530
xpath contains regex
Hi,

> You are generating a regular expression that will contain "\\w". This will
> match a string containing a "\" followed by a "w". But you are using it to
> match element names, which never contain a "\".

Well, actually I checked it by running the same java function through xsl.
Using 4 "\" i
get the regex \w or \w* as the case may be.

The Processor i am using is Xalan 2.4.1

Regards
Manpreet Singh


-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: Tuesday, January 04, 2005 6:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  How to call extension function from xpath multiple
times?


> 		pattern = pattern.replaceAll("_asterix_", "\\\\w*");
> 		pattern = pattern.replaceAll("_qstnmark_", "\\\\w");
>
> 		return java.util.regex.Pattern.matches(pattern,
> elemName);

You are generating a regular expression that will contain "\\w". This will
match a string containing a "\" followed by a "w". But you are using it to
match element names, which never contain a "\".

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.