Re: [xsl] Selecting other than certain children

Subject: Re: [xsl] Selecting other than certain children
From: Joerg Pietschmann <j3322ptm@xxxxxxxx>
Date: Thu, 2 Jan 2003 14:02:57 +0100
On Thursday 02 January 2003 07:17, Conal Tuohy wrote:
> I don't really know if "not(self::c)" is more efficient than "name()!='c'"
> but I prefer it for some reason, maybe because there's no function call?
I don't think there is a performance difference for most XSLT processors.

However, using self:: is mnore robust when it comes to elements in a
namespace. If you write
 name()='foo:bar'
only elements with the literal name foo:bar fulfill this condition but not
baz:bar, even if the baz prefix is bound to the same namespace.
Like in
 <sample xmlns:foo="uri:sample:stuff" xmlns:baz="uri:sample:stuff">
   <foo:bar/>
   <baz:bar/>
 </sample>
the inner elements have different a name(), but they are both matched
by self::foo:bar

J.Pietschmann

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


Current Thread