[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: Re: Recursive calls to a named template

Subject: Re: Re: Re: Recursive calls to a named template
From: Kevin Jones <kjones@xxxxxxxxxxx>
Date: Fri, 21 Nov 2003 10:27:27 +0000
grass identifier
On Friday 21 November 2003 08:43, Ram wrote:
> Exactly Charles! That z what I need...
>
> Ram

Ok. That ones a bit easier, this should do it. Sorry for 
confusing the issue.

xsl:key name="GroupByIdentifier" match="group" 
use="identifier[1]"/>

<xsl:template match="signature">
 <xsl:copy-of select="."/>
 <xsl:if test="count(../identifier[2])>0">
  <xsl:apply-templates 
select="key('GroupByIdentifier',../identifier[2])/signature"/>
  </xsl:if>
 </xsl:template>

 <xsl:template match="node()|@*">
  <xsl:copy>
   <xsl:apply-templates select="node()|@*"/>
  </xsl:copy>
 </xsl:template>

Kev.

>
> --- cknell@xxxxxxxxxx wrote:
> > > -----Original Message-----
> > > From:     Kevin Jones <kjones@xxxxxxxxxxx>
> > > Subject:  Re: Re:  Recursive calls to a named
> > > template
> > >
> > > Maybe I misunderstood what Ram was trying to achieve. In
> > > the output below the signature elements have been replaced
> > > by following the identifier mapping in the XML. In this
> > > example they all end up with the signature from the first
> > > group. The output shown is consistent with my
> > > interpretation of the problem he was trying to solve. Was
> > > something different required?
> >
> > [Ram, if you want to jump in here to clarify this, it will
> > make it easier to help.]
> >
> > My understanding was that he wanted to include all component
> > signatures. For example, in the input document the last
> > <group> contains <identifier>b</identifier> and
> > <identifier>c</identifier>. The next-to-last <group>
> > contains <identifier>b</identifier> and
> > <identifier>a</identifier>. Therefor, I believe that in the
> > last group in the output, he wants to include the
> > <signature> elements from the first and second groups in
> > addition to its own <signature> element and the next-to-last
> > <group> should contain the <signature> element from the
> > first <group> in addition to its own <signature> element.
> > That would make the output look like this:
> >
> > <?xml version = '1.0' encoding = 'UTF-8'?>
> > <formatted-xml>
> >    <group>
> >       <identifier>a</identifier>
> >       <signature>signature
> >       <identifier>DNSQuery1</identifier>
> >       <in>in
> >         <long>long</long>
> >         <identifier>ant</identifier>
> >       </in>
> >    </signature>
> >    </group>
> >    <group>
> >       <identifier>b</identifier>
> >       <identifier>a</identifier>
> >       <signature>signature
> >       <identifier>DNSQuery2</identifier>
> >       <inout>inout
> >         <string>string</string>
> >         <identifier>grass</identifier>
> >       </inout>
> >     </signature>
> >       <signature>signature
> >       <identifier>DNSQuery1</identifier>
> >       <in>in
> >         <long>long</long>
> >         <identifier>ant</identifier>
> >       </in>
> >    </signature>
> >    </group>
> >    <group>
> >       <identifier>c</identifier>
> >       <identifier>b</identifier>
> >       <signature>signature
> >       <identifier>DNSQuery3</identifier>
> >       <out>out
> >         <boolean>boolean</boolean>
> >         <identifier>fish</identifier>
> >       </out>
> >      </signature>
> >       <signature>signature
> >       <identifier>DNSQuery2</identifier>
> >       <inout>inout
> >         <string>string</string>
> >         <identifier>grass</identifier>
> >       </inout>
> >     </signature>
> >       <signature>signature
> >       <identifier>DNSQuery1</identifier>
> >       <in>in
> >         <long>long</long>
> >         <identifier>ant</identifier>
> >       </in>
> >    </signature>
> >    </group>
> > </formatted-xml>
> > --
> > Charles Knell
> > cknell@xxxxxxxxxx - email
> >
> >
> >  XSL-List info and archive: 
> > http://www.mulberrytech.com/xsl/xsl-list
>
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
>
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list


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


Current Thread
  • Converting Duration, (continued)
        • kakridge - Fri, 21 Nov 2003 13:06:21 -0500 (EST)
        • J.Pietschmann - Fri, 21 Nov 2003 13:44:20 -0500 (EST)
        • tim - Fri, 21 Nov 2003 15:49:15 -0500 (EST)
        • kakridge - Fri, 21 Nov 2003 16:53:20 -0500 (EST)
        • Kevin Jones - Fri, 21 Nov 2003 05:28:01 -0500 (EST) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.