OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Embedding SQL statements in XML

[ Lists Home | Date Index | Thread Index ]
  • From: Jeff Turner <jeff@socialchange.net.au>
  • To: Michel Rodriguez <mrodrigu@ieee.org>
  • Date: Wed, 15 Nov 2000 15:26:48 +1100 (EST)


The Cocoon publishing framework (http://xml.apache.org/cocoon) has
something that does exactly what you want:

http://xml.apache.org/cocoon/sqltaglib.html

You embed the XML-formatted SQL query in a page, eg:

<sql:execute-query>
  <sql:driver>com.informix.jdbc.IfxDriver</sql:driver>
  
<sql:dburl>jdbc:informix-sqli://localhost:1526/database:informixserver=server</sql:dburl>
  <sql:username>dbUser</sql:username>
  <sql:password>dbPass</sql:password>
  <sql:query>SELECT * FROM CUSTOMER;</sql:query>
</sql:execute-query>


When the user requests that page, they get back the query results marked
up as XML. There can be intermediate stylesheets to format the output too.

There's also an equivalent tagset for querying LDAP, and another for
reading/writing XML files, where nodes are specified with XPath
expressions.

All Open Source, works really well.

--Jeff


On Tue, 14 Nov 2000, Michel Rodriguez wrote:

> Hi,
> 
> I was wondering whether some work, maybe standardization work, has been
> done on embedding data from a relational database into an XML document.
> The document is processed to generate the complete XML document, but the
> non-processed version is the one that is edited and managed in the system.
> 
> I have found no trace of public work on that topic, although I know of a
> couple of old SGML implementations.
> 
> I realize that various type of results can be required, from a single
> value to a complete table, through one or more rows or columns (columns
> being even trickier than rows). Plus the queries can be variously
> parametrized and connection to the DB is always a problem. But I am
> surprized not to find _anything_ on the subject.
> 
> I am looking at something like standard fragments looking like 
> 
> <p> text <sql_value db="db1" query="select price from book where
> isbn=123456"> more text</p>
> 
> for single values and like
> 
> <tr><sql_row db="db2" query="select title, price from book where
> isbn=123456"></tr>
> 
> for rows
> 
> Would anyone know of anything in this area?
> 
> Thank you
> 
> Michel Rodriguez
> Perl & XML
> 





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS