Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

SQL->XML->XSLT

by set_uk (Pilgrim)
on Apr 07, 2003 at 13:09 UTC ( [id://248583]=perlquestion: print w/replies, xml ) Need Help??

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

Replies are listed 'Best First'.
(jeffa) Re: SQL->XML->XSLT
by jeffa (Bishop) on Apr 07, 2003 at 13:30 UTC
      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
        There is not. Patches welcome, or post a bug report on RT.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://248583]
Approved by diotalevi
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found