xsl-list
[Top] [All Lists]

Re: Is this node, the document root... best test?

2003-10-20 13:21:24

There's no point comparing the times as they test completely different
things.

not(parent::*)

tests whether the current node has a parent element, so this is true of
the document node /, the top level element and any top level comments
and processing instructions.

". = /"

is a wildly expensive test that tests the string value of the current
node with the string value of the entire document. This could be true on
any number of nodes, depending on the document structure.
On a document with just elements and attributes and no text, it is true
on every node for example.

David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list