Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Element. // Used for XPath and serialization Why is Element.getNamespacePrefixesInScope() private?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Element. // Used for XPath and serialization Why is Element.getNamespacePrefixesInScope() private?
  • Date: Mon, 23 Jan 2006 20:34:01 -0500

Wolfgang Hoschek wrote:

Anything that converts an external XML representation from/to XOM requires efficient support for namespace iterations. Like the nu.xom.Serializer or DOMConverter or SAXConverter, or the streaming serializers, the bnux serializer or the STAX converters, or any number of other things connecting to Axis AXIOM, XFire, JAXB, JixB, etc, etc.

No, I don't think it is. Needing namespaces *in-scope* is a very weird thing and purely relevant to XML and things that try to be XML but aren't. I don't think generic data binding frameworks and serialization into other frameworks actually need to inspect or preserve this information. SAXConverter/DOMConverter, OK, maybe. They need to do this, but those aren't what I think of as speed-critical operations (especially DOMConverter). They're there for convenience, not speed.

The part of XML that is potentially relevant (and not always then) when converting to something that's not XML is the namespace of each element and attribute, and this can be cleanly and efficiently managed without much effort. The problem only arises if you really want to preserve all namespaces in scope, including those declared as additional namespaces. I've yet to see a use-case that needs to iterate over those additional namespaces other than alternate representations of XML. Alternate representations of non-XML data models (JAXB, JibX, etc.) don';t need this.

I still think this is on the wrong side of 80/20.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page