Unix Technical Forum

Using xmltype.existsNode with an xml file which uses parameters

This is a discussion on Using xmltype.existsNode with an xml file which uses parameters within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi all, I am trying to use xmltype.existsNode as part of a select to parse an xmltype variable. I've ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 12:18 PM
J Englert
 
Posts: n/a
Default Using xmltype.existsNode with an xml file which uses parameters

Hi all,

I am trying to use xmltype.existsNode as part of a select to parse an
xmltype variable. I've noticed that existsNode doesn't seem to be
able to handle situations in which an element of the xmltype has
paramters. Here is an illustration of the problem:

select a.col1.existsNode('/OpGetListResponse')
from jason_xml_test a

returns 1 if the root element looks like this:

<OpGetListResponse>

and returns 0 if the root element looks like this:

<OpGetListResponse xmlns="urn:AST_CDROMDrive" >

Has anyone ever seen this before? If so, how did you work around it?

Thanks for the help,
Jason

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 12:18 PM
Ko van der Sloot
 
Posts: n/a
Default Re: Using xmltype.existsNode with an xml file which uses parameters

J Englert wrote:
> Hi all,
>
> I am trying to use xmltype.existsNode as part of a select to parse an
> xmltype variable. I've noticed that existsNode doesn't seem to be
> able to handle situations in which an element of the xmltype has
> paramters. Here is an illustration of the problem:
>
> select a.col1.existsNode('/OpGetListResponse')
> from jason_xml_test a
>
> returns 1 if the root element looks like this:
>
> <OpGetListResponse>
>
> and returns 0 if the root element looks like this:
>
> <OpGetListResponse xmlns="urn:AST_CDROMDrive" >


This is not a 'parameter' but an 'attribute', but ok,
what about something like:
a.col1.existsNode('/OpGetListResponse', 'AST_CDROMDrive' )

> Has anyone ever seen this before? If so, how did you work around it?


in case of a namespace declariation, existsNode needs an extra parameter!

> Thanks for the help,
> Jason


Ko vd Sloot
Tilburg Univerity
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 12:18 PM
J Englert
 
Posts: n/a
Default Re: Using xmltype.existsNode with an xml file which uses parameters

On Feb 14, 10:49 am, Ko van der Sloot <Ko.vanderSl...@uvt.nl> wrote:
> J Englert wrote:
> > Hi all,

>
> > I am trying to use xmltype.existsNode as part of a select to parse an
> > xmltype variable. I've noticed that existsNode doesn't seem to be
> > able to handle situations in which an element of the xmltype has
> > paramters. Here is an illustration of the problem:

>
> > select a.col1.existsNode('/OpGetListResponse')
> > from jason_xml_test a

>
> > returns 1 if the root element looks like this:

>
> > <OpGetListResponse>

>
> > and returns 0 if the root element looks like this:

>
> > <OpGetListResponse xmlns="urn:AST_CDROMDrive" >

>
> This is not a 'parameter' but an 'attribute', but ok,
> what about something like:
> a.col1.existsNode('/OpGetListResponse', 'AST_CDROMDrive' )
>
> > Has anyone ever seen this before? If so, how did you work around it?

>
> in case of a namespace declariation, existsNode needs an extra parameter!
>
> > Thanks for the help,
> > Jason

>
> Ko vd Sloot
> Tilburg Univerity- Hide quoted text -
>
> - Show quoted text -


Thanks for the help.

I actually had to use

a.col1.existsNode('/OpGetListResponse', 'xmlns=urn:HPD_Help_Desk')

but your suggestion put me on the right path.

Thanks again,
Jason

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:15 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com