我有下面的XMLXSLT转换,字符串连接
<R N="14" MIME="application/pdf">
<RK>7</RK>
<MT N="Abstract"
V="Lorem Ipsum is simply dummy text of the printing " />
<MT N="Abstract1"
V="and typesetting industry. Lorem Ipsum has been the industry's standard "/>
<MT N="Author" V="Bernard Shaw;" />
<MT N="Author1" V="Mark Twain" />
<MT N="Abstract2"
V="dummy text ever since the 1500s, when an unknown printer took a galley"/>
<LANG>en</LANG>
</R>
当使用XSLT转换,我需要连接的摘要和作者字段,并显示它像
Abstract: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley
Author: Bernard Shaw;Mark Twain
摘要, Abstract1,Abstract2可能以任何顺序出现在xml中。
我想使用类似以下,但卡在条件&串联串的时候摘要,Abstract1不会以相同的顺序
<xsl:template match="MT">
<xsl:if test="(some generic condition to display Title)">
<br/>
<span class="f">
<xsl:value-of select="@N"/>
</span>
</xsl:if>
<xsl:value-of select="@V"/>
</xsl:template>
得到任何帮助出现。
如果您可以给出示例输出(您看到的以及您想看到的内容),这会很有帮助。 – kojiro 2011-03-02 14:33:57
好问题,+1。看到我的答案是一个完整的,简短的,简单的解决方案,它被重构为最通用的。 :) – 2011-03-02 14:49:06
检查我的答案只是改变规则匹配'MT'元素的分组方法。 – 2011-03-02 15:39:28