我对这个 XSLT 脚本有疑问。我想重命名我的标签,并且我有一个包含新名称标签元素的表。我正在使用 Talend 获取每一行并将名称存储在两个变量“generic”中,其中包含新名称和另一个包含完整路径 (arbre) 的变量。
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="" indent="yes" />
<xsl:param name = "generique" />
<xsl:param name = "arbre" />
<xsl:variable name="vXpath" select= "$arbre" />
<xsl:template match= "/">
<xsl:value-of select="$vXpath"/>
<xsl:element name ="{$generique}">
<xsl:apply-templates select="child"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()" priority="0">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
该脚本无法按我的意愿工作。