XSLT 2.0 - Template Matching With Contains() -


i'm wondering if possible write template match contains() function.

i have document has multiple elements need renamed common element. of following need renamed op: op1.2, op7.3, op2.4, op5.6`, etc.

yes, can use contains() inside of predicate filter in match criteria elements.

<xsl:template match="*[contains(local-name(),'op')]>   <op>     <xsl:apply-templates select="@*|node()"/>   </op> </xsl:template> 

you use starts-with()

*[starts-with(local-name(),'op')] 

if using xslt 2.0 use matches() function, supports regex patterns more complex matching.

*[matches(local-name(),'^op')] 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -