mlw writes:
> Given a HTTP formatted query:
> GET "http://localhost:8181/pgmuze?query=select+*+from+zsong+limit+2"
>
> The output is entered below.
That looks a lot like the SQL/XML-style output plus a SOAP header. Below
is the output that I get from the SQL/XML function that I wrote. A simple
XSLT stylesheet should do the trick for you.
Btw., I also have an XSLT stylesheet that can make an HTML table out of
this output and I have a table function that can generate a virtual table
from this output.
=> select table2xml('select * from products');
<?xml version='1.0'?>
<table xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='#'> <!-- XXX this needs
tobe fixed -->
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:sqlxml='http://www.iso-standards.org/mra/9075/2001/12/sqlxml'>
<xsd:import namespace='http://www.iso-standards.org/mra/9075/2001/12/sqlxml'
schemaLocation='http://www.iso-standards.org/mra/9075/2001/12/sqlxml.xsd'/>
<xsd:simpleType name='peter.pg_catalog.text'> <xsd:restriction base='xsd:string'> <xsd:maxLength value='MLIT' /> <!--
XXXneeds actual value --> </xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name='INTEGER'> <xsd:restriction base='xsd:integer'> <xsd:maxInclusive value='2147483647'/>
<xsd:minInclusivevalue='-2147483648'/> </xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name='NUMERIC'> <xsd:restriction base='xsd:decimal'> <xsd:totalDigits value='PLIT'/> <!-- XXX needs
actualvalues --> <xsd:fractionDigits value='SLIT'/> </xsd:restriction>
</xsd:simpleType>
<xsd:complexType name='RowType'> <xsd:sequence> <xsd:element name='name' type='peter.pg_catalog.text'
nillable='true'></xsd:element> <xsd:element name='category' type='INTEGER' nillable='true'></xsd:element>
<xsd:elementname='price' type='NUMERIC' nillable='true'></xsd:element> </xsd:sequence>
</xsd:complexType>
<xsd:complexType name='TableType'> <xsd:sequence> <xsd:element name='row' type='RowType' minOccurs='0'
maxOccurs='unbounded'/> </xsd:sequence>
</xsd:complexType>
<xsd:element name='table' type='TableType' />
</xsd:schema>
<row> <name>screwdriver</name> <category>3</category> <price>7.99</price> </row>
<row> <name>drill</name> <category>9</category> <price>12.49</price> </row>
</table>
--
Peter Eisentraut peter_e@gmx.net