|
Subject: [xsl] Could not use matches in Regular Expression (XSLT 2.0) From: Jack Bush <netbeansfan@xxxxxxxxxxxx> Date: Sat, 1 May 2010 06:56:05 -0700 (PDT) |
Hi Forum members,
I
am new to XSLT 2.0 and would like to do the following
basic numeric string pattern
matching using regular expression:
<xsl:template
match="ns:p[ns:strong='Telephones:']">
<xsl:choose>
< -- If global
parameter $TELEPHONE_AREA_CODE equals to FAIRYLAND -->
<xsl:when
test="$TELEPHONE_AREA_CODE = ''FAIRYLAND">
<xsl:for-each select="ns:a">
<-- Only accept the phone number that starts with 4 follow by six digits....
--->
<xsl:if test="matches(.,4[0-9][0-9][0-9]0-9][0-9][0-9])">
<phone_number><xsl:value-of select='.'/></phone_number>
</xsl:if>
</xsl:for-each>/>
......
However, it is picking up phone numbers starting
with 1 instead. Also tried the starts-with() with the same outcomes.
I am
using JDK1.6.19, Netbeans 6.7, JDOM 1.1, Saxon 9.1 on Windows XP.
Your
assistance would be much appreciated.
Thanks in advance,
Jack
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] XSL-List Guidelines, Mulberry Technologie | Thread | RE: [xsl] Could not use matches in , Michael Kay |
| [xsl] XSL-List Guidelines, Mulberry Technologie | Date | RE: [xsl] Could not use matches in , Michael Kay |
| Month |