set_uk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am putting together a module that runs SQL, XMLifies the resultset and then transforms the XML via XSLT.
I want to use XML-Generator-DBI to encode the SQL - and I believe I want to then have that transformed into a DOM so that I can use XML:LibXSLT to transform.
Within XMLGenerator it states "Alternatively you might want to generate a DOM tree or XML::XPath tree, which you can do with either of those module's SAX handlers".
I have looked at the doc for LibXML and cant see where its SAX handler is.
What module do I need to plug into XMLGenerator so that I can get it to generate a DOM.
Thanks
(jeffa) Re: SQL->XML->XSLT
by jeffa (Bishop) on Apr 07, 2003 at 13:30 UTC
|
| [reply] [Watch: Dir/Any] |
|
Thanks for this - Tried it and it worked and pretty much did what I want.
However (and isn't there always a however).
I want to be able to pass in a variable to the XSLT transormation that isn't part of the query (the report title).
And here is where I am going up the Perl Object learning curve.
I can see that XML::Filter::XSLT uses XML::Filter::XSLT::LibXSLT and that this uses XML::LibXSLT to parse the stylesheet.
I can also see that XML::LibXSLT supports transform(doc, %params) to allow me to pass in hash of parameters to the transformation. Which I have tested - and the value of the variable is replaced in the transformation using <xsl:value-of select="$cust_name"/>
It doesn't appear there is anyway that I can pass in a hash to the XML::Filter::XSLT as described in the example as there is no method - or is there.
Any pointers you can give
| [reply] [Watch: Dir/Any] [d/l] |
|
There is not. Patches welcome, or post a bug report on RT.
| [reply] [Watch: Dir/Any] |
|