XML / XSL rendering in PostgreSQL server?

Started by Peter Sampsonover 17 years ago4 messages
#1Peter Sampson
peter@kobry.com

Hi,

I would like to use one of the XML rendering functions like
table_to_xml_and_xmlschema OR table_to_xml and render the output via XSL,
preferably in one query.

I've searched the mailing lists,site, docs and Google -- to no avail. Also,
I see that xslt_process (from xml2) will be deprecated going forward. We're
building an app that will be used for a long time into the future, and I'd
like to keep it future-compatible.

I've also searched online for sql / xml docs or tutorials, but haven't found
any that directly addresses using xsl in queries itself.

First, is this even possible without xslt_process ? If so, how?

Any ideas?

Thanks a lot!

Regards,

Peter Sampson

#2Tino Wildenhain
tino@wildenhain.de
In reply to: Peter Sampson (#1)
Re: XML / XSL rendering in PostgreSQL server?

Hi,

Peter Sampson wrote:

Hi,

I would like to use one of the XML rendering functions like
table_to_xml_and_xmlschema OR table_to_xml and render the output via
XSL, preferably in one query.

What do you think would be the benefit of doing that?

I've searched the mailing lists,site, docs and Google -- to no avail.
Also, I see that xslt_process (from xml2) will be deprecated going
forward. We're building an app that will be used for a long time into
the future, and I'd like to keep it future-compatible.

I've also searched online for sql / xml docs or tutorials, but haven't
found any that directly addresses using xsl in queries itself.

You could try with one of the pl/*u languages.

Regards
Tino

#3Peter Sampson
peter@kobry.com
In reply to: Tino Wildenhain (#2)
Re: XML / XSL rendering in PostgreSQL server?

Tino, thanks for your reply

I would like to use one of the XML rendering functions like

table_to_xml_and_xmlschema OR table_to_xml and render the output via XSL,
preferably in one query.

"What do you think would be the benefit of doing that?"

My main reason would be to embed all of the application logic in the
postgres server. This way, we can build out the app more efficiently by not
relying on middleware. It seems like there would be fewer cycles committed
to the whole application if it was all done in the DB, but I could be wrong.

Yes, I am using pl/pgSQL for all of the internals. I could formulate and
output the data this way, but if Postgres has methods for using XSL to do
this, why not use it instead of re-inventing it (and we can keep the
public-view logic separate from the business logic in the server)?

Thanks.

Peter

On Fri, Aug 15, 2008 at 1:46 AM, Tino Wildenhain <tino@wildenhain.de> wrote:

Show quoted text

Hi,

Peter Sampson wrote:

Hi,

I would like to use one of the XML rendering functions like
table_to_xml_and_xmlschema OR table_to_xml and render the output via XSL,
preferably in one query.

What do you think would be the benefit of doing that?

I've searched the mailing lists,site, docs and Google -- to no avail.

Also, I see that xslt_process (from xml2) will be deprecated going forward.
We're building an app that will be used for a long time into the future, and
I'd like to keep it future-compatible.

I've also searched online for sql / xml docs or tutorials, but haven't
found any that directly addresses using xsl in queries itself.

You could try with one of the pl/*u languages.

Regards
Tino

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Sampson (#1)
Re: XML / XSL rendering in PostgreSQL server?

Am Friday, 15. August 2008 schrieb Peter Sampson:

I've searched the mailing lists,site, docs and Google -- to no avail. Also,
I see that xslt_process (from xml2) will be deprecated going forward. We're
building an app that will be used for a long time into the future, and I'd
like to keep it future-compatible.

There is no "future-proof" XSL(T) support in PostgreSQL yet. We need to work
out how we want to do that.