[xml] <li> closing <li> in HTTPparser.c

Date view Thread view Subject view Author view

From: Kristian Hogsberg Kristensen (hogsberg@daimi.au.dk)
Date: Tue Oct 05 1999 - 17:59:22 EDT


Hi,

I've been working with the HTML parser that comes with gnome-xml, and
after debugging my own code for a while because of some weird nesting
of lists, I realized that the HTML parser doesn't infer </li> when
current element is <li> and a new <li> is seen. Shouldn't it do so?
I added "LI" to the "LI" entry in the htmlStartClose array in
HTMLParser.c, line 302, and it all worked allright.

By the way, I would really like to use the HTML parser with the SAX
interface, however this isn't possible, since the parser looks at the
currently open element to infer close tags, and the element stack is
maintained by the DOM building default SAX handler. On the other hand
I cant maintain the element stack in my SAX handler, since I dont have
access to the parser context there.

But actually I need the DOM tree later on anyway, so I would be happy
if I could just add a SAX handler, instead of replacing to default
one. An elegant way to implement multiple SAX handlers could be to do
a meta SAX handler, that has a list of SAX handlers and just
propagates the callback to each of the handlers in the list.

Finally, how about a way to attach custom data to xmlNode? The
application I'm thinking of is that, suppose you have an xmlDoc and a
visualisation using some interface objects (canvas items, widgets,
whatever). What I'd like to do, is to have pointers from the xmlNodes
to the interface objects, so that when the xmlDoc changes I can follow
the pointer and change the visualisation accordingly. I suspect this
is the kind of functionality you'd have to support if you were to
export the DOM tree using gdome (I haven't studied this in detail,
though). Is there something I'm missing, how is this usually done?

regards,
Kristian

----
Message from the list xml@rufus.w3.org
Archived at : http://rufus.w3.org/veillard/XML/messages
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:48 EDT