XSLT 2.0 - Template Matching With Contains()
问题 I'm wondering if it is possible to write a template match with the contains() function. I have a document that has multiple elements that need to be renamed to a common element. All of the following need to be renamed to just OP: OP1.2, OP7.3, OP2.4, OP5.6`, etc. 回答1: Yes, you can use contains() inside of a predicate filter in the match criteria for elements. <xsl:template match="*[contains(local-name(),'OP')]> <OP> <xsl:apply-templates select="@*|node()"/> </OP> </xsl:template> You could