File tree Expand file tree Collapse file tree
basex-core/src/test/java/org/basex/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,23 @@ public final class NamespaceTest extends SandboxTest {
8989
9090 query ("declare namespace p = 'A'; <p:l>{ namespace p { 'B' } }</p:l> => in-scope-prefixes()" ,
9191 "p_1\n p\n xml" );
92+
93+ query ("<e xmlns='E'/> -> namespace-uri()" , "E" );
94+ query ("<a:e xmlns:a='A'/> -> namespace-uri()" , "A" );
95+ query ("<e a='{<e b:a='42' xmlns:b='N'/>/@a:a}' xmlns:a='N'/>/@a -> data()" , 42 );
96+ query ("<e a='{<x a:b='42' xmlns:a='A'/>/@Q{A}b}'/>/@a -> data()" , 42 );
97+ query ("<e a='{<f xmlns='N'/> -> namespace-uri()}'/>/@a -> data()" , "N" );
98+ query ("<e a:a='42' xmlns:a='A'/>/@*:a -> namespace-uri()" , "A" );
99+ query ("<e a='{f:identity(42)}' xmlns:f='http://www.w3.org/2005/xpath-functions'/>/@a -> data()" ,
100+ 42 );
101+ query ("<e a='{let $x:v := 42 return $y:v}' xmlns:x='N' xmlns:y='N'/>/@a -> data()" , 42 );
102+ query (
103+ "<e a='{0 cast as type:byte}' xmlns:type='http://www.w3.org/2001/XMLSchema'/>/@a -> data()" ,
104+ 0 );
105+
106+ error ("<e a='{f:identity(42)}'/>" , NOURI_X );
107+ error ("<e xmlns:a='A' xmlns:a='B'/>" , DUPLNSDEF_X );
108+ error ("<e xmlns:xml='X'/>" , BINDXML_X );
92109 }
93110
94111 /** Simple tests. */
You can’t perform that action at this time.
0 commit comments