我正在創建一個XSLT,並且我想選擇一個特定的節點,只要其中一個子元素的值在一個範圍之間。範圍將使用xsl文件中的參數指定。限制按範圍在XSLT輸出
的XML文件就像
<root>
<org>
<name>foo</name>
<chief>100</chief>
</org>
<org parent="foo">
<name>foo2</name>
<chief>106</chief>
</org>
</root>
的XSLT到目前爲止
<xsl:param name="fromRange">99</xsl:param>
<xsl:param name="toRange">105</xsl:param>
<xsl:template match="/">
<xsl:element name="orgo">
<xsl:apply-templates select="//org[not(@parent)]"/>
</xsl:element>
</xsl:template>
我想從正在處理其<首席限制的組織節點>節點的值不在範圍內
我也想要限制,該節點不應該有一個父屬性以及範圍 – charudatta 2010-10-03 21:16:47
好問題再次(+1)。看到我的答案有兩個完整的解決方案:XSLT 1.0和XSLT 2.0 :) – 2010-10-03 23:51:02