Re: XML libs (was Re: gconf backend)
- From: Peter Williams <peter newton cx>
- To: desktop-devel-list gnome org
- Subject: Re: XML libs (was Re: gconf backend)
- Date: Sun, 28 Sep 2003 00:09:32 -0400
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.
Peter
--
Peter Williams peter newton cx
"[Ninjas] are cool; and by cool, I mean totally sweet."
-- REAL Ultimate Power
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]