Monsieur le Plankton,

I have to go check out the exact docbook xml format and the dtd, and haven't yet for lack of time, since I first read your OP, but..

I was thinking you could apply an xslt transform to the situation..

If you have the ability to add a stylesheet line (using a perl oneliner maybe) to the many source files you have, then you could construct the xsl output using a stylesheet which would allow you to define pretty much ... everything.. I'd used this to format nmap output and was amazed how powerful it is

Click on "subnet-tcp-scan" here:
http://florian.hastek.net/scans/
then view the source of that and you see the stylesheet line up top (which you can add to an xml file)

Then from the same scans/ URL click the stylesheet link to check out the example. Of course you'd have to completely rewrite it for your purposes but after following how this works, you can see how mixing CSS, html, and xslt you can do a lot (basically build the output page you need)

at W3C and other places there's lots of references for the syntax and functions of xsl.

I hope this suggestion is on the mark, and I didn't miss your original intent, and again, I have to go check out docbook xml format and see if you can use transforms on it as I've suggested but I'm pretty sure you can...

HTH

update- forgot to finish the thought - once you have it in html it might be easier to convert other formats..

update2 - no, this won't do... I just reread your post, my suggestion will render HTML, if the document (which uses the stylesheet) is viewed in an xml capable browser. Then you'd have to go get the source of the rendered HTML page somehow.. Ah.. how about getting it with LWP and writing out to a new disk file.. but you never did mention the final desired file formats...

In reply to Re^3: XML to SGML or xsl vs DTD confused by hsinclai
in thread XML to SGML or xsl vs DTD confused by Plankton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.