how to handle xml Name spaces using db2 xquery

This is a discussion on how to handle xml Name spaces using db2 xquery within the db2-udb forums in Other Databases category; Hi, I am trying xml data processing using Xquery version 9.1 My xml file --------- HTML Code: <?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <GetBookingDetailsResponse xmlns="http://types.xml.bookingquery.myproject.ws.clientname.com"> <record> <id>123</id> …… </record> ------------- To get id value i.e “123” fallowing query will work if I remove above name spaces in xml file select XMLCAST(xmlquery('$id/record/id' passing info as id ), ...

Go Back   Database Forum > Other Databases > db2-udb

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 06-23-2008, 05:34 AM
Angry how to handle xml Name spaces using db2 xquery

Hi,

I am trying xml data processing using Xquery version 9.1

My xml file
---------
HTML Code:
<?xml version="1.0" ?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <GetBookingDetailsResponse
			xmlns="http://types.xml.bookingquery.myproject.ws.clientname.com"> <record> <id>123</id>
        ……
  </record>
-------------
To get id value i.e “123” fallowing query will work if I remove above name spaces in xml file

select XMLCAST(xmlquery('$id/record/id' passing info as "id"), name AS VARCHAR(25)) from src_tab

but according to my requirement I can’t remove that xmlns from xml.

So please tell me how to handle names spaces in xquery.

Can I have example query for above situation.

Appreciate for early replies.

Thanks and regards
tomasss
Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 04:46 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.