Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Shemp: an XMLFilter for use with XOM

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT mercury.ccil.org>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: Xom Interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Shemp: an XMLFilter for use with XOM
  • Date: Wed, 18 Jun 2003 09:38:30 -0400

Elliotte Rusty Harold scripsit:

> By default returning null from startElement() will simply remove the
> start-tags and end-tags, but retain the element's content. A custom
> builder could easily change this behavior to remove everything inside
> the element. In DOM terms this is a skip rather than a reject. I am
> wondering if I've got this backwards. Perhaps by default returning
> null from startElement() should remove everything inside the element,
> and there should be some way to override this behavior? Thoughts?

This is a classic datahead/dochead split, and the fact that you're
ambivalent shows that you have some of each in your makeup. :-)
Dataheads think of an element as a container for its content, and
if the container is removed, the content goes to Tumbolia with it.
Docheads think of elements as basically annotations of ranges, and if
the annotation is removed, the underlying content remains.

I don't think you can make everyone happy here. Just make sure that
*some* path through the code makes it possible to do either operation.

> Another open question are other uses of NodeFactory as a filter. In
> XOM today it is possible to change the name or namespace or
> attributes of an element as its built. Should it be possible to go
> further and replace an element with a processing instruction or vice
> versa? i.e. to substitute a different kind of node in the tree? All
> enabling this would really require is having the various makeXXX
> methods return Node instead of the more specific type. However, this
> might expand the type-checking in other parts of the code which is
> expensive, so I'd prefer not to do it unless there's a good use-case.

How clever would this be? If I returned an attribute, or text, where
you expected an element, would it become an attribute of/part of the
content of the parent element? If so, this would be a Good Thing for
architectural forms support.

--
John Cowan jcowan AT reutershealth.com www.reutershealth.com
www.ccil.org/~cowan
Consider the matter of Analytic Philosophy. Dennett and Bennett are
well-known.
Dennett rarely or never cites Bennett, so Bennett rarely or never cites
Dennett.
There is also one Dummett. By their works shall ye know them. However, just
as
no trinities have fourth persons (Zeppo Marx notwithstanding), Bummett is
hardly
known by his works. Indeed, Bummett does not exist. It is part of the
function
of this and other e-mail messages, therefore, to do what they can to create
him.




Archive powered by MHonArc 2.6.24.

Top of Page