[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Extracting XML data from a Table in PosgreSQL

Peter pc.subscriptions at gmail.com
Thu Dec 27 13:33:39 PST 2007


  Extracting XML data from a Table in PosgreSQL
> queries, but I don't know of one that does this - the DataDirect engine,
> which has this general architecture, will allow you to use XQuery
> against
> data stored in relational form, but not (as far as I am aware) against
> XML
> stored in a relational database as text.
Actually...it is possible using an extension function (ddtek:parse).

The doc has an example

create table xmltab (key int primary key, xmlval varchar(2000))
insert into xmltab values(1,'<a><b>1</b><b>11</b></a>')
insert into xmltab values(2,'<a><b>2</b><b>22</b></a>')

The following query returns the key value and b elements from
the xmlval column for every b element that contains a value
greater than 10:

for $x in collection('xmltab')/xmltab
let $y := ddtek:parse($x/xmlval)//b[xs:integer(.) > 10]
return (data($x/key),$y)

I am unfamiliar with the latest changes in terms of product architecture,
but with the last version I knew some of the internals, this approach would
only be practically feasible on 'smaller' XML fragments. 



Purchase Stylus Studio Online Today!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.