Subject: Re: [xsl] Find elements where any attribute contains alpha-numerical chars of an input string From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 02 Nov 2012 21:56:25 -0400 |
On Fri, Nov 02, 2012 at 11:54:22PM +0100, Philipp Kursawe scripsit: > I have this rather complex xpath: > > //element[@*[contains(translate(., translate(., > 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ''), > ''), translate('string', translate('string', > 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ''), > ''))]] > > where "string" would be an input string with non-alpha chars and > spaces and mixed letter cases. > I would like to select any element whose attributes contain parts of > the input string, stripped by non-alpha chars and whitespace. > > Problem is, the xpath does not work for mixed char input strings.
Wouldn't
//element[matches(@*,replace($string,'[\p{L}\p{Nd}]',''),'i')]
work?
-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Find elements where any a, Graydon | Thread | [xsl] Text value templates in XSLT , Imsieke, Gerrit, le- |
Re: [xsl] Find elements where any a, Graydon | Date | [xsl] Text value templates in XSLT , Imsieke, Gerrit, le- |
Month |