views:

217

answers:

1

Background:
We've created a client portal that selects desired data points from our database and outputs them as XML. The client has provided us with their desired format in the form of an XSLT stylesheet. So our deliverable to them is preferably the most user-friendly format possible, preferably a PDF. Our service is in Perl, so we've tried a variety of methods within various CPAN perl modules, and also used Apache FOP with an external Java service to go straight from XML/XSL to PDF, but it's a nightmare for our IT team to replicate in production, and the results are less than stellar visually.

Status:
We're trying to use xmlsoft's xsltproc to convert the XML/XSL into HTML and then either deliver that or convert it into a PDF, but our problem so far is that it's outputting deprecated HTML that's causing problems with style and presentation in all cases. Therefore...

Question:
We're trying to see if there's a way to make xsltproc output using a custom specification, specifically xhtml so that we can style it and export it to a PDF in the preferable manner. Is this even possible, or is there a smarter way to go about doing this?

+2  A: 
  1. Google.
  2. Read http://www.sagehill.net/docbookxsl/OtherOutputForms.html.

To generate XHTML output using xsltproc, you can use commands such as these:

Single file XHTML:
xsltproc  \
     --output  myfile.xhtml  \
    xhtml/docbook.xsl  myfile.xml

Chunked XHTML:
xsltproc  \
    --stringparam chunker.output.doctype-public \   For versions 1.61 and earlier
               "-//W3C//DTD XHTML 1.0 Transitional//EN" \
    --stringparam chunker.output.doctype-system \   For versions 1.61 and earlier
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" \
    xhtml/chunk.xsl  myfile.xml
Dave Jarvis
I apologize. It turns out I was wrong. I never got the xsl to look at until just now, it turns out those deprecated tags were coming from them by being coded into the xsl. I kept trying your posted solution before I posted this, and those tags kept showing up. I thought they were part of the processor, turns out it's just more PEBKAC from our client. Thanks for the reference though, and pointing out it was on google. "Take a chance and be the dumbest guy in the room." : ) I don't mind.
NateDSaint