← Back to team overview

zorba-coders team mailing list archive

[Bug 917923] [NEW] undeclared variable in built-in module if called through invoke

 

Public bug reported:

[err:XPDY0002]: "r:foo": undeclared variable is raised for the following
scenario.

----------------------
A built-in module such as random declares a variable as follows:

declare variable $r:foo := 1;

----------------------
A library module foo declares a variable and accesses $r:foo in a function.

module namespace foo = "http://foo.com/";;

import module namespace r = 'http://www.zorba-
xquery.com/modules/random';

declare variable $foo:blub := 1;

declare function foo:bar()
{
  $r:foo
};

----------------------
A main module imports the library module foo and invokes the function foo:bar()

import module namespace invoke = 'http://www.zorba-xquery.com/modules/reflection';
import module namespace foo = "http://foo.com/"; at "/home/mbrantner/zorba/build/foo.xq";

invoke:invoke-s ( fn:QName ( 'http://foo.com/', 'bar' ) )

** Affects: zorba
     Importance: Critical
     Assignee: Markos Zaharioudakis (markos-za)
         Status: New

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/917923

Title:
  undeclared variable in built-in module if called through invoke

Status in Zorba - The XQuery Processor:
  New

Bug description:
  [err:XPDY0002]: "r:foo": undeclared variable is raised for the
  following scenario.

  ----------------------
  A built-in module such as random declares a variable as follows:

  declare variable $r:foo := 1;

  ----------------------
  A library module foo declares a variable and accesses $r:foo in a function.

  module namespace foo = "http://foo.com/";;

  import module namespace r = 'http://www.zorba-
  xquery.com/modules/random';

  declare variable $foo:blub := 1;

  declare function foo:bar()
  {
    $r:foo
  };

  ----------------------
  A main module imports the library module foo and invokes the function foo:bar()

  import module namespace invoke = 'http://www.zorba-xquery.com/modules/reflection';
  import module namespace foo = "http://foo.com/"; at "/home/mbrantner/zorba/build/foo.xq";

  invoke:invoke-s ( fn:QName ( 'http://foo.com/', 'bar' ) )

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/917923/+subscriptions


Follow ups

References