Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML, XHTML, PDFs, and PHP (oh my!)

    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 or similar

    Well?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #4
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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? 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

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

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

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.

  • #7
    Regular Coder
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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::

  • #8
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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.

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Location
    Belgium
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •