0
我尝试了不同的方法,但无法找出错误。我必须做2次检查以设置属性的值。下面的示例是它的简单版本。开始于在办理登机手续时不工作Xsl
输入XML
`
<Detail Type="3242432" LastDate="2016-04-22T11:02:43+01:00"
NodName="10001"
UpdateValueReason="Apple: 123 56"
Date="2016-04-22T11:02:43+01:00">
<Sub EventID="2">
</Detail>
`
XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/Detail/Sub">
<Status>
<xsl:attribute name="StatusType">
<xsl:choose>
<xsl:when test="../starts-with(@UpdateValueReason, 'Apple') and @EventID='2'">
<xsl:value-of select="'23'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'1234'" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</Status>
</xsl:template>
</xsl:stylesheet>
我在这里检查,如果一个属性与某些字符集的我开始我冲压另一个属性,但它抛出错误
错误的炉灶
错误运行时:
错误:说明:NodeTest这里的预期。
../-->starts-with < - (@ UpdateValueReason, '苹果'),并@事件ID = '2'
您应该编辑您的问题说的是什么错误,因为经常错误信息给有用的信息。谢谢。 –