xsl-list
[Top] [All Lists]

RE: match nodes based on given path

2003-04-11 05:12:50

how about generating multiple templates for the different locators,
somthing like

of course!

sometimes things are so obvious (after... uh... I know the answer :)

If I am generating the stylesheet the solution wont involve keys or a nodeset, 
just a set of templates generated from the given node-set:

<xsl:template match="/root/node/foo">
  <xsl:call-template name="special">
    <xsl:with-param name="nodeset">
      <locator file=... path="... />
      <locator file=... path="... />
</xsl:template>

<sigh/>

good job its friday

cheers
andrew

-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]
Sent: 11 April 2003 12:41
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] match nodes based on given path



As Im generating the stylesheet I can do pretty much anything, but I
cant see how to do it using the key approach. 

how about generating multiple templates for the different locators,
somthing like

<xsl:key name="fooLink" match="/root/node/foo" use="generate-id()"/>

<xsl:template match="*[generate-id() = 
generate-id(key('fooLink',generate-id()))]">
  <xsl:call-template name="IndyLink">
   <xsl:with-param name="locator" select="'test1.xml'"
 ...

<xsl:key name="barLink" match="/root/node/bar" use="generate-id()"/>

<xsl:template match="*[generate-id() = 
generate-id(key('barLink',generate-id()))]">
  <xsl:call-template name="IndyLink">
   <xsl:with-param name="locator" select="'test2.xml'"
 ...


<xsl:key name="bazLink" match="/root/node/foo" use="generate-id()"/>

<xsl:template match="*[generate-id() = 
generate-id(key('bazLink',generate-id()))]">
  <xsl:call-template name="IndyLink">
   <xsl:with-param name="locator" select="'test3.xml'"
 ...

______________________________________________________________
__________
This e-mail has been scanned for all viruses by Star Internet. 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





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.470 / Virus Database: 268 - Release Date: 08/04/2003
 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.470 / Virus Database: 268 - Release Date: 08/04/2003
 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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