I played around with getting XML generation from a DB and then rendering that XML in some fashion as (X)HTML. Generation the XML is typcially no problem, but I'm looking at the various choices in the presentation of XML. It looks like the most general solution here is to use XSLT stylesheets to mark up the XML into strict XHTML with help from XPath (this is the language neutral solution). However, in Perl, we have various template solutions, including Template Toolkit 2. TT2 now has an XPath extention such that you can refer easily to parts of an XML document that you pass to it, though here, the output of the templating solution may or may not be proper XHTML (depending on how well I write the template code). However, with TT2, you also get the addition of a lot of additional functionality that you may not have gotten from the various transformations allowed on the data by XSLT.
It would seem to me that using TT2 for transformations also gives you more control on the rest of the layout of the page (eg using INCLUDE statements for headers, footers, etc), though I believe I saw that XSLT also had that.
Does anyone have any suggestions as to which way is better for XML->(X)HTML in perl? And as a side question, does anyone know any good books that cover XML, XSLT, and XPath (such as anything from ORA?)
Dr. Michael K. Neylon - email@example.com
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important