Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Node.query final

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Blaine R Southam" <bsoutham AT gmail.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Node.query final
  • Date: Mon, 18 Sep 2006 15:37:19 -0600

I'm thinking of using XOM in a new project I'm starting on, but I have a few
questions...

I'm working with a schema, with all definitions in a single namespace, and I
won't interact with other namespaces (other than default schema namespace).
So I was hoping to make it simpler to use namespaces.

Want I don't want to do is pass in a URI everytime I construct a new
Element. I can do that by subclassing Element with MyElement and overriding
the "public Element(String name)" constructor. Instead of calling
"this(name, "")" it would call "this(name, MY_DEFAULT_NS)".

This works ok.

The problem comes in when I want to do XPath queries. Node defines the
query method as final. If it didn't, I could override it with "return
query(xpath, MyNamepaceContext)", that would have been contstructed to
handle my default namespace.

I know namespaces are messed up - which is part of why I'm trying to remove
them from my user interaction. Since I'm only going to deal with a single
namespace I'm not sure why this would be a problem.

So I guess my question is, without overriding Node.query(string), is there
another way to "default" my namespace handling?

Thanks,
-Blaine




Archive powered by MHonArc 2.6.24.

Top of Page