[XML-SIG] Fun with the DOM.

Stefane Fermigier fermigie@math.jussieu.fr
Mon, 14 Sep 1998 15:26:41 +0200


I had some fun with my own implementation of the DOM yesterday.  I made a
toy linuxdoc -> LaTeX transformation engine using ideas from my somewhat
clumsy SGML -> SGML transformer. Basically, the idea is that having
a tree in memory is nice because you can transform nodes in a bottom
-> up fashion (assuming your tree grows downwards, like they usually
do), i.e. you transform the children first then pass the result to the
parents. This is much simpler than an event based transformer (a la
ASP), where you call start_XXX and end_XXX for each node traversed.

The program uses my outdated DOM core implementation along with my
completely bogus ESIS -> DOM builder, and it doesn't implement the
full DTD. You have to have nsgmls or a similar tool to use my program.

The program, which is just a toy but I find rather nice, is available
at the URL: <http://www.math.jussieu.fr/~fermigie/python/dom/sg2tex>.

There is an open issue regarding really complex tranformation, like
transposing a table for instance.



Stéfane Fermigier, MdC à l'Université Paris 7. Tel: (Bureau).
<www.math.jussieu.fr/~fermigie/>, <www.aful.org>, <www.linux-center.org>. 
"Without hardware memory protection, the machine-dependent actions taken
after an arror can cause a machine crash [...]. (MacIntosh users experience
this problem on a daily basis)." Adrew K. Wright.