我正在创建一个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