previous
01: XQ2XML: Transformations on XQueries
02: XQ2XML: Transformations on XQueries
03: XQuery
04: XML syntax
05: Parsing XQuery
06: Parsing XQuery (XML)
07: Parsing XQuery syntax errors (XML)
08: XQueryX
09: XQ2XQX Stylesheet
10: xq2xsl: translator or implementation?
11: 1+2 as XSLT
12: Generated XSLT Functions
13: Direct element constructor
14: typeswitch
15: Quantified Expressions
16: FLWOR
17: FLWOR (simple cases)
18: FLWOR (less simple cases)
19: FLWOR (tuples)
20: FLWOR (general case)
21: Schema features
22: Built in types
23: xq2xsl: Why you might be interested.
24: xq2xsl: Why you might not use it
25: xq2xsl: Why you might use it
26: Queries and transformations on XQuery
27: Full Axis Feature
28: Full Axis Stylesheet
29: Querying External Parameters
30: XQuery and XSLT: Similarities
31: XQuery and XSLT: Differences
32: Conclusions
33: Links next
Full Axis Stylesheet
This is implemented as a classic “modified identity transformation”.
<xsl:import href="xq2xq.xsl"/>
.
.
.
<xsl:template match="StepExpr[ReverseAxis/data='preceding']">
(let $here := . return
reverse(root()/descendant::
<xsl:apply-templates select="NodeTest"/>
[. << $here][not(descendant::node()[. is $here])]))
<xsl:apply-templates select="* except (ReverseAxis|NodeTest)"/>
</xsl:template>
This template produces an expression that returns nodes in reverse document order. A higher priority template matches steps
that are not part of a larger Path expression and applies the reverse() function when required.