在XSL中得到任意节点在DOM树中的深度

在XSL中得到任意节点在DOM树中的深度

孟子E章

要在XSL中得到任意节点的在XML DOM树中的深度,可以通过计算节点的祖先(ancestors)的数量得到。下面就是具体实现的例子。

TestNodeDeep.xml

TestNodeDeep.xsl

Published At
Categories with Web编程
Tagged with
comments powered by Disqus