Re: XML ouput for psql - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: XML ouput for psql
Date
Msg-id 200303172136.h2HLaac09321@candle.pha.pa.us
Whole thread Raw
In response to Re: XML ouput for psql  (greg@turnstep.com)
Responses Re: XML ouput for psql  (greg@turnstep.com)
List pgsql-patches
Greg, do you have a newer patch to address the feedback you received, or
is this one good?

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

greg@turnstep.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@turnstep.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@postgresql.org
>
[ Decrypting message... End of raw data. ]

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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PGRES_POLLING_ACTIVE is unused...
Next
From: Bruce Momjian
Date:
Subject: Re: Dump ALTER TABLE/SET STORAGE in pg_dump