Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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 - mneylon-pm@masemware.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


In reply to XSLT vs Templating? by Masem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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:
    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
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (10)
    As of 2014-08-20 13:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (113 votes), past polls