03: glib: gmarkup: G_MARKUP_TEXTSTART



I have made good success with an extension of G_MARKUP_TEXTSTART
to the gmarkup interpreter - it simply guides the xml reader to
issue callbacks for any element before the root element. That
way one can even see <? and other elements instead of dropping
them. It makes gmarkup more useful as a general xml reader
instead of a halfdone gscanner replacement.

The change is overly simple: add a constant into gmarkup.h like
G_MARKUP_TEXTSTART and set the initial state of the parser in
xml_g_parse_context_new() like

if (flags & G_MARKUP_TEXTSTART) context->state = STATE_INSIDE_TEXT;
(or see http://xmlg.sourceforge.net/xml/gmarkup.html#160:gmarkup.c )

-- have fun, guido                          counter.li.org #81555




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]