Re: XML libs (was Re: gconf backend)



Peter Williams wrote:
Hi all,

On Sat, 2003-09-27 at 16:49, Havoc Pennington wrote:

I essentially agree that:

- XML is too hard for apps to get right - we should try to use it anyway, as best we can

I would add:

- sometimes it's OK to restrict the XML features you can use in a particular context, as long as you fail gracefully


Well, I know I shouldn't volunteer code for someone else to write, but
perhaps we can make a layer that sits on top of libxml and has some
guarantees:

	* Bomb if anything "complicated" happens (namespaced elements, PIs). Or
just ignore them.
	* Perform some canonical set of entity substitutions
	* Expose an XmlTextReader or SAX-like interface
	* Maybe add hooks for the app to complain about illegal content a la
Havoc's color values

In general, it seems to me that it should be possible to make something
that reads/writes compliant XML but doesn't force the app programmer to
write a lot of boilerplate code like:

	if (element_namespace != NULL)
		bomb ("Unexpected XML content.");
	
Anyway, it seems like the reasonable way to develop a simple API for
simple XML is on top of a more complex API for more complex XML, rather
than starting fresh.

Uhh... It rather sounds like there should be an api that goes basicly like this:

ProcessAllThatXmlStuff("path_to_xml_file.xml", "path_to_spec.xml");

where path_to_spec.xml is a libglade style really simple xml file letting the developer specify just what it wants done...


Peter






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