postgresql query to XML result - Mailing list pgsql-sql

From Rishabh Gupta
Subject postgresql query to XML result
Date
Msg-id a9sktm$6ol$1@pump1.york.ac.uk
Whole thread Raw
List pgsql-sql
Hi all,
    Can anyone tell me whether there is any querying system that allows
query results to be output in XML. The data that I am dealing with  is
ordinary relation data, so this is not a question on how to store XML
documents into postgresql. I am not trying to save XML documents into the
DB. What I would like is if I could run an SQL-like query and the output
would be an XML document.

E.g. suppose I have a database of Music CDS, there would be a table for the
CD, a table for the Artist, a table for the Track. There would be further
tables to join them together, e.g. CD_Artist and CD_Track. The output of a
query would be something like this:

<CD>
    <TITLE>CD TITLE</TITLE>
    <ARTISTS>
        <ARTIST>artist1</ARTIST>
        <ARTIST>artist2</ARTIST>
        <ARTIST>artist3</ARTIST>
        <ARTIST>artist4</ARTIST>
    </ARTISTS>
    <TRACKS>
        <TRACK>Track Title 1</TRACK>
        <TRACK>Track Title 2</TRACK>
        <TRACK>Track Title 3</TRACK>
        <TRACK>Track Title 4</TRACK>
        <TRACK>Track Title 5</TRACK>
    </TRACKS>
</CD>


I have had a look at LXP but I would prefer something that sits closer to
the actual DBMS. As I understand it, LXP is a scripting language that is
executed by Apache.

Does anyone know of such a system. Your help would be greatly appreciated.

Many Thanks

Rishabh



pgsql-sql by date:

Previous
From: tulasi
Date:
Subject: accept AD35- 6FA9 -9515
Next
From: Peter Eisentraut
Date:
Subject: Re: accept AD35- 6FA9 -9515