【发布时间】:2012-04-30 02:56:21
【问题描述】:
我有以下代码。
<xsl:template match="Rel/SPFMarkupFile">
<xsl:for-each select="./SPFReportItem">
<tr>
<td>X</td>
<td><xsl:value-of select='../../../SPFReportItem/ReportAttribute[@AttrName="Name"]/@AttrValue' /></td>
<td colspan="4" indent="yes">
<xsl:value-of select='ReportAttribute[@AttrName="SPFMarkupText"]/@AttrValue' />
</td>
<td><xsl:value-of select='ReportAttribute[@AttrName="CreationUser"]/@AttrValue' /></td>
<td colspan="2">N/A</td>
<td><xsl:value-of select='ReportAttribute[@AttrName="SPFMarkupType"]/@AttrValue' /></td>
</tr>
</xsl:for-each>
对于<xsl:value-of select='ReportAttribute[@AttrName="SPFMarkupText"]/@AttrValue' />
例如值可以是 test123~test2~test4~test1 分隔符是~
我想拆分该值并将其放入不同的行中。所以我希望它像
test123
测试2
测试4
测试1
对于其他列,它将是相同的值。
我怎样才能做到这一点?
【问题讨论】:
-
您使用的是 XSLT1.0 还是 XSLT2.0?在 XSLT2.0 中,有一个 'tokenize' 函数可以让这更容易。
标签: xslt