Alan,

I don't have understood you problem, but, anyway, I'll give it a try:

a) If you want output elements' names decoupled from the actual column names, you may 
use the "AS" statement, like in:

SELECT Name AS FirstColumn, Phone AS SecondColumn
FROM Employee;

b) If you just want an handy way of selecting XML elements, you may use 
"name()='Name'" instead of "@id='Name')="

c) Yes, you can implement an XSLT to change the SQLTransformer's output

d) If you really want decouple your data layer from the application logic, use Stored 
Procedures (provided your DBMS can do that)

I hope this helps,

--------------------------------------------- 
               Luca Morandini 
               GIS Consultant 
              [EMAIL PROTECTED] 
http://utenti.tripod.it/lmorandini/index.html 
---------------------------------------------
 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 19, 2002 7:34 PM
> To: [EMAIL PROTECTED]
> Subject: Generic SQL transformer output
> 
> 
> 
> Dear All,
> 
> I'm trying to implement a set of XSP sheets to manage
> administrative records in a database. This merely means
> implementing insert, update and delete for records in
> a number of different tables.
> 
> Naturally, I'm striving for a generic solution so that 
> I can use the same insert/update/elete functionality on
> different database tables just by changing a table 
> name parameter (most likely in the sitemap).
> 
> My problem is that the output generated by the 
> SQLTransformer gives me <row>'s, which are fine, except 
> that they contain elements named after the columns names. 
> I'd rather have a series of 
> 
>   <column id="columnName">columnValue</column>
> 
> tags (or something equivalent). My goal is to be able to
> transform the output into a display table or input form.
> 
> My questions:
> 
> 1. Is it possible to instruct the SQLTransformer (or
> if not, the esql logicsheet) to generate <column>
> tags that contain the column name and value.
> 
> 2. Is there some XSLT trick I can use to sidestep the
> problem entirely? E.g. Is it possible to write an XSLT 
> transformation that converts the current SQLTransformer 
> output to the format that I want?
> 
> 3. Is there some way of getting the meta data associated
> with the data being returned by the SQLTransformer? I would
> like this in order to set up the table/column headers.
> 
> 4. Is there already some clever code (in the Cocoon code/
> examples that I haven't yet been able to find yet) that 
> does this already?
> 
> Thanks in advance,
> 
> Alan.
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to