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

Proposed by William Candillon
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10753
Merged at revision: 10775
Proposed branch: lp:~zorba-coders/zorba/xqdoc_fixes
Merge into: lp:zorba
Diff against target: 64 lines (+14/-3)
4 files modified
modules/com/zorba-xquery/www/modules/xqdoc.xsd (+1/-0)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+11/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res (+1/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/xqdoc_fixes
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Sorin Marian Nasoi Approve
Review via email: mp+101580@code.launchpad.net

Commit message

Add prefix attribute to xqdoc:annotation elements.
This enables a better handling of predeclared namespaces.

Description of the change

Add prefix attribute to xqdoc:annotation elements.
This enables a better handling of predeclared namespaces.

To post a comment you must log in.
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 xqdoc_fixes-2012-04-11T15-14-09.312Z is finished. The final status was:

All tests succeeded!

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

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Pending.

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

I have tested on Linux and everything looks fine: I have to test on Windows before approving the changes.

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

I have tested on Windows and also checked if the XQDoc XML's are valid according to the XQDoc Schema.

review: Approve
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 xqdoc_fixes-2012-04-18T12-26-55.106Z 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/xqdoc.xsd'
2--- modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-03-28 05:19:57 +0000
3+++ modules/com/zorba-xquery/www/modules/xqdoc.xsd 2012-04-11 15:13:31 +0000
4@@ -141,6 +141,7 @@
5 </xsd:complexType>
6
7 <xsd:complexType name="annotation">
8+ <xsd:attribute name="prefix" type="xsd:string" use="optional"/>
9 <xsd:attribute name="namespace" type="xsd:string" use="optional"/>
10 <xsd:attribute name="localname" type="xsd:string" use="optional"/>
11 <xsd:attribute name="value" type="xsd:string" use="optional"/>
12
13=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
14--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2012-04-11 03:19:40 +0000
15+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2012-04-11 15:13:31 +0000
16@@ -140,7 +140,10 @@
17 store::Item_t lAttrValueItem;
18 theFactory->createString(lAttrValueItem, lTmp);
19
20- store::Item_t lAttrNamespaceItem, lAttrLocalnameItem;
21+ store::Item_t lAttrPrefixItem, lAttrNamespaceItem, lAttrLocalnameItem;
22+
23+ zstring lPrefix = lAnn->get_qname()->get_prefix();
24+ theFactory->createString(lAttrPrefixItem, lPrefix);
25
26 lTmp = lAnn->get_qname()->get_prefix();
27 lTmp = theNamespaceMap[lTmp];
28@@ -149,6 +152,8 @@
29 lTmp = lAnn->get_qname()->get_localname();
30 theFactory->createString(lAttrLocalnameItem, lTmp);
31
32+ store::Item_t lPrefixQName;
33+ theFactory->createQName(lPrefixQName, "", "", "prefix");
34 store::Item_t lNamespaceQName;
35 theFactory->createQName(lNamespaceQName, "", "", "namespace");
36 store::Item_t lLocalnameQName;
37@@ -158,6 +163,11 @@
38
39 lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
40 theFactory->createAttributeNode(
41+ lPrefixQName, lAnnotationElem, lPrefixQName,
42+ lTypeName, lAttrPrefixItem);
43+
44+ lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
45+ theFactory->createAttributeNode(
46 lNamespaceQName, lAnnotationElem, lNamespaceQName,
47 lTypeName, lAttrNamespaceItem);
48
49
50=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res'
51--- test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2012-03-28 05:19:57 +0000
52+++ test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res 2012-04-11 15:13:31 +0000
53@@ -1,1 +1,1 @@
54-<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" 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>
55\ No newline at end of file
56+<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>
57
58=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res'
59--- test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2012-03-28 05:19:57 +0000
60+++ test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res 2012-04-11 15:13:31 +0000
61@@ -1,1 +1,1 @@
62-<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" 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>
63\ No newline at end of file
64+<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>

Subscribers

People subscribed via source and target branches