RE: [xsl] newbie - comparing attributes in nodes

Subject: RE: [xsl] newbie - comparing attributes in nodes
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 16 Jan 2002 19:01:13 -0000
> Each time the printCategory ID changes I need to output a heading.
>
> I tried to follow the examples in the book and came up with
> variants as
> below but none work. Can someone please help?
>
> <xsl:for-each select="/Report/printCategory">
> 			<xsl:if
> test="not(@ID=preceding::printCategory/@ID)">

Try test="not(@ID=preceding-sibling::printCategory[1]/@ID)"

which narrows down the number of preceding nodes you're looking at (to one!)

Having said that, I can't see why your code shouldn't work, so perhaps
there's something you haven't shown us. How is it failing?

Mike Kay

> 			<fo:table-row>
> 				<fo:table-cell>
> 					<fo:block>Print Category
> <xsl:value-of select="@ID"/></fo:block>
> 				</fo:table-cell>
> 			</fo:table-row>
> 			</xsl:if>
>
> Thanks in advance
> Jan
>
>
>
>
>
>
>
> --------------------------------------------------------------
> ------------
> CONFIDENTIALITY
> The information contained in this e-mail and any files
> transmitted with it
> is private and confidential. It is intended for the named
> addressee only.
> If you are not the intended addressee you are prohibited from
> storing, copying or using the information in any way.
> If you received this e-mail due to a transmission error
> please notify the
> sender immediately. No liability is accepted by Northern Rock
> for any losses caused by viruses contracted during transit
> over the Internet or present in any receiving system.
> This e-mail is not intended to create legally binding commitments on
> behalf of Northern Rock plc, nor do its contents reflect the
> corporate
> views or policies of Northern Rock plc.
> --------------------------------------------------------------
> ------------
>
>
>  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