[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Keying over added attributes in temporary tree

Subject: Re: Keying over added attributes in temporary tree
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 27 Jan 2006 15:38:15 GMT
attributes for a tree
  I would assume that the keys are created before starting the "/" template.
  The xsl:key element is not allowed in a template, so that can't force
  the re-indexing for the key.

The specification doesn't say when they are created, but in practice for
performance reasons most systems only create them when (if) they are
referenced by key(). keys (separately) index all trees, there is no way
to specify an key only applies to one tree. So if you use xsl:key when
the current node is in a temporary tree (or if you supply a node in a
temporary tree as third argument) then that tree will be indexed using
the specified key.

  1) Is the xsl:variable "objects-with-new" considered a "temporary
     tree"?
The value of that variable is a (document node of a) temorary tree, yes.

2) Is it possible to access the "object" elements in $objects-with-new
via a key, where the @use is an attribute that was added after parsing
the input document?

Yes

key('objects-by-new','a') if the current node is a descendant of
$objects-with-new or
key('objects-by-new','a',$objects-with-new) otherwise.

so for example

     20   <xsl:copy-of select="$objects-with-new//object[@new=2]"/>


could be

     20   <xsl:copy-of select="$objects-with-new/key('objects-by-new','2') "/>

or

     20   <xsl:copy-of select="key('objects-by-new','2',$objects-with-new) "/>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.