[jdom-interest] Element Reference from Attribute

bob mcwhirter bob at werken.com
Mon Nov 20 06:35:45 PST 2000

> >What methods do you think would be appropriate for Node, or would
> >it simply be a hollow class/interface, for generic method signatures?
> >
> The Node interface should have methods to get the parent and the 
> value of the node. I propose that the "value" of the Node be 
> determined by the XPath definition of value rather than the DOM 
> definition of value. This way the value of al element is the text of 
> the element rather than null.

Though, XPath's StringValue of an Element is actually the text of
the element, and it's descendants, in document order.

> However, the main reason I want a Node interface is for return and 
> argument types. There are a lot of methods where I find I'm forced to 
> pass or return Object simply because there's no other common type for 
> XML nodes. For instance, in XInclude an element can be replaced by an 
> element, a String, a group of elements, or a group of elements and 
> strings. Thus my resolve method is declared like this:
> public Object resolve(Element e)

Yah, I too have similar signatures at times.  Though, mine results
from taking a List or an Element or a Document.  Even if we had 
Node and NodeSet, it'd be stuck still talking in terms of Object.


More information about the jdom-interest mailing list