kszbcss / xspec

Private backup of the xspec project at google code, as google code is going to disappear.
MIT License
1 stars 0 forks source link

incorrect namespace prefix generated for t:result in xquery test #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I run the following xpsec test, the query it generates doesn't define the 
t: 
namespace prefix, but makes use of it in the form of $t:result.  I've included 
the 
relevant snippet below.  

I think the fix is as simple as changing $t:result into $x:result in 
generate-query-
tests.xsl

declare function local:d4e2()
{
<x:scenario xmlns:x="http://www.jenitennison.com/xslt/xspec"><x:label>returns 
something</x:label><x:call function="m:identity"><x:param><hello 
xmlns:m="http://test.com"/></x:param></x:call>      
{
  let $d6e1 := ( <hello xmlns:m="http://test.com"/> )
  let $t:result := m:identity($d6e1)
    return (
      test:report-value($t:result, 'x:result'),
      let $x:tmp := local:d4e6($x:result) return (
        $x:tmp
      )
    )
}
</x:scenario>
};

Original issue reported on code.google.com by jsulak@gmail.com on 10 Mar 2010 at 11:05

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch!  Actually the problem is a bit more subtle.  The
stylesheet tries to reuse the prefix used in the source test
suite instead of hard-coding it.  Unfortunately, a few hard-
coded prefixes found their way to the stylesheet during some
refactoring.  I've fixed that.  Note however that the prefix x:
is still hard-coded in a few places, in legacy code, but as long
as it is used it is declared.

I've just commited r144 which hopefully solves this bug.  Can you
check it does and close this issue if so?

Original comment by fgeorges on 11 Mar 2010 at 10:05

GoogleCodeExporter commented 9 years ago
Looks good to me.  

Original comment by jsulak@gmail.com on 11 Mar 2010 at 12:31

GoogleCodeExporter commented 9 years ago

Original comment by fgeorges on 11 Mar 2010 at 1:33