我有一个存储xpath的xml文档
<Field col_header="Content ID " mapping="$contentTagRef/v41:contentId" />
<Field col_header="Channel (Mandatory)" mapping="v43:channelId" />
<Field col_header="HID (Mandatory)" mapping="v43:eventId" />
<Field col_header="TX Date (Mandatory)" mapping="$eventTimeStamp" />
<Field col_header="TX Date (Mandatory)" mapping="$eventTimeStamp" />
我有一个xsl,我需要在匹配的项目上迭代这些字段并检索值。
<!-- Reading the other document as -->
<xsl:param name="mappingsFile" select="document('SVT_input_Mappings.xml')" />
<xsl:template match="v43:event">
<xsl:param name="contentTagRef"></xsl:param>
<xsl:param name="materialTagRef"></xsl:param>
<xsl:param name="eventTimeStamp"></xsl:param>
<xsl:variable name="root">
<xsl:value-of select="."></xsl:value-of>
</xsl:variable>
<xsl:for-each select="$mappingsFile//Field">
<xsl:variable name="mapping">
<xsl:value-of select="@mapping"></xsl:value-of>
</xsl:variable>
-- How to evaluate the mapping ?? -----
</xsl:for-each>
我得到的输出
$contentTagRef/v41:contentId
相反,我期待
Content1-xx-454