[Monetdb-developers] different presentation of XQuery results in mapiclient and jdbcclient

Fabian Groffen Fabian.Groffen at cwi.nl
Wed Sep 6 21:10:25 CEST 2006


On 06-09-2006 18:31:04 +0200, Ying Zhang wrote:
> Hi,
> 
> Mapiclient and jdbcclient use different ways to present the results of
> an XQuery query:
> 
> $ mapiclnt -lx
> <example>{<doc>Hello World</doc>/text()}</example>
> <?xml version="1.0" encoding="utf-8"?>
> <XQueryResult><example>Hello World</example></XQueryResult>
> 
> $ java -jar $INSTALL_DIR/share/MonetDB/lib/jdbcclient-1.4.jar -lxquery
> Welcome to the MonetDB interactive JDBC terminal!
> Type \q to quit, \h for a list of available commands
> auto commit mode: on
> monetdb-> <example>{<doc>Hello World</doc>/text()}</example>
> monetdb=>
> <xquery>
> <result>
>   <row>
>     <xml><example>Hello World</example></xml>
>   </row>
> </result>
> </xquery>
> 
> Why do we need two different ways?  Isn't it inconsistent?

Yes it is inconsistent, if you consider the two clients to be made for
the same purpose.  While MapiClient has (had) some different output
mode, JdbcClient has only two, one being tabular aligned result, such as
the MySQL and PostgreSQL consoles produce.  The other is XML output as
described in the SQL/XML standards paper: it implements the way to
transform a tabular result into an XML structure.
I thought that an xquery user would simply like XML output over tabular
output, hence you get this fancy XML structure.  However, what you see
is the representation of a tabular result; exactly what JDBC was
designed for, and exactly what JDBC v4.x is going to do with SQL/XML:
put it in strings in SQL-ish tabular structures.

The only thing that suprises me is the "<example>", but as I'm far
from an XML serialisation expert, the answer whether that is correct
behaviour is up to Wouter or Jan R.




More information about the developers-list mailing list