On Wed, Jan 8, 2014 at 12:26 PM, David Carlisle <dav...@nag.co.uk> wrote:
> On 08/01/2014 12:17, Ihe Onwuka wrote: > list of them, it is not weird at all. > >> >> Furthermore atomizing it makes explicitly clear to the programmer whats >> gone on whereas barfing about duplicate attribute nodes when what you >> have coded >> >> <something>{$t/@sex}</__something> >> >> >> has no explicit duplicate node in sight is bloody confusing until you >> figure out that the duplicates have mysteriously morphed from the group >> by clause. Note this can happen even if your are grouping on something >> other than @sex. >> >> >> you seem to be saying you want > > <something sex="M"/> > > No I'm not. I want <someting sex='M M"/> then I could count them. and if it was <foo bar="...."/> where the sequence of @bar's take on several distinct overlapping values I may want to union or interesect them and if @bar didn't taken on overlapping values I may want to return them as a list. I don't know how much clearer I can make this. > if there is one attribute in the list but to atomise if there are two > and produce > > <something>MM</something> > > I don't think that would be helpful but as Michael commented it's > irrelevant what either of us think as that's not how it's defined (and > basically it has been defined this way since Xpath 1, 15 years ago) > > If you want a single attribute you want > > > {$t[1]/@sex} <something sex="M"/> > > If you want the concatenation of the atomisation of all the attributes as > a text node child, you want > > {$t/string(@sex)} <something>MM</something> > > If you want the atomisation of a single attribute as a text node child you > want > > {$t[1]/@sex} <something>M</something> > > I can't imagine a case where you want to decide between those depending on > whether there is a duplicate or not. > > > David > > > > > ________________________________________________________________________ > The Numerical Algorithms Group Ltd is a company registered in England > and Wales with company number 1249803. The registered office is: > Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. > > This e-mail has been scanned for all viruses by Star. The service is > powered by MessageLabs. ______________________________ > __________________________________________ >
_______________________________________________ talk@x-query.com http://x-query.com/mailman/listinfo/talk