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

I am looking for a algorithm/module/script/paper-napkin with some information in transforming a SGML CALS table over to a HTML table. The XML DTD I am working with allows authors to define tables using the SGML CALS. I believe at one time our data was in SGML but it has been translated to XML and we are displaying it in HTML. The process I have going is getting to be a complicated 3 stage process involving XML processing, XSLT transforming, then some HTML processing before being displayed.

Information is scarce on the internet about doing this translation, and I don't have the time to read through all the SGML modules out there hoping for a bit on outputing to HTML. I have been chewing on this for a while on my own, and I have a pretty good start, but I keep running into little things that are getting to me and sucking up time.

Anybody got anything I may find useful?????

Replies are listed 'Best First'.
Re: SGML CALS -> HTML TABLE
by mirod (Canon) on Jul 19, 2005 at 12:48 UTC

    I have something using XML::Twig that does this, at least for a subset of the complete CALS spec. It works on tables generated by FrameMaker SGML, so it takes advantages of some of the conventions they use for colspecs, but that could be fixed. More annoyingly I think I remember that it does not process properly row spans (I haven't looked at the code in a while). Doing this would require redesigning the algorithm that places cells on a grid. It also comes with no formal tests, which is the main reason I never released it in the wild.

    At least it can give you a starting point.

    Let me know if you want it.

    I know there is some pretty complete XSLT code that does this, by Norm Walsh I think. even if you don't use it it might also help you.

      Thanks, let me know where I can get either one.
Re: SGML CALS -> HTML TABLE
by Anonymous Monk on Jul 18, 2005 at 22:55 UTC
    Did you check the SGML FAQ?
      I have not, do you have a url for it?