The presentation of this document has been augmented to identify changes from a previous version. Three kinds of changes are highlighted: new, added text, changed text, and deleted text.
See also translations.
This document is also available in these non-normative formats: XML, Change markings relative to previous Working Draft, and
.
Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is one document in a set of seven documents that are being progressed to Recommendation together (XQuery 3.0, XQueryX 3.0, XSLT 3.0, Data Model 3.0, Functions and Operators 3.0, Serialization 3.0, XPath 3.0).
W3C publishes a Candidate Recommendation, as described in the Process Document, to indicate that the document is believed to be stable and to encourage implementation by the developer community. The publication of this document constitutes a call for implementations of this specification.
This document was developed by the W3C XML Query Working Group, which is part of the XML Activity. It will remain a Candidate Recommendation until at least 08 April 2013. The Working Group expects to advance this specification to Recommendation Status.
Once the entrance criteria for Proposed Recommendation have been achieved, the Director will be requested to advance this document to Proposed Recommendation status. Working closely with the developer community, we expect to show evidence of implementations by approximately 31 July 2013.
This Candidate Recommendation makes several substantive technical changes, including new features, adopted since the Last Call Working Draft was published. These changes affect only the XQueryX XML Schema and XSLT Stylesheet, and the change log. This Candidate Recommendaion of XQueryX 3.0 represents the second version of a previous W3C Recommendation.
No implementation report currently exists. However, a Test Suite for this document is under development. Implementors are encouraged to run this test suite and report their results. The Test Suite can be found at http://dev.w3.org/2011/QT3-test-suite/.
This document incorporates changes made against the Last Call Working Draft of 13 December 2011. Changes to this document since the Last Call Working Draft are detailed in D Change log.
Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string “[XQX30]” in the subject line of your report, whether made in Bugzilla or in email. Please use multiple Bugzilla entries (or, if necessary, multiple email messages) if you have more than one comment to make. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.
Publication as a Candidate Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
1 Introduction
2 Mapping the XQuery Syntax
3 Examples from the XML Query Use Cases in XML Syntax
3.1 Example 1
3.1.1 XQuery solution in XQuery Use Cases:
3.1.2 A Solution in XQueryX:
3.1.3 Transformation of XQueryX Solution into XQuery
3.1.4 Corresponding Grammar Abstract Parse Tree
3.2 Example 2
3.2.1 XQuery solution in XQuery Use Cases:
3.2.2 A solution in XQueryX:
3.2.3 Transformation of XQueryX Solution into XQuery
3.3 Example 3
3.3.1 XQuery solution in XQuery Use Cases:
3.3.2 A solution in XQueryX:
3.3.3 Transformation of XQueryX Solution into XQuery
3.4 Example 4
3.4.1 XQuery solution in XQuery Use Cases:
3.4.2 A solution in XQueryX:
3.4.3 Transformation of XQueryX Solution into XQuery
4 An XML Schema for the XQuery XML Syntax
5 Conformance
A References
B Transforming XQueryX to XQuery
C The application/xquery+xml Media Type
C.1 Introduction
C.2 Registration of MIME Media Type application/xquery+xml
C.2.1 Encoding Considerations
C.2.2 Security Considerations
C.2.3 Interoperability Considerations
C.2.4 Published specification
C.2.5 Applications That Use This Media Type
C.2.6 Additional Information
C.2.6.1 Recognizing XQuery Files ("Magic Numbers")
C.2.6.2 File Extensions
C.2.6.3 Macintosh File Type Code(s)
C.2.7 Person and Email Address to Contact For Further Information
C.2.8 Intended Usage
C.2.9 Restrictions on usage
C.2.10 Author/Change Controller
C.2.11 Fragment Identifiers
D Change log (Non-Normative)
D.1 Substantive changes
D.2 Incompatibilities
D.3 Editorial changes
The [XQuery 3.0 Requirements] states that "The XML Query Language MAY have more than one syntax binding. One query language syntax MUST be convenient for humans to read and write. One query language syntax MUST be expressed in XML in a way that reflects the underlying structure of the query."
XQueryX is an XML representation of an XQuery. It was created by mapping the productions of the XQuery grammar into XML productions. The result is not particularly convenient for humans to read and write, but it is easy for programs to parse, and because XQueryX is represented in XML, standard XML tools can be used to create, interpret, or modify queries.
In this document, examples and material labeled as "Note" are provided for explanatory purposes and are not normative.
Note:
Because the two syntaxes are merely different grammars that express the same query semantics, they share all aspects of an XQuery processing system except for the component that recognizes and translates the source representation of a query (that is, the parser). The aspects that are shared include both the static context and the dynamic context that are defined in [XQuery 3.0: An XML Query Language] .
There are several environments in which XQueryX may be useful:
Parser Reuse. In heterogeneous environments, a variety of systems may be used to execute a query. One parser can generate XQueryX for all of these systems.
Queries on Queries. Because XQueryX is represented in XML, queries can be queried and can be transformed into new queries. For instance, a query can be performed against a set of XQueryX queries to determine which queries use FLWOR expressions to range over a set of invoices.
Generating Queries. In some XML-oriented programming environments, it may be more convenient to build a query in its XQueryX representation than in the corresponding XQuery representation, since ordinary XML tools can be used.
Embedding Queries in XML. XQueryX can be embedded directly in an XML document.
This version of XQueryX is fully compatible with [XML Syntax for XQuery 1.0 (XQueryX)] . It differs from that earlier version of the language by the addition of new XML Schema definitions and XSLT stylesheet templates. All queries expressed in the syntax defined by [XML Syntax for XQuery 1.0 (XQueryX)] continue to be valid, with the same meaning, when processed by an implementation of this version of XQueryX.
The most recent versions of the XQueryX XML Schema and the XQueryX XSLT stylesheet are available at http://www.w3.org/2013/01/XQueryX/xqueryx.xsd and http://www.w3.org/2013/01/XQueryX/xqueryx.xsl, respectively.
Note:
The locations at which the current versions of the XML Schema and XSLT stylesheet are located during development of this specification will vary with each Working Draft and Candidate Recommendation of the spec that is published. The namespace target URI is identical to that used for [XML Syntax for XQuery 1.0 (XQueryX)] .
XQueryX is an XML representation of the abstract syntax found in Appendix A of [XQuery 3.0: An XML Query Language] . The XQueryX syntax is defined by the XQueryX Schema, which is specified in 4 An XML Schema for the XQuery XML Syntax. The XQueryX semantics are defined by a stylesheet that maps an instance of XQueryX to an instance of XQuery; see B Transforming XQueryX to XQuery.
The main data structure in the XQueryX Schema is the set of types that describe expressions. We have chosen to model expressions using substitution groups, with an "expr" abstract base class and a number of intermediate abstract classes.
Consider the following productions from the abstract syntax:
FLWORExpr ::= InitialClause IntermediateClause* ReturnClause InitialClause ::= ForClause | LetClause | WindowClause IntermediateClause ::= InitialClause | WhereClause | GroupByClause | OrderByClause | CountClause ForClause ::= "outer"? "for" "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle ("," "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle)* PositionalVar ::= "at" "$" VarName LetClause ::= "let" "$" VarName TypeDeclaration? ":=" ExprSingle ("," "$" VarName TypeDeclaration? ":=" ExprSingle)* WhereClause ::= "where" ExprSingle
Note:
Those productions do not represent the entire FLWOR expression, so some of the BNF non-terminal names are not resolved in the example abstract syntax.
The following XQueryX Schema definitions reflect the structure of those productions from that abstract syntax:
<!-- The base class --> <xsd:complexType name="expr"/> <xsd:element name="expr" type="expr" abstract="true"/> <!-- Simple wrapper class --> <xsd:complexType name="exprWrapper"> <xsd:sequence> <xsd:element ref="expr"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="flworExpr"> <xsd:complexContent> <xsd:extension base="expr"> <xsd:sequence> <xsd:choice> <xsd:element ref="forClause"/> <xsd:element ref="letClause"/> <xsd:element ref="windowClause"/> </xsd:choice> <xsd:sequence> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="forClause"/> <xsd:element ref="letClause"/> <xsd:element ref="windowClause"/> <xsd:element ref="countClause"/> <xsd:element ref="whereClause"/> <xsd:element ref="groupByClause"/> <xsd:element ref="orderByClause"/> </xsd:choice> <xsd:element ref="returnClause"/> </xsd:sequence> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:element name="flworExpr" type="flworExpr" substitutionGroup="expr"/> <xsd:complexType name="forClause"> <xsd:sequence> <xsd:element ref="forClauseItem" minOccurs="1" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="outer" type="xsd:boolean" default="false"/> </xsd:complexType> <xsd:element name="forClause" type="forClause"/> <xsd:complexType name="forClauseItem"> <xsd:sequence> <xsd:element ref="typedVariableBinding"/> <xsd:element ref="positionalVariableBinding" minOccurs="0" maxOccurs="1"/> <xsd:element ref="forLetClauseItemExtensions" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="forExpr" type="exprWrapper"/> </xsd:sequence> </xsd:complexType> <xsd:element name="forClauseItem" type="forClauseItem"/> <xsd:element name="forLetClauseItemExtensions" abstract="true"/> <xsd:complexType name="letClause"> <xsd:sequence> <xsd:element ref="letClauseItem" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:element name="letClause" type="letClause"/> <xsd:complexType name="letClauseItem"> <xsd:sequence> <xsd:choice> <xsd:sequence> <xsd:element ref="typedVariableBinding"/> <xsd:element ref="forLetClauseItemExtensions" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:element ref="forLetClauseItemExtensions" minOccurs="0" maxOccurs="unbounded"/> </xsd:choice> <xsd:element name="letExpr" type="exprWrapper"/> </xsd:sequence> </xsd:complexType> <xsd:element name="letClauseItem" type="letClauseItem"/> <xsd:element name="whereClause" type="exprWrapper"/>
Since XQuery uses the expression production liberally to allow expressions to be flexibly combined, XQueryX uses the exprWrapper type in embedded contexts to allow all expression types to occur.
Three of following examples are based on the data and queries in the XMP (Experiences and Exemplars) use case in [XQuery 3.0 Use Cases] , while a fourth example is based on the data and queries in the NS (Queries Using Namespaces) use case. For each example, we show the English description of the query, the XQuery solution given in [XQuery 3.0 Use Cases] , an XQueryX solution, and the XQuery that results from applying the XQueryX-to-XQuery transformation defined by the stylesheet in B Transforming XQueryX to XQuery to the XQueryX solution. That produced XQuery is presented only as a sanity-check — the intent of the stylesheet is not to create the identical XQuery expression given in [XQuery 3.0 Use Cases] , but to produce a valid XQuery expression with the same semantics. The semantics of the XQueryX solution are determined by the semantics of the XQuery expression that results from that transformation. The "correctness" of that transformation is determined by asking the following the question: Can some XQueryX processor QX process some XQueryX document D1 to produce results R1, after which the stylesheet is used to translate D1 into an XQuery expression E1 that, when processed by some XQuery processor Q, produces results R2 that are equivalent (under some meaningful definition of "equivalent") to results R1?
Comparison of the results of the XQueryX-to-XQuery transformation given in this document with the XQuery solutions in the [XQuery 3.0 Use Cases] may be helpful in evaluating the correctness of the XQueryX solution in each example.
The XQuery Use Cases solution given for each example is provided only to assist readers of this document in understanding the XQueryX solution. There is no intent to imply that this document specifies a "compilation" or "transformation" of XQuery syntax into XQueryX syntax.
In the following examples, note that path expressions are expanded to show their structure. Also, note that the prefix syntax for binary operators like "and" makes the precedence explicit. In general, humans find it easier to read an XML representation that does not expand path expressions, but it is less convenient for programmatic representation and manipulation. XQueryX is designed as a language that is convenient for production and modification by software, and not as a convenient syntax for humans to read and write.
Finally, please note that white space, including new lines, have been added to some of the XQueryX documents and XQuery expressions for readability. That additional white space is not produced by the XQueryX-to-XQuery transformation.
Here is Q1 from the [XQuery 3.0 Use Cases] , use case XMP (Experiences and Exemplars): "List books published by Addison-Wesley after 1991, including their year and title."
Application of the stylesheet in B Transforming XQueryX to XQuery to the XQueryX solution results in:
<bib>{ for $b in doc("http://bstore1.example.com/bib.xml")/child::bib/child::book where (($b/child::publisher = "Addison-Wesley") and ($b/attribute::year > 1991)) return <book year="{$b/attribute::year}">{$b/child::title}</book> }</bib>
For comparison, here is the abstract parse tree corresponding to the XQuery for Example 1, as produced by the XQuery grammar applets found at http://www.w3.org/2007/01/applets/.
XPath2 QueryList Module MainModule Prolog QueryBody Expr PathExpr Constructor DirectConstructor DirElemConstructor > LessThanOpOrTagO < TagQName bib DirAttributeList StartTagClose > DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent CommonContent EnclosedExpr Lbrace { Expr FLWORExpr ForClause VarName QName b PathExpr FunctionCall FunctionQName doc PathExpr StringLiteral "http://bstore1.example.com/bib.xml" StepExpr AbbrevForwardStep NodeTest NameTest QName bib StepExpr AbbrevForwardStep NodeTest NameTest QName book WhereClause AndExpr and ComparisonExpr = PathExpr VarName QName b StepExpr AbbrevForwardStep NodeTest NameTest QName publisher PathExpr StringLiteral "Addison-Wesley" ComparisonExpr > PathExpr VarName QName b StepExpr AbbrevForwardStep @ NodeTest NameTest QName year PathExpr IntegerLiteral 1991 PathExpr Constructor DirectConstructor DirElemConstructor > LessThanOpOrTagO < TagQName book DirAttributeList S TagQName year ValueIndicator = DirAttributeValue OpenQuot " QuotAttrValueContent CommonContent EnclosedExpr Lbrace { Expr PathExpr VarName QName b StepExpr AbbrevForwardStep @ NodeTest NameTest QName year Rbrace } CloseQuot " StartTagClose > DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent CommonContent EnclosedExpr Lbrace { Expr PathExpr VarName QName b StepExpr AbbrevForwardStep NodeTest NameTest QName title Rbrace } DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar DirElemContent ElementContentChar Rbrace } DirElemContent ElementContentChar
Here is Q4 from the [XQuery 3.0 Use Cases] , use case XMP (Experiences and Exemplars): "For each author in the bibliography, list the author's name and the titles of all books by that author, grouped inside a "result" element."
Application of the stylesheet in B Transforming XQueryX to XQuery to the XQueryX solution results in:
<results>{ let $a:=doc("http://bstore1.example.com/bib.xml")/descendant-or-self::node()/child::author for $last in distinct-values($a/child::last), $first in distinct-values($a[(./child::last = $last)]/child::first) order by $last , $first return <result><author><last>{$last}</last><first>{$first}</first></author>{ for $b in doc("http://bstore1.example.com/bib.xml")/child::bib/child::book where (some $ba in $b/child::author satisfies (($ba/child::last = $last) and ($ba/child::first = $first))) return $b/child::title }</result> }</results>
Here is Q7 from the [XQuery 3.0 Use Cases] , use case XMP (Experiences and Exemplars): "List the titles and years of all books published by Addison-Wesley after 1991, in alphabetic order."
Application of the stylesheet in B Transforming XQueryX to XQuery to the XQueryX solution results in:
<bib>{ for $b in doc("http://bstore1.example.com/bib.xml")/descendant-or-self::node()/child::book where (($b/child::publisher = "Addison-Wesley") and ($b/attribute::year > 1991)) order by $b/child::title return <book>{$b/attribute::year}{$b/child::title}</book> }</bib>
Here is Q8 from the [XQuery 3.0 Use Cases] , use case NS (Queries Using Namespaces): "Select all traders (either seller or high bidder) without negative comments."
Application of the stylesheet in B Transforming XQueryX to XQuery to the XQueryX solution results in:
declare namespace ma="http://www.example.com/AuctionWatch"; <Q8 xmlns:ma="http://www.example.com/AuctionWatch" xmlns:eachbay="http://www.example.com/auctioneers#eachbay" xmlns:xlink="http://www.w3.org/1999/xlink">{ for $s in fn:doc("auction.xml")/descendant-or-self::node()/ child::ma:Trading_Partners/ ((child::ma:Seller union child::ma:High_Bidder)) where ($s/child::*:NegativeComments = 0) return $s }</Q8>
Here is the XML Schema against which XQueryX documents must be valid.
This section defines the conformance criteria for an XQueryX processor (see Figure 1, "Processing Model Overview", in [XQuery 3.0: An XML Query Language] , Section 2.2 Processing Model XQ30.
In this section, the following terms are used to indicate the requirement levels defined in [RFC 2119]. [Definition: MUST means that the item is an absolute requirement of the specification.] [Definition: SHOULD means that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.] [Definition: MAY means that an item is truly optional.]
An XQueryX processor that claims to conform to this specification MUST implement the XQueryX syntax as defined in 4 An XML Schema for the XQuery XML Syntax of this specification and include a claim of Minimal Conformance as defined in [XQuery 3.0: An XML Query Language] , Section 5.1 Minimal Conformance XQ30. In addition to a claim of Minimal Conformance, it MAY claim conformance to one or more optional features defined in [XQuery 3.0: An XML Query Language] , Section 5.2 Optional Features XQ30.
The following stylesheet converts from XQueryX syntax to XML Query syntax. Note the intent of the stylesheet is to produce a valid XQuery with the same semantics (see [XQuery 1.0 and XPath 2.0 Formal Semantics]) as the input XQueryX.
<?xml version="1.0"?> <!-- ================================================================================ --> <!-- Changes from Recommendation (edition 1): --> <!-- * In XSLT stylesheet, deleted template for xqx:parenthesizedExpr (bug #4963) --> <!-- * In XSLT stylesheet, corrected template for xqx:namespaceDeclaration (bug #5343) --> <!-- Changes from Recommendation (edition 2): --> <!-- * Added support for new Windowing clause in FLWOR expression --> <!-- * Added support for new Group By Clause in FLWOR expression --> <!-- * Added support for new Count Clause in FLWOR expression --> <!-- * Added support for keyword "outer" on for expression --> <!-- * Modified structure of FLWOR clause per "simplified FLWOR expressions" --> <!-- * Modified validation syntax per Bugzilla Bug 5472 --> <!-- * Modified function declaration so that external functions can be nondeterminstic --> <!-- * Modified variable declaration so external variables can have an initial value --> <!-- * Added support for new try-catch expression --> <!-- * Made changes triggered by Bugzilla Bugs 6309, 6310, and 6311 --> <!-- * Modified errlist syntax per Bugzilla Bug 7053 --> <!-- * Added support for public/private functions --> <!-- * Replaced "outer for" support with support for "allowing empty" --> <!-- * Added support for higher-order functions --> <!-- * Added support for value-based "switch" expression --> <!-- * Changed functionItemExpr child element QName to be functionName for consistency --> <!-- * Added simpleMapExpr and removed mapStepExpr (see bug 16197) --> <!-- ================================================================================ --> <!-- Errata applied: --> <!-- XQX.E3 - Editorial (Bugzilla Bug 4963) --> <!-- XQX.E5 - Editorial (Bugzilla Bug 5343) --> <!-- XQX.E9 - Minor technical (Bugzilla Bug 6733) --> <!-- ================================================================================ --> <!-- Modifications: --> <!-- 2008-07-30 - Add XQuery 1.1 grouping and windowing support --> <!-- 2008-09-18 - Add XQuery 1.1 count and outer-for support, simplified FLWOR --> <!-- 2008-09-27 - Add validation type, nondeterministic function declarations, --> <!-- initial values for external variables, try-catch expressions --> <!-- 2008-11-14 - Add decimal formatting decl, encoding for version decl, --> <!-- context item decl, computed namespace constructor --> <!-- 2008-11-25 - Add support for fixes for validate expression, and change to allow --> <!-- the count clause to only be an intermediate expression --> <!-- 2009-01-13 - Bugs 6309 and 6310 (fixes to details of certain windowing clauses --> <!-- 2009-03-03 - tumblingWindowClause syntax now matches slidingWindowClause syntax --> <!-- 2009-09-06 - Modified errlist syntax per Bugzilla Bug 7053 --> <!-- 2009-10-09 - Added support for private/public functions --> <!-- Replace "outer for" with "allowing empty" --> <!-- 2009-10-22 - Add support for higher-order functions & switch expression --> <!-- 2010-01-06 - Omit parens when following-sibling of rootExpr is stepExpr --> <!-- 2010-04-06 - Changed functionItemExpr child QName -> functionName (consistency) --> <!-- 2010-06-23 - Added support for partial function application --> <!-- 2011-05-04 - Updated structure of catch component of try-catch expression --> <!-- 2011-05-04 - Updated validationexpr, mode/type alternatives, type is EQName --> <!-- 2011-05-31 - Fixed functionItemExpr and functionCallExpr re: unqualified names --> <!-- 2011-07-08 - Added support for concatenation operator || --> <!-- 2011-09-09 - Added support for simple mapping operator ! --> <!-- 2011-09-09 - Added support for sequenceTypeUnion in typeswitch --> <!-- 2011-09-09 - Added support for annotations on inline functions --> <!-- 2011-09-14 - Added support for new group-by syntax --> <!-- 2011-11-21 - Jim changed "literalFunctionItemExpr" to "namedFunctionRef" --> <!-- 2011-11-21 - Jim changed "inlineFunctionItemExpr" to "inlineFunctionExpr" --> <!-- 2012-02-24 - Jim updated EQname template to generate revised XQuery syntax --> <!-- 2012-06-15 - Added simpleMapExpr and removed mapStepExpr (see bug 16197) --> <!-- 2012-06-22 - Generate parentheses surrounding try-catch expressions (bug 17549) --> <!-- 2012-09-07 - Added %-annotation support for function tests --> <!-- 2012-09-25 - If encoding is specified in versionDecl, the generated XQ uses it --> <!-- ================================================================================ --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xqx="http://www.w3.org/2005/XQueryX"> <!-- Note that this stylesheet frequently invokes templates for specified elements, even when there are no templates in the stylesheet whose match="" attribute identifies those elements. In such case, the default template's element matching template is invoked, which merely invokes xsl:apply-templates --> <xsl:output method="text"/> <xsl:strip-space elements="*"/> <xsl:preserve-space elements="xqx:value xqx:attributeValue xqx:pragmaContents xqx:optionContents xqx:xquery"/> <xsl:variable name="DOT" select="'.'"/> <xsl:variable name="SPACE" select="' '"/> <xsl:variable name="SLASH" select="'/'"/> <xsl:variable name="SLASH_SLASH" select="'//'"/> <xsl:variable name="LESSTHAN" select="'<'"/> <xsl:variable name="GREATERTHAN" select="'>'"/> <xsl:variable name="LPAREN" select="'('"/> <xsl:variable name="RPAREN" select="')'"/> <xsl:variable name="NEWLINE"><xsl:text> </xsl:text></xsl:variable> <xsl:variable name="COMMA" select="','"/> <xsl:variable name="COMMA_SPACE" select="', '"/> <xsl:variable name="COMMA_NEWLINE"><xsl:text>, </xsl:text></xsl:variable> <xsl:variable name="QUOTE"><xsl:text>'</xsl:text></xsl:variable> <xsl:variable name="DOUBLEQUOTE"><xsl:text>"</xsl:text></xsl:variable> <xsl:variable name="TO" select="' to '"/> <xsl:variable name="LBRACE" select="'{'"/> <xsl:variable name="RBRACE" select="'}'"/> <xsl:variable name="LBRACKET" select="'['"/> <xsl:variable name="RBRACKET" select="']'"/> <xsl:variable name="DOLLAR" select="'$'"/> <xsl:variable name="MINUS" select="'-'"/> <xsl:variable name="PLUS" select="'+'"/> <xsl:variable name="EQUAL" select="'='"/> <xsl:variable name="COLON" select="':'"/> <xsl:variable name="DOUBLE_COLON" select="'::'"/> <xsl:variable name="SEMICOLON" select="';'"/> <xsl:variable name="AT" select="'@'"/> <xsl:variable name="STAR" select="'*'"/> <xsl:variable name="QUESTIONMARK" select="'?'"/> <xsl:variable name="EXCLAMATIONMARK" select="'!'"/> <xsl:variable name="PERCENT" select="'%'"/> <xsl:variable name="ASSIGN" select="':='"/> <xsl:variable name="SEPARATOR" select="';'"/> <xsl:variable name="PRAGMA_BEGIN" select="'(# '"/> <xsl:variable name="PRAGMA_END" select="' #)'"/> <xsl:variable name="CONCATENATE" select="'||'"/> <xsl:template name="delimitedList"> <xsl:param name="delimiter" /> <xsl:param name="leftEncloser"/> <xsl:param name="rightEncloser" /> <xsl:param name="selector"/> <xsl:value-of select="$leftEncloser"/> <xsl:for-each select="*"> <xsl:apply-templates select="."/> <xsl:if test="not (position()=last())"> <xsl:value-of select="$delimiter"/> </xsl:if> </xsl:for-each> <xsl:value-of select="$rightEncloser"/> </xsl:template> <xsl:template name="parenthesizedList"> <xsl:param name="delimiter" select="$COMMA_SPACE"/> <xsl:call-template name="delimitedList"> <xsl:with-param name="delimiter" select="$delimiter" /> <xsl:with-param name="leftEncloser" select="$LPAREN"/> <xsl:with-param name="rightEncloser" select="$RPAREN"/> </xsl:call-template> </xsl:template> <xsl:template name="commaSeparatedList"> <xsl:call-template name="delimitedList"> <xsl:with-param name="delimiter"> <xsl:value-of select="$COMMA_SPACE"/> </xsl:with-param> </xsl:call-template> </xsl:template> <!-- To resolve Bugzilla bug #3446, we now escape CR (#xD), NEL (#x85), and LINE SEPARATOR (#x2028) characters in text nodes and attribute values. Note that this template is invoked for a number of other purposes (e.g., xqx:collation, xqx:namespaceDeclaration) where the presence of such characters would be invalid and thus are highly unlikely to appear. If they do, then this template will happily escape them, deferring the error until the resulting XQuery expression is processed. --> <xsl:template name="quote"> <xsl:param name="item"/> <xsl:value-of select="$DOUBLEQUOTE"/> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:value-of select="$item"/> </xsl:with-param> <xsl:with-param name="toBeReplaced">&</xsl:with-param> <xsl:with-param name="replacement">&amp;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced"><</xsl:with-param> <xsl:with-param name="replacement">&lt;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced" select="'…'"/> <xsl:with-param name="replacement">&#x85;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced" select="'
'"/> <xsl:with-param name="replacement">&#xD;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced" select="'
'"/> <xsl:with-param name="replacement">&#x2028;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced"><xsl:text>"</xsl:text></xsl:with-param> <xsl:with-param name="replacement"><xsl:text>""</xsl:text></xsl:with-param> </xsl:call-template> <xsl:value-of select="$DOUBLEQUOTE"/> </xsl:template> <xsl:template name="globalReplace"> <xsl:param name="stringToBeFixed"/> <xsl:param name="toBeReplaced"/> <xsl:param name="replacement"/> <xsl:choose> <xsl:when test="contains($stringToBeFixed, $toBeReplaced)"> <xsl:value-of select="concat(substring-before($stringToBeFixed, $toBeReplaced), $replacement)"/> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed" select="substring-after($stringToBeFixed, $toBeReplaced)"/> <xsl:with-param name="toBeReplaced" select="$toBeReplaced"/> <xsl:with-param name="replacement" select="$replacement"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$stringToBeFixed"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="renderQName"> <xsl:if test="@xqx:prefix"> <xsl:value-of select="@xqx:prefix"/> <xsl:value-of select="$COLON"/> </xsl:if> <xsl:value-of select="."/> </xsl:template> <!-- 2012-02-24 - Changed output generated when URI is given instead of prefix --> <xsl:template name="renderEQName" match="xqx:QName | xqx:pragmaName | xqx:typeName | xqx:varName | xqx:functionName | xqx:optionName | xqx:annotationName | xqx:atomicType | xqx:tagName | xqx:name | xqx:decimalFormatName"> <xsl:choose> <xsl:when test="xqx:tagName/parent::xqx:elementConstructor"> <xsl:call-template name="renderQName"/> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="@xqx:prefix and @xqx:URI"> <xsl:message terminate="yes">Incorrect XQueryX: Elements of type xqx:EQName must not have both 'prefix' and 'URI' attributes</xsl:message> </xsl:when> <xsl:when test="@xqx:prefix"> <xsl:value-of select="@xqx:prefix"/> <xsl:value-of select="$COLON"/> <xsl:value-of select="."/> </xsl:when> <xsl:when test="@xqx:URI"> <xsl:text>Q</xsl:text> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="@xqx:URI"/> <xsl:value-of select="$RBRACE"/> <xsl:value-of select="."/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="xqx:attributeName"> <xsl:choose> <xsl:when test="@xqx:prefix='xmlns'"> <xsl:message terminate="yes">Incorrect XQueryX: Attribute names are not permitted to have prefix 'xmlns'; use xqx:namespaceDeclaration to declare namespaces</xsl:message> </xsl:when> <xsl:when test=". = 'xmlns'"> <xsl:message terminate="yes">Incorrect XQueryX: Attribute names are not permitted to be 'xmlns'; use xqx:namespaceDeclaration to declare namespaces</xsl:message> </xsl:when> <xsl:otherwise> <xsl:call-template name="renderQName"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="xqx:NCName"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:rootExpr"> <xsl:value-of select="$SLASH"/> </xsl:template> <!-- 2010-06-23 - Added support for partial function application --> <xsl:template match="xqx:argumentPlaceholder"> <xsl:value-of select="$QUESTIONMARK"/> </xsl:template> <!-- To resolve Bugzilla bug #6733, we now treat a rootExpr child of pathExpr distinctly from a rootExpr that occurs in other contexts, transforming it to "(/)" as proper XQuery grammar. There is an additional consideration on this: If the immediately following sibling of rootExpr is a stepExpr, then the parens must be omitted. --> <xsl:template match="xqx:pathExpr/xqx:rootExpr"> <xsl:if test="not(following-sibling::xqx:stepExpr)"> <xsl:value-of select="$LPAREN"/> </xsl:if> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$SLASH"/> <xsl:value-of select="$SPACE"/> <xsl:if test="not(following-sibling::xqx:stepExpr)"> <xsl:value-of select="$RPAREN"/> </xsl:if> </xsl:template> <xsl:template match="xqx:contextItemExpr"> <xsl:value-of select="$DOT"/> </xsl:template> <xsl:template match="xqx:stringConstantExpr"> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:value"/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:integerConstantExpr | xqx:decimalConstantExpr | xqx:doubleConstantExpr"> <xsl:value-of select="xqx:value"/> </xsl:template> <xsl:template match="xqx:varRef"> <xsl:value-of select="$DOLLAR"/> <xsl:apply-templates select="xqx:name"/> </xsl:template> <xsl:template match="xqx:pragma"> <xsl:value-of select="$PRAGMA_BEGIN"/> <xsl:apply-templates select="xqx:pragmaName"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="xqx:pragmaContents"/> <xsl:value-of select="$PRAGMA_END"/> </xsl:template> <xsl:template match="xqx:extensionExpr"> <xsl:apply-templates select="xqx:pragma"/> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <!-- 2012-06-15 - Jim added simpleMapExpr --> <xsl:template match="xqx:simpleMapExpr"> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:pathExpr[1]"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RPAREN"/> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$EXCLAMATIONMARK"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:pathExpr[2]"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <!-- Response to Bugzilla bug #2528 --> <!-- Response to Bugzilla bug #12788 --> <xsl:template match="xqx:functionCallExpr"> <xsl:if test="(xqx:functionName = 'node' or xqx:functionName = 'document-node' or xqx:functionName = 'element' or xqx:functionName = 'attribute' or xqx:functionName = 'schema-element' or xqx:functionName = 'schema-attribute' or xqx:functionName = 'processing-instruction' or xqx:functionName = 'comment' or xqx:functionName = 'text' or xqx:functionName = 'function' or xqx:functionName = 'namespace-node' or xqx:functionName = 'item' or xqx:functionName = 'if' or xqx:functionName = 'switch' or xqx:functionName = 'typeswitch' or xqx:functionName = 'empty-sequence') and ((not(xqx:functionName/@xqx:prefix) and not(xqx:functionName/@xqx:URI)) or xqx:functionName/@xqx:prefix = '' or xqx:functionName/@xqx:URI = '')"> <xsl:variable name="message"><xsl:text>Incorrect XQueryX: function calls must not use unqualified "reserved" name "</xsl:text><xsl:value-of select="xqx:functionName"/><xsl:text>"</xsl:text></xsl:variable> <xsl:message terminate="yes"><xsl:value-of select="$message"/></xsl:message> </xsl:if> <xsl:apply-templates select="xqx:functionName"/> <xsl:choose> <xsl:when test="xqx:arguments"> <xsl:for-each select="xqx:arguments"> <xsl:call-template name="parenthesizedList"/> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="$RPAREN"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="xqx:constructorFunctionExpr"> <xsl:apply-templates select="xqx:typeName"/> <xsl:for-each select="xqx:argExpr"> <xsl:call-template name="parenthesizedList"/> </xsl:for-each> </xsl:template> <xsl:template match="xqx:unaryMinusOp | xqx:unaryPlusOp"> <xsl:value-of select="$LPAREN"/> <xsl:choose> <xsl:when test="self::xqx:unaryPlusOp"><xsl:value-of select="$PLUS"/></xsl:when> <xsl:when test="self::xqx:unaryMinusOp"><xsl:value-of select="$MINUS"/></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:operand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:addOp | xqx:subtractOp | xqx:multiplyOp | xqx:divOp | xqx:idivOp | xqx:modOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:addOp"><xsl:value-of select="$PLUS"/></xsl:when> <xsl:when test="self::xqx:subtractOp"><xsl:text> </xsl:text><xsl:value-of select="$MINUS"/><xsl:text> </xsl:text></xsl:when> <xsl:when test="self::xqx:multiplyOp"><xsl:value-of select="$STAR"/></xsl:when> <xsl:when test="self::xqx:divOp"><xsl:text> div </xsl:text></xsl:when> <xsl:when test="self::xqx:idivOp"><xsl:text> idiv </xsl:text></xsl:when> <xsl:when test="self::xqx:modOp"><xsl:text> mod </xsl:text></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:stringConcatenateOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:value-of select="$CONCATENATE"/> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:eqOp | xqx:neOp | xqx:ltOp | xqx:gtOp | xqx:leOp | xqx:geOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:eqOp"><xsl:text> eq </xsl:text></xsl:when> <xsl:when test="self::xqx:neOp"><xsl:text> ne </xsl:text></xsl:when> <xsl:when test="self::xqx:ltOp"><xsl:text> lt </xsl:text></xsl:when> <xsl:when test="self::xqx:gtOp"><xsl:text> gt </xsl:text></xsl:when> <xsl:when test="self::xqx:leOp"><xsl:text> le </xsl:text></xsl:when> <xsl:when test="self::xqx:geOp"><xsl:text> ge </xsl:text></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:equalOp | xqx:notEqualOp | xqx:lessThanOp | xqx:greaterThanOp | xqx:lessThanOrEqualOp | xqx:greaterThanOrEqualOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:equalOp"> <xsl:text> </xsl:text><xsl:value-of select="$EQUAL"/><xsl:text> </xsl:text> </xsl:when> <xsl:when test="self::xqx:notEqualOp"> <xsl:text> !</xsl:text><xsl:value-of select="$EQUAL"/><xsl:text> </xsl:text> </xsl:when> <xsl:when test="self::xqx:lessThanOp"> <xsl:text> </xsl:text><xsl:value-of select="$LESSTHAN"/><xsl:text> </xsl:text> </xsl:when> <xsl:when test="self::xqx:greaterThanOp"> <xsl:text> </xsl:text><xsl:value-of select="$GREATERTHAN"/><xsl:text> </xsl:text> </xsl:when> <xsl:when test="self::xqx:lessThanOrEqualOp"> <xsl:text> </xsl:text><xsl:value-of select="$LESSTHAN"/> <xsl:value-of select="$EQUAL"/><xsl:text> </xsl:text> </xsl:when> <xsl:when test="self::xqx:greaterThanOrEqualOp"> <xsl:text> </xsl:text><xsl:value-of select="$GREATERTHAN"/> <xsl:value-of select="$EQUAL"/><xsl:text> </xsl:text> </xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:isOp | xqx:nodeBeforeOp | xqx:nodeAfterOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:isOp"><xsl:text> is </xsl:text></xsl:when> <xsl:when test="self::xqx:nodeBeforeOp"><xsl:text> </xsl:text> <xsl:value-of select="$LESSTHAN"/><xsl:value-of select="$LESSTHAN"/> <xsl:text> </xsl:text></xsl:when> <xsl:when test="self::xqx:nodeAfterOp"><xsl:text> </xsl:text> <xsl:value-of select="$GREATERTHAN"/><xsl:value-of select="$GREATERTHAN"/> <xsl:text> </xsl:text></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:andOp | xqx:orOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:andOp"><xsl:text> and </xsl:text></xsl:when> <xsl:when test="self::xqx:orOp"><xsl:text> or </xsl:text></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:unionOp | xqx:intersectOp | xqx:exceptOp"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:firstOperand"/> <xsl:choose> <xsl:when test="self::xqx:unionOp"><xsl:text> union </xsl:text></xsl:when> <xsl:when test="self::xqx:intersectOp"><xsl:text> intersect </xsl:text></xsl:when> <xsl:when test="self::xqx:exceptOp"><xsl:text> except </xsl:text></xsl:when> </xsl:choose> <xsl:apply-templates select="xqx:secondOperand"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:sequenceExpr"> <xsl:for-each select="."> <xsl:call-template name="parenthesizedList"> <xsl:with-param name="delimiter" select="$COMMA_NEWLINE"/> </xsl:call-template> </xsl:for-each> </xsl:template> <xsl:template match="xqx:rangeSequenceExpr"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:startExpr"/> <xsl:value-of select="$TO"/> <xsl:apply-templates select="xqx:endExpr"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:forClause"> <xsl:text> for </xsl:text> <xsl:call-template name="commaSeparatedList"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:forClauseItem"> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:allowingEmpty"> <xsl:text> allowing empty </xsl:text> </xsl:template> <xsl:template match="xqx:forExpr"> <xsl:value-of select="$NEWLINE"/> <xsl:text> in </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:letClause"> <xsl:text> let </xsl:text> <xsl:call-template name="commaSeparatedList"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:letClauseItem"> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:letExpr"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$ASSIGN"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:windowClause"> <xsl:text> for </xsl:text> <xsl:apply-templates/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:tumblingWindowClause"> <xsl:text> tumbling window </xsl:text> <xsl:apply-templates select="xqx:typedVariableBinding"/> <xsl:text> in </xsl:text> <xsl:apply-templates select="xqx:bindingSequence"/> <xsl:value-of select="$NEWLINE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="xqx:windowStartCondition"/> <xsl:value-of select="$NEWLINE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="xqx:windowEndCondition"/> </xsl:template> <xsl:template match="xqx:slidingWindowClause"> <xsl:text> sliding window </xsl:text> <xsl:apply-templates select="xqx:typedVariableBinding"/> <xsl:text> in </xsl:text> <xsl:apply-templates select="xqx:bindingSequence"/> <xsl:value-of select="$NEWLINE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="xqx:windowStartCondition"/> <xsl:value-of select="$NEWLINE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="xqx:windowEndCondition"/> </xsl:template> <xsl:template match="xqx:bindingSequence"> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:windowStartCondition"> <xsl:text>start </xsl:text> <xsl:apply-templates select="xqx:windowVars"/> <xsl:text> when </xsl:text> <xsl:apply-templates select="xqx:winStartExpr"/> </xsl:template> <xsl:template match="xqx:windowEndCondition"> <xsl:if test="@xqx:onlyEnd='true'"> <xsl:text>only </xsl:text> </xsl:if> <xsl:text>end </xsl:text> <xsl:apply-templates select="xqx:windowVars"/> <xsl:text> when </xsl:text> <xsl:apply-templates select="xqx:winEndExpr"/> </xsl:template> <xsl:template match="xqx:windowVars"> <xsl:apply-templates select="xqx:currentItem"/> <xsl:apply-templates select="xqx:positionalVariableBinding"/> <xsl:apply-templates select="xqx:previousItem"/> <xsl:apply-templates select="xqx:nextItem"/> </xsl:template> <xsl:template match="xqx:currentItem"> <xsl:value-of select="$DOLLAR"/> <xsl:call-template name="renderEQName"/> </xsl:template> <xsl:template match="xqx:previousItem"> <xsl:text> previous </xsl:text> <xsl:value-of select="$DOLLAR"/> <xsl:call-template name="renderEQName"/> </xsl:template> <xsl:template match="xqx:nextItem"> <xsl:text> next </xsl:text> <xsl:value-of select="$DOLLAR"/> <xsl:call-template name="renderEQName"/> </xsl:template> <xsl:template match="xqx:countClause"> <xsl:text> count </xsl:text> <xsl:apply-templates/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:whereClause"> <xsl:text> where </xsl:text> <xsl:apply-templates select="*"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:groupByClause"> <xsl:text> group by </xsl:text> <xsl:call-template name="commaSeparatedList"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:groupingSpec"> <xsl:value-of select="$DOLLAR"/> <xsl:apply-templates/> </xsl:template> <!-- 2011-09-14/JM - added the ability to initialize a grouping variable, opt set type --> <xsl:template match="xqx:groupVarInitialize"> <xsl:if test="xqx:typeDeclaration"> <xsl:apply-templates select="xqx:typeDeclaration"/> </xsl:if> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$ASSIGN"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:varValue"/> </xsl:template> <xsl:template match="xqx:collation"> <xsl:text> collation </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item"> <xsl:value-of select="."/> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="xqx:emptyOrderingMode"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:orderingKind"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:orderModifier"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="xqx:orderBySpec"> <xsl:apply-templates select="xqx:orderByExpr"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:orderModifier"/> </xsl:template> <xsl:template match="xqx:orderByClause"> <xsl:if test="xqx:stable"> <xsl:text> stable</xsl:text> </xsl:if> <xsl:text> order by </xsl:text> <xsl:apply-templates select="xqx:orderBySpec[1]"/> <xsl:for-each select="xqx:orderBySpec[position() > 1]"> <xsl:value-of select="$COMMA_SPACE"/> <xsl:apply-templates select="."/> </xsl:for-each> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:returnClause"> <xsl:text> return </xsl:text> <xsl:apply-templates select="*"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <!-- Surrounding FLWOR expressions with parentheses completes the set --> <xsl:template match="xqx:flworExpr"> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:ifThenElseExpr"> <xsl:value-of select="$LPAREN"/> <xsl:text> if </xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:ifClause"/> <xsl:value-of select="$RPAREN"/> <xsl:text> then </xsl:text> <xsl:apply-templates select="xqx:thenClause"/> <xsl:text> else </xsl:text> <xsl:apply-templates select="xqx:elseClause"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:positionalVariableBinding"> <xsl:text> at </xsl:text> <xsl:value-of select="$DOLLAR"/> <xsl:call-template name="renderQName"/> </xsl:template> <xsl:template match="xqx:variableBinding"> <xsl:value-of select="$DOLLAR"/> <xsl:call-template name="renderEQName"/> <xsl:if test="parent::xqx:typeswitchExprCaseClause"> <xsl:text> as </xsl:text> </xsl:if> </xsl:template> <xsl:template match="xqx:typedVariableBinding" name="typedVariableBinding"> <xsl:value-of select="$DOLLAR"/> <xsl:apply-templates select="xqx:varName"/> <xsl:apply-templates select="xqx:typeDeclaration"/> </xsl:template> <xsl:template match="xqx:quantifiedExprInClause"> <xsl:apply-templates select="xqx:typedVariableBinding"/> <xsl:text> in </xsl:text> <xsl:apply-templates select="xqx:sourceExpr"/> </xsl:template> <xsl:template match="xqx:quantifiedExpr"> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="xqx:quantifier"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:quantifiedExprInClause[1]"/> <xsl:for-each select="xqx:quantifiedExprInClause[position() > 1]"> <xsl:value-of select="$COMMA_SPACE"/> <xsl:apply-templates select="."/> </xsl:for-each> <xsl:text> satisfies </xsl:text> <xsl:apply-templates select="xqx:predicateExpr"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:instanceOfExpr"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:text> instance of </xsl:text> <xsl:apply-templates select="xqx:sequenceType"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:castExpr"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:text> cast as </xsl:text> <xsl:apply-templates select="xqx:singleType"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:castableExpr"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:text> castable as </xsl:text> <xsl:apply-templates select="xqx:singleType"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:treatExpr"> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:text> treat as </xsl:text> <xsl:apply-templates select="xqx:sequenceType"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:switchExprCaseClause"> <xsl:for-each select="xqx:switchCaseExpr"> <xsl:value-of select="$NEWLINE"/> <xsl:text> case (</xsl:text> <xsl:apply-templates select="."/> <xsl:text>) </xsl:text> </xsl:for-each> <xsl:value-of select="$NEWLINE"/> <xsl:text> return </xsl:text> <xsl:apply-templates select="xqx:resultExpr"/> </xsl:template> <xsl:template match="xqx:switchExprDefaultClause"> <xsl:value-of select="$NEWLINE"/> <xsl:text> default return </xsl:text> <xsl:apply-templates select="xqx:resultExpr"/> </xsl:template> <xsl:template match="xqx:switchExpr"> <xsl:value-of select="$LPAREN"/> <xsl:text>switch</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:value-of select="$RPAREN"/> <xsl:apply-templates select="xqx:switchExprCaseClause"/> <xsl:apply-templates select="xqx:switchExprDefaultClause"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <!-- 2011-09-09/JM - augmented sequenceType with sequenceTypeUnion --> <xsl:template match="xqx:typeswitchExprCaseClause"> <xsl:text> case </xsl:text> <xsl:apply-templates select="xqx:variableBinding"/> <xsl:apply-templates select="xqx:sequenceType | xqx:sequenceTypeUnion"/> <xsl:text> return </xsl:text> <xsl:apply-templates select="xqx:resultExpr"/> </xsl:template> <xsl:template match="xqx:typeswitchExprDefaultClause"> <xsl:text> default </xsl:text> <xsl:apply-templates select="xqx:variableBinding"/> <xsl:text> return </xsl:text> <xsl:apply-templates select="xqx:resultExpr"/> </xsl:template> <xsl:template match="xqx:typeswitchExpr"> <xsl:value-of select="$LPAREN"/> <xsl:text>typeswitch</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:value-of select="$RPAREN"/> <xsl:apply-templates select="xqx:typeswitchExprCaseClause"/> <xsl:apply-templates select="xqx:typeswitchExprDefaultClause"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:tryCatchExpr"> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$LPAREN"/> <xsl:text>try </xsl:text> <xsl:apply-templates select="xqx:tryClause"/> <xsl:apply-templates select="xqx:catchClause"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:tryClause"> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:catchClause"> <xsl:value-of select="$NEWLINE"/> <xsl:text> catch </xsl:text> <xsl:apply-templates select="xqx:catchErrorList"/> <xsl:apply-templates select="xqx:catchExpr"/> </xsl:template> <xsl:template match="xqx:catchErrorList"> <xsl:for-each select="xqx:nameTest | xqx:Wildcard"> <xsl:if test="(position() mod 5) = 0"> <xsl:value-of select="$NEWLINE"/> <xsl:text> </xsl:text> </xsl:if> <xsl:if test="position() > 1"> <xsl:text>| </xsl:text> </xsl:if> <xsl:apply-templates select="."/> <xsl:value-of select="$SPACE"/> </xsl:for-each> </xsl:template> <xsl:template match="xqx:catchExpr"> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:validateExpr"> <xsl:value-of select="$LPAREN"/> <xsl:text> validate </xsl:text> <xsl:if test="xqx:validationMode"> <xsl:value-of select="xqx:validationMode"/> <xsl:value-of select="$SPACE"/> </xsl:if> <xsl:if test="xqx:sequenceType"> <xsl:text>type </xsl:text> <xsl:apply-templates select="xqx:typeName"/> <xsl:value-of select="$SPACE"/> </xsl:if> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:argExpr"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:xpathAxis"> <xsl:value-of select="."/> <xsl:value-of select="$DOUBLE_COLON"/> </xsl:template> <xsl:template match="xqx:predicates"> <xsl:for-each select="*"> <xsl:value-of select="$LBRACKET"/> <xsl:apply-templates select="."/> <xsl:value-of select="$RBRACKET"/> </xsl:for-each> </xsl:template> <!-- part of higher-order functions --> <xsl:template match="xqx:dynamicFunctionInvocationExpr"> <xsl:apply-templates select="xqx:functionItem"/> <xsl:apply-templates select="xqx:predicates"/> <xsl:choose> <xsl:when test="xqx:arguments"> <xsl:for-each select="xqx:arguments"> <xsl:call-template name="parenthesizedList"/> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="$RPAREN"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- part of higher-order functions --> <xsl:template match="xqx:functionItem"> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:star"> <xsl:value-of select="$STAR"/> </xsl:template> <xsl:template match="xqx:Wildcard[*]"> <xsl:choose> <xsl:when test="local-name(./child::*[1])='star'"> <xsl:apply-templates select="xqx:star"/> <xsl:value-of select="$COLON"/> <xsl:apply-templates select="xqx:NCName"/> </xsl:when> <xsl:when test="local-name(./child::*[1])='NCName'"> <xsl:apply-templates select="xqx:NCName"/> <xsl:value-of select="$COLON"/> <xsl:apply-templates select="xqx:star"/> </xsl:when> <xsl:when test="local-name(./child::*[1])='uri'"> <xsl:text>Q</xsl:text> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="./xqx:uri"/> <xsl:value-of select="$RBRACE"/> <xsl:apply-templates select="xqx:star"/> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="xqx:Wildcard[not(*)]"> <xsl:value-of select="$STAR"/> </xsl:template> <!-- select="xqx:EQname" fixed to be select="xqx"QName"; bug 12674 --> <xsl:template name="simpleWildcard" match="xqx:simpleWildcard"> <xsl:apply-templates select="xqx:star"/> <xsl:apply-templates select="xqx:QName"/> </xsl:template> <xsl:template match="xqx:textTest"> <xsl:text>text()</xsl:text> </xsl:template> <xsl:template match="xqx:commentTest"> <xsl:text>comment()</xsl:text> </xsl:template> <xsl:template match="xqx:namespaceTest"> <xsl:text>namespace-node()</xsl:text> </xsl:template> <xsl:template match="xqx:anyKindTest"> <xsl:text>node()</xsl:text> </xsl:template> <xsl:template match="xqx:piTest"> <xsl:text>processing-instruction</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:value-of select="*"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:documentTest"> <xsl:text>document-node</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <!-- // THIS IS WRONG!! A nameText is a QName *OR* a Wildcard!!! --> <xsl:template match="xqx:nameTest"> <xsl:call-template name="renderEQName"/> </xsl:template> <xsl:template match="xqx:attributeTest"> <xsl:text>attribute</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:for-each select="xqx:attributeName"> <xsl:call-template name="simpleWildcard"/> </xsl:for-each> <xsl:if test="xqx:typeName"> <xsl:value-of select="$COMMA"/> <xsl:apply-templates select="xqx:typeName"/> </xsl:if> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:elementTest"> <xsl:text>element</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:for-each select="xqx:elementName"> <xsl:call-template name="simpleWildcard"/> </xsl:for-each> <xsl:if test="xqx:typeName"> <xsl:value-of select="$COMMA"/> <xsl:apply-templates select="xqx:typeName"/> </xsl:if> <xsl:if test="xqx:nillable"> <xsl:value-of select="$QUESTIONMARK"/> </xsl:if> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:schemaElementTest"> <xsl:text>schema-element</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:call-template name="renderEQName"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <xsl:template match="xqx:schemaAttributeTest"> <xsl:text>schema-attribute</xsl:text> <xsl:value-of select="$LPAREN"/> <xsl:call-template name="renderEQName"/> <xsl:value-of select="$RPAREN"/> </xsl:template> <!-- anyFunctionTest, part of higher-order functions --> <!-- 2012-09-07: Jim added annotation support --> <xsl:template match="xqx:anyFunctionTest"> <xsl:apply-templates select="xqx:annotation"/> <xsl:text> function(*)</xsl:text> </xsl:template> <!-- typedFunctionTest, part of higher-order functions --> <!-- 2012-09-07: Jim added annotation support --> <xsl:template match="xqx:typedFunctionTest"> <xsl:apply-templates select="xqx:annotation"/> <xsl:text> function</xsl:text> <xsl:apply-templates select="xqx:paramTypeList"/> <xsl:text> as </xsl:text> <xsl:apply-templates select="xqx:sequenceType"/> </xsl:template> <xsl:template match="xqx:paramTypeList"> <xsl:call-template name="parenthesizedList"/> </xsl:template> <!-- parenthesizedItemType, part of higher-order functions --> <xsl:template match="xqx:parenthesizedItemType"> <xsl:text> ( </xsl:text> <xsl:apply-templates/> <xsl:text> ) </xsl:text> </xsl:template> <!-- rewrote test expression per Bugzilla Bug #2523 --> <xsl:template match="xqx:stepExpr"> <xsl:if test="preceding-sibling::xqx:stepExpr"> <xsl:value-of select="$SLASH"/> </xsl:if> <xsl:apply-templates select="*"/> </xsl:template> <!-- deleted xqx:parenthesizedExpr per Bugzilla Bug #4963 --> <xsl:template match="xqx:filterExpr"> <xsl:apply-templates/> </xsl:template> <!-- part of higher-order functions --> <!-- Response to Bugzilla bug #12788 --> <!-- 2011-11-21 - Jim changed "literalFunctionItemExpr" to "namedFunctionRef" --> <xsl:template match="xqx:namedFunctionRef"> <xsl:if test="(xqx:functionName = 'node' or xqx:functionName = 'document-node' or xqx:functionName = 'element' or xqx:functionName = 'attribute' or xqx:functionName = 'schema-element' or xqx:functionName = 'schema-attribute' or xqx:functionName = 'processing-instruction' or xqx:functionName = 'comment' or xqx:functionName = 'text' or xqx:functionName = 'function' or xqx:functionName = 'namespace-node' or xqx:functionName = 'item' or xqx:functionName = 'if' or xqx:functionName = 'switch' or xqx:functionName = 'typeswitch' or xqx:functionName = 'empty-sequence') and ((not(@xqx:prefix) and not(@xqx:URI)) or (@xqx:prefix and @xqx:prefix = '') or (@xqx:URI and @xqx:URI = ''))"> <xsl:variable name="message"><xsl:text>Incorrect XQueryX: function calls must not use unqualified "reserved" name "</xsl:text><xsl:value-of select="xqx:functionName"/><xsl:text>"</xsl:text></xsl:variable> <xsl:message terminate="yes"><xsl:value-of select="$message"/></xsl:message> </xsl:if> <xsl:apply-templates select="xqx:functionName"/> <xsl:text>#</xsl:text> <xsl:apply-templates select="xqx:integerConstantExpr"/> </xsl:template> <!-- part of higher-order functions --> <!-- 2011-09-09/JM - Added annotations to inline functions --> <!-- 2011-11-21 - Jim changed "inlineFunctionItemExpr" to "inlineFunctionExpr" --> <xsl:template match="xqx:inlineFunctionExpr"> <xsl:apply-templates select="xqx:annotation"/> <xsl:text> function </xsl:text> <xsl:apply-templates select="xqx:paramList"/> <xsl:apply-templates select="xqx:typeDeclaration"/> <xsl:apply-templates select="xqx:functionBody"/> </xsl:template> <!-- rewrote pathExpr template per Bugzilla Bug #2523 --> <xsl:template match="xqx:pathExpr"> <xsl:apply-templates select="xqx:rootExpr | xqx:stepExpr"/> </xsl:template> <!-- To resolve Bugzilla bug #3446, we now escape NL (#xA) and TAB (#x9) characters in attribute values --> <xsl:template match="xqx:attributeConstructor"> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:attributeName"/> <xsl:value-of select="$EQUAL"/> <xsl:choose> <xsl:when test="xqx:attributeValue"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="quote"> <xsl:with-param name="item"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:value-of select="xqx:attributeValue"/> </xsl:with-param> <xsl:with-param name="toBeReplaced"><xsl:text>{</xsl:text></xsl:with-param> <xsl:with-param name="replacement"><xsl:text>{{</xsl:text></xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced"><xsl:text>}</xsl:text></xsl:with-param> <xsl:with-param name="replacement"><xsl:text>}}</xsl:text></xsl:with-param> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced" select="'
'"/> <xsl:with-param name="replacement">&#xA;</xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced" select="'	'"/> <xsl:with-param name="replacement">&#x9;</xsl:with-param> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$DOUBLEQUOTE"/> <xsl:for-each select="./xqx:attributeValueExpr/xqx:*"> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="."/> <xsl:value-of select="$RBRACE"/> </xsl:for-each> <xsl:value-of select="$DOUBLEQUOTE"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- replaced xqx:namespaceDeclaration per Bugzilla Bug #5343 --> <xsl:template match="xqx:namespaceDeclaration"> <xsl:text> xmlns</xsl:text> <xsl:if test="xqx:prefix"> <xsl:text>:</xsl:text> <xsl:value-of select="xqx:prefix"/> </xsl:if> <xsl:value-of select="$EQUAL"/> <xsl:call-template name="quote"> <xsl:with-param name="item"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:call-template name="globalReplace"> <xsl:with-param name="stringToBeFixed"> <xsl:value-of select="xqx:uri"/> </xsl:with-param> <xsl:with-param name="toBeReplaced"> <xsl:text>{</xsl:text> </xsl:with-param> <xsl:with-param name="replacement"> <xsl:text>{{</xsl:text> </xsl:with-param> </xsl:call-template> </xsl:with-param> <xsl:with-param name="toBeReplaced"> <xsl:text>}</xsl:text> </xsl:with-param> <xsl:with-param name="replacement"> <xsl:text>}}</xsl:text> </xsl:with-param> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="xqx:attributeList"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="xqx:elementContent"> <xsl:for-each select="*"> <xsl:if test="not(self::xqx:elementConstructor)"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LBRACE"/> </xsl:if> <xsl:apply-templates select="."/> <xsl:if test="not(self::xqx:elementConstructor)"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template match="xqx:elementConstructor"> <xsl:value-of select="$LESSTHAN"/> <xsl:apply-templates select="xqx:tagName"/> <xsl:apply-templates select="xqx:attributeList"/> <xsl:value-of select="$GREATERTHAN"/> <xsl:apply-templates select="xqx:elementContent"/> <xsl:value-of select="$LESSTHAN"/> <xsl:value-of select="$SLASH"/> <xsl:apply-templates select="xqx:tagName"/> <xsl:value-of select="$GREATERTHAN"/> </xsl:template> <xsl:template match="xqx:tagNameExpr"> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:computedElementConstructor"> <xsl:text> element </xsl:text> <xsl:apply-templates select="xqx:tagName"/> <xsl:apply-templates select="xqx:tagNameExpr"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="$SPACE"/> <xsl:apply-templates select="xqx:contentExpr"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:contentExpr"> <xsl:apply-templates/> </xsl:template> <xsl:template match="xqx:computedAttributeConstructor"> <xsl:text> attribute </xsl:text> <xsl:apply-templates select="xqx:tagName"/> <xsl:apply-templates select="xqx:tagNameExpr"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:valueExpr"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:computedDocumentConstructor"> <xsl:text> document {</xsl:text> <xsl:apply-templates select="*"/> <xsl:text> }</xsl:text> </xsl:template> <xsl:template match="xqx:computedTextConstructor"> <xsl:text> text</xsl:text> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:computedCommentConstructor"> <xsl:text> comment</xsl:text> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:computedNamespaceConstructor"> <xsl:text> namespace </xsl:text> <xsl:choose> <xsl:when test="xqx:prefix"> <xsl:value-of select="xqx:prefix"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:prefixExpr"/> <xsl:value-of select="$RBRACE"/> </xsl:otherwise> </xsl:choose> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:URIExpr"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:piTargetExpr"> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="*"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <!-- Move value braces into computedPIConstructor template from this template, Bugzilla bug #3442 --> <xsl:template match="xqx:piValueExpr"> <xsl:apply-templates select="*"/> </xsl:template> <!-- Move value braces into this template from piValueExpr template, Bugzilla bug #3442 --> <xsl:template match="xqx:computedPIConstructor"> <xsl:text> processing-instruction </xsl:text> <xsl:value-of select="xqx:piTarget"/> <xsl:apply-templates select="xqx:piTargetExpr"/> <xsl:value-of select="$LBRACE"/> <xsl:apply-templates select="xqx:piValueExpr"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:unorderedExpr"> <xsl:text> unordered</xsl:text> <xsl:value-of select="$LBRACE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="*"/> <xsl:text> </xsl:text> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:orderedExpr"> <xsl:text> ordered</xsl:text> <xsl:value-of select="$LBRACE"/> <xsl:text> </xsl:text> <xsl:apply-templates select="*"/> <xsl:text> </xsl:text> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:versionDecl"> <xsl:text>xquery </xsl:text> <xsl:if test="xqx:version"> <xsl:text>version </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:version"/> </xsl:call-template> </xsl:if> <xsl:if test="xqx:encoding and xqx:version"> <xsl:value-of select="$SPACE"/> </xsl:if> <xsl:if test="xqx:encoding"> <xsl:text>encoding </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:encoding"/> </xsl:call-template> </xsl:if> <xsl:value-of select="$SEPARATOR"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:namespaceDecl"> <xsl:text>declare namespace </xsl:text> <xsl:value-of select="xqx:prefix"/> <xsl:value-of select="$EQUAL"/> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:uri"/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:defaultNamespaceDecl"> <xsl:text>declare default </xsl:text> <xsl:value-of select="xqx:defaultNamespaceCategory"/> <xsl:text> namespace </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:uri"/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:boundarySpaceDecl"> <xsl:text>declare boundary-space </xsl:text> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:defaultCollationDecl"> <xsl:text>declare default collation </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="."/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:baseUriDecl"> <xsl:text>declare base-uri </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="."/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:constructionDecl"> <xsl:text>declare construction </xsl:text> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:orderingModeDecl"> <xsl:text>declare ordering </xsl:text> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:emptyOrderingDecl"> <xsl:text>declare default order </xsl:text> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:copyNamespacesDecl"> <xsl:text>declare copy-namespaces </xsl:text> <xsl:value-of select="xqx:preserveMode"/> <xsl:value-of select="$COMMA"/> <xsl:value-of select="xqx:inheritMode"/> </xsl:template> <xsl:template match="xqx:optionDecl"> <xsl:text>declare option </xsl:text> <xsl:apply-templates select="xqx:optionName"/> <xsl:value-of select="$SPACE"/> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:optionContents"/> </xsl:call-template> </xsl:template> <xsl:template match="xqx:decimalFormatDecl"> <xsl:if test="@xqx:default = 'true' and xqx:decimalFormatName"> <xsl:message terminate="yes">Incorrect XQueryX: xqx:decimalFormatDecl does not allow both @default=true and xqx:decimalFormatName</xsl:message> </xsl:if> <xsl:text>declare </xsl:text> <xsl:if test="@xqx:default = 'true'"> <xsl:text>default </xsl:text> </xsl:if> <xsl:text>decimal-format </xsl:text> <xsl:if test="xqx:decimalFormatName"> <xsl:apply-templates select="xqx:decimalFormatName"/> <xsl:text> </xsl:text> </xsl:if> <xsl:apply-templates select="xqx:decimalFormatParam"/> </xsl:template> <xsl:template match="xqx:decimalFormatParam"> <xsl:value-of select="xqx:decimalFormatParamName"/> <xsl:text> = </xsl:text> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:decimalFormatParamValue"/> </xsl:call-template> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="xqx:voidSequenceType"> <xsl:text>empty-sequence()</xsl:text> </xsl:template> <xsl:template match="xqx:occurrenceIndicator"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="xqx:anyItemType"> <xsl:text>item()</xsl:text> </xsl:template> <xsl:template match="xqx:sequenceType"> <xsl:apply-templates select="*"/> </xsl:template> <!-- 2011-09-09/JM - added a sequenceTypeUnion type --> <xsl:template match="xqx:sequenceTypeUnion"> <xsl:apply-templates select="xqx:sequenceType[1]"/> <xsl:if test="count(xqx:sequenceType) > 1"> <xsl:for-each select="xqx:sequenceType[position() > 1]"> <xsl:text> | </xsl:text> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:if> </xsl:template> <xsl:template match="xqx:singleType"> <xsl:apply-templates select="xqx:atomicType"/> <xsl:if test="xqx:optional"> <xsl:text>?</xsl:text> </xsl:if> </xsl:template> <xsl:template match="xqx:typeDeclaration"> <xsl:text> as </xsl:text> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="xqx:contextItemDecl"> <xsl:text>declare context item </xsl:text> <xsl:apply-templates select="xqx:typeDeclaration"/> <xsl:if test="xqx:varValue"> <xsl:value-of select="$ASSIGN"/> <xsl:apply-templates select="xqx:varValue"/> </xsl:if> <xsl:if test="xqx:external"> <xsl:text> external </xsl:text> <xsl:if test="xqx:external/xqx:varValue"> <xsl:text>:= </xsl:text> <xsl:apply-templates select="xqx:external/xqx:varValue"/> </xsl:if> </xsl:if> </xsl:template> <xsl:template match="xqx:annotation"> <xsl:value-of select="$SPACE"/> <xsl:value-of select="$PERCENT"/> <xsl:apply-templates select="xqx:annotationName"/> <xsl:if test="xqx:arguments"> <xsl:for-each select="xqx:arguments"> <xsl:call-template name="parenthesizedList"/> </xsl:for-each> </xsl:if> </xsl:template> <xsl:template match="xqx:varDecl"> <xsl:text>declare</xsl:text> <xsl:apply-templates select="xqx:annotation"/> <xsl:text> variable </xsl:text> <xsl:value-of select="$DOLLAR"/> <xsl:apply-templates select="xqx:varName"/> <xsl:apply-templates select="xqx:typeDeclaration"/> <xsl:if test="xqx:varValue"> <xsl:value-of select="$ASSIGN"/> <xsl:apply-templates select="xqx:varValue"/> </xsl:if> <xsl:if test="xqx:external"> <xsl:text> external </xsl:text> <xsl:if test="xqx:external/xqx:varValue"> <xsl:text>:= </xsl:text> <xsl:apply-templates select="xqx:external/xqx:varValue"/> </xsl:if> </xsl:if> </xsl:template> <!-- Part of fix for Bugzilla bug #3520 --> <xsl:template match="xqx:targetLocation"> <xsl:choose> <xsl:when test="position()=1"> at </xsl:when> <xsl:otherwise>,
 </xsl:otherwise> </xsl:choose> <xsl:call-template name="quote"> <xsl:with-param name="item" select="."/> </xsl:call-template> </xsl:template> <!-- Modified to fix Bugzilla bug #3520 --> <xsl:template match="xqx:schemaImport"> <xsl:text> import schema </xsl:text> <xsl:if test="xqx:defaultElementNamespace"> <xsl:text> default element namespace </xsl:text> </xsl:if> <xsl:if test="xqx:namespacePrefix"> <xsl:text> namespace </xsl:text> <xsl:value-of select="xqx:namespacePrefix"/> <xsl:value-of select="$EQUAL"/> </xsl:if> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:targetNamespace"/> </xsl:call-template> <xsl:apply-templates select="xqx:targetLocation"/> </xsl:template> <!-- Modified to fix Bugzilla bug #3520 --> <xsl:template match="xqx:moduleImport"> <xsl:text> import module </xsl:text> <xsl:if test="xqx:namespacePrefix"> <xsl:text> namespace </xsl:text> <xsl:value-of select="xqx:namespacePrefix"/> <xsl:value-of select="$EQUAL"/> </xsl:if> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:targetNamespace"/> </xsl:call-template> <xsl:apply-templates select="xqx:targetLocation"/> </xsl:template> <xsl:template match="xqx:param"> <xsl:value-of select="$DOLLAR"/> <xsl:apply-templates select="xqx:varName"/> <xsl:apply-templates select="xqx:typeDeclaration"/> </xsl:template> <xsl:template match="xqx:paramList"> <xsl:call-template name="parenthesizedList"/> </xsl:template> <xsl:template match="xqx:functionBody"> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$LBRACE"/> <xsl:value-of select="$NEWLINE"/> <xsl:apply-templates/> <xsl:value-of select="$NEWLINE"/> <xsl:value-of select="$RBRACE"/> </xsl:template> <xsl:template match="xqx:functionDecl"> <xsl:text>declare</xsl:text> <xsl:apply-templates select="xqx:annotation"/> <xsl:text> function </xsl:text> <xsl:apply-templates select="xqx:functionName"/> <xsl:apply-templates select="xqx:paramList"/> <xsl:apply-templates select="xqx:typeDeclaration"/> <xsl:choose> <xsl:when test="xqx:externalDefinition"> <xsl:text> external </xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="xqx:functionBody"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="xqx:queryBody"> <xsl:apply-templates select="*"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:moduleDecl"> <xsl:text> module namespace </xsl:text> <xsl:value-of select="xqx:prefix"/> <xsl:value-of select="$EQUAL"/> <xsl:call-template name="quote"> <xsl:with-param name="item" select="xqx:uri" /> </xsl:call-template> <xsl:value-of select="$SEPARATOR"/> <xsl:value-of select="$NEWLINE"/> </xsl:template> <xsl:template match="xqx:prolog"> <xsl:for-each select="*"> <xsl:apply-templates select="."/> <xsl:value-of select="$SEPARATOR"/> <xsl:value-of select="$NEWLINE"/> </xsl:for-each> </xsl:template> <xsl:template match="xqx:libraryModule"> <xsl:apply-templates select="xqx:moduleDecl"/> <xsl:apply-templates select="xqx:prolog"/> </xsl:template> <xsl:template match="xqx:mainModule"> <xsl:apply-templates select="xqx:prolog"/> <xsl:apply-templates select="xqx:queryBody"/> </xsl:template> <xsl:template match="xqx:module" priority="2"> <xsl:choose> <xsl:when test="xqx:versionDecl/xqx:encoding"> <xsl:variable name="enc"> <xsl:value-of select='xqx:versionDecl/xqx:encoding'/> </xsl:variable> <xsl:result-document encoding="{$enc}"> <xsl:apply-templates select="*"/> <xsl:fallback> <xsl:apply-templates select="*"/> </xsl:fallback> </xsl:result-document> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="*"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="/xqx:*"> <xsl:message terminate="yes">Incorrect XQueryX: The only top-level element permitted is xqx:module</xsl:message> </xsl:template> </xsl:stylesheet>
application/xquery+xml
Media TypeThis Appendix specifies the media type for XQueryX Version 3.0. XQueryX is the XML syntax of a language, XQuery, for querying over data from XML data sources, as specified in [XQuery 3.0: An XML Query Language].
Note:
Specification of media types is described in [RFC 3023].
This media type is being submitted to the IESG for review, approval, and registration with IANA.
This document was prepared by members of the W3C XML Query Working Group. Please send comments to public-qt-comments@w3.org, a public mailing list with archives at http://lists.w3.org/Archives/Public/public-qt-comments.
application/xquery+xml
MIME media type name: application
This media type registration is for XQueryX documents as described by the XQueryX 3.0 specification, which is located at http://www.w3.org/TR/xqueryx-30/. It is also appropriate to use this media type with later versions of the XQueryX language.
The public XQuery Web page lists more than two dozen implementations of the XQuery language, both proprietary and open source. Some of these are known to support XQueryX.
This new media type is being registered to allow for deployment of XQueryX on the World Wide Web.
There is no experimental, vendor specific, or personal tree predecessor to "application/xquery+xml", reflecting the fact that no applications currently recognize it. This new type is being registered in order to allow for the expected deployment of XQueryX 3.0 on the World Wide Web, as a first class XML application.
The intended usage of this media type is for interchange of XQueryX expressions.
Change | Bugzilla | Category | Description |
Group By clause in FLWOR expression. | None. | Substantive. | A new clause was added to the FLWOR expression to allow query writers to cause groups of tuples to be created based on the values of some expression. |
Window clause in FLWOR expression. | None. | Substantive. | A new clause was added to the FLWOR expression to allow query writers to create sliding and tumbling windows of tuples based on a number of criteria. |
Simplification of FLWOR expression. | None. | Substantive. | The syntax of the FLWOR expression was considerably relaxed, permitting most clauses (other than the return clause) to be used at almost any position (only a few clauses are allowed to be the first clause) within a FLWOR expression. |
Outer for supported in FLWOR expressions. | None. | Substantive. | The syntax of the for clause in FLWOR expressions was extended to allow the use of "outer for". |
Count clause in FLWOR expression. | None. | Substantive. | A new clause was added to the FLWOR expression to allow query writers to capture the total number of items that are returned by a (portion of a) FLWOR expression. |
Declaration of decimal number formats. | None. | Substantive. | A new option was added to the query prologue, allowing query authors to specify a named (or an unnamed default) format for decimal numbers. This allows the specification of such items as the decimal separator, the minus sign, the percent and per mille signs, and even the class of Unicode digits. |
Query version and encoding declaration. | None. | Substantive. | Allows specification of either or both of the version of XQuery to which a query adheres and the encoding of the query (e.g., UTF8, ISO8859-1). |
Enhanced validation expression. | [XQuery 1.1] Requirement: validation by type | Substantive. | Permits query authors to validate an expression against a specified XML Schema type. |
Nondeterministic external functions. | None. | Substantive. | Functions declared to be external functions can also be specified to be deterministic or nondeterministic. |
Syntax used to provide default value for external variables. | None. | Minor. | The declaration of external variables now uses ":=" to indicate the default value given to such variables, instead of the keyword "default". |
Try/catch for error handling. | None. | Substantive. | A try/catch facility is provided that allows query authors to control how errors are handled when raised by evaluation of queries. |
Context item declaration. | None. | Substantive. | It is now possible to declare both the type of and the default initial value of the context item of a query, and to specify whether its value may be provided by the external environment. |
Computed namespace constructor. | None. | Substantive. | Added new complex type and element to XQueryX schema, and new template to XQueryX stylesheet, in support of computed namespace constructors in XQuery 1.1. |
Generate proper syntax for variable names in positional variable bindings. | [XQX30] template for positionalVariableBinding | Substantive. | Modified XQueryX stylesheet template to correctly generate a "$" preceding the variable name. |
Allow positional variable bindings to be optional in window variables. | [XQX30] positionalVariableBinding should be optional in windowVars | Substantive. | Modified XQueryX schema to add minOccurs="0" on element positionalVariableBinding in windowVars complex type definition. |
XQueryX syntax must allow wildcards in the try/catch error list. | [XQX30] cannot represent a catchErrorList wildcard in XQueryX | Substantive. | In XQueryX schema, modified catchErrorList complex type definition to allow a choice between a nameText (essentially a QName) and a Wildcard. In XQueryX stylesheet, modified catchErrorList template to support Wildcard as well as nameText. |
Private functions. | None. | Substantive. | In XQueryX schema, added new attribute "private" in functionDecl complex type. In XQUeryX stylesheet, template for functionDecl, added support for @private (generate "private" for private functions and "public" for others) |
Replace "outer for" with "allowing empty". | None. | Substantive. | In XQueryX schema, forClause complex type, delete attribute "outer"; in forClauseItem complex type, add new element allowingEmpty. In XQueryX stylesheet template for forClause, remove generation of "outer"; in template for forClauseItem, generate "allowing empty". |
Higher-order functions. | None. | Substantive. | Made changes to XQueryX schema and stylesheet corresponding to new higher-order function syntax in XQuery 1.1. |
New "switch" expression ("value switch", analogous to typeswitch). | None. | Substantive. | Made changes to XQueryX schema and stylesheet corresponding to new switch syntax in XQuery 3.0. |
Support for partial function application. | None. | Substantive. | Made changes to XQueryX schema and stylesheet to support the partial function application capability of XQuery 3.0. |
XML Schema and XSLT Stylesheet | lack of syntactic symmetry between the control flow expressions | Substantive. | Eliminated the possibility of defining three "error variables" as part of the catch clause; those variables (and others) are now implicitly defined, and may be used without explicit definition. At the same time, fixed a bug in the schema and stylesheet that recognized and produced invalid syntax for the validation expression. |
Change | Bugzilla | Category | Description |
XML Schema and XSLT Stylesheet | None. | Substantive. | Added support for the string concatenation operator ("||"). |
XML Schema and XSLT Stylesheet | None. | Substantive. | Added support for the simple mapping operator ("!"). |
XML Schema and XSLT Stylesheet | None. | Substantive. | Added support for the sequenceTypeUnion in the typeswitch expression. |
XML Schema and XSLT Stylesheet | None. | Substantive. | Added support for the annotations on inline functions. |
XML Schema and XSLT Stylesheet | None. | Substantive. | Added support for new group-by syntax. |
XML Schema and XSLT Stylesheet | None. | Substantive. | Replaced the element named "literalFunctionItemExpr" with an identical element named "namedFunctionRef"; Replaced the element named "inlineFunctionItemExpr" with an identical element named "inlineFunctionExpr" |
XML Schema and XSLT Stylesheet[1] | Section 4 and Appendix B | Substantive | Removed the element mapStepExpr and added an element simpleMapExpr, thus changing the precedence of the simple map operator (!). |
XSLT Stylesheet | Appendix B | Substantive | Generate parentheses that surround the XQuery code generated for a tryCatchExpr. |
XML Schema and XSLT Stylesheet | Section 4 and Appendix B | Substantive | Provide support for (annotation) assertions in function tests. |
XML Schema and XSLT Stylesheet | Section 4 and Appendix B | Substantive | Require that a <versionDecl> element contain a <version> element, an <encoding> element, or both. Use the <encoding> element to determine the actual encoding of the generated XQuery output. |
1. This row and all following rows were added after the previously-published draft. |
Change | Bugzilla | Category | Description |
Erratum XQX.E1 | Arguably incorrect element definition in XQueryX's Schema. | Editorial. | The published XQueryX 1.0 schema defined many elements using anonymous complex types. That made it infeasible to extend the content model of those elements in other specifications that define XQueryX extensions corresponding perhaps to XQuery extensions. While conceptually simple, a number of changes were required to ensure that all elements are defined using named complex types. |
Erratum XQX.E2 and Erratum XQX.E3 | Removed element xqx:parenthesizedExpr used in example. | Editorial. | The XQueryX solution to Example 4 incorrectly contained an <xqx:parenthesizedExpr> element. That element was changed to an <xqx:sequenceExpr> element. The XSLT stylesheet in Appendix B contained a template for the transformation of <xqx:parenthesizedExpr> elements that was unnecessary and confusing; that template was deleted. |
Erratum XQX.E4 | Bug in XQueryX applet | Editorial. | The XQueryX 1.0 Recommendation linked to an obsolete version of the XQuery 1.0 grammar applet. The proper link has now been used. |
Erratum XQX.E5 | Problem with {{ and }} in a Namespace Declaration Attribute | Editorial. | The XSLT stylsheet in Appendix B contained a template for the transformation of <xqx:namespaceDeclaration> elements that failed to correctly "escape" curly braces in the same manner as does the template for the transformation of <xqx:attributeConstructor> elements. That template has been corrected. |
Introduction. | [XQX] non-normative notes | Editorial. | Added text in 1 Introduction to clarify that Notes are non-normative. |
This appendix. | None. | Editorial. | Reorganized this appendix to more clearly distinguish between substantive and editorial changes and to clearly identify incompatibilities with the previous Recommendation. |
Version number. | None. | Editorial. | Changed the version number of the spec from 1.1 to 3.0. |
Introduction. | section 1: schema and stylesheet URLs | Editorial. | Corrected the URI of the XQueryX schema document and stylesheet. |
Introduction. | section 1: version typo | Editorial. | Corrected the version number of the previous version of XQueryX. Also removed normative reference to "this" document and replaced it with a reference to the XQueryX 1.0 document. |
Change | Bugzilla | Category | Description |
XML Schema and XSLT Stylesheet | (W3C confidential email) | Editorial. | Changed the stylesheet XSLT version number to 2.0, reflecting the new use of the xsl:result-document element to control the character encoding of the generated XQuery query. |