Merge lp:~zorba-coders/zorba/fix_bug_1124374 into lp:zorba

Proposed by Sorin Marian Nasoi
Status: Needs review
Proposed branch: lp:~zorba-coders/zorba/fix_bug_1124374
Merge into: lp:zorba
Diff against target: 426 lines (+134/-184)
8 files modified
modules/com/zorba-xquery/www/modules/xqdoc.xsd (+12/-5)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+78/-47)
test/rbkt/ExpQueryResults/zorba/xqdoc/annotations.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/xqdoc/collindex.xml.res (+7/-128)
test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res (+1/-1)
test/rbkt/Queries/zorba/xqdoc/annotations.xq (+32/-0)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq (+2/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/fix_bug_1124374
Reviewer Review Type Date Requested Status
Matthias Brantner Needs Fixing
Sorin Marian Nasoi Approve
Review via email: mp+174398@code.launchpad.net

Commit message

- fix for lp:1124374; Updated XQDoc schema.

To post a comment you must log in.
11554. By sorin.marian.nasoi <email address hidden>

- fix for lp:1124374; also updated the XQDoc schema

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Stage "TestZorbaUbuntu" failed.
3 tests failed (8344 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/79/testReport/ to view the results.

11555. By sorin.marian.nasoi <email address hidden>

- updated expected results for XQDoc test-cases

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398 :
Votes: {'Approve': 1}

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/31/console to view the results.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Could you please add a test for literals? I couldn't find one.

review: Needs Fixing
11556. By sorin.marian.nasoi <email address hidden>

Merged lp:zorba trunk.

11557. By sorin.marian.nasoi <email address hidden>

- added a test for the XQDoc annotations of the functions and variables

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> Could you please add a test for literals? I couldn't find one.
Done: please see rev. 11557.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

- I don't think the prefix and the namespace for an annotation are needed. One should be good enough because the namespaces are listed at the beginning of the document.
- Rename localname to just name
- Would it be possible to keep the numeric type (i.e. xs:integer, xs:decimal, or xs:double)
- It looks like the string literal ''no message delivered'' is missing the second ' at the beginning and the end in the annotation. Am I missing something?

review: Needs Fixing
11558. By sorin.marian.nasoi <email address hidden>

Merged lp:zorba trunk after fixing conflicts.

11559. By sorin.marian.nasoi <email address hidden>

- removed the namespace and left only the prefix
- renamed 'localname' to 'local'
- added the correct numeric type (i.e. xs:integer, xs:decimal, or xs:double) instead of 'numeric'

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Stage "TestZorbaUbuntu" failed.
1 tests failed (8403 total tests run).

Check test results at http://jenkins.lambda.nu/job/TestZorbaUbuntu/207/testReport/ to view the results.

11560. By sorin.marian.nasoi <email address hidden>

- fixed the test-case after the @localname attribute of the annotations was renamed to @local

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> - I don't think the prefix and the namespace for an annotation are needed. One
> should be good enough because the namespaces are listed at the beginning of
> the document.
Done in r11559.

> - Rename localname to just name
Done in r11559.

> - Would it be possible to keep the numeric type (i.e. xs:integer, xs:decimal,
> or xs:double)
Done in r11559.

> - It looks like the string literal ''no message delivered'' is missing the
> second ' at the beginning and the end in the annotation. Am I missing something?
Yes, I think you are missing the fact that the actual function annotation is:

declare %restxq:form-param("message","{$message}", "'no message delivered'", 5) function annotations:function()

and NOT:
declare %restxq:form-param("message","{$message}", "''no message delivered''", 5) function annotations:function()

In the annotations.xq test-case the module is given as text and that is why there is an escaping of the ' : does this makes sense?

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398 :
Votes: {'Approve': 1, 'Needs Fixing': 1}

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue result for https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1124374/+merge/174398

Stage "CommitZorba" failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/119/console to view the results.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Looks good. However, there is one minor thing which seems to be an existing bug but only now becomes important. The uri attribute of the annotation namespace element is empty:

<xqdoc:custom tag="namespaces">
 <xqdoc:namespace prefix="an" uri="" isSchema="false"/>

review: Needs Fixing
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

> Looks good. However, there is one minor thing which seems to be an existing
> bug but only now becomes important. The uri attribute of the annotation
> namespace element is empty:
>
> <xqdoc:custom tag="namespaces">
> <xqdoc:namespace prefix="an" uri="" isSchema="false"/>

1) please give me more information in order to reproduce this SEPARATE BUG:

Here is the test/rbktExpQueryResults/zorbaxqdoc/annotations.xml.res:

<xqdoc:custom tag="namespaces">
<xqdoc:namespace prefix="annotations" uri="http://www.zorba-xquery.com/modules/xqdoc/annotations" isSchema="false"/>
<xqdoc:namespace prefix="restxq" uri="http://www.zorba-xquery.com/modules/xqdoc/test" isSchema="false"/>
</xqdoc:custom>

2) please provide this information in a SEPARATE BUG and approve this merge

