|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL sheet Optimisation
Hi Frederic,
> Some of my nodes have an id attribute, but can be at any depth of the tree.
> For example I have a <theme id="t1"> tag. So when I want to "reach" it from
> the root node, I have to use this XPath expression :
>
> <xsl:apply-templates select="//theme[@id='t1']" />
>
> Will the XSL processor (I use Xalan in Cocoon) process every node until it
> finds the one ? Just like the XPath expression "://*[name(.)='theme' and
> @id='t1']" ? Or is it better potimized ?
if your id attribute is a *real* id, i.e. of the type ID declared in your
DTD (e.g. <!ATTLIST theme id ID #IMPLIED>) then you can use the id function.
-> select="id('t1')"
Otherwise use keys.
<xsl:key name="mykey" match="theme" use="@id" />
and then select="key('mykey', 't1')"
Salut,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








