Re: Create XML elements from rows

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: Thangalin <thangalin(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Create XML elements from rows
Date: 2011-12-28 08:15:48
Message-ID: CA+h6AhgsDp3URuPt+4iawNGr6jydnGW_+0MrK8j+Y+Qu6WgNaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Check below link:-

http://wiki.postgresql.org/wiki/XML_Support

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

On Wed, Dec 28, 2011 at 1:41 PM, Thangalin <thangalin(at)gmail(dot)com> wrote:

> Hi,
>
> Data in a table called 'equipment_group' (eg) contains various equipment
> categories:
>
> bakeware
> cookware
> kitchenware
> utensils
>
> I would like to use these values as elements within an XML document.
> Something like:
>
> xmlelement( name eg.label )
>
> Each of these data element can have multiple objects, as shown in the
> following XML snippet:
>
> <equipment>
> <bakeware>
> <object min-quantity="20">ramekin</object>
> <object min-quantity="2" alias="pan">shallow baking pan</object>
> </bakeware>
> <cookware>
> <object min-quantity="1" alias="pot">medium pot</object>
> </cookware>
> <utensils>
> <object alias="torch">kitchen butane torch</object>
> <object alias="sieve">fine-mesh sieve</object>
> <object alias="whisk">wire whisk</object>
> </utensils>
> </equipment>
>
> In PostgreSQL 9.1, I do not see an XML function that allows XML element
> creation based on row data. It seems the row data is always used as the
> values for elements.
>
> How do you create XML elements using names stored as row data?
>
> Thank you!
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2011-12-28 09:49:50 Re: Detecting uncommitted changes
Previous Message Scott Marlowe 2011-12-28 08:15:17 Re: PostgreSQL 9.1 pg_dump setval() sets wrong value