xsl-list
[Top] [All Lists]

RE: How to call extension function from xpath multiple times?

2005-01-04 23:40:05
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(_at_)saxonica(_dot_)com]
Sent: Tuesday, January 04, 2005 6:14 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] 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/


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


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