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

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10529
Merged at revision: 10533
Proposed branch: lp:~zorba-coders/zorba/bug_872502
Merge into: lp:zorba
Diff against target: 89 lines (+16/-5)
7 files modified
ChangeLog (+1/-0)
modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq (+4/-4)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+1/-1)
test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res (+1/-0)
test/rbkt/Queries/zorba/schemas/validate_xqdoc_01.xq (+4/-0)
test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq (+4/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug_872502
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Sorin Marian Nasoi Approve
Review via email: mp+80463@code.launchpad.net

Commit message

Fix for bug lp:872502:
- in the case where library modules were using external C++ library dependencies (like it was the case with the reported Json module) the XQDoc XML generated by Zorba was not valid according to the XQDoc schema: this was fixed.
- also the XQDoc2XHTML generator was updated to reflect this change
- added 2 tests but I used a module part of the Zorba core (http://www.zorba-xquery.com/modules/http-client) that has an external C++ library dependency on Curl

Description of the change

Fix for bug lp:872502:
- in the case where library modules were using external C++ library dependencies (like it was the case with the reported Json module) the XQDoc XML generated by Zorba was not valid according to the XQDoc schema: this was fixed.
- also the XQDoc2XHTML generator was updated to reflect this change
- added 2 tests but I used a module part of the Zorba core (http://www.zorba-xquery.com/modules/http-client) that has an external C++ library dependency on Curl

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Could you please add the fix to the ChangeLog?

review: Needs Information
lp:~zorba-coders/zorba/bug_872502 updated
10527. By Sorin Marian Nasoi

merged trunk.

10528. By Sorin Marian Nasoi

Merged trunk.

10529. By Sorin Marian Nasoi

Added the fix to the Changelog.

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

Added the change to the Changelog.
Also approved the changes.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug_872502-2011-11-02T16-08-06.541Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-10-30 08:04:47 +0000
3+++ ChangeLog 2011-11-02 15:57:30 +0000
4@@ -57,6 +57,7 @@
5 * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
6 * Fixed bug #872799 (validate-in-place can set incorrect types)
7 * Fixed bug #855715 (Invalid escaped characters in regex not caught)
8+ * Fixed bug #872502 (validation of the JSON module xqdoc fails)
9
10 version 2.0.1
11
12
13=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
14--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2011-10-19 05:09:31 +0000
15+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2011-11-02 15:57:30 +0000
16@@ -1154,7 +1154,7 @@
17 : @return the XHTML for the module annotations.
18 :)
19 declare %private function xqdoc2html:annotations-module($comment) {
20- let $annotations := $comment/xqdoc:*[not((local-name(.) = ("description", "param", "return", "error", "deprecated", "see", "library", "project", "custom")))]
21+ let $annotations := $comment/xqdoc:*[not((local-name(.) = ("description", "param", "return", "error", "deprecated", "see", "project", "custom")))]
22 return
23 for $annotation in $annotations
24 let $annName := local-name($annotation)
25@@ -1195,7 +1195,7 @@
26 declare %private function xqdoc2html:module-dependencies(
27 $xqdoc) {
28 if (fn:count($xqdoc/xqdoc:imports/xqdoc:import) > 0 or
29- fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:*[(local-name(.) = ("library"))]) > 0) then
30+ fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]) > 0) then
31 (<div class="section"><span id="module_dependencies">Module Dependencies</span></div>,
32 xqdoc2html:imports($xqdoc))
33 else
34@@ -1238,10 +1238,10 @@
35 }
36 </ul></p>
37 else (),
38- if (fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:*[(local-name(.) = ("library"))]) > 0) then
39+ if (fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]) > 0) then
40 <p>External C++ library dependencies:<ul>
41 {
42- for $library in $xqdoc/xqdoc:module/xqdoc:comment/xqdoc:*[(local-name(.) = ("library"))]
43+ for $library in $xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]
44 return
45 <li>{$library/node()}</li>
46 }
47
48=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
49--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2011-08-11 19:09:24 +0000
50+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2011-11-02 15:57:30 +0000
51@@ -338,7 +338,7 @@
52 // library
53 for (lIt = lLibraryAnn.begin(); lIt != lLibraryAnn.end(); ++lIt) {
54 const XQDocAnnotation lAnnotation = *lIt;
55- printCommentFragment(lCommentElem, lAnnotation.getValue().str(), "library");
56+ printCommentFragment(lCommentElem, lAnnotation.getValue().str(), "library", true);
57 }
58
59 // example
60
61=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_01.xml.res'
62--- test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_01.xml.res 1970-01-01 00:00:00 +0000
63+++ test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_01.xml.res 2011-11-02 15:57:30 +0000
64@@ -0,0 +1,1 @@
65+true
66
67=== added file 'test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res'
68--- test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res 1970-01-01 00:00:00 +0000
69+++ test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res 2011-11-02 15:57:30 +0000
70@@ -0,0 +1,1 @@
71+true
72
73=== added file 'test/rbkt/Queries/zorba/schemas/validate_xqdoc_01.xq'
74--- test/rbkt/Queries/zorba/schemas/validate_xqdoc_01.xq 1970-01-01 00:00:00 +0000
75+++ test/rbkt/Queries/zorba/schemas/validate_xqdoc_01.xq 2011-11-02 15:57:30 +0000
76@@ -0,0 +1,4 @@
77+import module namespace x = "http://www.zorba-xquery.com/modules/xqdoc";
78+import schema namespace xqds = "http://www.xqdoc.org/1.0";
79+
80+exists(validate lax { x:xqdoc("http://www.zorba-xquery.com/modules/http-client") })
81
82=== added file 'test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq'
83--- test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq 1970-01-01 00:00:00 +0000
84+++ test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq 2011-11-02 15:57:30 +0000
85@@ -0,0 +1,4 @@
86+import module namespace x = "http://www.zorba-xquery.com/modules/xqdoc";
87+import schema namespace xqds = "http://www.xqdoc.org/1.0";
88+
89+exists(validate { x:xqdoc("http://www.zorba-xquery.com/modules/http-client") })

Subscribers

People subscribed via source and target branches