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 - firstname.lastname@example.org
"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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||