[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Executing SQL queries - XSLT ?

Subject: Re: Executing SQL queries - XSLT ?
From: tim panton <tpanton@xxxxxxxxxxxxx>
Date: Sat, 28 Feb 2004 12:49:55 +0000
tim panton
Manish Rambabu wrote:
Hi All,

I have an application written in Java which accepts an XML file (data) as input transforms it using a XSL file. I am using Xalan as my parser to do the transformation. As part of the transforming logic I am grouping the data and also performing some basic math operations to result in sub-totals for each of the grouping categories. Is it possible to execute SQL queries from the XSL file against a database so I can store these values in a table?

I have taken a look at Oracle's xsql utility and standalone (command line/ servlet) Im able to fire select/insert queries using the tool. Is it possible to do this programmatically while performing the transformation.


Dunno about _during_ the transformation. If you have a DOM in memory with the results in it that you want to insert in the db you can use
something like:



import oracle.xml.xsql.*; ..... URL xsqlsheetURL = this.getClass().getResource(xsqlFile); // build an xsql request using it XSQLRequest req = new XSQLRequest(xcmf, xsqlsheetURL); req.setPostedDocument(rows); // invoke xsql Document res = req.processToXML();


The problems with this are: 1) it is Oracle only - and they keep changing the spec 2) I don't think it works if you use a DOM produced by a parser other than oracle's to produce 'rows' above.

However it works for me.

(Blush, my first posting to this list, and it's Off Topic....)


Any help is greatly appreciated.
Thanks much
M




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.