This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: quick table layout problem


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]