Re: [xsl] Defining a key on a RTF inside a Template

Subject: Re: [xsl] Defining a key on a RTF inside a Template
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Wed, 8 Dec 2004 07:13:52 -0800 (PST)
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@xxxxxxxxx> 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
>
________________________________________________________________________
> 
> 



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

Current Thread