[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Query Format in XML
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 !
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|