Re: XML ouput for psql

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: greg(at)turnstep(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: XML ouput for psql
Date: 2003-03-17 21:36:36
Message-ID: 200303172136.h2HLaac09321@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Greg, do you have a newer patch to address the feedback you received, or
is this one good?

---------------------------------------------------------------------------

greg(at)turnstep(dot)com wrote:
[ There is text before PGP section. ]
>
[ PGP not available, raw data follows ]
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Peter Eisentraut wrote:
> > 1. Look into the SQL/XML standard draft (ftp.sqlstandards.org) to find out
> > whether the standard addresses this sort of thing.
>
> The URL you gave leads to a site curiously content-free and full of dead links.
> I've looked around a bit, but found nothing definitive. One good resource I
> did find was this:
>
> http://www.wiscorp.com/sql/SQLX_Bringing_SQL_and_XML_Together.pdf
>
> The article mentions a lot of links on the sqlstandards.org and iso.org sites, none
> of which work or are restricted. If anyone knows of some good links, please
> let me know. (especially ISO 9075). From what I've read of the SQLX stuff, the
> format in my patch should be mostly standard:
>
> <row>
> <name>Joe Sixpack</name>
> <age>35</age>
> <state>Alabama</state>
> </row>
>
> One problem is that the recommended way to handle non-standard characters
> (including spaces) is to escape them like this:
>
> foobar baz => <foobar_x0020_baz>
>
> This also includes escaping things like "_x*" and "xml*". We don't have
> anything like that in the code yet (?), but we should probably think about
> heading that way. I think escaping whitespace in quotes is good enough
> for now for:
>
> foobar baz => <"foobar baz">
>
> The xsd and xsi standards are also interesting, but needlessly complicated
> for psql output, IMO.
>
> > Incidentally, the HTML table model is such an established and standardized
> > XML and SGML table model, so the easiest way to get the task "add XML
> > output to psql" done is to update the HTML output to conform to XHTML.
> > That way you get both the strict XML and you can look at the formatted
> > result with any old (er, new) browser.
>
> I don't agree with this: XML and XHTML are two different things. We could
> certainly upgrade the HTML portion, but I am pretty sure that the XML
> standard calls for this format:
>
> <columnname>data here</columnname>
>
> ..which is not valid XHTML and won't be viewable by any browser. The other
> suggested XML formats are even further from XHTML than the above. The HTML
> format should be "html table/layout" specific and the XML should be
> "schema/data" specific.
>
> - --
> Greg Sabino Mullane greg(at)turnstep(dot)com
> PGP Key: 0x14964AC8 200302280938
>
> -----BEGIN PGP SIGNATURE-----
> Comment: http://www.turnstep.com/pgp.html
>
> iD8DBQE+X3k5vJuQZxSWSsgRAuXFAKDGO1IsjB9Lwtkcws1xJy47PibcLQCg3dx5
> fsy27qguZv841lPvCjzdUic=
> =4f9B
> -----END PGP SIGNATURE-----
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
[ Decrypting message... End of raw data. ]

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-03-17 21:41:48 Re: Bug #904: Deallocating of prepared statement in ECPG at
Previous Message Tom Lane 2003-03-17 20:18:44 Re: More outdated examples

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-03-17 21:37:23 Re: Dump ALTER TABLE/SET STORAGE in pg_dump
Previous Message Bruce Momjian 2003-03-17 19:57:10 Re: PGRES_POLLING_ACTIVE is unused...