Category: HTML FORM
HTML form -> XML file -> PDF - How to?
though I'm not very experienced in the practical application of XML (I know the basics, but never really worked on a larger project), I need to develop a website that allows the user to enter some personal data (name, address etc., plus some text) for my faculty. This data should be stored in an XML file and then turned into a printer-friendly, page-based format.
So much for the idea. What I've done so far is I created an XML schema which served merely as some kinda mindmap in the first place, but now pretty much resembles the structure the XML files should have later on.
find a way to make the XML file available for the user to download (shouldn't be too hard if I find a way to solve problem #1)
create a style-sheet for the XML file so you get DIN A4 - i.e. 297x210mm - pages (I could do that for display in a browser, but I never tried to do printer-friendly stuff with CSS; does it actually support things like page breaks??)
find a way to turn this XML file + style-sheet into a single, word processor-compatible file (a PDF should be easy to create - there's probably some open-source script out there I could use - but PDFs can't be modified; is there a way to create an .RTFor any other such format instead?)
find out whether its possible to make a schema in which the attribute of an element determines which of its child elements are optional and which aren't. The idea is to create a schema for a bibliography and differentiate the different types of sources you can have. So if it's a book, you'll need fields like publisher and maybe editor - but if it's an article from a magazine, you'll need a field for the magazine's title which would be obsolete for the book though.
I've solved this problem for now by making "book", "mag article" etc. child elements of a bibliographical entry (which in turn have only the appropriate child elements themselves), but since those are actually meta data, I'd prefer to make an attribute out of them. This would then determine which of the child elements of of a bibliographical entry (author, title, publisher, name of magazine etc.) are optional and which are to be left out - I just don't know whether or how that can be done with XML schema!?
Since my intention might be hard to understand from that clumsy explanation, I have to small pics that should illustrate my idea (in a simplified way, of course): the way it is now (http://server5.uploadit.org/files/JonnieDoe-bibliography_bad.jpg) and the way it should be (http://server5.uploadit.org/files/JonnieDoe-bibliography_good.jpg).
I'd really appreciate if someone could give me a few hints on some of those issues!