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

Re: Re: Remove Duplicates from Recursive Template Call

Subject: Re: Re: Remove Duplicates from Recursive Template Calls
From: "Patrick Lademan" <plademan@xxxxxxxxxxxxxxxxx>
Date: Wed, 04 May 2005 13:23:54 -0500
patrick lademan
>Why does the test for whether this is teh first node in a document depend on
whether the template invocation is recursive?

      <xsl:for-each select="//component/@id[.=$idRef]//..">

It must locate the component that is being referenced, recurse into that
component to follow the componentReferences to other components.  It must
recurse until there are no more componentReferences found.

>that's a very odd XPath. selecting the parent of every node below $idRef.

This locates the component that the componentReference refers.  The "//.." was
a typo.  It should be "/..".  I took the extra slash out of the code and ran
it again and the results are the same.  The reason that I have the "/.." is
because node was at the component-attribute level.  Every reference I made was
../ @attribute.  The trailing "/.." took me back to the component node level
and therefore was much easier to make the @status and @estimate references
without the "../" prefixes.

>As a side issue I note that you are combining  indent="yes" with explictly
addded indentation eg

          <xsl:value-of select="$indent"/>
          (<xsl:value-of select="@estimate"/>)

>which adds the value of $indent followed by 10 spaces and a ( before the
estimate.

Because the end result generates HTML.  In order to make a simple example to
illustration of the problem I am experiencing, I removed all HTML tags for
clarity.  I use the indent="yes" for nice HTML formatting, but not for display
formatting.  The above data would be in an HTML table.  I will continue to use
the indent, because I want a much smaller outline indent than the HTML LI tags
provide.  The (@estimate) is the time estimate to develop that particular
component.  My end goal of this project is to provide time estimates to build
each phase of a project.  I put it in Parenthesis, because I stripped out all
the HTML to simplify my problem.  This value will end up in it's own column
with a subtotal per phase of delivery.

In reference to your solution:

Thank you very much for taking the time to respond.  I like your idea.  I have
a concern that apply-templates will apply all templates in the XSL stylesheet,
when I only want this one to execute.  Can this same process be done with a
call-template?  This two pass concept is foreign to me, do you know a website
with good working examples?

<xsl:template match="/">
<xsl:variable name="x">
<xsl:apply-templates/>
</xsl:variable>
<xsl:apply-templates select="xalan:node-set($x)"/>
</xsl:template>

Thank you,

Pat

--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

Current Thread

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.