11561. By sorin.marian.nasoi <email address hidden>

- merged lp:zorba trunk

11562. By sorin.marian.nasoi <email address hidden>

- merged lp:zorba trunk

11563. By sorin.marian.nasoi <email address hidden>

- updated annotations namespace

Unmerged revisions

11563. By sorin.marian.nasoi <email address hidden>

- updated annotations namespace

11562. By sorin.marian.nasoi <email address hidden>

- merged lp:zorba trunk

11561. By sorin.marian.nasoi <email address hidden>

- merged lp:zorba trunk

11560. By sorin.marian.nasoi <email address hidden>

- fixed the test-case after the @localname attribute of the annotations was renamed to @local

11559. By sorin.marian.nasoi <email address hidden>

- removed the namespace and left only the prefix
- renamed 'localname' to 'local'
- added the correct numeric type (i.e. xs:integer, xs:decimal, or xs:double) instead of 'numeric'

11558. By sorin.marian.nasoi <email address hidden>

Merged lp:zorba trunk after fixing conflicts.

11557. By sorin.marian.nasoi <email address hidden>

- added a test for the XQDoc annotations of the functions and variables

11556. By sorin.marian.nasoi <email address hidden>

Merged lp:zorba trunk.

11555. By sorin.marian.nasoi <email address hidden>

- updated expected results for XQDoc test-cases

11554. By sorin.marian.nasoi <email address hidden>

