Syntactic Confectionery Delight | |
PerlMonks |
SGML FAQ to HTML (or XML? or SQL?)by hacker (Priest) |
on Aug 17, 2002 at 17:53 UTC ( [id://190896]=perlquestion: print w/replies, xml ) | Need Help?? |
hacker has asked for the wisdom of the Perl Monks concerning the following question: I have an SGML FAQ for one of my projects, which was originally a static text file. In the interests of keeping the FAQ updated and maintainable, I've converted it to SGML, and it resides in our CVS. I'd like to be able to take the FAQ, through LWP via either of the two ViewCVS interfaces (which is how it was done when it was static text), convert it to XHTML, and display it on the webpage, dynamically. Each time a user clicks on the 'FAQ' link on the website, the FAQ will be queried from CVS, converted, wrapped in validated XHTML, and thrown at their browser. The FAQ generally looks like this:
There are some sections with <itemizedlist> and <listitem> tags in them, so those must be parsed as well. I'd rather stay away from HTML::Template for this particular venture, but I will be moving that direction soon. Right now, 'sub faq {...}' is where the code is taking place. Has anyone done this? Are there secrets to it? I've read that converting the SGML output to XML first is one way to go. I've looked at SGML::Parser and HTML::Parser, but I'm not sure they can help, without a lot of hand rolling around in the FAQ and parsing out elements into hashes myself. One other idea I had was to parse it from SGML into a MySQL database, and just keep the text of the FAQ in there. The only problem with this is that the file itself wouldn't be in CVS, available for checkout.. though I could add a pre-checkout command to that, which does the query and writes the data to the SGML file from mysql (slowly getting off-topic here). What's the best approach here?
Back to
Seekers of Perl Wisdom
|
|