Subject: Re: [xsl] xslt 2.0 regex From: davep <davep@xxxxxxxxxxxxx> Date: Sat, 17 Mar 2012 16:43:09 +0000 |
On Sat, March 17, 2012 4:14 pm, davep wrote: ...It's still not working
<xsl:variable name="NameStartChar.re" as="xs:string"> $[A-Z]|_|[a-z] | [À-Ö] | [Ø-ö] | [ø-˿] | [Ͱ-ͽ] | [Ϳ-῿] | [‌-‍] | [⁰-↏] | [Ⰰ-⿯] | [、-퟿] | [豈-﷏] | [ﷰ-�] | [𐀀-] </xsl:variable>
<xsl:variable name="NameChar.re" as="xs:string" select="concat($NameStartChar.re,' | - | \. | [0-9] |· | [̀-ͯ] | [‿-⁀]')"/>
<xsl:variable name='Name.re' select='concat($NameStartChar.re, "(", $NameChar.re,")*")'/>
Why not use '\i' and '\c' from http://www.w3.org/TR/xmlschema-2/#charcter-classes?
\i includes : which is wrong? \c looks good though! Ah no. Again it's NameChar from http://www.w3.org/TR/2000/WD-xml-2e-20000814#NT-NameChar which is more than allowed for xsl:variable @name?
Otherwise, you may want '(' and ')' around $NameStartChar.re in $Name.re, otherwise (to mix variable expansions) it looks like '...|[‿-⁀]($NameChar.re)*" and you'll only match multi-character names when they begin with a character in the range [‿-⁀].
As I read it (or more accurately fail to read it correctly) It's NameChar less : followed by (Name less :)+
Simpler version [A-Za-z0-9]+ and the i18N additions, but I can't get the simpler one working.
Produces "xsl:variable" [f] "xsl:variable" [r] "xsl:variable" [e] "xsl:variable" [d]
Regards,
Tony Graham tgraham@xxxxxxxxxx Consultant http://www.mentea.net Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XML, XSL-FO and XSLT consulting, training and programming
-- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xslt 2.0 regex, Tony Graham | Thread | Re: [xsl] xslt 2.0 regex, Tony Graham |
Re: [xsl] xslt 2.0 regex, Tony Graham | Date | Re: [xsl] xslt 2.0 regex, Tony Graham |
Month |