zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #03163
[Merge] lp:~danielturcanu/zorba/xqueryx_fulltext into lp:zorba
Daniel Turcanu has proposed merging lp:~danielturcanu/zorba/xqueryx_fulltext into lp:zorba.
Requested reviews:
Zorba Coders (zorba-coders)
For more details, see:
https://code.launchpad.net/~danielturcanu/zorba/xqueryx_fulltext/+merge/87018
Fixed XQueryX for full text.
Plus some other fixes for XQueryX.
--
https://code.launchpad.net/~danielturcanu/zorba/xqueryx_fulltext/+merge/87018
Your team Zorba Coders is requested to review the proposed merge of lp:~danielturcanu/zorba/xqueryx_fulltext into lp:zorba.
=== modified file 'src/compiler/xqueryx/xqueryx_to_xquery.cpp'
--- src/compiler/xqueryx/xqueryx_to_xquery.cpp 2011-09-05 20:08:30 +0000
+++ src/compiler/xqueryx/xqueryx_to_xquery.cpp 2011-12-28 14:47:28 +0000
@@ -53,7 +53,10 @@
if(!inited)
{
xmlDocPtr doc;
- doc = xmlParseDoc((xmlChar*)xqueryx_update_xslt);
+ std::string xqueryx_full_xslt;
+ xqueryx_full_xslt += xqueryx3_0_update_xslt;
+ xqueryx_full_xslt += xqueryx_fulltext_xslt;
+ doc = xmlParseDoc((xmlChar*)xqueryx_full_xslt.c_str());
xqueryx_xslt = (xsltStylesheet*)xsltParseStylesheetDoc(doc);
// xmlFreeDoc(doc);
=== modified file 'src/compiler/xqueryx/xqueryx_xslt.cpp'
--- src/compiler/xqueryx/xqueryx_xslt.cpp 2011-07-07 07:20:10 +0000
+++ src/compiler/xqueryx/xqueryx_xslt.cpp 2011-12-28 14:47:28 +0000
@@ -23,9 +23,11 @@
namespace zorba {
-//XQueryX 3.0 (draft 14 june 2011) http://www.w3.org/TR/xqueryx-30/#Stylesheet
+//XQueryX 3.0 (draft 13 december 2011) http://www.w3.org/TR/xqueryx-30/#Stylesheet
+//XQueryX update 1.0
+//XQueryX full text http://www.w3.org/TR/xpath-full-text-10/#id-xqft-xqueryx
-const char xqueryx_update_xslt[] =
+const char xqueryx3_0_update_xslt[] =
"<?xml version=\"1.0\"?>"
"<!-- ================================================================================ -->"
"<!-- Changes from Recommendation (edition 1): -->"
@@ -75,13 +77,22 @@
"<!-- 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\" -->"
"<!-- ================================================================================ -->"
"<xsl:stylesheet version=\"1.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\""
-" xmlns:xqxuf=\"http://www.w3.org/2007/xquery-update-10\">"
-"<!-- Note that this stylesheet frequently invokes templates for"
+" xmlns:xqxuf=\"http://www.w3.org/2007/xquery-update-10\""
+" xmlns:xqxft=\"http://www.w3.org/2007/xpath-full-text\""
+" >"
+" <!-- 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"
@@ -98,14 +109,22 @@
" <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=\"NEWLINE\">"
+" <xsl:text>"
+" </xsl:text><!--my fix-->"
+" </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=\"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=\"'}'\"/>"
@@ -121,11 +140,13 @@
" <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\"/>"
@@ -134,12 +155,12 @@
" <xsl:value-of select=\"$leftEncloser\"/>"
" <xsl:for-each select=\"*\">"
" <xsl:apply-templates select=\".\"/>"
-" <xsl:if test=\"not (position()=last())\"> "
+" <xsl:if test=\"not (position()=last())\">"
" <xsl:value-of select=\"$delimiter\"/>"
-" </xsl:if> "
+" </xsl:if>"
" </xsl:for-each>"
" <xsl:value-of select=\"$rightEncloser\"/>"
-" </xsl:template> "
+" </xsl:template>"
" <xsl:template name=\"parenthesizedList\">"
" <xsl:param name=\"delimiter\" select=\"$COMMA_SPACE\"/>"
" <xsl:call-template name=\"delimitedList\">"
@@ -199,8 +220,12 @@
" <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: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>"
@@ -280,7 +305,7 @@
" <xsl:template match=\"xqx:rootExpr\">"
" <xsl:value-of select=\"$SLASH\"/>"
" </xsl:template>"
-"<!-- 2010-06-23 - Added support for partial function application -->"
+" <!-- 2010-06-23 - Added support for partial function application -->"
" <xsl:template match=\"xqx:argumentPlaceholder\">"
" <xsl:value-of select=\"$QUESTIONMARK\"/>"
" </xsl:template>"
@@ -293,13 +318,13 @@
" 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:if test=\"not(following-sibling::xqx:stepExpr or following-sibling::xqx:mapStepExpr)\">"
" <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:if test=\"not(following-sibling::xqx:stepExpr or following-sibling::xqx:mapStepExpr)\">"
" <xsl:value-of select=\"$RPAREN\"/>"
" </xsl:if>"
" </xsl:template>"
@@ -333,8 +358,8 @@
" <xsl:apply-templates select=\"xqx:argExpr\"/>"
" <xsl:value-of select=\"$RBRACE\"/>"
" </xsl:template>"
-"<!-- Response to Bugzilla bug #2528 -->"
-"<!-- Response to Bugzilla bug #12788 -->"
+" <!-- 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"
@@ -355,8 +380,14 @@
" ((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: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>"
@@ -380,8 +411,12 @@
" <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: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\"/>"
@@ -391,27 +426,60 @@
" <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: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: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\"/>"
@@ -422,24 +490,36 @@
" <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: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: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: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: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: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: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\"/>"
@@ -449,13 +529,21 @@
" <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: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\"/>"
@@ -464,8 +552,12 @@
" <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: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\"/>"
@@ -474,9 +566,15 @@
" <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: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\"/>"
@@ -520,7 +618,9 @@
" <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\">"
@@ -609,6 +709,16 @@
" <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\">"
@@ -650,7 +760,7 @@
" <xsl:apply-templates select=\"*\"/>"
" <xsl:value-of select=\"$NEWLINE\"/>"
" </xsl:template>"
-"<!-- Surrounding FLWOR expressions with parentheses completes the set -->"
+" <!-- Surrounding FLWOR expressions with parentheses completes the set -->"
" <xsl:template match=\"xqx:flworExpr\">"
" <xsl:value-of select=\"$NEWLINE\"/>"
" <xsl:value-of select=\"$LPAREN\"/>"
@@ -758,10 +868,11 @@
" <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\"/>"
+" <xsl:apply-templates select=\"xqx:sequenceType | xqx:sequenceTypeUnion\"/>"
" <xsl:text> return </xsl:text>"
" <xsl:apply-templates select=\"xqx:resultExpr\"/>"
" </xsl:template>"
@@ -898,7 +1009,7 @@
" <xsl:template match=\"xqx:Wildcard[not(*)]\">"
" <xsl:value-of select=\"$STAR\"/>"
" </xsl:template>"
-"<!-- select=\"xqx:EQname\" fixed to be select=\"xqx\"QName\"; bug 12674 -->"
+" <!-- 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\"/>"
@@ -927,7 +1038,7 @@
" <xsl:apply-templates select=\"*\"/>"
" <xsl:value-of select=\"$RPAREN\"/>"
" </xsl:template>"
-"<!-- // THIS IS WRONG!! A nameText is a QName *OR* a Wildcard!!! -->"
+" <!-- // THIS IS WRONG!! A nameText is a QName *OR* a Wildcard!!! -->"
" <xsl:template match=\"xqx:nameTest\">"
" <xsl:call-template name=\"renderEQName\"/>"
" </xsl:template>"
@@ -991,19 +1102,28 @@
" <xsl:text> ) </xsl:text>"
" </xsl:template>"
" <!-- rewrote test expression per Bugzilla Bug #2523 -->"
+" <!-- 2011-09-09/JM - Added mapStepExpr -->"
" <xsl:template match=\"xqx:stepExpr\">"
-" <xsl:if test=\"preceding-sibling::xqx:stepExpr\">"
+" <xsl:if test=\"preceding-sibling::xqx:stepExpr or preceding-sibling::xqx:mapStepExpr\">"
" <xsl:value-of select=\"$SLASH\"/>"
" </xsl:if>"
" <xsl:apply-templates select=\"*\"/>"
" </xsl:template>"
+" <!-- 2011-09-09/JM - Added mapStepExpr -->"
+" <xsl:template match=\"xqx:mapStepExpr\">"
+" <xsl:if test=\"preceding-sibling::xqx:stepExpr or preceding-sibling::xqx:mapStepExpr\">"
+" <xsl:value-of select=\"$EXCLAMATIONMARK\"/>"
+" </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 -->"
-" <xsl:template match=\"xqx:literalFunctionItemExpr\">"
+" <!-- 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"
@@ -1023,23 +1143,33 @@
" ((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: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 -->"
-" <xsl:template match=\"xqx:inlineFunctionItemExpr\">"
+" <!-- 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 -->"
+" <!-- 2011-09-09/JM - Added mapStepExpr as an alternative -->"
" <xsl:template match=\"xqx:pathExpr\">"
-" <xsl:apply-templates select=\"xqx:rootExpr | xqx:stepExpr\"/>"
+" <xsl:apply-templates select=\"xqx:rootExpr | xqx:stepExpr | xqx:mapStepExpr\"/>"
" </xsl:template>"
" <!-- To resolve Bugzilla bug #3446, we now escape NL (#xA) and TAB (#x9)"
" characters in attribute values -->"
@@ -1061,12 +1191,20 @@
" <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: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: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>"
@@ -1131,9 +1269,11 @@
" <xsl:for-each select=\"*\">"
" <xsl:if test=\"not(self::xqx:elementConstructor)\">"
" <xsl:value-of select=\"$LBRACE\"/>"
+" <xsl:value-of select=\"$SPACE\"/>"
" </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>"
@@ -1161,7 +1301,7 @@
" <xsl:value-of select=\"$SPACE\"/>"
" <xsl:value-of select=\"$LBRACE\"/>"
" <xsl:value-of select=\"$SPACE\"/>"
-" <xsl:apply-templates select=\"xqx:contentExpr\"/> "
+" <xsl:apply-templates select=\"xqx:contentExpr\"/>"
" <xsl:value-of select=\"$SPACE\"/>"
" <xsl:value-of select=\"$RBRACE\"/>"
" </xsl:template>"
@@ -1174,7 +1314,7 @@
" <xsl:apply-templates select=\"xqx:tagNameExpr\"/>"
" <xsl:value-of select=\"$SPACE\"/>"
" <xsl:value-of select=\"$LBRACE\"/>"
-" <xsl:apply-templates select=\"xqx:valueExpr\"/> "
+" <xsl:apply-templates select=\"xqx:valueExpr\"/>"
" <xsl:value-of select=\"$SPACE\"/>"
" <xsl:value-of select=\"$RBRACE\"/>"
" </xsl:template>"
@@ -1219,11 +1359,11 @@
" <xsl:apply-templates select=\"*\"/>"
" <xsl:value-of select=\"$RBRACE\"/>"
" </xsl:template>"
-"<!-- Move value braces into computedPIConstructor template from this template, Bugzilla bug #3442 -->"
+" <!-- 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 -->"
+" <!-- 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\"/>"
@@ -1361,6 +1501,16 @@
" <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\">"
@@ -1415,7 +1565,7 @@
" </xsl:if>"
" </xsl:if>"
" </xsl:template>"
-"<!-- Part of fix for Bugzilla bug #3520 -->"
+" <!-- Part of fix for Bugzilla bug #3520 -->"
" <xsl:template match=\"xqx:targetLocation\">"
" <xsl:choose>"
" <xsl:when test=\"position()=1\"> at </xsl:when>"
@@ -1425,7 +1575,7 @@
" <xsl:with-param name=\"item\" select=\".\"/>"
" </xsl:call-template>"
" </xsl:template>"
-"<!-- Modified to fix Bugzilla bug #3520 -->"
+" <!-- Modified to fix Bugzilla bug #3520 -->"
" <xsl:template match=\"xqx:schemaImport\">"
" <xsl:text> import schema </xsl:text>"
" <xsl:if test=\"xqx:defaultElementNamespace\">"
@@ -1441,7 +1591,7 @@
" </xsl:call-template>"
" <xsl:apply-templates select=\"xqx:targetLocation\"/>"
" </xsl:template>"
-"<!-- Modified to fix Bugzilla bug #3520 -->"
+" <!-- Modified to fix Bugzilla bug #3520 -->"
" <xsl:template match=\"xqx:moduleImport\">"
" <xsl:text> import module </xsl:text>"
" <xsl:if test=\"xqx:namespacePrefix\">"
@@ -1522,10 +1672,6 @@
" <xsl:message terminate=\"yes\">Incorrect XQueryX: The only top-level element permitted is xqx:module</xsl:message>"
" </xsl:template>"
" <!-- XQueryX Update -->"
-" <!-- Initial creation 2006-08-17: Jim Melton -->"
-" <!-- Added revalidationDecl 2006-08-21: Jim Melton -->"
-" <!-- Bring up to date with spec 2007-08-07: Jim Melton -->"
-" <!-- Surround updating exprs w/parens 2007-09-13: Jim Melton -->"
" <!-- revalidationDecl -->"
" <xsl:template match=\"xqxuf:revalidationDecl\">"
" <xsl:text>declare revalidation </xsl:text>"
@@ -1552,10 +1698,10 @@
" <!-- insertInto -->"
" <xsl:template match=\"xqxuf:insertInto\">"
" <xsl:if test=\"child::node()\">"
-" <xsl:text> as </xsl:text>"
+" <xsl:text>as </xsl:text>"
" </xsl:if>"
" <xsl:apply-templates/>"
-" <xsl:text> into </xsl:text>"
+" <xsl:text>into </xsl:text>"
" </xsl:template>"
" <!-- insertAsFirst -->"
" <xsl:template match=\"xqxuf:insertAsFirst\">"
@@ -1567,11 +1713,11 @@
" </xsl:template>"
" <!-- insertAfter -->"
" <xsl:template match=\"xqxuf:insertAfter\">"
-" <xsl:text> after </xsl:text>"
+" <xsl:text>after </xsl:text>"
" </xsl:template>"
" <!-- insertBefore -->"
" <xsl:template match=\"xqxuf:insertBefore\">"
-" <xsl:text> before </xsl:text>"
+" <xsl:text>before </xsl:text>"
" </xsl:template>"
" <!-- targetExpr -->"
" <xsl:template match=\"xqxuf:targetExpr\">"
@@ -1665,7 +1811,353 @@
" <xsl:text> external </xsl:text>"
" </xsl:if>"
" </xsl:template>"
-"</xsl:stylesheet>"
+;
+const char xqueryx_fulltext_xslt[] =
+" <!-- Initial creation 2006-08-17: Jim Melton -->"
+" <!-- Added ftOptionDecl, ftScoreVariableBinding 2006-08-21: Jim Melton -->"
+" <!-- First version believed complete 2006-08-29: Jim Melton -->"
+" <!-- Revised to align with 2008-01-24 draft 2008-02-08: Jim Melton -->"
+" <!-- Revised position of \"weight\" in grammar 2008-11-12: Jim Melton -->"
+" <!-- Various bug fixes 2009-07-14: Michael Dyck -->"
+" <!-- ftcontains => \"contains text\", Bug 7247 2009-09-17: Jim Melton -->"
+" <!-- with => using, stop words default, Bug 7271 2009-09-17: Jim Melton -->"
+" <!-- {} around weight values, around empty"
+" selection after pragmas 2010-09-07: Jim Melton -->"
+" <!-- ftOptionDecl -->"
+" <xsl:template match=\"xqxft:ftOptionDecl\">"
+" <xsl:text>declare ft-option </xsl:text>"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <!-- ftScoreVariableBinding -->"
+" <xsl:template match=\"xqxft:ftScoreVariableBinding\">"
+" <xsl:text> score </xsl:text>"
+" <xsl:value-of select=\"$DOLLAR\"/>"
+" <xsl:if test=\"@xqx:prefix\">"
+" <xsl:value-of select=\"@xqx:prefix\"/>"
+" <xsl:value-of select=\"$COLON\"/>"
+" </xsl:if>"
+" <xsl:value-of select=\".\"/>"
+" </xsl:template>"
+" <!-- ftcontains -->"
+" <xsl:template match=\"xqxft:ftContainsExpr\">"
+" <xsl:apply-templates select=\"xqxft:ftRangeExpr\"/>"
+" <xsl:text> contains text </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:ftSelectionExpr\"/>"
+" <xsl:apply-templates select=\"xqxft:ftIgnoreOption\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:value\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftRangeExpr\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftLiteralRangeExpr\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftSelectionExpr\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftIgnoreOption\">"
+" <xsl:text>without content </xsl:text>"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftSelection\">"
+" <xsl:apply-templates select=\"xqxft:ftSelectionSource\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" <xsl:text> </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:ftPosFilter\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftSelectionSource\">"
+" <xsl:apply-templates/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftPosFilter\">"
+" <xsl:apply-templates/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <!-- FTProximity alternative: ordered -->"
+" <xsl:template match=\"xqxft:ftOrdered\">"
+" <xsl:text>ordered </xsl:text>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- FTProximity alternative: window -->"
+" <xsl:template match=\"xqxft:ftWindow\">"
+" <xsl:text>window </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:value\"/>"
+" <xsl:text> </xsl:text>"
+" <xsl:value-of select=\"xqxft:unit\"/>"
+" <xsl:text>s</xsl:text>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- FTProximity alternative: distance -->"
+" <xsl:template match=\"xqxft:ftDistance\">"
+" <xsl:text>distance </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:ftRange\"/>"
+" <xsl:text> </xsl:text>"
+" <xsl:value-of select=\"xqxft:unit\"/>"
+" <xsl:text>s</xsl:text>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- FTProximity alternative: scope -->"
+" <xsl:template match=\"xqxft:ftScope\">"
+" <xsl:value-of select=\"xqxft:type\"/>"
+" <xsl:text> </xsl:text>"
+" <xsl:value-of select=\"xqxft:unit\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- FTProximity alternative: content -->"
+" <xsl:template match=\"xqxft:ftContent\">"
+" <xsl:value-of select=\"xqxft:location\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:exactlyRange | xqxft:exactlyLiteralRange\">"
+" <xsl:text>exactly </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:value\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:atLeastRange | xqxft:atLeastLiteralRange\">"
+" <xsl:text>at least </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:value\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:atMostRange | xqxft:atMostLiteralRange\">"
+" <xsl:text>at most </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:value\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:fromToRange | xqxft:fromToLiteralRange\">"
+" <xsl:text>from </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:lower\"/>"
+" <xsl:text> to </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:upper\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:lower\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:upper\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <!-- ftMatchOption alternative: case -->"
+" <xsl:template match=\"xqxft:case\">"
+" <xsl:text> using </xsl:text>"
+" <xsl:value-of select=\"xqxft:value\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- ftMatchOption alternative: diacritics -->"
+" <xsl:template match=\"xqxft:diacritics\">"
+" <xsl:text> using </xsl:text>"
+" <xsl:value-of select=\"xqxft:value\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- ftMatchOption alternative: stemming -->"
+" <xsl:template match=\"xqxft:stem\">"
+" <xsl:text> using </xsl:text>"
+" <xsl:value-of select=\"xqxft:value\"/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <!-- ftMatchOption alternative: thesaurus -->"
+" <xsl:template match=\"xqxft:thesaurus\">"
+" <xsl:text> using </xsl:text>"
+" <xsl:choose>"
+" <xsl:when test=\"xqxft:noThesauri\">"
+" <xsl:text>no thesaurus </xsl:text>"
+" </xsl:when>"
+" <xsl:otherwise>"
+" <xsl:apply-templates/>"
+" </xsl:otherwise>"
+" </xsl:choose>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:thesauri\">"
+" <xsl:text> </xsl:text>"
+" <xsl:text>thesaurus </xsl:text>"
+" <xsl:choose>"
+" <xsl:when test=\"child::*[2]\">"
+" <xsl:call-template name=\"parenthesizedList\"/>"
+" </xsl:when>"
+" <xsl:otherwise>"
+" <xsl:apply-templates/>"
+" </xsl:otherwise>"
+" </xsl:choose>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:default\">"
+" <xsl:text>default </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:thesaurusID\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:at\">"
+" <xsl:text>at \"</xsl:text>"
+" <xsl:value-of select=\".\"/>"
+" <xsl:text>\" </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:relationship\">"
+" <xsl:text>relationship \"</xsl:text>"
+" <xsl:value-of select=\".\"/>"
+" <xsl:text>\" </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:levels\">"
+" <xsl:apply-templates/>"
+" <xsl:text> levels </xsl:text>"
+" </xsl:template>"
+" <!-- ftMatchOption alternative: stopword -->"
+" <xsl:template match=\"xqxft:stopword\">"
+" <xsl:text>using </xsl:text>"
+" <xsl:choose>"
+" <xsl:when test=\"xqxft:noStopwords\">"
+" <xsl:text>no stop words </xsl:text>"
+" </xsl:when>"
+" <xsl:otherwise>"
+" <xsl:apply-templates/>"
+" </xsl:otherwise>"
+" </xsl:choose>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:stopwords\">"
+" <xsl:text> </xsl:text>"
+" <xsl:choose>"
+" <xsl:when test=\"xqxft:default\">"
+" <xsl:text>stop words default </xsl:text>"
+" </xsl:when>"
+" <xsl:otherwise>"
+" <xsl:text>stop words </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:ftStopWords\"/>"
+" </xsl:otherwise>"
+" </xsl:choose>"
+" <xsl:apply-templates select=\"xqxft:ftStopWordsInclExcl\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftStopWords\">"
+" <xsl:call-template name=\"ftStopWords_type\"/>"
+" </xsl:template>"
+" <xsl:template name=\"ftStopWords_type\">"
+" <xsl:choose>"
+" <xsl:when test=\"xqxft:ref\">"
+" <xsl:text>at \"</xsl:text>"
+" <xsl:value-of select=\"xqxft:ref\"/>"
+" <xsl:text>\" </xsl:text>"
+" </xsl:when>"
+" <xsl:otherwise>"
+" <xsl:apply-templates/>"
+" </xsl:otherwise>"
+" </xsl:choose>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:list\">"
+" <xsl:call-template name=\"parenthesizedList\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:FTStopWordsInclExcl\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:union\">"
+" <xsl:text>union </xsl:text>"
+" <xsl:call-template name=\"ftStopWords_type\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:except\">"
+" <xsl:text>except </xsl:text>"
+" <xsl:call-template name=\"ftStopWords_type\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:language\">"
+" <xsl:text>using language \"</xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text>\"</xsl:text>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:wildcard\">"
+" <xsl:text>using </xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:value-of select=\"$NEWLINE\"/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftAnd\">"
+" <xsl:apply-templates select=\"xqx:firstOperand\"/>"
+" <xsl:text> ftand </xsl:text>"
+" <xsl:apply-templates select=\"xqx:secondOperand\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftOr\">"
+" <xsl:apply-templates select=\"xqx:firstOperand\"/>"
+" <xsl:text> ftor </xsl:text>"
+" <xsl:apply-templates select=\"xqx:secondOperand\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftMildNot\">"
+" <xsl:apply-templates select=\"xqx:firstOperand\"/>"
+" <xsl:text> not in </xsl:text>"
+" <xsl:apply-templates select=\"xqx:secondOperand\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftUnaryNot\">"
+" <xsl:text>ftnot </xsl:text>"
+" <xsl:apply-templates select=\"xqx:operand\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftPrimaryWithOptions\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftPrimary\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:parenthesized\">"
+" <xsl:text>( </xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text> ) </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftWords\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftWordsValue\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftWordsLiteral\">"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftWordsExpression\">"
+" <xsl:text> { </xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text> } </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftAnyAllOption\">"
+" <xsl:value-of select=\".\"/>"
+" <xsl:text> </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftTimes\">"
+" <xsl:text>occurs </xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text> times </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftExtensionSelection\">"
+" <xsl:apply-templates select=\"xqxft:pragma\"/>"
+" <xsl:text> { </xsl:text>"
+" <xsl:apply-templates select=\"xqxft:ftSelection\"/>"
+" <xsl:text> } </xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft: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=\"xqxft:ftExtensionOption\">"
+" <xsl:text>using option </xsl:text>"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftExtensionName\">"
+" <xsl:if test=\"@xqx:prefix\">"
+" <xsl:value-of select=\"@xqx:prefix\"/>"
+" <xsl:value-of select=\"$COLON\"/>"
+" </xsl:if>"
+" <xsl:apply-templates/>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:ftExtensionValue\">"
+" <xsl:text> \"</xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text>\"</xsl:text>"
+" </xsl:template>"
+" <xsl:template match=\"xqxft:weight\">"
+" <xsl:text> weight { </xsl:text>"
+" <xsl:apply-templates/>"
+" <xsl:text> } </xsl:text>"
+" </xsl:template>"
+" </xsl:stylesheet>"
"";
};//end namespace zorba
=== modified file 'src/compiler/xqueryx/xqueryx_xslt.h'
--- src/compiler/xqueryx/xqueryx_xslt.h 2011-07-05 17:10:30 +0000
+++ src/compiler/xqueryx/xqueryx_xslt.h 2011-12-28 14:47:28 +0000
@@ -19,7 +19,8 @@
namespace zorba {
-extern const char xqueryx_update_xslt[];
+extern const char xqueryx3_0_update_xslt[];
+extern const char xqueryx_fulltext_xslt[];
}
=== modified file 'test/rbkt/Queries/CMakeLists.txt'
--- test/rbkt/Queries/CMakeLists.txt 2011-12-22 20:34:53 +0000
+++ test/rbkt/Queries/CMakeLists.txt 2011-12-28 14:47:28 +0000
@@ -168,6 +168,9 @@
SET (SKIP_TEST 1)
ENDIF (NEEDS_FULL_TEXT)
ENDIF (ZORBA_NO_FULL_TEXT)
+ IF(TESTNAME MATCHES "w3c_testsuite/TestSources/")
+ SET (SKIP_TEST 1)
+ ENDIF(TESTNAME MATCHES "w3c_testsuite/TestSources/")
# If WordNet thesaurus not found, skip ft-thesaurus-true tests
IF (NOT ZORBA_WORDNET_FOUND)
@@ -211,7 +214,7 @@
IF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS)
EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Steps-leading-lone-slash-8a 3408285)
- EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Functions/QNameFunc/NamespaceURIForPrefixFunc/K2-NamespaceURIForPrefixFunc-2 872732)
+ #EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Functions/QNameFunc/NamespaceURIForPrefixFunc/K2-NamespaceURIForPrefixFunc-2 872732)
IF(NOT ZORBA_WITH_BIG_INTEGER)
# These tests fail due to integer overflow.
@@ -223,6 +226,18 @@
IF(ZORBA_TEST_XQUERYX)
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/PathExpr/Steps/Steps-leading-lone-slash-8a 3408285)
+
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemContent/K2-DirectConElemContent-27 909303)
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemWhitespace/K2-DirectConElemWhitespace-25 909303)
+
+ IF(NOT ZORBA_WITH_BIG_INTEGER)
+ # These tests fail due to integer overflow.
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Operators/CompExpr/ValComp/NumericComp/NumericGT/K2-NumericGT-1 3323548)
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Operators/CompExpr/ValComp/NumericComp/NumericGT/K2-NumericGT-2 3323548)
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Operators/CompExpr/ValComp/NumericComp/NumericLT/K2-NumericLT-1 3323548)
+ EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQueryX/Operators/CompExpr/ValComp/NumericComp/NumericLT/K2-NumericLT-2 3323548)
+ ENDIF(NOT ZORBA_WITH_BIG_INTEGER)
#w3c bug
EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes011 3355019)
EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes012 3355019)
@@ -233,7 +248,7 @@
#this is marked as expected failure because the RQ uses XQTS_1_0_3. In that version the expected result is err:FODC0004 instead of err:FODC0002.
#W3C has changed the expected result for this test in the meantime: please see http://www.w3.org/Bugs/Public/show_bug.cgi?id=12542
- EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQuery/Functions/NodeSeqFunc/SeqCollectionFunc/fn-collection-2 882002)
+ #EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQuery/Functions/NodeSeqFunc/SeqCollectionFunc/fn-collection-2 882002)
ENDIF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS)
Follow ups