xsl-list
[Top] [All Lists]

Re: Defining a key on a RTF inside a Template

2004-12-08 08:13:52
Thank you David for the most precise explanation.. I
have another related doubt..

Supposing, I want to apply key() function within the
below for-each loop, on the document constructed from
the source XML(and not the RTF)
<xsl:for-each
select="exsl:node-set($rtf)/someelement">
  <!-- using key() here to operate on the document
representing the source XML; not the RTF -->
</xsl:for-each>

Can this be done..?

I feel, this could be a requirement in applications..

Regards,
Mukul

--- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

  But please consider this.., if for instance, the
main
  XML document also contained the <projectsum>
nodes,
  then the key definition -
  <xsl:key name="countDetail" match="projectsum"
  use="@id"/>
  would include those nodes also in the scope.. So
  introducing the <temp> tag would be neccessary to
  enforce the scope to RTF..

No, XSLT indexes each document _separately_ key()
only ever returns
nodes from one document (the document which the
current node is in).
So if the current node is in a document which
resulted from calling
xx:node-set on an rtf, any use of key will only
return nodes from that
same document, there is no other scoping required
(or possible).

In this case even if other documents (such as the
main input document)
contain projectsum elements they will not be
returned by key() because
no nodes from other documents are ever returned.

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

________________________________________________________________________


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





        
                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--