<xsl:choose>
<xsl:when test="block4[messageType = '103']">
<xsl:value-of select="block4/tag[name = '32A']/value"/>,<xsl:text/>
</xsl:when>
<xsl:when test="block4[messageType = '102']">
<xsl:value-of select="block4/tag[name = '32B']/value"/>,<xsl:text/>
</xsl:when>
</xsl:choose>
xml看起来像
<block2>
<tag>
<name>32A</name>
<value>051028EUR6104,42</value>
</tag>
</block2>
对我来说,价值正在上升,但在价值方面,我需要达到前六个字符
使输出看起来像 051028
答案 0 :(得分:1)
<xsl:value-of select="substring(block4/tag[name = '32A']/value, 1, 6)" />