Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] Remarks on 1.0d8 API

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Mike Fitzgerald" <mike AT wyeast.net>
  • To: "Elliotte Rusty Harold" <elharo AT metalab.unc.edu>, "Laurent Bihanic" <laurent.bihanic AT atosorigin.com>, "XOM-interest" <XOM-interest AT lists.ibiblio.org>
  • Subject: RE: [XOM-interest] Remarks on 1.0d8 API
  • Date: Thu, 16 Jan 2003 19:01:06 -0800

> I've thought that myself, though I hadn't noticed Comment and Text,
> only ProcessingInstruction. I chose getValue() because that has an
> XPath definition, and setData because that has an XML 1.0 definition.
> Every node has a value that can be gotten but not every node has a
> value that can be set. Thus the difference, but you're right. This is
> needlessly divergent. It would be nice to improve this. What do other
> people think?

I like it. Symmetry == less things to forget.

> >- Likewise, many classes offer protected checkXxx methods (e.g.
> >checkRoot, checkRemove, checkTarget, checkData) but Comment and Text
> >only have check(). For consistency, it would be nice to rename them
> >checkData (or checkValue), even if these classes only have one check
> >method (but Document and Attributes are in the same case).
>
> Sounds good. Any objections from anyone?

No objections from the left coast. Three cheers for symmetry.

> The big concern for the declare and undeclare methods is what happens
> when you attempt to declare or undeclare the namespace of that
> element or one of its attributes? Should I throw an exception? no-op?
> Or should I allow namespace declarations in the list of additional
> namespaces which duplicate the namespaces of the element and its
> attributes, in case the URI or prefix of the element or attribute is
> later changed?

add/remove seem to have a clearer intent. Am I following you? Are you
suggesting having two or more redundant declarations on one element and in
such a case no-oping? Or what about just a warning? Also, would the
redundant declaration (w/ identical namespace URI) have the effect of
undeclaring/redeclaring, and then just let it slip w/o an error or warning?

Mike





Archive powered by MHonArc 2.6.24.

Top of Page