betacentauri has asked for the wisdom of the Perl Monks concerning the following question:

O Monks, I want to build this CGI app to help teachers work online to build courses. I am grabbing user-entered HTML content chunks into a database. A course module, say, will be stored into a database record. This record will have string or blob fields called name, goals, resources, required-knowledge, and so on. These fields are to contain the HTML provided by users.

The purpose of this app is to allow XML DocBook documents to be generated from the database.

Each of my course module records would result in a DocBook article, each of its columns roughly corresponding to sections or subsections. I'd obviously love to have a free thin-client XML editor, but have to make do with a Javascript HTML editor.

My goal in generating these DocBook files is being able to postprocess them, importing them into some other tool, converting to HTML/PDF, etc. However, I can use advice about this choice as well. Why not input HTML, just print HTML -- because I want to enforce structure over the individual documents. Some versions of the resulting documents will keep some sections, others won't. Some material will be piped into other pieces of machinery. Why DocBook -- It already has a structure known to other tools. I am new to XML, XSLT and the gang. I have a feeling that this is the missing piece to organize the document, but I may be wrong. Why not use a wiki -- I tried! Honest! I selected TWiki which is able to provide structure for content... but something went wonky, and it ate an amount of work massive enough to encourage me to take up this hopefully not too big project.

I know of Class::DBI::AsXML which seems fine for the task of getting a direct XML representation from the database contents. I'd hope to postprocess this XML stuff into DocBook. I want to find a good toolchain for this.

So, my questions are, 1) Does the overall approach seem sane to your wisdom? 2) In either case :), which would be the way to perform raw XML to DocBook conversion from inside the said application? Should I (shudder) write down my XSLT sheet from the ground up or does CPAN hide a spell for me?

Respectfully yours

  • Comment on Advice on using DocBook for automated document processing?

Replies are listed 'Best First'.
Re: Advice on using DocBook for automated document processing?
by jfroebe (Parson) on Jan 10, 2006 at 18:43 UTC

    Hi Beta Centauri,

    I like your idea and I think it is quite reasonable :) You could just use the XSLT style sheets from the DocBook Sourceforge.net project instead of writing your own. Would that be sufficient or are you looking to remove the XSLT sheets for CSS or similar?

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1