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

Re: RE: untitled from Biray Giray: colour on first occ

Subject: Re: RE: untitled from Biray Giray: colour on first occurrenceof an a ttribute value.
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 16 Apr 2002 20:05:41 +0200
biray
Hello Tom,

you created a little bit oversized Muenchian Method.

I wonder if you could use a key? How about
<xsl:key name="firsts"
match="//Content[not(./preceding::Content/@ContentText=./@ContentText)]"
use="@ContentText"/>

With your key you only have these nodes in your key-table, which are the first with its attribute value. So you would not need the Muenchian Method itself:


<xsl:when test="(count(. | key('firsts',@ContentText)) = 1)">

An easy key('firsts',@contentText) would be enough.


But your code removes the real advantage of using keys. What you have in your key, you can write easily in your <xsl:when>. You don't need the key.

<xsl:when test="self::Content[not(preceding::Content/@ContentText = @ContentText)]">

It's more a processing time problem then an error. Jeni gave already the correct code.

And one more comment: in the matcher of <xsl:key> you don't need '//'. The key is created for all Content elements in the file, independent on its level.

Regards,

Joerg



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-2011 All Rights Reserved.