- fix for lp:1124374; also updated the XQDoc schema

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xsd'
2--- modules/com/zorba-xquery/www/modules/xqdoc.xsd 2013-02-07 17:24:36 +0000
3+++ modules/com/zorba-xquery/www/modules/xqdoc.xsd 2013-08-23 05:12:21 +0000
4@@ -140,16 +140,22 @@
5 </xsd:sequence>
6 </xsd:complexType>
7
8+ <xsd:complexType name="literal">
9+ <xsd:attribute name="type" type="xsd:string" use="required"/>
10+ <xsd:attribute name="value" type="xsd:string" use="required"/>
11+ </xsd:complexType>
12+
13 <xsd:complexType name="annotation">
14- <xsd:attribute name="prefix" type="xsd:string" use="optional"/>
15- <xsd:attribute name="namespace" type="xsd:string" use="optional"/>
16- <xsd:attribute name="localname" type="xsd:string" use="optional"/>
17- <xsd:attribute name="value" type="xsd:string" use="optional"/>
18+ <xsd:sequence>
19+ <xsd:element name="literal" type="literal" minOccurs="0" maxOccurs="unbounded"/>
20+ </xsd:sequence>
21+ <xsd:attribute name="prefix" type="xsd:string" use="optional"/>
22+ <xsd:attribute name="local" type="xsd:string" use="optional"/>
23 </xsd:complexType>
24
25 <xsd:complexType name="annotations">
26 <xsd:sequence>
27- <xsd:element name="annotation" type="annotation" minOccurs="1" maxOccurs="unbounded"/>
28+ <xsd:element name="annotation" type="annotation" minOccurs="1" maxOccurs="unbounded"/>
29 </xsd:sequence>
30 </xsd:complexType>
31
32@@ -203,6 +209,7 @@
33 <xsd:element name="uri" type="uri"/>
34 <xsd:element name="type" type="type" minOccurs="0"/>
35 <xsd:element name="comment" type="comment" minOccurs="0"/>
36+ <xsd:element name="annotations" type="annotations" minOccurs="0"/>
37 <xsd:choice minOccurs="0" maxOccurs="unbounded">
38 <xsd:element name="invoked" type="invoked" minOccurs="0" maxOccurs="unbounded"/>
39 <xsd:element name="ref-variable" type="invoked" minOccurs="0" maxOccurs="unbounded"/>
40
41=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
42--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-07-01 18:59:06 +0000
43+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-08-23 05:12:21 +0000
44@@ -137,8 +137,8 @@
45 void print_annotations(AnnotationListParsenode* aAnn, store::Item_t aParent)
46 {
47 if (aAnn) {
48- store::Item_t lTypeName, lAnnotationsQName, lAnnotationQName;
49- store::Item_t lAnnotationsElem, lAnnotationElem;
50+ store::Item_t lTypeName, lAnnotationsQName, lAnnotationQName, lLiteralQName;
51+ store::Item_t lAnnotationsElem, lAnnotationElem, lLiteralElem;
52
53 theFactory->createQName(lAnnotationsQName, theXQDocNS, theXQDocPrefix, "annotations");
54 lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
55@@ -159,40 +159,12 @@
56 store::Item_t lAnnAttr;
57 lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
58
59- AnnotationLiteralListParsenode* lLits = lAnn->get_literals().getp();
60-
61- std::ostringstream lAttrValue;
62- if (lLits)
63- {
64- for (size_t j = 0; j < lLits->size(); ++j)
65- {
66- if (j > 0)
67- lAttrValue << " ";
68-
69- exprnode* lLit = (*lLits)[j].getp();
70- StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
71- if (l)
72- {
73- lAttrValue << l->get_strval();
74- }
75- else
76- {
77- NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
78- assert(n);
79- lAttrValue << n->toString();
80- }
81- }
82- }
83- zstring lTmp( lAttrValue.str() );
84- store::Item_t lAttrValueItem;
85- theFactory->createString(lAttrValueItem, lTmp);
86-
87 store::Item_t lAttrPrefixItem, lAttrNamespaceItem, lAttrLocalnameItem;
88
89 zstring lPrefix = lAnn->get_qname()->get_prefix();
90 theFactory->createString(lAttrPrefixItem, lPrefix);
91
92- lTmp = lAnn->get_qname()->get_prefix();
93+ zstring lTmp = lAnn->get_qname()->get_prefix();
94 lTmp = theNamespaceMap[lTmp];
95 theFactory->createString(lAttrNamespaceItem, lTmp);
96
97@@ -201,12 +173,8 @@
98
99 store::Item_t lPrefixQName;
100 theFactory->createQName(lPrefixQName, "", "", "prefix");
101- store::Item_t lNamespaceQName;
102- theFactory->createQName(lNamespaceQName, "", "", "namespace");
103- store::Item_t lLocalnameQName;
104- theFactory->createQName(lLocalnameQName, "", "", "localname");
105- store::Item_t lValueQName;
106- theFactory->createQName(lValueQName, "", "", "value");
107+ store::Item_t lLocalQName;
108+ theFactory->createQName(lLocalQName, "", "", "local");
109
110 lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
111 theFactory->createAttributeNode(
112@@ -215,18 +183,81 @@
113
114 lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
115 theFactory->createAttributeNode(
116- lNamespaceQName, lAnnotationElem, lNamespaceQName,
117- lTypeName, lAttrNamespaceItem);
118-
119- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
120- theFactory->createAttributeNode(
121- lLocalnameQName, lAnnotationElem, lLocalnameQName,
122+ lLocalQName, lAnnotationElem, lLocalQName,
123 lTypeName, lAttrLocalnameItem);
124
125- lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
126- theFactory->createAttributeNode(
127- lValueQName, lAnnotationElem, lValueQName,
128- lTypeName, lAttrValueItem);
129+ AnnotationLiteralListParsenode* lLits = lAnn->get_literals().getp();
130+
131+ zstring lAttrValue;
132+ zstring lAttrType;
133+ if (lLits)
134+ {
135+ for (size_t j = 0; j < lLits->size(); ++j)
136+ {
137+ exprnode* lLit = (*lLits)[j].getp();
138+ StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
139+ if (l)
140+ {
141+ lAttrValue = l->get_strval();
142+ lAttrType = "xs:string";
143+ }
144+ else
145+ {
146+ NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
147+ assert(n);
148+ lAttrValue = n->toString();
149+ switch (n->get_type())
150+ {
151+ case ParseConstants::num_integer:
152+ {
153+ lAttrType = "xs:integer";
154+ break;
155+ }
156+ case ParseConstants::num_decimal:
157+ {
158+ lAttrType = "xs:decimal";
159+ break;
160+ }
161+ case ParseConstants::num_double:
162+ {
163+ lAttrType = "xs:double";
164+ break;
165+ }
166+ }
167+ }
168+
169+ theFactory->createQName(lLiteralQName, theXQDocNS, theXQDocPrefix, "literal");
170+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
171+
172+ theFactory->createElementNode(
173+ lLiteralElem, lAnnotationElem, lLiteralQName,
174+ lTypeName, true, false, theNSBindings, theBaseURI);
175+
176+ store::Item_t lAttrTypeItem, lAttrValueItem;
177+
178+ theFactory->createString(lAttrTypeItem, lAttrType);
179+ theFactory->createString(lAttrValueItem, lAttrValue);
180+
181+ lTmp = lAnn->get_qname()->get_localname();
182+ theFactory->createString(lAttrLocalnameItem, lTmp);
183+
184+ store::Item_t lTypeQName;
185+ theFactory->createQName(lTypeQName, "", "", "type");
186+ store::Item_t lValueQName;
187+ theFactory->createQName(lValueQName, "", "", "value");
188+
189+
190+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
191+ theFactory->createAttributeNode(
192+ lTypeQName, lLiteralElem, lTypeQName,
193+ lTypeName, lAttrTypeItem);
194+
195+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
196+ theFactory->createAttributeNode(
197+ lValueQName, lLiteralElem, lValueQName,
198+ lTypeName, lAttrValueItem);
199+ }
200+ }
201 }
202 }
203 }
204
205=== added file 'test/rbkt/ExpQueryResults/zorba/xqdoc/annotations.xml.res'
206--- test/rbkt/ExpQueryResults/zorba/xqdoc/annotations.xml.res 1970-01-01 00:00:00 +0000
207+++ test/rbkt/ExpQueryResults/zorba/xqdoc/annotations.xml.res 2013-08-23 05:12:21 +0000
208@@ -0,0 +1,1 @@
209+<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://zorba.io/annotations</xqdoc:uri><xqdoc:name></xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="annotations" uri="http://zorba.io/annotations" isSchema="false"/><xqdoc:namespace prefix="restxq" uri="http://www.zorba-xquery.com/modules/xqdoc/test" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports/><xqdoc:variables><xqdoc:variable><xqdoc:uri>annotations:variable</xqdoc:uri><xqdoc:annotations><xqdoc:annotation prefix="restxq" local="form-param"><xqdoc:literal type="xs:string" value="message"/><xqdoc:literal type="xs:string" value="{$message}"/><xqdoc:literal type="xs:string" value="'no message delivered'"/><xqdoc:literal type="xs:integer" value="5"/></xqdoc:annotation></xqdoc:annotations></xqdoc:variable></xqdoc:variables><xqdoc:collections/><xqdoc:indexes/><xqdoc:functions><xqdoc:function arity="0"><xqdoc:name>annotations:function</xqdoc:name><xqdoc:annotations><xqdoc:annotation prefix="restxq" local="form-param"><xqdoc:literal type="xs:string" value="message"/><xqdoc:literal type="xs:string" value="{$message}"/><xqdoc:literal type="xs:string" value="'no message delivered'"/><xqdoc:literal type="xs:integer" value="5"/></xqdoc:annotation></xqdoc:annotations><xqdoc:signature>declare %restxq:form-param(message {$message} 'no message delivered' 5) function annotations:function() as xs:string</xqdoc:signature><xqdoc:return><xqdoc:type>xs:string</xqdoc:type></xqdoc:return></xqdoc:function></xqdoc:functions></xqdoc:xqdoc>
210\ No newline at end of file
211
212=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/collindex.xml.res'
213--- test/rbkt/ExpQueryResults/zorba/xqdoc/collindex.xml.res 2013-08-09 07:33:21 +0000
214+++ test/rbkt/ExpQueryResults/zorba/xqdoc/collindex.xml.res 2013-08-23 05:12:21 +0000
215@@ -1,128 +1,7 @@
216-<xqdoc:xqdoc xmlns:xqdoc="http://www.xqdoc.org/1.0">
217- <xqdoc:control>
218- <xqdoc:date/>
219- <xqdoc:version>1.0</xqdoc:version>
220- </xqdoc:control>
221- <xqdoc:module type="library">
222- <xqdoc:uri>http://www.zorba-xquery.com/collindex</xqdoc:uri>
223- <xqdoc:name>collindex.xqlib</xqdoc:name>
224- <xqdoc:custom tag="namespaces">
225- <xqdoc:namespace prefix="an" uri="" isSchema="false"/>
226- <xqdoc:namespace prefix="cache" uri="http://www.28msec.com/modules/http/util/cache" isSchema="false"/>
227- <xqdoc:namespace prefix="cil" uri="http://www.zorba-xquery.com/collindex" isSchema="false"/>
228- <xqdoc:namespace prefix="ddl" uri="http://www.zorba-xquery.com/modules/store/static/collections/ddl" isSchema="false"/>
229- <xqdoc:namespace prefix="dml" uri="http://www.zorba-xquery.com/modules/store/static/collections/dml" isSchema="false"/>
230- <xqdoc:namespace prefix="functx" uri="http://www.functx.com" isSchema="false"/>
231- <xqdoc:namespace prefix="idml" uri="http://www.zorba-xquery.com/modules/store/static/indexes/dml" isSchema="false"/>
232- <xqdoc:namespace prefix="req" uri="http://www.28msec.com/modules/http/request" isSchema="false"/>
233- <xqdoc:namespace prefix="resp" uri="http://www.28msec.com/modules/http/response" isSchema="false"/>
234- </xqdoc:custom>
235- </xqdoc:module>
236- <xqdoc:imports>
237- <xqdoc:import type="library">
238- <xqdoc:uri>http://www.functx.com</xqdoc:uri>
239- </xqdoc:import>
240- <xqdoc:import type="library">
241- <xqdoc:uri>http://www.28msec.com/modules/http/request</xqdoc:uri>
242- </xqdoc:import>
243- <xqdoc:import type="library">
244- <xqdoc:uri>http://www.28msec.com/modules/http/response</xqdoc:uri>
245- </xqdoc:import>
246- <xqdoc:import type="library">
247- <xqdoc:uri>http://www.28msec.com/modules/http/util/cache</xqdoc:uri>
248- </xqdoc:import>
249- <xqdoc:import type="library">
250- <xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/collections/ddl</xqdoc:uri>
251- </xqdoc:import>
252- <xqdoc:import type="library">
253- <xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/collections/dml</xqdoc:uri>
254- </xqdoc:import>
255- <xqdoc:import type="library">
256- <xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/indexes/dml</xqdoc:uri>
257- </xqdoc:import>
258- </xqdoc:imports>
259- <xqdoc:variables>
260- <xqdoc:variable>
261- <xqdoc:uri>cil:entries</xqdoc:uri>
262- <xqdoc:invoked arity="1">
263- <xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri>
264- <xqdoc:name>QName</xqdoc:name>
265- </xqdoc:invoked>
266- </xqdoc:variable>
267- <xqdoc:variable>
268- <xqdoc:uri>cil:idx</xqdoc:uri>
269- <xqdoc:invoked arity="1">
270- <xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri>
271- <xqdoc:name>QName</xqdoc:name>
272- </xqdoc:invoked>
273- </xqdoc:variable>
274- </xqdoc:variables>
275- <xqdoc:collections>
276- <xqdoc:collection>
277- <xqdoc:name>entries</xqdoc:name>
278- <xqdoc:type>element(el)*</xqdoc:type>
279- <xqdoc:comment>
280- <xqdoc:description> some comment
281-</xqdoc:description>
282- </xqdoc:comment>
283- <xqdoc:annotations>
284- <xqdoc:annotation prefix="an" namespace="" localname="ordered" value=""/>
285- </xqdoc:annotations>
286- </xqdoc:collection>
287- <xqdoc:collection>
288- <xqdoc:name>entries2</xqdoc:name>
289- <xqdoc:comment>
290- <xqdoc:description> some comment2
291-</xqdoc:description>
292- </xqdoc:comment>
293- <xqdoc:annotations>
294- <xqdoc:annotation prefix="an" namespace="" localname="ordered" value=""/>
295- </xqdoc:annotations>
296- </xqdoc:collection>
297- <xqdoc:collection>
298- <xqdoc:name>entries3</xqdoc:name>
299- <xqdoc:type>element(el)*</xqdoc:type>
300- <xqdoc:comment>
301- <xqdoc:description> some comment3
302-</xqdoc:description>
303- </xqdoc:comment>
304- </xqdoc:collection>
305- <xqdoc:collection>
306- <xqdoc:name>entries4</xqdoc:name>
307- <xqdoc:comment>
308- <xqdoc:description> some comment4
309-</xqdoc:description>
310- </xqdoc:comment>
311- </xqdoc:collection>
312- </xqdoc:collections>
313- <xqdoc:indexes>
314- <xqdoc:index>
315- <xqdoc:name>idx</xqdoc:name>
316- <xqdoc:source>
317- <xqdoc:uri>http://www.zorba-xquery.com/collindex</xqdoc:uri>
318- <xqdoc:name>entries</xqdoc:name>
319- </xqdoc:source>
320- <xqdoc:comment>
321- <xqdoc:description> some comment5
322-</xqdoc:description>
323- </xqdoc:comment>
324- <xqdoc:annotations>
325- <xqdoc:annotation prefix="an" namespace="" localname="automatic" value=""/>
326- <xqdoc:annotation prefix="an" namespace="" localname="unique" value=""/>
327- <xqdoc:annotation prefix="an" namespace="" localname="value-equality" value=""/>
328- </xqdoc:annotations>
329- </xqdoc:index>
330- <xqdoc:index>
331- <xqdoc:name>idx</xqdoc:name>
332- <xqdoc:source>
333- <xqdoc:uri>http://www.zorba-xquery.com/collindex</xqdoc:uri>
334- <xqdoc:name>entries</xqdoc:name>
335- </xqdoc:source>
336- <xqdoc:comment>
337- <xqdoc:description> some comment6
338-</xqdoc:description>
339- </xqdoc:comment>
340- </xqdoc:index>
341- </xqdoc:indexes>
342- <xqdoc:functions/>
343-</xqdoc:xqdoc>
344+<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.zorba-xquery.com/collindex</xqdoc:uri><xqdoc:name>collindex.xqlib</xqdoc:name><xqdoc:custom tag="namespaces"><xqdoc:namespace prefix="an" uri="" isSchema="false"/><xqdoc:namespace prefix="cache" uri="http://www.28msec.com/modules/http/util/cache" isSchema="false"/><xqdoc:namespace prefix="cil" uri="http://www.zorba-xquery.com/collindex" isSchema="false"/><xqdoc:namespace prefix="ddl" uri="http://www.zorba-xquery.com/modules/store/static/collections/ddl" isSchema="false"/><xqdoc:namespace prefix="dml" uri="http://www.zorba-xquery.com/modules/store/static/collections/dml" isSchema="false"/><xqdoc:namespace prefix="functx" uri="http://www.functx.com" isSchema="false"/><xqdoc:namespace prefix="idml" uri="http://www.zorba-xquery.com/modules/store/static/indexes/dml" isSchema="false"/><xqdoc:namespace prefix="req" uri="http://www.28msec.com/modules/http/request" isSchema="false"/><xqdoc:namespace prefix="resp" uri="http://www.28msec.com/modules/http/response" isSchema="false"/></xqdoc:custom></xqdoc:module><xqdoc:imports><xqdoc:import type="library"><xqdoc:uri>http://www.functx.com</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.28msec.com/modules/http/request</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.28msec.com/modules/http/response</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.28msec.com/modules/http/util/cache</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/collections/ddl</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/collections/dml</xqdoc:uri></xqdoc:import><xqdoc:import type="library"><xqdoc:uri>http://www.zorba-xquery.com/modules/store/static/indexes/dml</xqdoc:uri></xqdoc:import></xqdoc:imports><xqdoc:variables><xqdoc:variable><xqdoc:uri>cil:entries</xqdoc:uri><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked></xqdoc:variable><xqdoc:variable><xqdoc:uri>cil:idx</xqdoc:uri><xqdoc:invoked arity="1"><xqdoc:uri>http://www.w3.org/2001/XMLSchema</xqdoc:uri><xqdoc:name>QName</xqdoc:name></xqdoc:invoked></xqdoc:variable></xqdoc:variables><xqdoc:collections><xqdoc:collection><xqdoc:name>entries</xqdoc:name><xqdoc:type>element(el)*</xqdoc:type><xqdoc:comment><xqdoc:description> some comment
345+</xqdoc:description></xqdoc:comment><xqdoc:annotations><xqdoc:annotation prefix="an" local="ordered"/></xqdoc:annotations></xqdoc:collection><xqdoc:collection><xqdoc:name>entries2</xqdoc:name><xqdoc:comment><xqdoc:description> some comment2
346+</xqdoc:description></xqdoc:comment><xqdoc:annotations><xqdoc:annotation prefix="an" local="ordered"/></xqdoc:annotations></xqdoc:collection><xqdoc:collection><xqdoc:name>entries3</xqdoc:name><xqdoc:type>element(el)*</xqdoc:type><xqdoc:comment><xqdoc:description> some comment3
347+</xqdoc:description></xqdoc:comment></xqdoc:collection><xqdoc:collection><xqdoc:name>entries4</xqdoc:name><xqdoc:comment><xqdoc:description> some comment4
348+</xqdoc:description></xqdoc:comment></xqdoc:collection></xqdoc:collections><xqdoc:indexes><xqdoc:index><xqdoc:name>idx</xqdoc:name><xqdoc:source><xqdoc:uri>http://www.zorba-xquery.com/collindex</xqdoc:uri><xqdoc:name>entries</xqdoc:name></xqdoc:source><xqdoc:comment><xqdoc:description> some comment5
349+</xqdoc:description></xqdoc:comment><xqdoc:annotations><xqdoc:annotation prefix="an" local="automatic"/><xqdoc:annotation prefix="an" local="unique"/><xqdoc:annotation prefix="an" local="value-equality"/></xqdoc:annotations></xqdoc:index><xqdoc:index><xqdoc:name>idx</xqdoc:name><xqdoc:source><xqdoc:uri>http://www.zorba-xquery.com/collindex</xqdoc:uri><xqdoc:name>entries</xqdoc:name></xqdoc:source><xqdoc:comment><xqdoc:description> some comment6
350+</xqdoc:description></xqdoc:comment></xqdoc:index></xqdoc:indexes><xqdoc:functions/></xqdoc:xqdoc>
351\ No newline at end of file
352
353=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res'
354--- test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2013-08-09 08:27:30 +0000
355+++ test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2013-08-23 05:12:21 +0000
356@@ -1,1 +1,1 @@
357-<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://zorba.io/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://zorba.io/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>
358+<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://zorba.io/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 prefix="ann" local="sequential"/></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>
359\ No newline at end of file
360
361=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res'
362--- test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2013-08-09 08:27:30 +0000
363+++ test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2013-08-23 05:12:21 +0000
364@@ -1,1 +1,1 @@
365-<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://zorba.io/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://zorba.io/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>
366+<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://zorba.io/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:indexes/><xqdoc:functions><xqdoc:function arity="0"><xqdoc:name>foo:bar</xqdoc:name><xqdoc:annotations><xqdoc:annotation prefix="ann" local="sequential"/></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>
367\ No newline at end of file
368
369=== added file 'test/rbkt/Queries/zorba/xqdoc/annotations.xq'
370--- test/rbkt/Queries/zorba/xqdoc/annotations.xq 1970-01-01 00:00:00 +0000
371+++ test/rbkt/Queries/zorba/xqdoc/annotations.xq 2013-08-23 05:12:21 +0000
372@@ -0,0 +1,32 @@
373+xquery version "3.0";
374+
375+import module namespace xqd = "http://www.zorba-xquery.com/modules/xqdoc";
376+
377+import schema namespace xqdoc = "http://www.xqdoc.org/1.0";
378+
379+declare copy-namespaces preserve, inherit;
380+
381+declare namespace ann = "http://zorba.io/annotations";
382+
383+declare %ann:sequential function local:remove-date($xqdoc)
384+{
385+ let $date := $xqdoc//xqdoc:date[1]
386+ return
387+ replace value of node $date with "";
388+ exit returning $xqdoc;
389+};
390+
391+local:remove-date(xqd:xqdoc-content(
392+'
393+ xquery version "3.0";
394+
395+ module namespace annotations = "http://zorba.io/annotations";
396+
397+ declare namespace restxq = "http://www.zorba-xquery.com/modules/xqdoc/test";
398+
399+ declare %restxq:form-param("message","{$message}", "''no message delivered''", 5) variable $annotations:variable := ("tt");
400+
401+ declare %restxq:form-param("message","{$message}", "''no message delivered''", 5) function annotations:function()
402+ as xs:string
403+ { "test" };
404+'))
405\ No newline at end of file
406
407=== modified file 'test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq'
408--- test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2013-08-09 09:20:54 +0000
409+++ test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2013-08-23 05:12:21 +0000
410@@ -137,7 +137,7 @@
411 let $module := $xqdoc/xqdoc:module
412 return
413 string-join(for $function in $xqdoc/xqdoc:functions/xqdoc:function
414- where not(exists($function//xqdoc:annotation[@localname = 'private']))
415+ where not(exists($function//xqdoc:annotation[@local = 'private']))
416 return local:test-function($module, $function),"")
417 };
418
419@@ -204,7 +204,7 @@
420 let $moduleUri := $module/xqdoc:uri
421 return
422 string-join(for $variable in $xqdoc/xqdoc:variables/xqdoc:variable
423- where not(exists($variable//xqdoc:annotation[@localname = 'private']))
424+ where not(exists($variable//xqdoc:annotation[@local = 'private']))
425 return local:test-variable($module, $variable),"")
426 };
427

Subscribers

People subscribed via source and target branches