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

RE: Re: Re: limiting preceding axis by ancestor

Subject: RE: Re: Re: limiting preceding axis by ancestor
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 9 May 2002 13:36:06 +0100
RE:  Re: Re: limiting preceding axis by ancestor
generate-id(), like many other functions in XPath, is defined to use the
node that is first in document order. The path expression used to obtain the
node-set is irrelevant.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Joerg
> Heinicke
> Sent: 09 May 2002 01:02
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Re: Re: limiting preceding axis by ancestor
>
>
> Hello Dimitre,
>
> I thought that this is true, *because* it's a reverse axis. I
> used [1]
> because I wanted the nearest ancestor. The question for me is "Why is
> the returned nodeset ancestor::foo upside down, so back in document
> order again?"
>
> So, while thinking is rarely being, the [1] is not implicit, it's a
> must. Sorry for the confusion.
>
> Joerg
>
> Dimitre Novatchev schrieb:
> > Joerg Heinicke <joerg dot heinicke at gmx dot de> wrote:
> >
> >
> >>The [1] is implicit and not needed, because generate-id() on a
> >>nodeset returns the id of the first element in this
> nodeset. I wrote
> >>it for maybe better understanding.
> >>
> >><xsl:if test=". = preceding::bar[generate-id(ancestor::foo[1]) =
> >>generate-id(current()/ancestor::foo[1])]">
> >
> >
> > This is one case where the established belief that
> >
> > generate-id(someXPathExpression) =
> generate-id(someXPathExpression[1])
> >
> > is *not* true.
> >
> > This is clearly not so, because "ancestor" is a reverse axis.
> >
> > generate-id(ancestor::foo[1])
> >
> > will be applied on the nearest ancesstor (the last in
> document order)
> >
> > while
> >
> > generate-id(ancestor::foo)
> >
> > will be applied on the outermost ancestor (the first in document
> > order).
>
>
>  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

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.