Regular Expressions in match attribute

Joined
Jun 20, 2010
Messages
1
Reaction score
0
Hello.

I just want to know if it's possible to use regular expressions in the match attribute of the template element.
For example , suppose i have the follow xml document:
<greeting>
<aaa>Hello</aaa>
<bbb>Good</bbb>
<ccc>Excellent</ccc>
<dddline>Line</dddline>
</greeting>

Now the xslt to transform the above document:
<xsl:stylesheet>

<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="matches(node-name(*),'line')">
<xsl:value-of select="."/>
</xsl:template>
</xsl:styleshhet>

When i try to use the syntax (matches(node-name(*),'line$')) in the match attribute of the template element , it retrieves a error message.Can i use regular expressions in the match attribute ?

Thanks very much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top