On 17/03/12 16:03, Dimitre Novatchev wrote:
It seems to me that in this subexpression:
| - | . | [0-9]
The dot needs to be escaped. Dot is a special character and in its
unescaped form means "accept any character at the current position".
On the other side:
\.
means literally the dot character.
Cheers,
Dimitre
Good catch Dimitre. Thanks.
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,")*")'/>
<xsl:template match="*[@select]">
<xsl:variable name='this' select="."/>
<xsl:if test="contains(@select,'$')"><!-- concat('(',$Name.re,')') -->
<xsl:analyze-string
select="@select"
regex="{$Name.re}"
flags="x">
<xsl:matching-substring>
<xsl:message>
"<xsl:value-of select="name($this)"/>"<xsl:text> </xsl:text>
[<xsl:value-of select="regex-group(0)"/>]
<xsl:text>
</xsl:text>
</xsl:message>
</xsl:matching-substring>
<xsl:non-matching-substring>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:if>
<xsl:apply-templates select="*"/>
</xsl:template>
The regex-group(0) isn't reporting the variable name?
Surrounding with () hasn't helped, to use -group(1) either.
regards
--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk
--~------------------------------------------------------------------
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>
--~--