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

Re: Keys with duplicates should be simple

Subject: Re: Keys with duplicates should be simple
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxx>
Date: Fri, 31 Jan 2014 07:22:39 +0000
Re:  Keys with duplicates should be simple
No [2] means that a 2nd one exists which would be true if a 3rd one existed etc.

The full dataset picks up instances where there is more than one
duplicate so I can verify the above interpretation.

Having said that your offering although more verbose is superior
semantically as really the best way to write this is something like
(and I am pleading the fifth on the syntax here)
exists(key('person',@href)[2]) but then you look at that and you
realise or can argue (I think) that what I wrote is an abbreviated
form of that anyway.

I suppose a guru could tell whether they are semantically identical
and whether the one abbreviates the other.

On Fri, Jan 31, 2014 at 12:45 AM, Graydon <graydon@xxxxxxxxx> wrote:
> On Thu, Jan 30, 2014 at 04:38:49PM -0800, Dimitre Novatchev scripsit:
>> <xsl:key name="person" match="a" use="@href"/>
>>    <xsl:template match="person">
>>      <duplicate>
>>        <xsl:copy-of select="a[key('person',@href)[2]]"/>
>>      </duplicate>
>>    </xsl:template>
>> </xsl:stylesheet>
>
> Can I note that the [2] would appear to suppose that there's only ever
> one duplicate?
>
> not(position() eq 1) is likely safer.
>
> -- Graydon

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.