...

View Full Version : XML, XHTML, PDFs, and PHP (oh my!)



beetle
12-04-2002, 04:30 PM
Hey all

I'm starting to pick up on XML, and would like to give myself an assignment. I'd like some opinions on what I want to accomplish, viewpoints on difficulty, practicality, feasibility, or any suggestions that could be alternatives (geez, wishy-washy, ain't I? ;))

Right now my work-in-progress website is delivered by PHP and coded as XHTML1.0 (transitional). All the layout is CSS so content is sufficiently separated from presentation. The only dynamic page (uses MySql) is some news. Now, here's what I'd like to do.

1) Save my page content as XML
2) Deliver valid XHTML to the web
3) Provide a 'Get this page as a PDF' link on every page.
4) Serve that PDF using FOP (http://xml.apache.org/fop/index.html) or similar

Well? :D

jkd
12-04-2002, 08:13 PM
Nothing undoable here. Bust out an XSLT document that transforms your XML into XSLFO, and convert the XSLFO output to PDF on the fly with FOP, as you mentioned.

The only real question is whether or not to use client-side XSLT transforms for XHTML, taking a load off of your server, but limiting it to Mozilla and IE, or use server-side transformations, creating some site overhead, but preserving compatibility.

beetle
12-04-2002, 08:46 PM
Thanks jkd. I think I'll do the transformations server-side, as they are simple pages and I'd like to keep compatibility up. Not to mention that I've got some great material on using XML, XSLT, and PHP together.

krycek
12-14-2002, 10:40 AM
Originally posted by beetle
Thanks jkd. I think I'll do the transformations server-side, as they are simple pages and I'd like to keep compatibility up. Not to mention that I've got some great material on using XML, XSLT, and PHP together.

...any chance you could share it? :D I am wanting to start using XML on my site but I don't really know where to start. Currently using PHP, MySQL, XHTML and CSS :p

::] krycek [::

maes
12-14-2002, 12:31 PM
I'm also intrested :)
How can you do it on the fly?
I experimented a bit with fop, but that is a batch file. how can you use that to do it on the fly:confused:

>>Bust out an XSLT document that transforms your XML into XSLFO
Does this mean that you have an XML file and a XSL file and when you open your XML file, your XSL will physicly make an .FO file?

I'm very new at XML, XSL, FO, SVG, ... so forgive my stupid questions:o

jkd
12-14-2002, 05:03 PM
The XSLT file will create an XSLFO representation of your document. You can save this output however you want, as long as you can get it to FOP to read.

maes
12-15-2002, 12:28 PM
do you have an example or what command in the xsl file will create the FO file, because I don't realy understand.
To me an xsl file formats the data to be put on a screen. how can it produce a file?

::runs away feeling ashamed::

jkd
12-15-2002, 04:32 PM
Originally posted by maes
do you have an example or what command in the xsl file will create the FO file, because I don't realy understand.
To me an xsl file formats the data to be put on a screen. how can it produce a file?

::runs away feeling ashamed::

XSLT only produces output. XHTML is one form of output, and XSL-FO is another. It doesn't necessarily need to be immediately output to a screen - I have batch jobs on my computer of Transformiix converting some XML into XHTML and saving the result as a .html document.

maes
12-20-2002, 03:37 PM
Thx jkd,

I start understanding what you mean (not fully 100%, actualy more like 45.1789%).
but all that fun stuff will have to wait for a few months. First I have to study for my exams . After that, I will come back to this and I'll ask you tons of questions, be affraid, be very affraid.Muhahahahahaha.
Nah just kidding, the exams haven't started yet and I'm allready loosing my mind :( .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum