This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: the nearest ancestor with the attribute
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] the nearest ancestor with the attribute
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Thu, 18 Jan 2001 11:02:59 +0100 (MET)
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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)
Conclusion:
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.
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list