Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

default namespace have to be the first in xmlnamespaces()

Ants HindpereSep 16 2008 — edited Sep 17 2008
Hi,

for some reason default namesapace have to be the first namespace and then you can add other namespaces.
SQL> select * from v$version;

BANNER                                                                          
----------------------------------------------------------------                
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi                
PL/SQL Release 10.2.0.1.0 - Production                                          
CORE	10.2.0.1.0	Production                                                      
TNS for Linux: Version 10.2.0.1.0 - Production                                  
NLSRTL Version 10.2.0.1.0 - Production                                          

SQL> with t as (select xmltype('<s:a xmlns:s="sss" xmlns="aaa"><b>1</b></s:a>') xcol
  2             from dual)
  3  select x.val
  4  from t
  5       ,xmltable(xmlnamespaces('sss' as "s",default 'aaa')
  6                 ,'/s:a'
  7          passing t.xcol
  8          columns val varchar2(1) path '/s:a/b/text()'
  9        ) x;

V                                                                               
-                                                                               
                                                                                
Value is missing!
SQL> 
SQL> with t as (select xmltype('<s:a xmlns:s="sss" xmlns="aaa"><b>1</b></s:a>') xcol
  2             from dual)
  3  select x.val
  4  from t
  5       ,xmltable(xmlnamespaces(default 'aaa', 'sss' as "s")
  6                 ,'/s:a'
  7          passing t.xcol
  8          columns val varchar2(1) path '/s:a/b/text()'
  9        ) x;

V                                                                               
-                                                                               
1                                                                               
Now we have the value.


Looks like a bug or what?

Ants
This post has been answered by Marco Gralike on Sep 16 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2008
Added on Sep 16 2008
3 comments
586 views