RE: [xsl] the nearest ancestor with the attribute

Subject: RE: [xsl] the nearest ancestor with the attribute
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Jan 2001 11:02:59 +0100 (MET)
> Noting that /@attr = /attribute::attr
> I guess this means that since attribute axis is in document order,
> this means, since its the last step, that document order rules
> for this expression?

Well, attributes of an element aren't ordered in a defined way. The 
order is implementation dependent. You can't tell, what @*[1] gives.
Document order or reverse document order is *only* important in
location steps, or to be more specific, in the predicates of a step.
If you have an expression that evaluates to a node-set and apply
a predicate, then this predicate "filters the node-set with respect to 
the child axis." (see XPath 3.3)

Don't know, why it was phrased this way, I think it means exactly the
same as <<the nodes of an expression are ordered in document order>>.
Or is there a slight difference that I haven't discovered yet?
(See also the note in 3.3 of XPath)

If there's a predicate, look to what "XPath construct" it applies.
If it's a step then the axis is important, since some of them are
reverse axes.
If it's an expression (evaluating to a node-set) then the order 
is always document order.
If you use xsl:value-of or the string function then you get always
the string-value of the first node in document order.
If you use xsl:for-each or xsl:apply-templates then the nodes are 
always processed in document order.


|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW: |

 XSL-List info and archive:

Current Thread