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

Re: position() in templates

Subject: Re: position() in templates
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 08 Feb 2002 12:22:24 -0500
position last template
Jian,

I'm afraid I didn't have time to dig into your code and figure out exactly what you need to do (partly since I'd have to guess exactly what you want to do!), but....

It seems to be that where you say:

<xsl:template match="*">
<xsl:variable name="last" select="substring(last-modified,1,8)"/>
<xsl:if test="not(preceding-sibling::item[substring(last-modified,1,8)=$last])">
<tr><td>
jian<b><xsl:value-of select="substring(last-modified,1,8)"/>@@@<xsl:value-of select="last-modified"/></b>
</td></tr>
<xsl:apply-templates select="/items/item/last-modified" mode="a">
<xsl:with-param name="inner" select="$last"/>
<xsl:sort select="."/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>

That xsl:apply-templates could be causing behavior such as you are complaining about. The template it appears inside of matches any element, but in practice (given the other templates' logic), only item elements. Yet for each (item) element matched, you apply templates to all last-modified elements in the document. Are you sure you don't want simply <xsl:apply-templates select="last-modified"/> to apply a template just to this item's last-modified?


If I'm not reading correctly and this doesn't put you on the right track, could you please post again with:

1. A simpler demonstration of the problem (strip your code and example down to the minimum that shows what's happening), and
2. A statement, preferably with example code, of exactly what output you want?


In that case it'd probably be easier for one of us to help you.

Good luck,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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



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.