[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] keys vs. parameters
Subject: [xsl] keys vs. parameters From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx> Date: Fri, 7 Jun 2002 13:03:23 -0500 |
Since I learned something with the last question let me try again.... Any opinions on using keys versus passing the same information down through multiple templates using parameters? In this case we have something like: <xsl:key name="inreq" match="req:request/req:params/*" use="@name"/> Which I subsequently use like: <xsl:value-of select="normalize-space(key( 'inreq', local-name() ))"/> several levels of template down. I happen to have templates that match each step of the way and I could grab the data of interest in the first template using something like: <xsl:variable name="inreq"><xsl:copy-of select="req:request/req:params/*"/></xsl:variable> This would then be passed through each template as a parameter to the next one (five templates involved in total). I'm assuming using the key is the way to go, but thought I'd check.... Assuming keys are the best, a somewhat related issue comes up when using external documents and/or extensions. From what I understand, there is no way of building a key on the external document (results from document()) or a nodeset returned from an extension? In such cases I presume I'm forced to pass the results through each template as a parameter? Eg, I'd like to be able to do something like: <xsl:key name="collection" match="java:CollectionHandler.getCollection($collection_id, $group_id )" use="local-name()"/> but Xalan chokes on this (as I assume would other processors)... ($collection_id and $group_id are global parameters to the template). Peter Hunsberger Phone: 901-495-5252 E-mail: Peter.Hunsberger@xxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Server Name, Mike Brown | Thread | Re: [xsl] keys vs. parameters, David Carlisle |
Re: [xsl] Newbie: See if a node exi, Mike Brown | Date | RE: [xsl] Newbie: See if a node exi, Americo Albuquerque |
Month |