[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] position last and attributes

Subject: Re: [xsl] position last and attributes
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Sep 2012 09:21:56 -0400

At 2012-09-20 13:56 +0100, Andrew Welch wrote:
> I saw a lot of comments talking about "[1]" and "[last()]" talking about
> attributes, and I think that is the problem regarding the discussion: The
> predicate "[1]" and "[last()]" is *not* based on the markup (attributes),
> but rather is based on the order of nodes in the XPath data model (attribute
> nodes).

it's based on the dynamic context, which, changes eg:


(@foo, @bar)[last()]

nothing special about attributes...

Granted, Andrew, thank you. Of course you are right that it is based on the context list which is dynamically changing all the time.

But I understood the discussion to be oriented around "@*[1]" and "@*[last()]", which when the abbreviation is expanded is "attribute::*[1]" and "attribute::*[last()]", which itself is oriented around nodes found along the attribute axis attached to an element. The predicates are not being applied to the artefacts found as markup in start tags.

For all we know an implementation might have alphabetized the nodes along the attribute axis in order to stop looking for an attribute when the name being looked for comes before the name of a given node on the axis!

So the specs say there is no order to attribute specifications and defaulted attributes, and the building of the XDM model imposes an order of attribute nodes on the attribute axis any way it wants or needs from the attribute specifications and defaults.

. . . . . . . . . Ken

-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread