XSLT语法在XML中复制和替换元素值时出错

时间:2016-01-07 20:15:52

标签: xml xslt xpath

我正在尝试创建一个XSLT来复制和替换XML文档中的一些元素。我想出了这个但是不断收到“XPath表达式中的语法错误”错误。我正在使用的工具是WMHelp XMLPad,它没有给我任何关于语法错误的详细信息。请帮忙。感谢。

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:fn="http://www.w3.org/2005/xpath-functions" 
xmlns:tx="http://ACORD.org/Standards/Life/2" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
  <xsl:output encoding="UTF-8" indent="yes" method="xml" version="1.0" omit-xml-declaration="yes"/>
  <xsl:variable name="currenYearContrAmt" select="'20.00'"/>
  <xsl:variable name="contrFAId" select="'FINANCIAL_ACTIVITY_ACH_1_1'" />

  <xsl:template match="@* | node()">
     <xsl:copy>
        <xsl:apply-templates select="@* | node()"/>
     </xsl:copy>
  </xsl:template>
  <xsl:template  
match="//tx:FinancialActivity[@id=$contrFAId]/tx:OLifEExtension/tx:CurrentYearContributionAmt/text()">
    <xsl:value-of select="$currenYearContrAmt"/>
 </xsl:template>
</xsl:stylesheet>

0 个答案:

没有答案