0
我現在有這樣一個XML文檔:過濾的xsl:value-of的有關屬性
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="./transform.xsl"?>
<Documentation><Tables>
<TABLE TABLE_NAME="FirstTable">
<COLUMN COLUMN_NAME="FirstColumn" ORDINAL_POSITION="1" IS_NULLABLE="NO" DATA_TYPE="int" />
<COLUMN COLUMN_NAME="SecondColumn" ORDINAL_POSITION="2" IS_NULLABLE="NO" DATA_TYPE="int" />
</TABLE>
...
</Tables><Comments>
<COMMENT ForTable="FirstTable" ForColumn="FirstColumn">Description of FirstColumn</COMMENT>
</Comments></Documentation>
我的問題是,如何遍歷表和列時,我會得到評論的價值?我有:
<xsl:for-each select="//TABLE">
...
<xsl:for-each select="COLUMN">
...
<xsl:value-of select="//COMMENT[@ForTable = @TABLE_NAME and @[email protected]_NAME]" />
但這不起作用。有什麼建議?
謝謝,我結束了使用的解決方案,而變量: 的 –
Todd
2009-12-16 22:53:43
請注意,這可能效率較低,但對於小型輸入文檔而言,它是學術性的。 – Tomalak 2009-12-17 00:06:21