Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Tatu Saloranta <cowtowncoder AT yahoo.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Attributes, ParentNodes, and "child" nodes ...
  • Date: Thu, 16 Mar 2006 10:00:58 -0800 (PST)

--- Michael Kay <mike AT saxonica.com> wrote:

> > I
> > look forward to a cleaner, more correct model.
> XOM 2.0?
>
> XML is messy. You can either have a clean model or a
> correct one but you
> can't have both. XOM finds a pretty good sweet spot
> between the two, in my
> view.

I think modeling XML is easier said than done. I have
done some simple modeling for StaxMate lib/framework,
and it became clear that there are lots of compromises
one has to make. Problems stemming from XML itself
include:

(a) Non-embeddability of XML: you can only have a
single document entity; and this entity has
similarities and differences to elements. So should
you try to model this "invisible" container similar to
elements? It can have comments, PIs, and must have a
single root element, plus an optional DTD element
(b) Duality of elements and attributes: elements are
nesting, hierarchical; attributes non-ordered set; but
both can be leaf elements (and only elements can be
parents, branches)
(c) Overloading of attribute notation as namespace
declarations (for backwards compatibility): or, if you
prefer, tendency for implementations to treat the two
as same (partially since DTDs can not distinguish
them), even though their handling is different.
(d) Messiness of DTDs: not so much the syntax like
many people think (that a schema language is written
in XML is of little importance in most cases -- proven
eloquently by RelaxNG compact notation), but its
strong orientation towards manual creation: difficulty
to process (or especially generate) by code; using
macro expansions (entities), and model that is bit
like XML (can have comments, PIs), but mostly not
(generally flat, except for entity declarations).

But of course there's always room for improvement,
especially for specific use cases.

-+ Tatu +-


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




Archive powered by MHonArc 2.6.24.

Top of Page