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

Proposed by Sorin Marian Nasoi
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10708
Merged at revision: 10712
Proposed branch: lp:~zorba-coders/zorba/bug_948712
Merge into: lp:zorba
Diff against target: 56 lines (+27/-11)
1 file modified
modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq (+27/-11)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug_948712
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Sorin Marian Nasoi Approve
Review via email: mp+96323@code.launchpad.net

Commit message

Fix for bug lp:948712: Added a way for easy copy&paste of the import schema statements.

Description of the change

Fix for bug lp:948712: Added a way for easy copy&paste of the import schema statements.

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

The result looks as follows:
----------------------------------------
Imported schemas:

  • http://expath.org/ns/http-client

Please note that the schemas are not automatically imported in the modules that import this module.
In order to import and use the schemas, please add:

import schema "http://expath.org/ns/http-client";
----------------------------------------

1. The schema import is syntactically not correct. You also need to specify a prefix.

2. IMHO, it would be sufficient to show something as follows:

http://expath.org/ns/http-client (usage: import schema namespace http = "http://expath.org/ns/http-client";)

review: Needs Fixing
lp:~zorba-coders/zorba/bug_948712 updated
10708. By Sorin Marian Nasoi <email address hidden>

Merged trunk.
Also fixed an error in the XQDoc module import section.

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

The error was fixed, Thanks for pointing it out Matthias.

I did not change the layout though because I think that Dana's original propose best fits the copy/paste scenario.

> The result looks as follows:
> ----------------------------------------
> Imported schemas:
>
> • http://expath.org/ns/http-client
>
> Please note that the schemas are not automatically imported in the modules
> that import this module.
> In order to import and use the schemas, please add:
>
> import schema "http://expath.org/ns/http-client";
> ----------------------------------------
>
> 1. The schema import is syntactically not correct. You also need to specify a
> prefix.
>
> 2. IMHO, it would be sufficient to show something as follows:
>
> • http://expath.org/ns/http-client (usage: import schema namespace http =
> "http://expath.org/ns/http-client";)

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

Validation queue job bug_948712-2012-03-09T18-25-16.692Z 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 'modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq'
2--- modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-03-07 15:49:25 +0000
3+++ modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-03-09 07:01:19 +0000
4@@ -1228,8 +1228,17 @@
5 }
6 </ul></p>
7 else (),
8+ if (fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]) > 0) then
9+ <p>External C++ library dependencies:<ul>
10+ {
11+ for $library in $xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]
12+ return
13+ <li>{$library/node()}</li>
14+ }
15+ </ul></p>
16+ else (),
17 if (fn:count($xqdoc/xqdoc:imports//xqdoc:import[@type = "schema"]) > 0) then
18- <p>Imported schemas:<ul>
19+ (<p>Imported schemas:<ul>
20 {
21 for $import in $xqdoc/xqdoc:imports//xqdoc:import[@type = "schema"]
22 return
23@@ -1243,16 +1252,23 @@
24 else
25 <li>{string($import/xqdoc:uri/text())}</li>
26 }
27- </ul></p>
28- else (),
29- if (fn:count($xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]) > 0) then
30- <p>External C++ library dependencies:<ul>
31- {
32- for $library in $xqdoc/xqdoc:module/xqdoc:comment/xqdoc:custom[@tag="library"]
33- return
34- <li>{$library/node()}</li>
35- }
36- </ul></p>
37+ </ul></p>,
38+ <p>Please note that the schemas are not automatically imported in the modules that import this module. <br />
39+ In order to import and use the schemas, please add:
40+ <pre class="brush: xquery;">
41+ {
42+ let $namespaces := $xqdoc/xqdoc:module//xqdoc:custom[@tag = "namespaces"]
43+ return
44+ string-join(
45+ for $import in $xqdoc/xqdoc:imports//xqdoc:import[@type = "schema"]
46+ return
47+ concat('import schema namespace ',
48+ $namespaces//xqdoc:namespace[@uri = $import/xqdoc:uri/text()][1]/@prefix,
49+ ' = "',
50+ string($import/xqdoc:uri/text()),'";'),"
51+")
52+ }
53+ </pre></p>)
54 else ()
55 )
56 };

Subscribers

People subscribed via source and target branches