zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #14614
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
David Graf has proposed merging lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba.
Commit message:
- xqdoc generation for collection declarations
- xqdoc generation for index declarations (inclusive sources)
- possibility to disable xqdoc generation for certain components
Requested reviews:
Matthias Brantner (matthias-brantner)
David Graf (davidagraf)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/xqdoc-extensions/+merge/125662
- xqdoc generation for collection declarations
- xqdoc generation for index declarations (inclusive sources)
- possibility to disable xqdoc generation for certain components
--
https://code.launchpad.net/~zorba-coders/zorba/xqdoc-extensions/+merge/125662
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-09-17 00:36:37 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-09-21 10:07:25 +0000
@@ -82,6 +82,8 @@
URI "http://www.zorba-xquery.com/modules/xml")
DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.0
URI "http://www.zorba-xquery.com/modules/xqdoc")
+DECLARE_ZORBA_SCHEMA(FILE xqdoc-options.xsd
+ URI "http://www.zorba-xquery.com/modules/xqdoc-options")
IF(NOT ZORBA_NO_FULL_TEXT)
DECLARE_ZORBA_MODULE(FILE full-text.xq VERSION 2.0
=== added file 'modules/com/zorba-xquery/www/modules/xqdoc-options.xsd'
--- modules/com/zorba-xquery/www/modules/xqdoc-options.xsd 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc-options.xsd 2012-09-21 10:07:25 +0000
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+ ! Copyright 2006-2012 The FLWOR Foundation.
+ !
+ ! Licensed under the Apache License, Version 2.0 (the "License");
+ ! you may not use this file except in compliance with the License.
+ ! You may obtain a copy of the License at
+ !
+ ! http://www.apache.org/licenses/LICENSE-2.0
+ !
+ ! Unless required by applicable law or agreed to in writing, software
+ ! distributed under the License is distributed on an "AS IS" BASIS,
+ ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ! See the License for the specific language governing permissions and
+ ! limitations under the License.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.zorba-xquery.com/modules/xqdoc-options"
+ xmlns="http://www.zorba-xquery.com/modules/xqdoc-options"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified">
+
+ <xs:element name="enable">
+ <xs:complexType>
+ <xs:attribute name="comments" type="xs:boolean"/>
+ <xs:attribute name="imports" type="xs:boolean"/>
+ <xs:attribute name="variables" type="xs:boolean"/>
+ <xs:attribute name="functions" type="xs:boolean"/>
+ <xs:attribute name="collections" type="xs:boolean"/>
+ <xs:attribute name="indexes" type="xs:boolean"/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xq'
--- modules/com/zorba-xquery/www/modules/xqdoc.xq 2012-09-17 00:36:37 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xq 2012-09-21 10:07:25 +0000
@@ -33,9 +33,9 @@
: Generating a user friendly presentation of the documentation is
: accomplished in the following steps:
: <ol>
- : <li>Module-, variable-, and function declarations need to be commented
- : using the xqDoc commenting conventions. For example, this module
- : contains xqDoc-style comments</li>
+ : <li>Module, variable, function, collection, and index declarations need
+ : to be commented using the xqDoc commenting conventions. For example,
+ : this module contains xqDoc-style comments</li>
: <li>A xqDoc-enabled processor can parse such documentation and generate
: a vendor neutral XML document which stores all the information about
: the code and the comments. Such a document adheres to the xqDoc
@@ -55,12 +55,19 @@
:
: @see <a href="http://xqdoc.org/" target="_blank">xqDoc specification</a>
: @see <a href="http://www.zorba-xquery.com/tutorials/xqdoc.html" target="_blank">xqDoc tutorial with Zorba</a>
- : @author Gabriel Petrovay
+ : @author Zorba Team
: @project xqdoc
:
:)
module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
+import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
+
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
+
+import schema namespace opt =
+ "http://www.zorba-xquery.com/modules/xqdoc-options";
+
declare namespace an = "http://www.zorba-xquery.com/annotations";
declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
@@ -70,7 +77,7 @@
declare option ver:module-version "2.0";
(:~
- : Generated an XQDoc XML document for the module located
+ : Generates an XQDoc XML document for the module located
: at the URI provided as parameter to this function.
:
: @param $module-uri The URL of the module for which to
@@ -82,6 +89,53 @@
:)
declare %an:nondeterministic function xqd:xqdoc(
$module-uri as xs:string
+) as element()
+{
+ let $content := fetch:content($module-uri)
+ return xqd:xqdoc-content-impl($content, $module-uri)
+};
+
+(:~
+ : Generates an XQDoc XML document for the module located
+ : at the URI provided as parameter to this function.
+ : In comparison to the single parameter version, this function does not
+ : generate XQDoc for all language components. By default, the
+ : the following components are deactivated: XQuery comments, import
+ : statements, variable declarations, function declarations, collection
+ : declarations, and index declarations. The second parameter is used to
+ : enable the XQDoc generation of those components.
+ :
+ : @param $module-uri The URL of the module for which to
+ : generate XQDoc.
+ : @param $options XQDoc generation options, e.g.:
+ : <pre>
+ : <enable xmlns="http://www.zorba-xquery.com/modules/xqdoc-options"
+ : comments="true"
+ : functions="true"
+ : indexes="true"
+ : >
+ : </pre>
+ : @return An element according to the xqdoc schema
+ : (<tt>http://www.zorba-xquery.com/modules/xqdoc.xsd</tt>).
+ : @error zerr::ZXQD0002 if the xqdoc comments in the
+ : module contain invalid XML
+ :)
+declare function xqd:xqdoc(
+ $module-uri as xs:string,
+ $options as element(opt:enable)
+) as element()
+{
+ let $content := fetch:content($module-uri)
+ let $xqdoc-options := if ( schema:is-validated( $options ) ) then
+ $options
+ else
+ validate { $options }
+ return xqd:xqdoc-content-options-impl($content, $module-uri, $xqdoc-options)
+};
+
+declare %private function xqd:xqdoc-content-impl(
+ $module as xs:string,
+ $filename as xs:string
) as element() external;
(:~
@@ -97,4 +151,51 @@
:)
declare function xqd:xqdoc-content(
$module as xs:string
+) as element()
+{
+ xqd:xqdoc-content-impl($module, "")
+};
+
+(:~
+ : Generated the an XQDoc XML document for the module provided
+ : as parameter to this function.
+ : In comparison to the single parameter version, this function does not
+ : generate XQDoc for all language components. By default, the
+ : the following components are deactivated: XQuery comments, import
+ : statements, variable declarations, function declarations, collection
+ : declarations, and index declarations. The second parameter is used to
+ : enable the XQDoc generation of those components.
+ :
+ : @param $module The module (as string) for which to generate
+ : the XQDoc documentation.
+ : @param $options XQDoc generation options, e.g.:
+ : <pre>
+ : <enable xmlns="http://www.zorba-xquery.com/modules/xqdoc-options"
+ : comments="true"
+ : functions="true"
+ : indexes="true"
+ : >
+ : </pre>
+ : @return An element according to the xqdoc schema
+ : (<tt>http://www.zorba-xquery.com/modules/xqdoc.xsd</tt>).
+ : @error zerr::ZXQD0002 if the xqdoc comments in the
+ : module contain invalid XML
+ :)
+declare function xqd:xqdoc-content(
+ $module as xs:string,
+ $options as element(opt:enable)
+) as element()
+{
+ let $xqdoc-options := if ( schema:is-validated( $options ) ) then
+ $options
+ else
+ validate { $options }
+ return xqd:xqdoc-content-options-impl($module, "", $xqdoc-options)
+};
+
+declare %private function xqd:xqdoc-content-options-impl(
+ $module as xs:string,
+ $filename as xs:string,
+ $options as element()
) as element() external;
+
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xsd'
--- modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-09-17 00:36:37 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-09-21 10:07:25 +0000
@@ -213,6 +213,45 @@
</xsd:sequence>
</xsd:complexType>
+ <!-- Complex type used for defining the collection names defined within
+ the library module and any comments associated with the collections. -->
+ <xsd:complexType name="collections">
+ <xsd:sequence>
+ <xsd:element name="collection" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="uri" type="uri"/>
+ <xsd:element name="type" type="type" minOccurs="0"/>
+ <xsd:element name="comment" type="comment" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- Complex type used for defining the index names defined within
+ the library module and any comments associated with the indexes. -->
+ <xsd:complexType name="indexes">
+ <xsd:sequence>
+ <xsd:element name="index" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="uri" type="uri"/>
+ <xsd:element name="sources">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="source" type="uri"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="comment" type="comment" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
<!-- Complex type used for defining the imported modules within the
the library module and any comments associated with the imports. -->
<xsd:complexType name="imports">
@@ -273,6 +312,8 @@
<xsd:element name="module" type="module"/>
<xsd:element name="imports" type="imports" minOccurs="0"/>
<xsd:element name="variables" type="variables" minOccurs="0"/>
+ <xsd:element name="collections" type="collections" minOccurs="0"/>
+ <xsd:element name="indexes" type="indexes" minOccurs="0"/>
<xsd:element name="functions" type="functions" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
=== modified file 'src/compiler/api/compiler_api.cpp'
--- src/compiler/api/compiler_api.cpp 2012-09-17 00:36:37 +0000
+++ src/compiler/api/compiler_api.cpp 2012-09-21 10:07:25 +0000
@@ -112,11 +112,13 @@
std::istream& aXQuery,
const zstring& aFileName,
store::Item_t& aResult,
- const store::Item_t& aDateTime)
+ const store::Item_t& aDateTime,
+ uint32_t aOptions)
{
parsenode_t lAST = parse(aXQuery, aFileName);
- print_parsetree_xqdoc(aResult, lAST.getp(), aFileName.c_str(), aDateTime);
+ print_parsetree_xqdoc(aResult, lAST.getp(),
+ aFileName.c_str(), aDateTime, aOptions);
}
=== modified file 'src/compiler/api/compiler_api.h'
--- src/compiler/api/compiler_api.h 2012-09-17 00:36:37 +0000
+++ src/compiler/api/compiler_api.h 2012-09-21 10:07:25 +0000
@@ -25,11 +25,9 @@
namespace zorba {
-
class XQueryCompiler
{
public:
-
CompilerCB * theCompilerCB;
public:
@@ -43,7 +41,8 @@
std::istream& aXQuery,
const zstring& aFileName,
store::Item_t& aResult,
- const store::Item_t& aDateTime);
+ const store::Item_t& aDateTime,
+ uint32_t aOptions);
parsenode_t parse(std::istream& aXQuery, const zstring& aFileName);
=== added file 'src/compiler/api/compiler_api_consts.h'
--- src/compiler/api/compiler_api_consts.h 1970-01-01 00:00:00 +0000
+++ src/compiler/api/compiler_api_consts.h 2012-09-21 10:07:25 +0000
@@ -0,0 +1,37 @@
+
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+#ifndef ZORBA_COMPILER_API_CONSTS_H
+#define ZORBA_COMPILER_API_CONSTS_H
+
+namespace zorba
+{
+
+enum xqdoc_component_t
+{
+ xqdoc_component_none = 0,
+ xqdoc_component_comments = 1,
+ xqdoc_component_imports = 2,
+ xqdoc_component_variables = 4,
+ xqdoc_component_functions = 8,
+ xqdoc_component_collections = 16,
+ xqdoc_component_indexes = 32
+};
+
+}
+
+#endif
=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2012-09-17 00:36:37 +0000
+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2012-09-21 10:07:25 +0000
@@ -20,6 +20,7 @@
#include <ostream>
#include <map>
+#include <compiler/api/compiler_api_consts.h>
#include <compiler/parsetree/parsenode_print_xquery_visitor.h>
#include <compiler/parsetree/parsenode_visitor.h>
@@ -275,7 +276,7 @@
store::Item_t print_comment(store::Item_t& result, const XQDocComment* aComment)
{
- if (aComment == 0) {
+ if (!(theOptions & xqdoc_component_comments) || aComment == 0) {
return NULL;
}
list<XQDocAnnotation> lAnnotations = aComment->getAnnotations();
@@ -464,6 +465,8 @@
store::Item_t theImports;
store::Item_t theVariables;
store::Item_t theFunctions;
+ store::Item_t theCollections;
+ store::Item_t theIndexes;
// set of functions being invoked in the function
// whoes declaration is currently being processed
@@ -489,9 +492,18 @@
zstring theEncoding;
zstring theXQueryVersion;
+ uint32_t theOptions;
+
+ // helper vars to compute index sources
+ bool theIsIndexDecl;
+ bool theWaitForIndexSourceLiteral;
+ std::vector<zstring> theIndexSources;
+
public:
-ParseNodePrintXQDocVisitor(store::Item_t& aResult, const string& aFileName)
+ParseNodePrintXQDocVisitor(store::Item_t& aResult,
+ const string& aFileName,
+ uint32_t aOptions)
:
theResult(aResult),
theXQDocNS("http://www.xqdoc.org/1.0"),
@@ -499,7 +511,10 @@
theFileName(getFileName(aFileName)),
theBaseURI("http://www.xqdoc.org/1.0"),
theVersion("1.0"),
- theFactory(GENV_ITEMFACTORY)
+ theFactory(GENV_ITEMFACTORY),
+ theOptions(aOptions),
+ theIsIndexDecl(false),
+ theWaitForIndexSourceLiteral(false)
{
theNamespaceMap["fn"] = XQUERY_XPATH_FN_NS;
theNamespaceMap[""] = XQUERY_XPATH_FN_NS;
@@ -511,8 +526,8 @@
void print(const parsenode* p, const store::Item_t& aDateTime)
{
store::Item_t lXQDocQName, lControlQName, lDateQName, lVersionQName,
- lImportsQName, lVariablesQName, lFunctionsQName,
- lModuleQName, lNamespacesQName;
+ lImportsQName, lVariablesQName, lCollectionsQName,
+ lIndexesQName, lFunctionsQName, lModuleQName, lNamespacesQName;
store::Item_t lControlElem, lDateElem, lVersionElem,
lDateText, lVersionText;
@@ -523,6 +538,8 @@
theFactory->createQName(lVersionQName, theXQDocNS, theXQDocPrefix, "version");
theFactory->createQName(lImportsQName, theXQDocNS, theXQDocPrefix, "imports");
theFactory->createQName(lVariablesQName, theXQDocNS, theXQDocPrefix, "variables");
+ theFactory->createQName(lCollectionsQName, theXQDocNS, theXQDocPrefix, "collections");
+ theFactory->createQName(lIndexesQName, theXQDocNS, theXQDocPrefix, "indexes");
theFactory->createQName(lFunctionsQName, theXQDocNS, theXQDocPrefix, "functions");
theFactory->createQName(lNamespacesQName, theXQDocNS, theXQDocPrefix, "namespaces");
theFactory->createQName(lModuleQName, theXQDocNS, theXQDocPrefix, "module");
@@ -546,20 +563,45 @@
lModuleQName, lTypeName,
true, false, theNSBindings, theBaseURI);
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(theImports, theResult,
- lImportsQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(theVariables, theResult,
- lVariablesQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(theFunctions, theResult,
- lFunctionsQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
+ if (theOptions & xqdoc_component_imports)
+ {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(theImports, theResult,
+ lImportsQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ }
+
+ if (theOptions & xqdoc_component_variables)
+ {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(theVariables, theResult,
+ lVariablesQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ }
+
+ if (theOptions & xqdoc_component_collections)
+ {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(theCollections, theResult,
+ lCollectionsQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ }
+
+ if (theOptions & xqdoc_component_indexes)
+ {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(theIndexes, theResult,
+ lIndexesQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ }
+
+ if (theOptions & xqdoc_component_functions)
+ {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(theFunctions, theResult,
+ lFunctionsQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ }
// date version
lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
@@ -699,180 +741,236 @@
void end_visit(const FunctionDecl& n, void* /*visit_state*/)
{
- store::Item_t lFuncQName, lNameQName, lSigQName, lArityQName, lPrivateQName, lParamsQName;
- store::Item_t lFuncElem, lNameElem, lSigElem, lParamsElem, lFuncText, lNameText, lSigText;
- store::Item_t lArityAttr, lArityValue;
-
- theFactory->createQName(lFuncQName, theXQDocNS, theXQDocPrefix, "function");
- theFactory->createQName(lNameQName, theXQDocNS, theXQDocPrefix, "name");
- theFactory->createQName(lSigQName, theXQDocNS, theXQDocPrefix, "signature");
- theFactory->createQName(lParamsQName, theXQDocNS, theXQDocPrefix, "parameters");
- theFactory->createQName(lArityQName, "", "", "arity");
-
- store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(
- lFuncElem, theFunctions, lFuncQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- print_comment(lFuncElem, n.getComment());
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(
- lNameElem, lFuncElem, lNameQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- ostringstream lAttr;
- lAttr << (n.get_param_count());
-
- zstring lAttrString(lAttr.str().c_str());
- theFactory->createString(lArityValue, lAttrString);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createAttributeNode(
- lArityQName, lFuncElem, lArityQName, lTypeName, lArityValue);
-
- AnnotationListParsenode* lAnns = n.get_annotations();
- print_annotations(lAnns, lFuncElem);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(
- lSigElem, lFuncElem, lSigQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- const ParamList* paramList = n.get_paramlist();
- if(paramList != NULL) {
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(lParamsElem, lFuncElem, lParamsQName, lTypeName, true, false, theNSBindings, theBaseURI);
- store::Item_t lParamQName;
- for (vector<rchandle<Param> >::const_iterator it = paramList->begin();
- it != paramList->end();
- ++it)
- {
- const Param* lParam = &**it;
-
- store::Item_t lParamElem;
- theFactory->createQName(lParamQName, theXQDocNS, theXQDocPrefix, "parameter");
- theFactory->createElementNode(lParamElem, lParamsElem, lParamQName, lTypeName, true, false, theNSBindings, theBaseURI);
-
- store::Item_t lParamNameElem, lParamNameQName;
- theFactory->createQName(lParamNameQName, theXQDocNS, theXQDocPrefix, "name");
- theFactory->createElementNode(lParamNameElem, lParamElem, lParamNameQName, lTypeName, true, false, theNSBindings, theBaseURI);
-
- zstring lParamNameVal(lParam->get_name()->get_qname());
- store::Item_t lParamNameText;
- theFactory->createTextNode(lParamNameText, lParamNameElem, lParamNameVal);
-
- if(lParam->get_typedecl()) {
- if(lParam->get_typedecl()->get_itemtype()) {
- ostringstream lType;
- print_parsetree_xquery(lType, lParam->get_typedecl()->get_itemtype());
- zstring lParamTypeStr(lType.str());
-
- store::Item_t lParamTypeElem, lParamTypeQName;
- theFactory->createQName(lParamTypeQName, theXQDocNS, theXQDocPrefix, "type");
- theFactory->createElementNode(lParamTypeElem, lParamElem, lParamTypeQName, lTypeName, true, false, theNSBindings, theBaseURI);
-
- store::Item_t lParamTypeText;
- theFactory->createTextNode(lParamTypeText, lParamTypeElem, lParamTypeStr);
-
- if(lParam->get_typedecl()->get_occur()){
- stringstream os;
- print_parsetree_xquery(os, lParam->get_typedecl()->get_occur());
- if(os.str().size() == 1) {
- zstring lOccur(os.str());
- store::Item_t lOccurValue, lOccurAttrQName;
- theFactory->createString(lOccurValue, lOccur);
- theFactory->createQName(lOccurAttrQName, "", "", "occurrence");
- theFactory->createAttributeNode(
- lOccurAttrQName, lParamTypeElem, lOccurAttrQName, lTypeName, lOccurValue
- );
+ if (theOptions & xqdoc_component_functions)
+ {
+ store::Item_t lFuncQName, lNameQName, lSigQName, lArityQName, lPrivateQName, lParamsQName;
+ store::Item_t lFuncElem, lNameElem, lSigElem, lParamsElem, lFuncText, lNameText, lSigText;
+ store::Item_t lArityAttr, lArityValue;
+
+ theFactory->createQName(lFuncQName, theXQDocNS, theXQDocPrefix, "function");
+ theFactory->createQName(lNameQName, theXQDocNS, theXQDocPrefix, "name");
+ theFactory->createQName(lSigQName, theXQDocNS, theXQDocPrefix, "signature");
+ theFactory->createQName(lParamsQName, theXQDocNS, theXQDocPrefix, "parameters");
+ theFactory->createQName(lArityQName, "", "", "arity");
+
+ store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lFuncElem, theFunctions, lFuncQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ print_comment(lFuncElem, n.getComment());
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lNameElem, lFuncElem, lNameQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ ostringstream lAttr;
+ lAttr << (n.get_param_count());
+
+ zstring lAttrString(lAttr.str().c_str());
+ theFactory->createString(lArityValue, lAttrString);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createAttributeNode(
+ lArityQName, lFuncElem, lArityQName, lTypeName, lArityValue);
+
+ AnnotationListParsenode* lAnns = n.get_annotations();
+ print_annotations(lAnns, lFuncElem);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lSigElem, lFuncElem, lSigQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ const ParamList* paramList = n.get_paramlist();
+ if(paramList != NULL) {
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(lParamsElem, lFuncElem, lParamsQName, lTypeName, true, false, theNSBindings, theBaseURI);
+ store::Item_t lParamQName;
+ for (vector<rchandle<Param> >::const_iterator it = paramList->begin();
+ it != paramList->end();
+ ++it)
+ {
+ const Param* lParam = &**it;
+
+ store::Item_t lParamElem;
+ theFactory->createQName(lParamQName, theXQDocNS, theXQDocPrefix, "parameter");
+ theFactory->createElementNode(lParamElem, lParamsElem, lParamQName, lTypeName, true, false, theNSBindings, theBaseURI);
+
+ store::Item_t lParamNameElem, lParamNameQName;
+ theFactory->createQName(lParamNameQName, theXQDocNS, theXQDocPrefix, "name");
+ theFactory->createElementNode(lParamNameElem, lParamElem, lParamNameQName, lTypeName, true, false, theNSBindings, theBaseURI);
+
+ zstring lParamNameVal(lParam->get_name()->get_qname());
+ store::Item_t lParamNameText;
+ theFactory->createTextNode(lParamNameText, lParamNameElem, lParamNameVal);
+
+ if(lParam->get_typedecl()) {
+ if(lParam->get_typedecl()->get_itemtype()) {
+ ostringstream lType;
+ print_parsetree_xquery(lType, lParam->get_typedecl()->get_itemtype());
+ zstring lParamTypeStr(lType.str());
+
+ store::Item_t lParamTypeElem, lParamTypeQName;
+ theFactory->createQName(lParamTypeQName, theXQDocNS, theXQDocPrefix, "type");
+ theFactory->createElementNode(lParamTypeElem, lParamElem, lParamTypeQName, lTypeName, true, false, theNSBindings, theBaseURI);
+
+ store::Item_t lParamTypeText;
+ theFactory->createTextNode(lParamTypeText, lParamTypeElem, lParamTypeStr);
+
+ if(lParam->get_typedecl()->get_occur()){
+ stringstream os;
+ print_parsetree_xquery(os, lParam->get_typedecl()->get_occur());
+ if(os.str().size() == 1) {
+ zstring lOccur(os.str());
+ store::Item_t lOccurValue, lOccurAttrQName;
+ theFactory->createString(lOccurValue, lOccur);
+ theFactory->createQName(lOccurAttrQName, "", "", "occurrence");
+ theFactory->createAttributeNode(
+ lOccurAttrQName, lParamTypeElem, lOccurAttrQName, lTypeName, lOccurValue
+ );
+ }
}
}
}
}
}
- }
-
- if(n.get_return_type()) {
+
+ if(n.get_return_type()) {
+
+ store::Item_t lReturnElem, lReturnQName, lTypeElem, lTypeQName;
+ theFactory->createQName(lReturnQName, theXQDocNS, theXQDocPrefix, "return");
+ theFactory->createElementNode(
+ lReturnElem, lFuncElem, lReturnQName, lTypeName, true, false, theNSBindings, theBaseURI
+ );
+
+ ostringstream lType;
+ print_parsetree_xquery(lType, n.get_return_type());
+ zstring lReturnType(lType.str());
+
+ store::Item_t lReturnTypeElem, lReturnTypeQName;
+ theFactory->createQName(lReturnTypeQName, theXQDocNS, theXQDocPrefix, "type");
+ theFactory->createElementNode(lReturnTypeElem, lReturnElem, lReturnTypeQName, lTypeName, true, false, theNSBindings, theBaseURI);
- store::Item_t lReturnElem, lReturnQName, lTypeElem, lTypeQName;
- theFactory->createQName(lReturnQName, theXQDocNS, theXQDocPrefix, "return");
- theFactory->createElementNode(
- lReturnElem, lFuncElem, lReturnQName, lTypeName, true, false, theNSBindings, theBaseURI
- );
-
- ostringstream lType;
- print_parsetree_xquery(lType, n.get_return_type());
- zstring lReturnType(lType.str());
-
- store::Item_t lReturnTypeElem, lReturnTypeQName;
- theFactory->createQName(lReturnTypeQName, theXQDocNS, theXQDocPrefix, "type");
- theFactory->createElementNode(lReturnTypeElem, lReturnElem, lReturnTypeQName, lTypeName, true, false, theNSBindings, theBaseURI);
-
- store::Item_t lReturnTypeText;
- theFactory->createTextNode(lReturnTypeText, lReturnTypeElem, lReturnType);
-
- if(n.get_return_type()->get_occur()){
- stringstream os;
- print_parsetree_xquery(os, n.get_return_type()->get_occur());
- if(os.str().size() == 1) {
- zstring lOccur(os.str());
- store::Item_t lOccurValue, lOccurAttrQName;
- theFactory->createString(lOccurValue, lOccur);
- theFactory->createQName(lOccurAttrQName, "", "", "occurrence");
- theFactory->createAttributeNode(
- lOccurAttrQName, lReturnTypeElem, lOccurAttrQName, lTypeName, lOccurValue
- );
- }
- }
- }
- zstring lNameString = n.get_name()->get_qname();
- theFactory->createTextNode(lNameText, lNameElem, lNameString);
-
- ostringstream lSig;
-
- FunctionDecl lFunctionDeclClone(n.get_location(),
- n.get_name(),
- n.get_paramlist(),
- n.get_return_type(),
- 0,
- n.is_updating(),
- n.is_external());
-
- lFunctionDeclClone.set_annotations(n.get_annotations());
-
- FunctionIndex lIndex = print_parsetree_xquery(lSig, &lFunctionDeclClone);
-
- zstring lSigString = lSig.str();
- theFactory->createTextNode(lSigText, lSigElem, lSigString);
-
- // add all invoked function elements as children to the end of the current
- // function element. After this, clear the set of invoked functions
- // to be prepared for the next function declaration
- for (map<string, store::Item_t>::const_iterator lIter = theInvokedFunc.begin();
- lIter != theInvokedFunc.end(); ++lIter)
- {
- store::CopyMode lCopyMode;
- (*lIter).second->copy(lFuncElem.getp(), lCopyMode);
- }
- theInvokedFunc.clear();
-}
-
-XQDOC_NO_BEGIN_TAG (FunctionCall)
+ store::Item_t lReturnTypeText;
+ theFactory->createTextNode(lReturnTypeText, lReturnTypeElem, lReturnType);
+
+ if(n.get_return_type()->get_occur()){
+ stringstream os;
+ print_parsetree_xquery(os, n.get_return_type()->get_occur());
+ if(os.str().size() == 1) {
+ zstring lOccur(os.str());
+ store::Item_t lOccurValue, lOccurAttrQName;
+ theFactory->createString(lOccurValue, lOccur);
+ theFactory->createQName(lOccurAttrQName, "", "", "occurrence");
+ theFactory->createAttributeNode(
+ lOccurAttrQName, lReturnTypeElem, lOccurAttrQName, lTypeName, lOccurValue
+ );
+ }
+ }
+ }
+ zstring lNameString = n.get_name()->get_qname();
+ theFactory->createTextNode(lNameText, lNameElem, lNameString);
+
+ ostringstream lSig;
+
+ FunctionDecl lFunctionDeclClone(n.get_location(),
+ n.get_name(),
+ n.get_paramlist(),
+ n.get_return_type(),
+ 0,
+ n.is_updating(),
+ n.is_external());
+
+ lFunctionDeclClone.set_annotations(n.get_annotations());
+
+ FunctionIndex lIndex = print_parsetree_xquery(lSig, &lFunctionDeclClone);
+
+ zstring lSigString = lSig.str();
+ theFactory->createTextNode(lSigText, lSigElem, lSigString);
+
+ // add all invoked function elements as children to the end of the current
+ // function element. After this, clear the set of invoked functions
+ // to be prepared for the next function declaration
+ for (map<string, store::Item_t>::const_iterator lIter = theInvokedFunc.begin();
+ lIter != theInvokedFunc.end(); ++lIter)
+ {
+ store::CopyMode lCopyMode;
+ (*lIter).second->copy(lFuncElem.getp(), lCopyMode);
+ }
+ theInvokedFunc.clear();
+ }
+}
+
+XQDOC_NO_BEGIN_TAG (StringLiteral)
+void end_visit(const StringLiteral& n, void*)
+{
+ if (theWaitForIndexSourceLiteral)
+ {
+ theIndexSources.push_back(n.get_strval());
+ theWaitForIndexSourceLiteral = false;
+ }
+}
+
+
+void *begin_visit(const FunctionCall& n)
+{
+ // search for index sources if function call is in an index declaration
+ if (theOptions & xqdoc_component_indexes && theIsIndexDecl)
+ {
+ if (is_collection_call(n))
+ {
+ theWaitForIndexSourceLiteral = true;
+ }
+ }
+ return no_state;
+}
void end_visit(const FunctionCall& n, void*)
{
- rchandle<QName> lFuncName = n.get_fname();
-
- add_invoked_function(
- lFuncName->get_localname(),
- lFuncName->get_prefix(),
- (n.get_arg_list()?n.get_arg_list()->size():0),
- n.get_location());
+ if (theOptions & xqdoc_component_indexes && theIsIndexDecl)
+ theWaitForIndexSourceLiteral = false;
+
+ if (theOptions & xqdoc_component_functions)
+ {
+ rchandle<QName> lFuncName = n.get_fname();
+
+ add_invoked_function(
+ n,
+ lFuncName->get_localname(),
+ lFuncName->get_prefix(),
+ (n.get_arg_list()?n.get_arg_list()->size():0),
+ n.get_location());
+ }
+}
+
+bool is_collection_call(
+ const FunctionCall& n)
+{
+ zstring lLocalName = n.get_fname()->get_localname();
+ zstring lPrefix = n.get_fname()->get_prefix();
+ map<zstring, zstring>::iterator ite = theNamespaceMap.find(lPrefix);
+ if (ite == theNamespaceMap.end())
+ return false;
+
+ zstring lNS = ite->second;
+
+ if (lLocalName != "collection")
+ return false;
+
+ if (lNS != "http://www.zorba-xquery.com/modules/store/static/collections/dml"
+ && lNS != "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml"
+ && lNS != "http://www.w3.org/2005/xpath-functions"
+ )
+ return false;
+
+ return true;
}
void add_invoked_function (
+ const FunctionCall& n,
const zstring& aLocalName,
const zstring& aPrefix,
size_t aArity,
@@ -938,51 +1036,54 @@
void end_visit(const GlobalVarDecl& n, void*)
{
- store::Item_t lVariableQName, lUriQName;
- store::Item_t lVariableElem, lUriElem, lUriText;
-
- theFactory->createQName(lVariableQName, theXQDocNS, theXQDocPrefix, "variable");
- theFactory->createQName(lUriQName, theXQDocNS, theXQDocPrefix, "uri");
-
- store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(
- lVariableElem, theVariables, lVariableQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
- theFactory->createElementNode(
- lUriElem, lVariableElem, lUriQName, lTypeName,
- true, false, theNSBindings, theBaseURI);
-
- zstring lUriString(n.get_var_name()->get_qname());
-
- theFactory->createTextNode(lUriText, lUriElem, lUriString);
-
- store::Item_t lCommentElem = print_comment(lVariableElem, n.getComment());
-
- if (n.get_var_type())
- {
- std::stringstream os;
- print_parsetree_xquery(os , &*n.get_var_type());
- print_custom(lCommentElem, "type", os.str());
- }
-
- if (n.is_extern())
- print_custom(lCommentElem, "isExternal", "true");
-
- // add all invoked function elements as children to the end of the current
- // function element. After this, clear the set of invoked functions
- // to be prepared for the next function declaration
- for (std::map<std::string, store::Item_t>::const_iterator lIter = theInvokedFunc.begin();
- lIter != theInvokedFunc.end(); ++lIter)
- {
- store::CopyMode lCopyMode;
- (*lIter).second->copy(lVariableElem.getp(), lCopyMode);
- }
- theInvokedFunc.clear();
-
- AnnotationListParsenode* lAnns = n.get_annotations();
- print_annotations(lAnns, lVariableElem);
+ if (theOptions & xqdoc_component_variables)
+ {
+ store::Item_t lVariableQName, lUriQName;
+ store::Item_t lVariableElem, lUriElem, lUriText;
+
+ theFactory->createQName(lVariableQName, theXQDocNS, theXQDocPrefix, "variable");
+ theFactory->createQName(lUriQName, theXQDocNS, theXQDocPrefix, "uri");
+
+ store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lVariableElem, theVariables, lVariableQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lUriElem, lVariableElem, lUriQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ zstring lUriString(n.get_var_name()->get_qname());
+
+ theFactory->createTextNode(lUriText, lUriElem, lUriString);
+
+ store::Item_t lCommentElem = print_comment(lVariableElem, n.getComment());
+
+ if (n.get_var_type())
+ {
+ std::stringstream os;
+ print_parsetree_xquery(os , &*n.get_var_type());
+ print_custom(lCommentElem, "type", os.str());
+ }
+
+ if (n.is_extern())
+ print_custom(lCommentElem, "isExternal", "true");
+
+ // add all invoked function elements as children to the end of the current
+ // function element. After this, clear the set of invoked functions
+ // to be prepared for the next function declaration
+ for (std::map<std::string, store::Item_t>::const_iterator lIter = theInvokedFunc.begin();
+ lIter != theInvokedFunc.end(); ++lIter)
+ {
+ store::CopyMode lCopyMode;
+ (*lIter).second->copy(lVariableElem.getp(), lCopyMode);
+ }
+ theInvokedFunc.clear();
+
+ AnnotationListParsenode* lAnns = n.get_annotations();
+ print_annotations(lAnns, lVariableElem);
+ }
}
@@ -990,6 +1091,9 @@
void end_visit(const ModuleImport& n, void*)
{
+ // info: (theOptions & xqdoc_component_imports) check not done
+ // because imported namespaces are needed by other components
+
store::Item_t lImportQName, lUriQName, lTypeQName;
store::Item_t lImportElem, lUriElem, lUriText, lTypeAttr;
@@ -1032,6 +1136,9 @@
void end_visit(const SchemaImport& n, void*)
{
+ // info: (theOptions & xqdoc_component_imports) check not done
+ // because imported namespaces are needed by other components
+
store::Item_t lImportQName, lUriQName, lTypeQName;
store::Item_t lImportElem, lUriElem, lUriText, lTypeAttr;
@@ -1082,6 +1189,109 @@
theNamespaceMap[n.get_prefix()] = n.get_uri();
}
+XQDOC_NO_BEGIN_TAG (CollectionDecl)
+
+void end_visit(const CollectionDecl& n, void*)
+{
+ if (theOptions & xqdoc_component_collections)
+ {
+ store::Item_t lCollectionQName, lUriQName;
+ store::Item_t lCollectionElem, lUriElem, lUriText;
+
+ theFactory->createQName(lCollectionQName, theXQDocNS, theXQDocPrefix, "collection");
+ theFactory->createQName(lUriQName, theXQDocNS, theXQDocPrefix, "uri");
+
+ store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lCollectionElem, theCollections, lCollectionQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lUriElem, lCollectionElem, lUriQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ zstring lUriString(n.getName()->get_qname());
+
+ theFactory->createTextNode(lUriText, lUriElem, lUriString);
+
+ store::Item_t lCommentElem = print_comment(lCollectionElem, n.getComment());
+
+ if (n.getType())
+ {
+ std::stringstream os;
+ print_parsetree_xquery(os , &*n.getType());
+ print_custom(lCommentElem, "type", os.str());
+ }
+
+ AnnotationListParsenode* lAnns = n.get_annotations();
+ print_annotations(lAnns, lCollectionElem);
+ }
+}
+
+void *begin_visit(const AST_IndexDecl& n)
+{
+ if (theOptions & xqdoc_component_indexes)
+ {
+ theIndexSources.clear();
+ theIsIndexDecl = true;
+ }
+ return no_state;
+}
+
+void end_visit(const AST_IndexDecl& n, void*)
+{
+ if (theOptions & xqdoc_component_indexes)
+ {
+ theIsIndexDecl = false;
+
+ store::Item_t lIndexQName, lUriQName, lSourcesQName, lSourceQName;
+ store::Item_t lIndexElem, lUriElem, lUriText, lSourcesElem, lSourceElem,
+ lSourceText;
+
+ theFactory->createQName(lIndexQName, theXQDocNS, theXQDocPrefix, "index");
+ theFactory->createQName(lUriQName, theXQDocNS, theXQDocPrefix, "uri");
+ theFactory->createQName(lSourcesQName, theXQDocNS, theXQDocPrefix, "sources");
+ theFactory->createQName(lSourceQName, theXQDocNS, theXQDocPrefix, "source");
+
+ store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lIndexElem, theIndexes, lIndexQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lUriElem, lIndexElem, lUriQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lSourcesElem, lIndexElem, lSourcesQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+
+ zstring lUriString(n.getName()->get_qname());
+
+ theFactory->createTextNode(lUriText, lUriElem, lUriString);
+
+ for (std::vector<zstring>::iterator lIter = theIndexSources.begin();
+ lIter != theIndexSources.end();
+ ++lIter)
+ {
+ store::Item_t lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+ theFactory->createElementNode(
+ lSourceElem, lSourcesElem, lSourceQName, lTypeName,
+ true, false, theNSBindings, theBaseURI);
+ theFactory->createTextNode(lSourceText, lSourceElem, *lIter);
+ }
+ theIndexSources.clear();
+
+ store::Item_t lCommentElem = print_comment(lIndexElem, n.getComment());
+
+ AnnotationListParsenode* lAnns = n.get_annotations();
+ print_annotations(lAnns, lIndexElem);
+ }
+}
+
XQDOC_NO_BEGIN_END_TAG (AdditiveExpr)
@@ -1107,7 +1317,6 @@
XQDOC_NO_BEGIN_END_TAG (CatchExpr)
XQDOC_NO_BEGIN_END_TAG (CatchListExpr)
XQDOC_NO_BEGIN_END_TAG (CDataSection)
-XQDOC_NO_BEGIN_END_TAG (CollectionDecl)
XQDOC_NO_BEGIN_END_TAG (CommentTest)
XQDOC_NO_BEGIN_END_TAG (CommonContent)
XQDOC_NO_BEGIN_END_TAG (ComparisonExpr)
@@ -1190,7 +1399,6 @@
XQDOC_NO_BEGIN_END_TAG (GroupSpec)
XQDOC_NO_BEGIN_END_TAG (GroupSpecList)
XQDOC_NO_BEGIN_END_TAG (IfExpr)
-XQDOC_NO_BEGIN_END_TAG (AST_IndexDecl)
XQDOC_NO_BEGIN_END_TAG (IndexKeyList)
XQDOC_NO_BEGIN_END_TAG (IndexKeySpec)
XQDOC_NO_BEGIN_END_TAG (InsertExpr)
@@ -1253,7 +1461,6 @@
XQDOC_NO_BEGIN_END_TAG (SignList)
XQDOC_NO_BEGIN_END_TAG (SIND_DeclList)
XQDOC_NO_BEGIN_END_TAG (SingleType)
-XQDOC_NO_BEGIN_END_TAG (StringLiteral)
XQDOC_NO_BEGIN_END_TAG (StringConcatExpr)
XQDOC_NO_BEGIN_END_TAG (TextTest)
XQDOC_NO_BEGIN_END_TAG (TransformExpr)
@@ -1312,9 +1519,10 @@
store::Item_t& result,
const parsenode* p,
const string& aFileName,
- const store::Item_t& aDateTime)
+ const store::Item_t& aDateTime,
+ uint32_t aOptions)
{
- ParseNodePrintXQDocVisitor v(result, aFileName);
+ ParseNodePrintXQDocVisitor v(result, aFileName, aOptions);
v.print(p, aDateTime);
}
=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.h'
--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.h 2012-09-17 00:36:37 +0000
+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.h 2012-09-21 10:07:25 +0000
@@ -29,7 +29,8 @@
store::Item_t&,
const parsenode *p,
const std::string&,
- const store::Item_t& aDateTime);
+ const store::Item_t& aDateTime,
+ uint32_t aOptions);
} // namespace
=== modified file 'src/compiler/parsetree/parsenodes.cpp'
--- src/compiler/parsetree/parsenodes.cpp 2012-09-19 18:18:02 +0000
+++ src/compiler/parsetree/parsenodes.cpp 2012-09-21 10:07:25 +0000
@@ -913,7 +913,7 @@
rchandle<AnnotationListParsenode> aAnnotations,
SequenceType* aTypeDecl)
:
- parsenode(aLoc),
+ XQDocumentable(aLoc),
theName(aName),
theTypeDecl(aTypeDecl),
theAnnotations(aAnnotations)
@@ -953,7 +953,7 @@
IndexKeyList* key,
rchandle<AnnotationListParsenode> aAnnotations)
:
- parsenode(loc),
+ XQDocumentable(loc),
theName(name),
theDomainExpr(domainExpr),
theKey(key),
=== modified file 'src/compiler/parsetree/parsenodes.h'
--- src/compiler/parsetree/parsenodes.h 2012-09-17 00:36:37 +0000
+++ src/compiler/parsetree/parsenodes.h 2012-09-21 10:07:25 +0000
@@ -1251,7 +1251,7 @@
[*] CollectionTypeDecl ::= KindTest OccurenceIndicator?
********************************************************************************/
-class CollectionDecl : public parsenode
+class CollectionDecl : public XQDocumentable
{
protected:
rchandle<QName> theName;
@@ -1296,7 +1296,7 @@
IndexKeyOrderModifier := ("ascending" | "descending")? ("collation" UriLiteral)?
*******************************************************************************/
-class AST_IndexDecl : public parsenode
+class AST_IndexDecl : public XQDocumentable
{
protected:
rchandle<QName> theName;
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2012-09-19 18:18:02 +0000
+++ src/context/static_context.cpp 2012-09-21 10:07:25 +0000
@@ -523,12 +523,12 @@
ns == ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DDL_FN_NS ||
ns == ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DML_FN_NS ||
ns == ZORBA_SCHEMA_FN_NS ||
- ns == ZORBA_XQDOC_FN_NS ||
ns == ZORBA_RANDOM_FN_NS ||
ns == ZORBA_INTROSP_SCTX_FN_NS ||
ns == ZORBA_REFLECTION_FN_NS ||
ns == ZORBA_SCRIPTING_FN_NS ||
ns == ZORBA_STRING_FN_NS ||
+ ns == ZORBA_XQDOC_FN_NS ||
ns == ZORBA_URI_FN_NS ||
@@ -592,6 +592,7 @@
ns == ZORBA_INTROSP_SCTX_FN_NS ||
ns == ZORBA_STRING_FN_NS ||
ns == ZORBA_JSON_FN_NS ||
+ ns == ZORBA_XQDOC_FN_NS ||
#ifdef ZORBA_WITH_JSON
ns == JSONIQ_FN_NS ||
#endif
=== modified file 'src/functions/pregenerated/func_xqdoc.cpp'
--- src/functions/pregenerated/func_xqdoc.cpp 2012-09-17 00:36:37 +0000
+++ src/functions/pregenerated/func_xqdoc.cpp 2012-09-21 10:07:25 +0000
@@ -31,17 +31,17 @@
-PlanIter_t fn_zorba_xqdoc_xqdoc::codegen(
+PlanIter_t fn_zorba_xqdoc_xqdoc_content_impl::codegen(
CompilerCB*,
static_context* sctx,
const QueryLoc& loc,
std::vector<PlanIter_t>& argv,
expr& ann) const
{
- return new XQDocIterator(sctx, loc, argv);
+ return new XQDocContentIterator(sctx, loc, argv);
}
-PlanIter_t fn_zorba_xqdoc_xqdoc_content::codegen(
+PlanIter_t fn_zorba_xqdoc_xqdoc_content_options_impl::codegen(
CompilerCB*,
static_context* sctx,
const QueryLoc& loc,
@@ -56,11 +56,12 @@
{
- DECL_WITH_KIND(sctx, fn_zorba_xqdoc_xqdoc,
- (createQName("http://www.zorba-xquery.com/modules/xqdoc","","xqdoc"),
+ DECL_WITH_KIND(sctx, fn_zorba_xqdoc_xqdoc_content_impl,
+ (createQName("http://www.zorba-xquery.com/modules/xqdoc","","xqdoc-content-impl"),
+ GENV_TYPESYSTEM.STRING_TYPE_ONE,
GENV_TYPESYSTEM.STRING_TYPE_ONE,
GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
- FunctionConsts::FN_ZORBA_XQDOC_XQDOC_1);
+ FunctionConsts::FN_ZORBA_XQDOC_XQDOC_CONTENT_IMPL_2);
}
@@ -68,11 +69,13 @@
{
- DECL_WITH_KIND(sctx, fn_zorba_xqdoc_xqdoc_content,
- (createQName("http://www.zorba-xquery.com/modules/xqdoc","","xqdoc-content"),
- GENV_TYPESYSTEM.STRING_TYPE_ONE,
+ DECL_WITH_KIND(sctx, fn_zorba_xqdoc_xqdoc_content_options_impl,
+ (createQName("http://www.zorba-xquery.com/modules/xqdoc","","xqdoc-content-options-impl"),
+ GENV_TYPESYSTEM.STRING_TYPE_ONE,
+ GENV_TYPESYSTEM.STRING_TYPE_ONE,
+ GENV_TYPESYSTEM.ELEMENT_TYPE_ONE,
GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
- FunctionConsts::FN_ZORBA_XQDOC_XQDOC_CONTENT_1);
+ FunctionConsts::FN_ZORBA_XQDOC_XQDOC_CONTENT_OPTIONS_IMPL_3);
}
=== modified file 'src/functions/pregenerated/func_xqdoc.h'
--- src/functions/pregenerated/func_xqdoc.h 2012-09-17 00:36:37 +0000
+++ src/functions/pregenerated/func_xqdoc.h 2012-09-21 10:07:25 +0000
@@ -38,15 +38,14 @@
-//fn-zorba-xqdoc:xqdoc
-class fn_zorba_xqdoc_xqdoc : public function
+//fn-zorba-xqdoc:xqdoc-content-impl
+class fn_zorba_xqdoc_xqdoc_content_impl : public function
{
public:
- fn_zorba_xqdoc_xqdoc(const signature& sig, FunctionConsts::FunctionKind kind)
+ fn_zorba_xqdoc_xqdoc_content_impl(const signature& sig, FunctionConsts::FunctionKind kind)
:
function(sig, kind)
{
-setDeterministic(false);
}
@@ -54,11 +53,11 @@
};
-//fn-zorba-xqdoc:xqdoc-content
-class fn_zorba_xqdoc_xqdoc_content : public function
+//fn-zorba-xqdoc:xqdoc-content-options-impl
+class fn_zorba_xqdoc_xqdoc_content_options_impl : public function
{
public:
- fn_zorba_xqdoc_xqdoc_content(const signature& sig, FunctionConsts::FunctionKind kind)
+ fn_zorba_xqdoc_xqdoc_content_options_impl(const signature& sig, FunctionConsts::FunctionKind kind)
:
function(sig, kind)
{
=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h 2012-09-18 16:29:31 +0000
+++ src/functions/pregenerated/function_enum.h 2012-09-21 10:07:25 +0000
@@ -469,8 +469,8 @@
FN_ZORBA_STRING_IS_STREAMABLE_1,
FN_ZORBA_STRING_SPLIT_2,
FN_ZORBA_URI_DECODE_3,
- FN_ZORBA_XQDOC_XQDOC_1,
- FN_ZORBA_XQDOC_XQDOC_CONTENT_1,
+ FN_ZORBA_XQDOC_XQDOC_CONTENT_IMPL_2,
+ FN_ZORBA_XQDOC_XQDOC_CONTENT_OPTIONS_IMPL_3,
=== modified file 'src/runtime/pregenerated/iterator_enum.h'
--- src/runtime/pregenerated/iterator_enum.h 2012-09-17 00:36:37 +0000
+++ src/runtime/pregenerated/iterator_enum.h 2012-09-21 10:07:25 +0000
@@ -348,7 +348,6 @@
TYPE_StringIsStreamableIterator,
TYPE_StringSplitIterator,
TYPE_DecodeURIIterator,
- TYPE_XQDocIterator,
TYPE_XQDocContentIterator,
=== modified file 'src/runtime/spec/xqdoc/xqdoc.xml'
--- src/runtime/spec/xqdoc/xqdoc.xml 2012-09-17 00:36:37 +0000
+++ src/runtime/spec/xqdoc/xqdoc.xml 2012-09-21 10:07:25 +0000
@@ -14,30 +14,23 @@
/*******************************************************************************
********************************************************************************/
-->
-<zorba:iterator name="XQDocIterator" arity="nary">
-
- <zorba:description author="Zorba Team">zorba:XQDoc</zorba:description>
-
- <zorba:function isDeterministic="false">
- <zorba:signature localname="xqdoc" prefix="fn-zorba-xqdoc">
- <zorba:param>xs:string</zorba:param>
- <zorba:output>element()</zorba:output>
- </zorba:signature>
- </zorba:function>
-
-</zorba:iterator>
-
-<!--
-/*******************************************************************************
-********************************************************************************/
--->
<zorba:iterator name="XQDocContentIterator" arity="nary">
<zorba:description author="Zorba Team">zorba:XQDoc</zorba:description>
<zorba:function>
- <zorba:signature localname="xqdoc-content" prefix="fn-zorba-xqdoc">
- <zorba:param>xs:string</zorba:param>
+ <zorba:signature localname="xqdoc-content-impl" prefix="fn-zorba-xqdoc">
+ <zorba:param>xs:string</zorba:param>
+ <zorba:param>xs:string</zorba:param>
+ <zorba:output>element()</zorba:output>
+ </zorba:signature>
+ </zorba:function>
+
+ <zorba:function>
+ <zorba:signature localname="xqdoc-content-options-impl" prefix="fn-zorba-xqdoc">
+ <zorba:param>xs:string</zorba:param>
+ <zorba:param>xs:string</zorba:param>
+ <zorba:param>element()</zorba:param>
<zorba:output>element()</zorba:output>
</zorba:signature>
</zorba:function>
=== modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h'
--- src/runtime/visitors/pregenerated/planiter_visitor.h 2012-09-17 00:36:37 +0000
+++ src/runtime/visitors/pregenerated/planiter_visitor.h 2012-09-21 10:07:25 +0000
@@ -721,8 +721,6 @@
class DecodeURIIterator;
- class XQDocIterator;
-
class XQDocContentIterator;
@@ -1754,9 +1752,6 @@
virtual void beginVisit ( const DecodeURIIterator& ) = 0;
virtual void endVisit ( const DecodeURIIterator& ) = 0;
- virtual void beginVisit ( const XQDocIterator& ) = 0;
- virtual void endVisit ( const XQDocIterator& ) = 0;
-
virtual void beginVisit ( const XQDocContentIterator& ) = 0;
virtual void endVisit ( const XQDocContentIterator& ) = 0;
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp'
--- src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-09-19 21:40:38 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-09-21 10:07:25 +0000
@@ -4601,20 +4601,6 @@
// </DecodeURIIterator>
-// <XQDocIterator>
-void PrinterVisitor::beginVisit ( const XQDocIterator& a) {
- thePrinter.startBeginVisit("XQDocIterator", ++theId);
- printCommons( &a, theId );
- thePrinter.endBeginVisit( theId );
-}
-
-void PrinterVisitor::endVisit ( const XQDocIterator& ) {
- thePrinter.startEndVisit();
- thePrinter.endEndVisit();
-}
-// </XQDocIterator>
-
-
// <XQDocContentIterator>
void PrinterVisitor::beginVisit ( const XQDocContentIterator& a) {
thePrinter.startBeginVisit("XQDocContentIterator", ++theId);
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.h'
--- src/runtime/visitors/pregenerated/printer_visitor.h 2012-09-17 00:36:37 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.h 2012-09-21 10:07:25 +0000
@@ -1101,9 +1101,6 @@
void beginVisit( const DecodeURIIterator& );
void endVisit ( const DecodeURIIterator& );
- void beginVisit( const XQDocIterator& );
- void endVisit ( const XQDocIterator& );
-
void beginVisit( const XQDocContentIterator& );
void endVisit ( const XQDocContentIterator& );
=== modified file 'src/runtime/xqdoc/pregenerated/xqdoc.cpp'
--- src/runtime/xqdoc/pregenerated/xqdoc.cpp 2012-09-17 00:36:37 +0000
+++ src/runtime/xqdoc/pregenerated/xqdoc.cpp 2012-09-21 10:07:25 +0000
@@ -32,34 +32,6 @@
namespace zorba {
-// <XQDocIterator>
-SERIALIZABLE_CLASS_VERSIONS(XQDocIterator)
-
-void XQDocIterator::serialize(::zorba::serialization::Archiver& ar)
-{
- serialize_baseclass(ar,
- (NaryBaseIterator<XQDocIterator, PlanIteratorState>*)this);
-}
-
-
-void XQDocIterator::accept(PlanIterVisitor& v) const
-{
- v.beginVisit(*this);
-
- std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
- std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
- for ( ; lIter != lEnd; ++lIter ){
- (*lIter)->accept(v);
- }
-
- v.endVisit(*this);
-}
-
-XQDocIterator::~XQDocIterator() {}
-
-// </XQDocIterator>
-
-
// <XQDocContentIterator>
SERIALIZABLE_CLASS_VERSIONS(XQDocContentIterator)
=== modified file 'src/runtime/xqdoc/pregenerated/xqdoc.h'
--- src/runtime/xqdoc/pregenerated/xqdoc.h 2012-09-17 00:36:37 +0000
+++ src/runtime/xqdoc/pregenerated/xqdoc.h 2012-09-21 10:07:25 +0000
@@ -37,36 +37,6 @@
* zorba:XQDoc
* Author: Zorba Team
*/
-class XQDocIterator : public NaryBaseIterator<XQDocIterator, PlanIteratorState>
-{
-public:
- SERIALIZABLE_CLASS(XQDocIterator);
-
- SERIALIZABLE_CLASS_CONSTRUCTOR2T(XQDocIterator,
- NaryBaseIterator<XQDocIterator, PlanIteratorState>);
-
- void serialize( ::zorba::serialization::Archiver& ar);
-
- XQDocIterator(
- static_context* sctx,
- const QueryLoc& loc,
- std::vector<PlanIter_t>& children)
- :
- NaryBaseIterator<XQDocIterator, PlanIteratorState>(sctx, loc, children)
- {}
-
- virtual ~XQDocIterator();
-
- void accept(PlanIterVisitor& v) const;
-
- bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba:XQDoc
- * Author: Zorba Team
- */
class XQDocContentIterator : public NaryBaseIterator<XQDocContentIterator, PlanIteratorState>
{
public:
=== modified file 'src/runtime/xqdoc/xqdoc_impl.cpp'
--- src/runtime/xqdoc/xqdoc_impl.cpp 2012-09-17 00:36:37 +0000
+++ src/runtime/xqdoc/xqdoc_impl.cpp 2012-09-21 10:07:25 +0000
@@ -32,6 +32,7 @@
#include "context/uri_resolver.h"
#include "compiler/api/compiler_api.h"
+#include "compiler/api/compiler_api_consts.h"
#include "compiler/api/compilercb.h"
#include "context/dynamic_context.h"
@@ -39,86 +40,39 @@
namespace zorba {
-/*******************************************************************************
-
-********************************************************************************/
-bool
-XQDocIterator::nextImpl(store::Item_t& result, PlanState& planState) const
+/**
+ * Helper function to transfrom the option item optionally passed to the
+ * xqdoc functions into an uint32_t option value.
+ */
+void readOptions(uint32_t& aOptions, const store::Item& aOptionItem)
{
- zstring lURI;
- zstring lFileName;
- store::Item_t lItem;
- store::Item_t lURIItem = 0;
- zstring strval;
- std::string uriStr;
- static_context* lSctx;
- std::auto_ptr<internal::Resource> lResource;
- internal::StreamResource* lStream;
- std::istream* lFile;
- zstring lErrorMessage;
-
- // setup a new CompilerCB and a new XQueryCompiler
- CompilerCB lCompilerCB(*planState.theCompilerCB);
- lCompilerCB.theRootSctx = GENV.getRootStaticContext().create_child_context();
- (planState.theCompilerCB->theSctxMap)[1] = lCompilerCB.theRootSctx;
-
- XQueryCompiler lCompiler(&lCompilerCB);
-
- PlanIteratorState* state;
- DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
-
- // retrieve the URI of the module to generate xqdoc for
- if(consumeNext(lItem, theChildren[0].getp(), planState))
- {
- lFileName = lItem->getStringValue().str();
- }
-
- // resolve the uri in the surrounding static context and use
- // the URI resolver to retrieve the module
- lSctx = theSctx;
- lItem->getStringValue2(strval);
- lURI = lSctx->resolve_relative_uri(strval);
- lResource = lSctx->resolve_uri(lURI, internal::EntityData::MODULE, lErrorMessage);
- lStream = static_cast<internal::StreamResource*>(lResource.get());
- if ( ! lStream )
- {
- throw XQUERY_EXCEPTION(
- err::XQST0046,
- ERROR_PARAMS( lURI, ZED( ModuleNotFound ) ),
- ERROR_LOC( loc )
- );
- }
- lFile = lStream->getStream();
-
- // now, do the real work
- if (lFile && lFile->good())
- {
- try
- {
- // retrieve the xqdoc elements
- lCompiler.xqdoc(*lFile,
- lFileName,
- result,
- planState.theLocalDynCtx->get_current_date_time());
- }
- catch (XQueryException& e)
- {
- set_source( e, loc );
- throw;
- }
-
- STACK_PUSH(true, state);
- }
- else
- {
- throw XQUERY_EXCEPTION(
- err::XQST0046,
- ERROR_PARAMS( lURI, ZED( ModuleNotFound ) ),
- ERROR_LOC( loc )
- );
- }
-
- STACK_END(state);
+ aOptions = xqdoc_component_none;
+
+ store::Iterator_t lAttrIter = aOptionItem.getAttributes();
+ lAttrIter->open();
+ store::Item_t lAttr;
+
+ while (lAttrIter->next(lAttr))
+ {
+ zstring lLocalName = lAttr->getNodeName()->getLocalName();
+ zstring lValue = lAttr->getStringValue();
+
+ if(lValue != "true")
+ continue;
+
+ if (lLocalName == "comments")
+ aOptions |= xqdoc_component_comments;
+ else if (lLocalName == "imports")
+ aOptions |= xqdoc_component_imports;
+ else if (lLocalName == "variables")
+ aOptions |= xqdoc_component_variables;
+ else if (lLocalName == "functions")
+ aOptions |= xqdoc_component_functions;
+ else if (lLocalName == "collections")
+ aOptions |= xqdoc_component_collections;
+ else if (lLocalName == "indexes")
+ aOptions |= xqdoc_component_indexes;
+ }
}
@@ -128,8 +82,9 @@
bool
XQDocContentIterator::nextImpl(store::Item_t& result, PlanState& planState) const
{
- store::Item_t lItem;
- zstring lFileName;
+ store::Item_t lCodeItem, lFileNameItem, lOptionsItem;
+ bool lIgnoreComments = true;
+ uint32_t lXQDocOptions;
// setup a new CompilerCB and a new XQueryCompiler
CompilerCB lCompilerCB(*planState.theCompilerCB);
@@ -143,18 +98,33 @@
PlanIteratorState* state;
DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
- // retrieve the URI of the module to generate xqdoc for
- consumeNext(lItem, theChildren[0].getp(), planState);
+ // retrieve the module code to generate xqdoc for
+ consumeNext(lCodeItem, theChildren[0].getp(), planState);
+
+ consumeNext(lFileNameItem, theChildren[1].getp(), planState);
+
+ if (theChildren.size() > 2)
+ {
+ // retrieve the options
+ consumeNext(lOptionsItem, theChildren[2].getp(), planState);
+ readOptions(lXQDocOptions, *lOptionsItem);
+ }
+ else
+ {
+ // if no option passed, everything is printed
+ lXQDocOptions = 0xFFFFFFFF;
+ }
try
{
- std::istringstream is(lItem->getStringValue().c_str());
+ std::istringstream is(lCodeItem->getStringValue().c_str());
// retrieve the xqdoc elements
lCompiler.xqdoc(is,
- lFileName,
+ lFileNameItem->getStringValue(),
result,
- planState.theLocalDynCtx->get_current_date_time());
+ planState.theLocalDynCtx->get_current_date_time(),
+ lXQDocOptions);
}
catch (XQueryException& e)
{
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/basic.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/basic.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/basic.xml.res 2012-09-21 10:07:25 +0000
@@ -5,5 +5,5 @@
</xqdoc:description><xqdoc:see>http://www.kbcafe.com/rss/atom.xsd.xml</xqdoc:see></xqdoc:comment></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:id</xqdoc:uri><xqdoc:comment><xqdoc:description> Google ID
</xqdoc:description><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:authToken</xqdoc:uri></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:blub</xqdoc:uri><xqdoc:comment><xqdoc:description> test xqdoc generation for a variable declaration
whose initializer invokes a function
-</xqdoc:description></xqdoc:comment><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>current-dateTime</xqdoc:name></xqdoc:invoked></xqdoc:variable></xqdoc:variables><xqdoc:functions><xqdoc:function arity="3"><xqdoc:comment><xqdoc:description> Google Login
-</xqdoc:description><xqdoc:param>account This parameter will be deleted by the test query.</xqdoc:param><xqdoc:param>password This description must have the whitespaces normalized.</xqdoc:param><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment><xqdoc:name>gdata:login</xqdoc:name><xqdoc:signature>declare function gdata:login($account as xs:string*, $password as xs:string+, $service as xs:string?) as xs:boolean+</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>account</xqdoc:name><xqdoc:type occurrence="*">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>password</xqdoc:name><xqdoc:type occurrence="+">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>service</xqdoc:name><xqdoc:type occurrence="?">xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:return><xqdoc:type occurrence="+">xs:boolean+</xqdoc:type></xqdoc:return><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>false</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>substring-after</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>true</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.zorba-xquery.com/zorba/rest-functions</xqdoc:uri><xqdoc:name>post</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-headers</xqdoc:name><xqdoc:signature>declare function gdata:get-headers() as element(rest:headers)</xqdoc:signature><xqdoc:return><xqdoc:type>element(rest:headers)</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>error</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-google-id</xqdoc:name><xqdoc:signature>declare function gdata:get-google-id() as xs:string</xqdoc:signature><xqdoc:return><xqdoc:type>xs:string</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>encode-for-uri</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
\ No newline at end of file
+</xqdoc:description></xqdoc:comment><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>current-dateTime</xqdoc:name></xqdoc:invoked></xqdoc:variable></xqdoc:variables><xqdoc:collections/><xqdoc:indexes/><xqdoc:functions><xqdoc:function arity="3"><xqdoc:comment><xqdoc:description> Google Login
+</xqdoc:description><xqdoc:param>account This parameter will be deleted by the test query.</xqdoc:param><xqdoc:param>password This description must have the whitespaces normalized.</xqdoc:param><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment><xqdoc:name>gdata:login</xqdoc:name><xqdoc:signature>declare function gdata:login($account as xs:string*, $password as xs:string+, $service as xs:string?) as xs:boolean+</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>account</xqdoc:name><xqdoc:type occurrence="*">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>password</xqdoc:name><xqdoc:type occurrence="+">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>service</xqdoc:name><xqdoc:type occurrence="?">xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:return><xqdoc:type occurrence="+">xs:boolean+</xqdoc:type></xqdoc:return><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>false</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>substring-after</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>true</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.zorba-xquery.com/zorba/rest-functions</xqdoc:uri><xqdoc:name>post</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-headers</xqdoc:name><xqdoc:signature>declare function gdata:get-headers() as element(rest:headers)</xqdoc:signature><xqdoc:return><xqdoc:type>element(rest:headers)</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>error</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-google-id</xqdoc:name><xqdoc:signature>declare function gdata:get-google-id() as xs:string</xqdoc:signature><xqdoc:return><xqdoc:type>xs:string</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>encode-for-uri</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== added file 'test/rbkt/ExpQueryResults/zorba/xqdoc/basic_options.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/basic_options.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/basic_options.xml.res 2012-09-21 10:07:25 +0000
@@ -0,0 +1,86 @@
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0">
+ <xqdoc:control>
+ <xqdoc:date/>
+ <xqdoc:version>1.0</xqdoc:version>
+ </xqdoc:control>
+ <xqdoc:module type="library">
+ <xqdoc:uri>http://www.28msec.com/modules/gdata</xqdoc:uri>
+ <xqdoc:name>gdata.xqlib</xqdoc:name>
+ <xqdoc:custom tag="namespaces">
+ <xqdoc:namespace prefix="atom" uri="http://www.w3.org/2005/Atom" isSchema="true"/>
+ <xqdoc:namespace prefix="atompub" uri="http://www.28msec.com/modules/atom" isSchema="false"/>
+ <xqdoc:namespace prefix="gdata" uri="http://www.28msec.com/modules/gdata" isSchema="false"/>
+ <xqdoc:namespace prefix="rest" uri="http://www.zorba-xquery.com/zorba/rest-functions" isSchema="false"/>
+ <xqdoc:namespace prefix="zorba" uri="http://www.zorba-xquery.com/zorba/internal-functions" isSchema="false"/>
+ </xqdoc:custom>
+ </xqdoc:module>
+ <xqdoc:functions>
+ <xqdoc:function arity="3">
+ <xqdoc:name>gdata:login</xqdoc:name>
+ <xqdoc:signature>declare function gdata:login($account as xs:string*, $password as xs:string+, $service as xs:string?) as xs:boolean+</xqdoc:signature>
+ <xqdoc:parameters>
+ <xqdoc:parameter>
+ <xqdoc:name>account</xqdoc:name>
+ <xqdoc:type occurrence="*">xs:string</xqdoc:type>
+ </xqdoc:parameter>
+ <xqdoc:parameter>
+ <xqdoc:name>password</xqdoc:name>
+ <xqdoc:type occurrence="+">xs:string</xqdoc:type>
+ </xqdoc:parameter>
+ <xqdoc:parameter>
+ <xqdoc:name>service</xqdoc:name>
+ <xqdoc:type occurrence="?">xs:string</xqdoc:type>
+ </xqdoc:parameter>
+ </xqdoc:parameters>
+ <xqdoc:return>
+ <xqdoc:type occurrence="+">xs:boolean+</xqdoc:type>
+ </xqdoc:return>
+ <xqdoc:invoked arity="0">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>current-dateTime</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="0">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>false</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="2">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>substring-after</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="0">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>true</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="2">
+ <xqdoc:uri>http://www.zorba-xquery.com/zorba/rest-functions</xqdoc:uri>
+ <xqdoc:name>post</xqdoc:name>
+ </xqdoc:invoked>
+ </xqdoc:function>
+ <xqdoc:function arity="0">
+ <xqdoc:name>gdata:get-headers</xqdoc:name>
+ <xqdoc:signature>declare function gdata:get-headers() as element(rest:headers)</xqdoc:signature>
+ <xqdoc:return>
+ <xqdoc:type>element(rest:headers)</xqdoc:type>
+ </xqdoc:return>
+ <xqdoc:invoked arity="1">
+ <xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri>
+ <xqdoc:name>QName</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="2">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>error</xqdoc:name>
+ </xqdoc:invoked>
+ </xqdoc:function>
+ <xqdoc:function arity="0">
+ <xqdoc:name>gdata:get-google-id</xqdoc:name>
+ <xqdoc:signature>declare function gdata:get-google-id() as xs:string</xqdoc:signature>
+ <xqdoc:return>
+ <xqdoc:type>xs:string</xqdoc:type>
+ </xqdoc:return>
+ <xqdoc:invoked arity="1">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>encode-for-uri</xqdoc:name>
+ </xqdoc:invoked>
+ </xqdoc:function>
+ </xqdoc:functions>
+</xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/basic_with_error.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/basic_with_error.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/basic_with_error.xml.res 2012-09-21 10:07:25 +0000
@@ -1,1 +1,1 @@
-zerr:ZXQD0001 "rest1": prefix not declared when calling function "post" from gdata_error.xqlib:24.20-88
+zerr:ZXQD0001 "rest1": prefix not declared when calling function "post" from
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/content.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/content.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/content.xml.res 2012-09-21 10:07:25 +0000
@@ -5,5 +5,5 @@
</xqdoc:description><xqdoc:see>http://www.kbcafe.com/rss/atom.xsd.xml</xqdoc:see></xqdoc:comment></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:id</xqdoc:uri><xqdoc:comment><xqdoc:description> Google ID
</xqdoc:description><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:authToken</xqdoc:uri></xqdoc:variable><xqdoc:variable><xqdoc:uri>gdata:blub</xqdoc:uri><xqdoc:comment><xqdoc:description> test xqdoc generation for a variable declaration
whose initializer invokes a function
-</xqdoc:description></xqdoc:comment><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>current-dateTime</xqdoc:name></xqdoc:invoked></xqdoc:variable></xqdoc:variables><xqdoc:functions><xqdoc:function arity="3"><xqdoc:comment><xqdoc:description> Google Login
-</xqdoc:description><xqdoc:param>account This parameter will be deleted by the test query.</xqdoc:param><xqdoc:param>password This description must have the whitespaces normalized.</xqdoc:param><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment><xqdoc:name>gdata:login</xqdoc:name><xqdoc:signature>declare function gdata:login($account as xs:string*, $password as xs:string+, $service as xs:string?) as xs:boolean+</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>account</xqdoc:name><xqdoc:type occurrence="*">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>password</xqdoc:name><xqdoc:type occurrence="+">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>service</xqdoc:name><xqdoc:type occurrence="?">xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:return><xqdoc:type occurrence="+">xs:boolean+</xqdoc:type></xqdoc:return><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>false</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>substring-after</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>true</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.zorba-xquery.com/zorba/rest-functions</xqdoc:uri><xqdoc:name>post</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-headers</xqdoc:name><xqdoc:signature>declare function gdata:get-headers() as element(rest:headers)</xqdoc:signature><xqdoc:return><xqdoc:type>element(rest:headers)</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>error</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-google-id</xqdoc:name><xqdoc:signature>declare function gdata:get-google-id() as xs:string</xqdoc:signature><xqdoc:return><xqdoc:type>xs:string</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>encode-for-uri</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
\ No newline at end of file
+</xqdoc:description></xqdoc:comment><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>current-dateTime</xqdoc:name></xqdoc:invoked></xqdoc:variable></xqdoc:variables><xqdoc:collections/><xqdoc:indexes/><xqdoc:functions><xqdoc:function arity="3"><xqdoc:comment><xqdoc:description> Google Login
+</xqdoc:description><xqdoc:param>account This parameter will be deleted by the test query.</xqdoc:param><xqdoc:param>password This description must have the whitespaces normalized.</xqdoc:param><xqdoc:see>http://www.google.com</xqdoc:see></xqdoc:comment><xqdoc:name>gdata:login</xqdoc:name><xqdoc:signature>declare function gdata:login($account as xs:string*, $password as xs:string+, $service as xs:string?) as xs:boolean+</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>account</xqdoc:name><xqdoc:type occurrence="*">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>password</xqdoc:name><xqdoc:type occurrence="+">xs:string</xqdoc:type></xqdoc:parameter><xqdoc:parameter><xqdoc:name>service</xqdoc:name><xqdoc:type occurrence="?">xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:return><xqdoc:type occurrence="+">xs:boolean+</xqdoc:type></xqdoc:return><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>false</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>substring-after</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="0"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>true</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.zorba-xquery.com/zorba/rest-functions</xqdoc:uri><xqdoc:name>post</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-headers</xqdoc:name><xqdoc:signature>declare function gdata:get-headers() as element(rest:headers)</xqdoc:signature><xqdoc:return><xqdoc:type>element(rest:headers)</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>error</xqdoc:name></xqdoc:invoked></xqdoc:function><xqdoc:function arity="0"><xqdoc:name>gdata:get-google-id</xqdoc:name><xqdoc:signature>declare function gdata:get-google-id() as xs:string</xqdoc:signature><xqdoc:return><xqdoc:type>xs:string</xqdoc:type></xqdoc:return><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>encode-for-uri</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== added file 'test/rbkt/ExpQueryResults/zorba/xqdoc/content_options.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/content_options.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/content_options.xml.res 2012-09-21 10:07:25 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0">
+ <xqdoc:control>
+ <xqdoc:date/>
+ <xqdoc:version>1.0</xqdoc:version>
+ </xqdoc:control>
+ <xqdoc:module type="library">
+ <xqdoc:uri>http://www.28msec.com/modules/gdata</xqdoc:uri>
+ <xqdoc:name></xqdoc:name>
+ <xqdoc:custom tag="namespaces">
+ <xqdoc:namespace prefix="atom" uri="http://www.w3.org/2005/Atom" isSchema="true"/>
+ <xqdoc:namespace prefix="atompub" uri="http://www.28msec.com/modules/atom" isSchema="false"/>
+ <xqdoc:namespace prefix="gdata" uri="http://www.28msec.com/modules/gdata" isSchema="false"/>
+ <xqdoc:namespace prefix="rest" uri="http://www.zorba-xquery.com/zorba/rest-functions" isSchema="false"/>
+ <xqdoc:namespace prefix="zorba" uri="http://www.zorba-xquery.com/zorba/internal-functions" isSchema="false"/>
+ </xqdoc:custom>
+ </xqdoc:module>
+ <xqdoc:variables>
+ <xqdoc:variable>
+ <xqdoc:uri>gdata:version</xqdoc:uri>
+ </xqdoc:variable>
+ <xqdoc:variable>
+ <xqdoc:uri>gdata:id</xqdoc:uri>
+ </xqdoc:variable>
+ <xqdoc:variable>
+ <xqdoc:uri>gdata:authToken</xqdoc:uri>
+ </xqdoc:variable>
+ <xqdoc:variable>
+ <xqdoc:uri>gdata:blub</xqdoc:uri>
+ </xqdoc:variable>
+ </xqdoc:variables>
+</xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/indentation.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/indentation.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/indentation.xml.res 2012-09-21 10:07:25 +0000
@@ -14,6 +14,32 @@
<xqdoc:uri>http://www.zorba-xquery.com/modules/xqdoc</xqdoc:uri>
</xqdoc:import>
</xqdoc:imports>
- <xqdoc:variables/>
+ <xqdoc:variables>
+ <xqdoc:variable>
+ <xqdoc:uri>local:dir</xqdoc:uri>
+ <xqdoc:invoked arity="0">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>last</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="0">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>static-base-uri</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="1">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>string-length</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="3">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>substring</xqdoc:name>
+ </xqdoc:invoked>
+ <xqdoc:invoked arity="2">
+ <xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri>
+ <xqdoc:name>tokenize</xqdoc:name>
+ </xqdoc:invoked>
+ </xqdoc:variable>
+ </xqdoc:variables>
+ <xqdoc:collections/>
+ <xqdoc:indexes/>
<xqdoc:functions/>
-</xqdoc:xqdoc>
\ No newline at end of file
+</xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2012-09-21 10:07:25 +0000
@@ -1,1 +1,1 @@
-<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="main"><xqdoc:uri>local.xqlib</xqdoc:uri><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="ann" uri="http://www.zorba-xquery.com/annotations" isSchema="false"/><xqdoc:namespace prefix="xqd" uri="http://www.zorba-xquery.com/modules/xqdoc" isSchema="false"/><xqdoc:namespace prefix="xqds" uri="http://www.xqdoc.org/1.0" isSchema="true"/></xqdoc:custom></xqdoc:module><xqdoc:imports><xqdoc:import type="schema"><xqdoc:uri>http://www.xqdoc.org/1.0</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.zorba-xquery.com/modules/xqdoc</xqdoc:uri></xqdoc:import></xqdoc:imports><xqdoc:variables/><xqdoc:functions><xqdoc:function arity="1"><xqdoc:name>local:remove-date</xqdoc:name><xqdoc:annotations><xqdoc:annotation namespace="http://www.zorba-xquery.com/annotations" localname="sequential" prefix="ann" value=""/></xqdoc:annotations><xqdoc:signature>declare %ann:sequential function local:remove-date($xqdoc)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>xqdoc</xqdoc:name></xqdoc:parameter></xqdoc:parameters></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="main"><xqdoc:uri>local.xqlib</xqdoc:uri><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="ann" uri="http://www.zorba-xquery.com/annotations" isSchema="false"/><xqdoc:namespace prefix="xqd" uri="http://www.zorba-xquery.com/modules/xqdoc" isSchema="false"/><xqdoc:namespace prefix="xqds" uri="http://www.xqdoc.org/1.0" isSchema="true"/></xqdoc:custom></xqdoc:module><xqdoc:imports><xqdoc:import type="schema"><xqdoc:uri>http://www.xqdoc.org/1.0</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.zorba-xquery.com/modules/xqdoc</xqdoc:uri></xqdoc:import></xqdoc:imports><xqdoc:variables/><xqdoc:collections/><xqdoc:indexes/><xqdoc:functions><xqdoc:function arity="1"><xqdoc:name>local:remove-date</xqdoc:name><xqdoc:annotations><xqdoc:annotation namespace="http://www.zorba-xquery.com/annotations" localname="sequential" prefix="ann" value=""/></xqdoc:annotations><xqdoc:signature>declare %ann:sequential function local:remove-date($xqdoc)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>xqdoc</xqdoc:name></xqdoc:parameter></xqdoc:parameters></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2012-09-21 10:07:25 +0000
@@ -1,1 +1,1 @@
-<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>foo:bar</xqdoc:uri><xqdoc:name>no_global_var.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="ann" uri="http://www.zorba-xquery.com/annotations" isSchema="false"/><xqdoc:namespace prefix="foo" uri="foo:bar" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports/><xqdoc:variables><xqdoc:variable><xqdoc:uri>foo:foo</xqdoc:uri></xqdoc:variable></xqdoc:variables><xqdoc:functions><xqdoc:function arity="0"><xqdoc:name>foo:bar</xqdoc:name><xqdoc:annotations><xqdoc:annotation namespace="http://www.zorba-xquery.com/annotations" localname="sequential" prefix="ann" value=""/></xqdoc:annotations><xqdoc:signature>declare %ann:sequential function foo:bar()</xqdoc:signature><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>concat</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>foo:bar</xqdoc:uri><xqdoc:name>no_global_var.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="ann" uri="http://www.zorba-xquery.com/annotations" isSchema="false"/><xqdoc:namespace prefix="foo" uri="foo:bar" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports/><xqdoc:variables><xqdoc:variable><xqdoc:uri>foo:foo</xqdoc:uri></xqdoc:variable></xqdoc:variables><xqdoc:collections></xqdoc:collections><xqdoc:indexes></xqdoc:indexes><xqdoc:functions><xqdoc:function arity="0"><xqdoc:name>foo:bar</xqdoc:name><xqdoc:annotations><xqdoc:annotation namespace="http://www.zorba-xquery.com/annotations" localname="sequential" prefix="ann" value=""/></xqdoc:annotations><xqdoc:signature>declare %ann:sequential function foo:bar()</xqdoc:signature><xqdoc:invoked arity="2"><xqdoc:uri>http://www.w3.org/2005/xpath-functions</xqdoc:uri><xqdoc:name>concat</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/testSchemaTypes.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/testSchemaTypes.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/testSchemaTypes.xml.res 2012-09-21 10:07:25 +0000
@@ -1,1 +1,1 @@
-<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>http://www.example.com/testModule</xqdoc:uri><xqdoc:name>image.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="image" uri="http://www.zorba-xquery.com/modules/image/image" isSchema="true"/><xqdoc:namespace prefix="testModule" uri="http://www.example.com/testModule" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports><xqdoc:import type="schema"><xqdoc:uri>http://www.zorba-xquery.com/modules/image/image</xqdoc:uri></xqdoc:import></xqdoc:imports><xqdoc:variables/><xqdoc:functions><xqdoc:function arity="1"><xqdoc:name>testModule:test</xqdoc:name><xqdoc:signature>declare function testModule:test($image as image:imageType)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>image</xqdoc:name><xqdoc:type>image:imageType</xqdoc:type></xqdoc:parameter></xqdoc:parameters></xqdoc:function><xqdoc:function arity="1"><xqdoc:name>testModule:test2</xqdoc:name><xqdoc:signature>declare function testModule:test2($image as xs:string)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>image</xqdoc:name><xqdoc:type>xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:invoked arity="1"><xqdoc:uri>http://www.example.com/testModule</xqdoc:uri><xqdoc:name>test</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="1"><xqdoc:uri>http://www.zorba-xquery.com/modules/image/image</xqdoc:uri><xqdoc:name>imageType</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
\ No newline at end of file
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>http://www.example.com/testModule</xqdoc:uri><xqdoc:name>image.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="image" uri="http://www.zorba-xquery.com/modules/image/image" isSchema="true"/><xqdoc:namespace prefix="testModule" uri="http://www.example.com/testModule" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports><xqdoc:import type="schema"><xqdoc:uri>http://www.zorba-xquery.com/modules/image/image</xqdoc:uri></xqdoc:import></xqdoc:imports><xqdoc:variables/><xqdoc:collections></xqdoc:collections><xqdoc:indexes></xqdoc:indexes><xqdoc:functions><xqdoc:function arity="1"><xqdoc:name>testModule:test</xqdoc:name><xqdoc:signature>declare function testModule:test($image as image:imageType)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>image</xqdoc:name><xqdoc:type>image:imageType</xqdoc:type></xqdoc:parameter></xqdoc:parameters></xqdoc:function><xqdoc:function arity="1"><xqdoc:name>testModule:test2</xqdoc:name><xqdoc:signature>declare function testModule:test2($image as xs:string)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>image</xqdoc:name><xqdoc:type>xs:string</xqdoc:type></xqdoc:parameter></xqdoc:parameters><xqdoc:invoked arity="1"><xqdoc:uri>http://www.example.com/testModule</xqdoc:uri><xqdoc:name>test</xqdoc:name></xqdoc:invoked><xqdoc:invoked arity="1"><xqdoc:uri>http://www.zorba-xquery.com/modules/image/image</xqdoc:uri><xqdoc:name>imageType</xqdoc:name></xqdoc:invoked></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/unorderedAnnotations.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/unorderedAnnotations.xml.res 2012-09-17 00:36:37 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/unorderedAnnotations.xml.res 2012-09-21 10:07:25 +0000
@@ -1,5 +1,5 @@
-<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>http://www.28msec.com/modules/mymodule</xqdoc:uri><xqdoc:name>unorderedAnnotations.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="mymod" uri="http://www.28msec.com/modules/mymodule" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports/><xqdoc:variables/><xqdoc:functions><xqdoc:function arity="2"><xqdoc:comment><xqdoc:description> This function contains some unordered annotations.
+<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0"><xqdoc:control><xqdoc:date/><xqdoc:version>1.0</xqdoc:version></xqdoc:control><xqdoc:module type="library"><xqdoc:uri>http://www.28msec.com/modules/mymodule</xqdoc:uri><xqdoc:name>unorderedAnnotations.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="mymod" uri="http://www.28msec.com/modules/mymodule" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports/><xqdoc:variables/><xqdoc:collections></xqdoc:collections><xqdoc:indexes></xqdoc:indexes><xqdoc:functions><xqdoc:function arity="2"><xqdoc:comment><xqdoc:description> This function contains some unordered annotations.
They should be ordered in the resulting XQDoc XML
according to the XQDoc schema:
description author version param return error deprecated see since
-</xqdoc:description><xqdoc:param>$one A dummy param.</xqdoc:param><xqdoc:param>$two One param.</xqdoc:param><xqdoc:return>Place of no return</xqdoc:return><xqdoc:error>Do we throw errors?</xqdoc:error><xqdoc:deprecated/><xqdoc:see>This should be almost at the end</xqdoc:see><xqdoc:since>The beginning of the world.</xqdoc:since></xqdoc:comment><xqdoc:name>mymod:foo</xqdoc:name><xqdoc:signature>declare function mymod:foo($one, $two)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>one</xqdoc:name></xqdoc:parameter><xqdoc:parameter><xqdoc:name>two</xqdoc:name></xqdoc:parameter></xqdoc:parameters></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
\ No newline at end of file
+</xqdoc:description><xqdoc:param>$one A dummy param.</xqdoc:param><xqdoc:param>$two One param.</xqdoc:param><xqdoc:return>Place of no return</xqdoc:return><xqdoc:error>Do we throw errors?</xqdoc:error><xqdoc:deprecated/><xqdoc:see>This should be almost at the end</xqdoc:see><xqdoc:since>The beginning of the world.</xqdoc:since></xqdoc:comment><xqdoc:name>mymod:foo</xqdoc:name><xqdoc:signature>declare function mymod:foo($one, $two)</xqdoc:signature><xqdoc:parameters><xqdoc:parameter><xqdoc:name>one</xqdoc:name></xqdoc:parameter><xqdoc:parameter><xqdoc:name>two</xqdoc:name></xqdoc:parameter></xqdoc:parameters></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
=== modified file 'test/rbkt/Queries/zorba/xqdoc/basic.xq'
--- test/rbkt/Queries/zorba/xqdoc/basic.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/basic.xq 2012-09-21 10:07:25 +0000
@@ -3,6 +3,14 @@
declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
declare %ann:sequential function local:remove-date($xqdoc)
{
let $date := $xqdoc//xqds:date[1]
@@ -13,7 +21,7 @@
let $xqdoc as schema-element(xqds:xqdoc) :=
validate lax {
- xqd:xqdoc("gdata.xqlib")
+ xqd:xqdoc($local:dir || "gdata.xqlib")
}
return
local:remove-date($xqdoc)
=== added file 'test/rbkt/Queries/zorba/xqdoc/basic_options.xq'
--- test/rbkt/Queries/zorba/xqdoc/basic_options.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/xqdoc/basic_options.xq 2012-09-21 10:07:25 +0000
@@ -0,0 +1,30 @@
+import module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
+import schema namespace xqds = "http://www.xqdoc.org/1.0";
+
+declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare namespace opt = "http://www.zorba-xquery.com/modules/xqdoc-options";
+
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
+declare %ann:sequential function local:remove-date($xqdoc)
+{
+ let $date := $xqdoc//xqds:date[1]
+ return
+ replace value of node $date with "";
+ exit returning $xqdoc;
+};
+
+let $xqdoc as schema-element(xqds:xqdoc) :=
+ validate lax {
+ xqd:xqdoc(
+ $local:dir || "gdata.xqlib",
+ <opt:enable functions="true" indexes="false" />)
+ }
+return
+ local:remove-date($xqdoc)
=== modified file 'test/rbkt/Queries/zorba/xqdoc/basic_with_error.xq'
--- test/rbkt/Queries/zorba/xqdoc/basic_with_error.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/basic_with_error.xq 2012-09-21 10:07:25 +0000
@@ -3,8 +3,16 @@
declare namespace err = "http://www.w3.org/2005/xqt-errors";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
try {
- xqd:xqdoc("gdata_error.xqlib")
+ xqd:xqdoc($local:dir || "gdata_error.xqlib")
} catch * {
- $err:code, $err:description
+ $err:code, fn:substring($err:description, 1, 62)
}
=== added file 'test/rbkt/Queries/zorba/xqdoc/content_options.xq'
--- test/rbkt/Queries/zorba/xqdoc/content_options.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/xqdoc/content_options.xq 2012-09-21 10:07:25 +0000
@@ -0,0 +1,32 @@
+import module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
+import module namespace file = "http://expath.org/ns/file";
+import schema namespace xqds = "http://www.xqdoc.org/1.0";
+
+declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare namespace opt = "http://www.zorba-xquery.com/modules/xqdoc-options";
+
+declare %ann:sequential function local:remove-date($xqdoc)
+{
+ let $date := $xqdoc//xqds:date[1]
+ return
+ replace value of node $date with "";
+ exit returning $xqdoc;
+};
+
+let $arg := fn:base-uri(<a/>)
+let $delim := "/"
+let $content := file:read-text(fn:concat(
+ if (matches($arg, replace($delim,
+ concat('^(.*)', replace($delim, '(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1'),'.*'),
+ '$1')))
+ then replace($arg,
+ concat('^(.*)', replace($delim, '(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1'),'.*'),
+ '$1')
+ else '', "/gdata.xqlib"))
+let $xqdoc :=
+ xqd:xqdoc-content(
+ $content,
+ <opt:enable variables="true" />)
+return
+ local:remove-date($xqdoc)
+
=== modified file 'test/rbkt/Queries/zorba/xqdoc/indentation.xq'
--- test/rbkt/Queries/zorba/xqdoc/indentation.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/indentation.xq 2012-09-21 10:07:25 +0000
@@ -1,6 +1,14 @@
import module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
-let $xqdoc := xqd:xqdoc("indentation.xq")
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
+let $xqdoc := xqd:xqdoc($local:dir || "indentation.xq")
return {
replace value of node $xqdoc//*:date[1] with "";
$xqdoc
=== modified file 'test/rbkt/Queries/zorba/xqdoc/local.xq'
--- test/rbkt/Queries/zorba/xqdoc/local.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/local.xq 2012-09-21 10:07:25 +0000
@@ -3,6 +3,14 @@
declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
declare %ann:sequential function local:remove-date($xqdoc)
{
let $date := $xqdoc//xqds:date[1]
@@ -13,7 +21,7 @@
let $xqdoc as schema-element(xqds:xqdoc) :=
validate lax {
- xqd:xqdoc("local.xqlib")
+ xqd:xqdoc($local:dir || "local.xqlib")
}
return
local:remove-date($xqdoc)
=== modified file 'test/rbkt/Queries/zorba/xqdoc/no_global_var.xq'
--- test/rbkt/Queries/zorba/xqdoc/no_global_var.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/no_global_var.xq 2012-09-21 10:07:25 +0000
@@ -3,6 +3,14 @@
declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
declare %ann:sequential function local:remove-date($xqdoc)
{
let $date := $xqdoc//xqds:date[1]
@@ -13,7 +21,7 @@
let $xqdoc as schema-element(xqds:xqdoc) :=
validate lax {
- xqd:xqdoc("no_global_var.xqlib")
+ xqd:xqdoc($local:dir || "no_global_var.xqlib")
}
return
local:remove-date($xqdoc)
=== modified file 'test/rbkt/Queries/zorba/xqdoc/testSchemaTypes.xq'
--- test/rbkt/Queries/zorba/xqdoc/testSchemaTypes.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/testSchemaTypes.xq 2012-09-21 10:07:25 +0000
@@ -3,6 +3,14 @@
declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
declare %ann:sequential function local:remove-date($xqdoc)
{
let $date := $xqdoc//*:date[1]
@@ -11,6 +19,6 @@
exit returning $xqdoc;
};
-let $xqdoc := xqd:xqdoc("image.xqlib")
+let $xqdoc := xqd:xqdoc($local:dir || "image.xqlib")
return
local:remove-date($xqdoc)
=== modified file 'test/rbkt/Queries/zorba/xqdoc/unorderedAnnotations.xq'
--- test/rbkt/Queries/zorba/xqdoc/unorderedAnnotations.xq 2012-09-17 00:36:37 +0000
+++ test/rbkt/Queries/zorba/xqdoc/unorderedAnnotations.xq 2012-09-21 10:07:25 +0000
@@ -3,6 +3,14 @@
declare namespace ann = "http://www.zorba-xquery.com/annotations";
+declare variable $local:dir :=
+ let $base-uri := fn:static-base-uri()
+ let $filename := tokenize($base-uri, "/")[last()]
+ return fn:substring(
+ $base-uri,
+ 1,
+ fn:string-length($base-uri) - fn:string-length($filename));
+
declare %ann:sequential function local:remove-date($xqdoc)
{
let $date := $xqdoc//xqds:date[1]
@@ -14,7 +22,7 @@
let $xqdoc as schema-element(xqds:xqdoc) :=
validate lax {
- xqd:xqdoc("unorderedAnnotations.xqlib")
+ xqd:xqdoc($local:dir || "unorderedAnnotations.xqlib")
}
return
local:remove-date($xqdoc)
Follow ups
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: noreply, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: David Graf, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-27
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: David Graf, 2012-09-27
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: David Graf, 2012-09-27
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-26
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-26
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Matthias Brantner, 2012-09-26
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Matthias Brantner, 2012-09-26
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Chris Hillery, 2012-09-25
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Chris Hillery, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Zorba Build Bot, 2012-09-25
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Matthias Brantner, 2012-09-25
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Matthias Brantner, 2012-09-25
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: Matthias Brantner, 2012-09-21
-
Re: [Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: David Graf, 2012-09-21
-
[Merge] lp:~zorba-coders/zorba/xqdoc-extensions into lp:zorba
From: David Graf, 2012-09-21