XML:
<?xml version="1.0" encoding="utf-8"?>
<NewDataSet>
<inc_incident>
<inc_traumatriagecriteria>
<TTC_ID>1 </TTC_ID>
<TraumaTriageCriteria>(M)echanism: Ejection</TraumaTriageCriteria>
</inc_traumatriagecriteria>
<inc_traumatriagecriteria>
<TTC_ID>2 </TTC_ID>
<TraumaTriageCriteria>(M)echanism: Fatality</TraumaTriageCriteria>
</inc_traumatriagecriteria>
<inc_traumatriagecriteria>
<TTC_ID>3 </TTC_ID>
<TraumaTriageCriteria>(P)hysiologic: GCS</TraumaTriageCriteria>
</inc_traumatriagecriteria>
<inc_traumatriagecriteria>
<TTC_ID>4 </TTC_ID>
<TraumaTriageCriteria>(A)natomic: Crushed</TraumaTriageCriteria>
</inc_traumatriagecriteria>
</inc_incident>
</NewDataSet>
XSL:
<fo:table-body>
<xsl:for-each select="inc_traumatriagecriteria">
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:if test="contains(TraumaTriageCriteria, '(M)')">
<xsl:value-of select="text()"> </xsl:value-of>
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:block>
<xsl:if test="contains(TraumaTriageCriteria, '(A)')">
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:block>
<xsl:if test="contains(TraumaTriageCriteria, '(P)')">
</xsl:if>
</fo:block>
</fo:table-cell>
使用 xsl:if test="contains(TraumaTriageCriteria, '(A)')" 我得到这样的结果:
| 语言 | 人工智能 | 电脑 | ==================================================== ============== |(M)机构:弹射 | | | -------------------------------------------------- ---------------- |(M)机制:致死性 | | | -------------------------------------------------- --------------- | |(A)解剖学:压碎 |(P)生理学:GCS | -------------------------------------------------- -----------------
但希望我的桌子看起来像这样:
| 语言 | 人工智能 | 电脑 | ================================================= |(M)机制:弹射|(A)解剖学:压碎|(P)生理学:GCS| -------------------------------------------------
有什么建议吗?