Pretty Printing From An XML File?
Omega1045 writes "Where I work we are developing a new product that receives an XML document (on a W2k workstation), and we need to format and print said document. We are currently using XSLT + CSS to build a cool little HTML page out the the XML, then use a browser to print out the HTML. However, while HTML is a nice format for display, it is not a nice format for printing. We have messed around with the idea of spitting out Rich Text with XSLT. However, Rich Text is confusing and quite frankly sucks. We are looking for a (free if possible) format that we can translate our XML document into via XSLT, and print. The best idea we have at this point is to translate into a Word or OpenOffice XML schema document, and use one of those applications to print. Other ideas?"
Apache FOP Homepage
Very powerful if you ask me. I used it on a project back in 2000-2001 and was pleased with how it turned out at the time. I'm sure the current product is much, much, better than it was back then.
I have a similiar problem I solve through the use of XSLT and XSL-FO. Use XSLT to transform the XML into XSL-FO. Then, use Apache FOP to render the XSL-FO into PDF.
Another variation is to transform your XML into an HTML subset, then use a standard XSLT to transform the HTML into XSL-FO. A similiar technique is used by Aurigadoc to create all sorts of output formats using an XML source.
http://xml.apache.org/fop/r ights.com/training/ has a book about how do this that was created using XSLT-FO
http://www.cranesoftw
There are also paywhere implimentations XSLT-FO this. Basicaly it is the extension to XSLT for print.
Oh really?
Prince is a batch formatter for converting XML into PDF and PostScript by applying Cascading Style Sheets (CSS). Unlike other formatters, Prince prints any XML vocabulary without relying on proprietary markup
500GB of disk, 5TB of transfer, $5.95/mo
Another XML-based format is DocBook, which originally was SGML based but now has a XML DTD too. From this format you can output to ps, pdf, rtf and plenty of other formats.
You could also hack one of the docbook XSL stylesheets (using XSLT? would be pretty!) to make it parse your own format.
Feel ready to own one or many Tux Stickers?
While its support might not be complete (http://xml.apache.org/fop/output.html#ps) Apache FOP can also render into postscript. The advantage of XML-FO, while it hasn't been very well received, is it tries to be sufficiently expressive to support any number of output types from print (PDF, PS, RDF, etc) to graphics (SVG).
Never quite sure what the hell it does myself, but a few people here swear by it:
http://www.xmlpdf.com/
Cheers,
Dave
I write a blog now, you should be afraid.
send it to a MySQL database, then Use PHP to creat a PDF, and print it from PDF... although I can't contest for the quality of printing from PDF. Just my 2cents.
The W3C seems to disagree with you.
No they don't, as other people have pointed out, you have thoroughly confused the terms "specification" and "standard". If you want to hear it straight from the horse's mouth:
The W3C has been an active voice in industry technology debates for a little over two years now. Today, we represent over one hundred and seventy developers, research organizations, government agencies, and users. We have a technical staff of three dozen folks around the world working in three Domains on thirty Activity Areas. We are not a:
There you have it. The W3C are not a standards body. They don't make standards. If you want to use a standardised document format, ISO, a real standards body, has produced ISO-HTML.
Actually, LaTeX does do Unicode, and quite well. You just have to install Dominique Unruh's unicode package if your LaTeX distribution doesn't already ship it. I've used it for over a year to typeset documents with lots of Old Church Slavonic, Greek, and Hebrew, easily mixing scripts in one document and being free to keep all foreign scripts in UTF-8.
If you would like to see some examples, check out my two tutorials for LaTeX for philologists (which I still work on and update from time to time).