Sorin Marian Nasoi has proposed merging lp:~zorba-coders/zorba/fix_bug_1167641 
into lp:zorba.

Commit message:
FOTS driver fox for lp:1167641.

Requested reviews:
  Sorin Marian Nasoi (sorin.marian.nasoi)
Related bugs:
  Bug #1167641 in Zorba: "Can not expand NS prefix to URI for decimal-format #2"
  https://bugs.launchpad.net/zorba/+bug/1167641

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1167641/+merge/164540
-- 
https://code.launchpad.net/~zorba-coders/zorba/fix_bug_1167641/+merge/164540
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'test/fots/CMakeLists.txt'
--- test/fots/CMakeLists.txt	2013-05-16 22:26:07 +0000
+++ test/fots/CMakeLists.txt	2013-05-17 21:06:26 +0000
@@ -169,7 +169,7 @@
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat60q 1167609)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat63 1167609)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat64 1167609)
-EXPECTED_FOTS_FAILURE (fn-format-number numberformat83 1167643)
+EXPECTED_FOTS_FAILURE (fn-format-number numberformat83 1167641)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat87 1167641)
 EXPECTED_FOTS_FAILURE (fn-format-number numberformat88 1167641)
 EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 1090514)

=== modified file 'test/fots_driver/environment.xq'
--- test/fots_driver/environment.xq	2013-04-29 12:41:47 +0000
+++ test/fots_driver/environment.xq	2013-05-17 21:06:26 +0000
@@ -170,10 +170,12 @@
  : to a test-case query.
  :
  : @param $decimal-formats decimal formats.
+ : @param $namespaces the declared environment namespaces.
  : @return the decimal formats declarations.
  :)
 declare function env:decl-decimal-formats(
-  $decimal-formats as element(fots:decimal-format)*
+  $decimal-formats as element(fots:decimal-format)*,
+  $namespaces      as element(fots:namespace)*
 ) as xs:string*
 {
   if (empty($decimal-formats))
@@ -183,9 +185,10 @@
     let $default := if ($tmp/@name)
                     then ()
                     else "default"
-    let $name := if ($tmp/@name)
-                 then data($tmp/@name)
-                 else ()
+    let $name := xs:string($tmp/@name)
+    let $eqName := fn:resolve-QName(xs:string($tmp/@name), $tmp)
+    let $prefix := fn:prefix-from-QName($eqName)
+    let $namespace := $namespaces/following-sibling::*[@uri=fn:namespace-uri-from-QName($eqName)]
     return
       string-join
       (
@@ -193,7 +196,9 @@
         "declare",
         $default,
         "decimal-format",
-        $name,
+        if(exists($prefix) and empty($namespace))
+        then concat("Q{", namespace-uri-from-QName($eqName), "}", local-name-from-QName($eqName))
+        else $name,
         env:set-properties($tmp),
         ";"
       ),

=== modified file 'test/fots_driver/fots-driver.xq'
--- test/fots_driver/fots-driver.xq	2013-05-02 23:13:17 +0000
+++ test/fots_driver/fots-driver.xq	2013-05-17 21:06:26 +0000
@@ -875,7 +875,9 @@
         env:decl-namespaces($env, $envCase, $test),
 
         env:decl-decimal-formats(($env/fots:decimal-format,
-                                  $envCase/fots:decimal-format)),
+                                  $envCase/fots:decimal-format),
+                                 ($env/fots:namespace,
+                                  $envCase/fots:namespace)),
 
         env:add-var-decl($env, $envCase, $envBaseURI, $testSetBaseURI),
 

-- 
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