William Candillon has proposed merging lp:~zorba-coders/zorba/xqdoc_fixes into 
lp:zorba.

Requested reviews:
  Sorin Marian Nasoi (sorin.marian.nasoi)
  Matthias Brantner (matthias-brantner)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/xqdoc_fixes/+merge/101580

Add prefix attribute to xqdoc:annotation elements.
This enables a better handling of predeclared namespaces.
-- 
https://code.launchpad.net/~zorba-coders/zorba/xqdoc_fixes/+merge/101580
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'modules/com/zorba-xquery/www/modules/xqdoc.xsd'
--- modules/com/zorba-xquery/www/modules/xqdoc.xsd	2012-03-28 05:19:57 +0000
+++ modules/com/zorba-xquery/www/modules/xqdoc.xsd	2012-04-11 15:13:31 +0000
@@ -141,6 +141,7 @@
   </xsd:complexType>
 
   <xsd:complexType name="annotation">
+     <xsd:attribute name="prefix" type="xsd:string" use="optional"/>
      <xsd:attribute name="namespace" type="xsd:string" use="optional"/>
      <xsd:attribute name="localname" type="xsd:string" use="optional"/>
      <xsd:attribute name="value" type="xsd:string" use="optional"/>

=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp	2012-04-11 03:19:40 +0000
+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp	2012-04-11 15:13:31 +0000
@@ -140,7 +140,10 @@
       store::Item_t lAttrValueItem;
       theFactory->createString(lAttrValueItem, lTmp);
 
-      store::Item_t lAttrNamespaceItem, lAttrLocalnameItem;
+      store::Item_t lAttrPrefixItem, lAttrNamespaceItem, lAttrLocalnameItem;
+
+      zstring lPrefix = lAnn->get_qname()->get_prefix();
+      theFactory->createString(lAttrPrefixItem, lPrefix);
 
       lTmp = lAnn->get_qname()->get_prefix();
       lTmp = theNamespaceMap[lTmp];
@@ -149,6 +152,8 @@
       lTmp = lAnn->get_qname()->get_localname();
       theFactory->createString(lAttrLocalnameItem, lTmp);
 
+      store::Item_t lPrefixQName;
+      theFactory->createQName(lPrefixQName, "", "", "prefix");
       store::Item_t lNamespaceQName;
       theFactory->createQName(lNamespaceQName, "", "", "namespace");
       store::Item_t lLocalnameQName;
@@ -158,6 +163,11 @@
      
       lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
       theFactory->createAttributeNode(
+        lPrefixQName, lAnnotationElem, lPrefixQName,
+        lTypeName, lAttrPrefixItem);
+     
+      lTypeName = GENV_TYPESYSTEM.XS_UNTYPED_QNAME;
+      theFactory->createAttributeNode(
         lNamespaceQName, lAnnotationElem, lNamespaceQName,
         lTypeName, lAttrNamespaceItem);
 

=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res	2012-03-28 05:19:57 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res	2012-04-11 15:13:31 +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" 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>
\ 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="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>

=== modified file 'test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res'
--- test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res	2012-03-28 05:19:57 +0000
+++ test/rbkt/ExpQueryResults/zorba/xqdoc/no_global_var.xml.res	2012-04-11 15:13:31 +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" 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>
\ 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>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>

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to