This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Announce: an XML parser for Guile
- To: Thierry Bezecourt <bezecourt at globeid dot com>
- Subject: Re: Announce: an XML parser for Guile
- From: Jost Boekemeier <jostobfe at linux dot zrz dot TU-Berlin dot DE>
- Date: 10 Jan 2000 15:28:20 +0100
- Cc: guile at sourceware dot cygnus dot com
- References: <3.0.5.32.19991223144558.012a1d10@edelweb.fr>
Thierry Bezecourt <bezecourt@globeid.com> writes:
> I have written a Guile interface to expat, James Clark's XML parser
> library. Expat is an XML 1.0, non-validating parser written in C, which is
> present for example in Mozilla.
> ;; Create the parser object
> (let ((parser (expat:parser-create)))
> ;; Specify callback functions
Hmm. This is only a SAX style parser, isn't it?
>The following functions are extensions to the raw expat interface,
>but I still don't know exactly what to do here. An object-oriented
>interface based on GOOPS and maybe DOM would be very convenient.
Have you looked at GDOM and gnome-xml?
-> http://xmlsoft.org/
-> http://www.levien.com/gnome/domination.html
Basically XML is just the serialized form of the DOM
contents. By using the SAX style parser you define a state
machine which parses your document. DOM style parsing
on the other hand means that you create the whole tree in
memory and then pass the nodes to a function which examines
the nodes.
However, GDOM handles it differently. You create a generic
class which takes a number of "rendering contexts" so that you
can parameterize it with your concrete classes. For example:
<p> --> render_paragraph
<img> --> render_image
<table> --> render_table
This is pretty much the same as the java beans specification or
(constrained) generics in eiffel.
Yes, I think you need GOOPS to implement this properly.
Jost