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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Query Format in XML

[ Lists Home | Date Index | Thread Index ]

Florent Georges wrote:
> Philippe Poulard wrote:
> 
>   Salut Philippe

Salut Florent ;)

> 
> 
>>                                     but unlike XSLT :
>>-it can query various data sources (RDBMS with SQL, XML:DB
>>databases, LDAP, etc)
> 
> 
>   XSLT too.  The XSLT input tree must conform to the XPath Data Model,
> but there is no need to have a lexical XML representation.  Actually,
> there is no need to have XML at all.

can you please give me the stylesheet that can produce the following XML :
<?xml version="1.0" encoding="UTF-8"?>
<order id="1234">
     <dollar>
         <item part-number="321" price="138.95" quantity="1">
             Lawnmower
         </item>
         <item part-number="654" price="29.99" quantity="2">
             Baby monitor
         </item>
     </dollar>
     <euro>
         <item part-number="987" price="11.27" quantity="3">
             Roquefort Cheese
         </item>
     </euro>
</order>

...from this SQL query :
SELECT id,po.pn,qty,product,price,currency
         FROM po, products
         WHERE po.pn = products.pn
         AND id = ?
         ORDER BY currency

...with XSLT ?

Here is a solution based on Active Tags that doesn't require any 
vendor-specific mapping mechanism :
http://reflex.gforge.inria.fr/tutorial.html#N801062
(as the underlying engine is in Java, all you need is a JDBC driver)

> 
>   I don't know if there are softwares like RDBMS that already implement
> that for XSLT, but I guess there are.  There are for XQuery, which rely
> on the same data model.

AFAIK, there is no XML-flavor data model for SQL (I mean : as a 
standard) ; at least, there is SQL/XML, but it is a mapping mechanism 
and not yet widely supported

On the opposite, there is a standard for LDAP :
http://www.oasis-open.org/specs/index.php#dsmlv2
So, the only thing to do is to parse such a file :
ldap://host:port/dc=acme,dc=org??sub?(sn~=Bill)...etc
(just plug the right driver to your app)

AFAIK, neither XSLT nor XQuery are defining by their own how to map SQL 
to XML, they are just relying on the result XML mapping

Active Tags is rather a system that can parse XML files, validate 
documents, run XSLT stylesheets, perform I/O operations, launch SQL 
queries, do system interactions, etc...

> 
>   Regards,
> 
> --drkm
> 

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !




 

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

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