Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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 - || "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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2023-03-24 18:27 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (61 votes). Check out past polls.