This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: quick table layout problem
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 7 Jan 2002 16:25:40 -0000
- Subject: RE: [xsl] quick table layout problem
- Reply-to: xsl-list at lists dot mulberrytech dot com
> Take the following: (this is a simplification of the XML file I posted
> earlier)
>
> <a>
> <b>
> <b>
> <b>
> <c>
> <d>
> <d>
> <e>
> </c>
> <f>
> <g>
> <g>
> <e>
> </f>
> </b>
> </a>
>
> What xpath expression will match the first <e>, without using //
/a/b/c/d/e
>
> As a point of interest, what kind of performance hit does
> using // give? Is it bad practice to use // ?
If you know a more precise path, it's usually a good idea to specify it,
because the processor can then avoid searching parts of the tree that aren't
relevant.
The performance hit depends on the size of the document and on the XSLT
processor you are using. With Saxon it can sometimes be a GOOD thing to use
//e, because Saxon will then build an index of all <e> elements in the
document. The only way to get definitive answers on performance questions
like this is to make your own measurements. You can get simple measurements
from Saxon, for example, by using the -t option.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list