我有一種情況需要顯示 xml 結果(布林值、日期、i
我希望將結果顯示在表格中,如果不完全重建整個程序,我無法找到解決此問題的好方法。
這是我如何處理布爾資料型別的示例。每個資料型別都是根據下面的示例構建的。
這是應用所有模板(布林值等)的代碼。我想弄清楚是否可以為apply-templates select=".".
uj5u.com熱心網友回復:
重要的是不要錯過層次結構中的任何級別fo:table/fo:table-body/fo:table-row/fo:table-cell。
如果我正確理解您的代碼,您需要類似以下內容:
<fo:table>
<fo:table-column column-width="{$adjustedWidth}in" />
<fo:table-column column-width="{$adjustedWidth}in" />
<fo:table-body>
<xsl:for-each select="bml:Parameter[not(bml:ID='EndConditionMatrix' or
bml:ID='PVATable' or
bml:ParameterSubType='NoReport')]">
<xsl:sort select="bml:SortOrder" data-type="number"/>
<xsl:apply-templates select="." />
</xsl:for-each>
</fo:table-body>
</fo:table>
和:
<xsl:template match="bml:DataType='boolean']">
<fo:table-row>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="paramCaption">
<xsl:value-of select="$caption" />
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block xsl:use-attribute-sets="paramValue">
<xsl:choose>
<xsl:when test="bml:Value/bml:ValueString='0'">No</xsl:when>
<xsl:otherwise>Yes</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
這并不能說明你的start-indent,但它應該能讓你朝著你想要的方向前進。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/471901.html
下一篇:XSLT從另一個節點選擇屬性
