xsl-list
[Top] [All Lists]

RE: Defining a key on a RTF inside a Template

2004-12-08 01:52:23
Just define the key globally, at the top level. When you use the key()
function, it searches for nodes matching the key within the current document
- if the current document is the RTF, then it will search within the RTF.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Ranjan K. Baisak [mailto:ranjanbaisak(_at_)yahoo(_dot_)com] 
Sent: 08 December 2004 08:08
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Defining a key on a RTF inside a Template 

I am creating  a key inside a template with RTF as
below:
<xsl:variable name="projectSum">
      <xsl:for-each select="//project">
              <xsl:variable name="projectname" select="./@name"/>
              <xsl:variable name="projectid" select="@id"/>
              <xsl:variable name="projectref"
select="projectelement/@ref"/>
              <xsl:copy>
                      <xsl:copy-of select="./@name"/>
                      <xsl:copy-of select="./@id"/>
                      <projectsum>
                              <xsl:copy-of
select="count(key('ProjectPartNumber',$projectref))"/>
                      </projectsum>
              </xsl:copy>
      </xsl:for-each>
</xsl:variable>

<xsl:key name="countDetail"
match="exslt:node-set($projectSum)/projectsum"
use="./@id"/>

In XALAN it throws error with message "Incorrect place
of defining Key".
I am not sure whether it is possible to create a key
with RTF within a template?
If not possible, is there any otherway to achive the
same functionality?

regards,
Ranjan



              
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>