Обсуждение: XML from postgreSQL tables

Поиск
Список
Период
Сортировка

XML from postgreSQL tables

От
Evgeniy Strokin
Дата:
Hi,
Does PostgreSQL generate XML?
I need get result of query not like recordset but like
XML (probably XML will be in recordset but it�s ok).
If it doesn�t support now may be some plans for
future?
Thanks
Jenya


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Re: XML from postgreSQL tables

От
Evgeniy Strokin
Дата:
Hmmm, I don�t think generate XML from recordset on
application side is better solution, than XML
generating on SQLServer side.
And there are no such tools (Java) and standards yet
as far as I know.
Anyway, I get the answer, Thanks for respond.

Jenya

--- Jeff Davis <list-pgsql-general@empires.org> wrote:
> I don't think postgres has any routines to generate
> xml. You might look into
> your application language; most have quite extensive
> xml libraries. There
> might be some better support in the future, but it's
> primarily an
> application's job to do that kind of thing.
>
> Regards,
>     Jeff
>
> On Wednesday 15 May 2002 06:58 am, Evgeniy Strokin
> wrote:
> > Hi,
> > Does PostgreSQL generate XML?
> > I need get result of query not like recordset but
> like
> > XML (probably XML will be in recordset but it�s
> ok).
> > If it doesn�t support now may be some plans for
> > future?
> > Thanks
> > Jenya
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > LAUNCH - Your Yahoo! Music Experience
> > http://launch.yahoo.com
> >
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

Re: XML from postgreSQL tables

От
Jeff Davis
Дата:
I don't think postgres has any routines to generate xml. You might look into
your application language; most have quite extensive xml libraries. There
might be some better support in the future, but it's primarily an
application's job to do that kind of thing.

Regards,
    Jeff

On Wednesday 15 May 2002 06:58 am, Evgeniy Strokin wrote:
> Hi,
> Does PostgreSQL generate XML?
> I need get result of query not like recordset but like
> XML (probably XML will be in recordset but it’s ok).
> If it doesn’t support now may be some plans for
> future?
> Thanks
> Jenya
>
>
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: XML from postgreSQL tables

От
Karel Zak
Дата:
On Wed, May 15, 2002 at 12:58:50PM -0700, Evgeniy Strokin wrote:
> Hmmm, I don’t think generate XML from recordset on
> application side is better solution, than XML
> generating on SQLServer side.

 Hmm, but SQL means SQL and not XML :-)
 Maybe you can try search some application server
 that support it.

 Is there some good and standard XML for SQL data
 description?

        Karel

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Re: XML from postgreSQL tables

От
"Marin Dimitrov"
Дата:
----- Original Message -----
From: "Karel Zak"


>  Maybe you can try search some application server
>  that support it.
>

a search on sourceforge.net for [xml sql] will return a bunch of projects
which may or may not be useful.

The one that seems interesting is "xmlQuery" at
http://sourceforge.net/projects/xmlquery/ which is described as a "Java
library to execute SQL Query to database and convert result into XML"

>  Is there some good and standard XML for SQL data
>  description?
>

none I am aware of, but the Oracle XML-SQL Utility may be a good start.
Their "canonical mapping" just wraps the resutset in  <ROWSET> and <ROW>
tags, so that (example quoted) "select * from dept" for a table defined as:

CREATE TABLE dept
(
  DEPTNO NUMBER,
  DEPTNAME VARCHAR2(20),
  DEPTADDR AddressType,
  EMPLIST  EmployeeListType
);


...will return something like

<?xml version='1.0'?>
<ROWSET>
 <ROW num="1">
    <DEPTNO>100</DEPTNO>
    <DEPTNAME>Sports</DEPTNAME>
    <DEPTADDR>
      <STREET>100 Redwood Shores Pkwy</STREET>
      <CITY>Redwood Shores</CITY>
      <STATE>CA</STATE>
      <ZIP>94065</ZIP>
    </DEPTADDR>
    <EMPLIST>
      <EMPLIST_ITEM num="1">
         <EMPNO>7369</EMPNO>
         <ENAME>John</ENAME>
         <SALARY>10000</SALARY>
         <EMPADDR>
           <STREET>300 Embarcadero</STREET>
           <CITY>Palo Alto</CITY>
           <STATE>CA</STATE>
           <ZIP>94056</ZIP>
         </EMPADDR>
      </EMPLIST_ITEM>
       <!-- additional employee types within the employee list -->
    </EMPLIST>
  </ROW>
  <!-- additional rows ... -->
</ROWSET>


and BTW it is not mandatory that this transformation be performed on the
server - it may as well be done on the middle or the client tier.
M
ore info about Oracle XSU is available at
http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Production9i/index.
html (requires free TechNet account)

hth,

    Marin

----
"...what you brought from your past, is of no use in your present. When
you must choose a new path, do not bring old experiences with you.
Those who strike out afresh, but who attempt to retain a little of the
old life, end up torn apart by their own memories. "




Re: XML from postgreSQL tables

От
Jeff Eckermann
Дата:
If you are running PostgreSQL version 7.2.x, you can
install pl/perlu ("untrusted" Perl procedural
language), which will allow you to use any Perl module
that will do what you want.

Sorry, don't know enough about the modules to
recommend one in particular.

--- Evgeniy Strokin <evgeniy_strokin@yahoo.com> wrote:
> Hmmm, I don�t think generate XML from recordset on
> application side is better solution, than XML
> generating on SQLServer side.
> And there are no such tools (Java) and standards yet
> as far as I know.
> Anyway, I get the answer, Thanks for respond.
>
> Jenya
>
> --- Jeff Davis <list-pgsql-general@empires.org>
> wrote:
> > I don't think postgres has any routines to
> generate
> > xml. You might look into
> > your application language; most have quite
> extensive
> > xml libraries. There
> > might be some better support in the future, but
> it's
> > primarily an
> > application's job to do that kind of thing.
> >
> > Regards,
> >     Jeff
> >
> > On Wednesday 15 May 2002 06:58 am, Evgeniy Strokin
> > wrote:
> > > Hi,
> > > Does PostgreSQL generate XML?
> > > I need get result of query not like recordset
> but
> > like
> > > XML (probably XML will be in recordset but it�s
> > ok).
> > > If it doesn�t support now may be some plans for
> > > future?
> > > Thanks
> > > Jenya
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > LAUNCH - Your Yahoo! Music Experience
> > > http://launch.yahoo.com
> > >
> > > ---------------------------(end of
> > broadcast)---------------------------
> > > TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>
>
> __________________________________________________
> Do You Yahoo!?
> LAUNCH - Your Yahoo! Music Experience
> http://launch.yahoo.com
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
>     (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com