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: Steve Loughran <steve.loughran AT gmail.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 07:41:13 -0500

Steve Loughran wrote:

Actually, rather than making this method public, a nice trick might be
to return some construct that implements
javax.xml.namespace.NamespaceContext

I don't think I want to introduce an external dependency on that class since it wasn't a standard part of the JDK until 1.5, and there's probably some silly legal reason I can't ship it bundled into XOM.

I have been looking at how namespaces are handled lately. One change Wolfgang suggested (caching namespaces in a stack as the tree is traversed) sped up serialization by a few percent. There may be other improvements that can be made there, and some of these might be exposed to the public if I'm convinced they're generally useful.

Right now I'm using a map to pass these things back and forth, and I'm trying to eliminate that. However, if I made this public I'd come up with something more type-safe, probably something similar to the Elements class except it would contain Namespace objects instead of Element objects.

--
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