XMLQuery (XQuery) with namespace
526128Aug 23 2006 — edited Aug 31 2006I'm pretty new to XML/XQuery and have the following problem.
I've got a DB outside oracle which is the same as I got in Oracle (10.2.0.1.0). Using XMLSpy I can make a simple query with a default namespace that gives me an XML document.
####################
xquery version "1.0";
declare default element namespace "POI";
for $x in fn:doc("H:\urs\025_XPOI\XDB\xdb\Simple\xml\001_03082006\xpoi\simple.xml")/Simple_XPOIS/Simple
where $x/ID = 1
return $x
####################
When I try the same in Oracle, it fails. I have no idea how to use the XMLNamespaces......
####################
SQL>
SQL> WITH XMLNamespaces (DEFAULT 'POI')
2 SELECT XMLQuery('
3 for $x in fn:doc("/home/Simple/xml/001_03082006/xpoi/simple.xml")/Simple_XPOIS/Simple
4 where $x/ID = 1
5 return $x
6 '
7 RETURNING CONTENT) AS RESULT FROM DUAL;
WITH XMLNamespaces (DEFAULT 'POI')
*
ERROR at line 1:
ORA-32033: unsupported column aliasing
####################