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
Post a Comment