Hi J�rg,
you are completely right, is bad practice to write the SQL directly into
the XSL, it should only demostrate my ideas.
Eventually I had some time today spending on a prototype implementation
of my ideas, which I'm going to present to you in the next view
paragraphs.
1) Requirements:
================
a) Automatically include database content into XSL using
document("dbisql:/...")-calls using LibXSLT.
b) This should work in AxKit-environment and any other Perl-Environment.
2) The Result:
==============
a) AbstractDbhProvider.pm
Base-Class for DbhProviders
b) DefaultDbhProvider.pm
DefaultDbhProvider, configured via normal cnf-File/httpd.conf
c) AbstractQueryProvider.pm
Base-Class for QueryProviders
d) DefaultQueryProvider.pm
DefaultDbhProvider, reads queries from a xml-file
e) SQLEngine.pm
The main module which does the magic loading of SQL into
XML
f) XSLProcessor.pm
Class which is used when running outside of AxKit, simply
defines the callbacks, for LibXML, eventually it is a layer
in front LibXSLT.
g) DbiSQL.pm:
Handler called from LibXSLTSupport for dbisql-Protocol, when
running in AxKit-Env.
The result can be view using these URIs they read the content from an
cvs-file using DBD::CSV.
1) SQL in XSL:
==============
http://ferrum.bestsolution.at:8080/SQL-XSL-Embedder/test.xml
http://ferrum.bestsolution.at:8080/SQL-XSL-Embedder/test.xsl
2) SQL in External-File loaded by DefaultQueryProvider:
=======================================================
http://ferrum.bestsolution.at:8080/SQL-XSL-Embedder/test2.xml
http://ferrum.bestsolution.at:8080/SQL-XSL-Embedder/test2.xsl
http://ferrum.bestsolution.at:8080/query-def.xml
If someone is interested in it, I could provide him/her the modules, the
only thing which has to be done is Patching LibXMLSupport.pm to
recognize the dbisql-Protocol.
Still I think they are not production code at the moment, because
there's no error-catching, fairly no docu, ... .
The classes are only a small proof of concept which are created by
studying the AxKit internals.
Comments on it are welcome.
Tom
Am Do, 2003-08-28 um 15.49 schrieb J�rg Walter:
> Am Thursday, 28. August 2003 14:28, schrieb Tom Schindl:
> > Well I need some informations from a database(small part) and some from
> > XML-Files. If all data comes from a database I'd agree with you. Still
> > when having data from different sources like I have I think I've the
> > following possibilities:
> >
> > 1) Using axkit:-URIs => XSP->DBI->XML
> > 2) Using xincludes
> > 3) Embedd my SQL-Queries into XSL with a construct something like this:
> >
> > --------------------------8<--------------------------
> > <xsl:value-of select="document( 'dbisql:/SELECT_*_FROM_foo' )/test"/>
>
> Using SQL queries inside URL's is generally considered bad practice - you can
> easily get bitten by SQL injection and whatnot. I have a prototype SQL
> provider (and a more advanced design which I will release when done) which
> lets you access either selected rows of any table you want, or lets you
> define fixed queries which you can later retrieve via
> document('sql:myquery/2.xml') (selecting row nr. 2 of your query). I can send
> it to you if you want to play with that, but you also need to patch AxKit in
> order to have the 'sql' pseudoprotocol recognized. The provider is quite
> limited, but it seems to fit your requirements very well. Tell me if you want
> it.
> A more generic version of it will be released later.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]