[jdom-interest] What is a jdom context?

Syloke Soong ssoong at protedyne.com
Tue Nov 7 08:07:38 PST 2006


Given a jdom doc and a jdom xpath,
I wish to extract whatever this xpath is pointing to in the doc.

The jdom javadoc for class XPath says,

selectNodes(java.lang.Object context, java.lang.String path) 
Evaluates an XPath expression and returns the list of selected items.
Parameters:
context - the node to use as context for evaluating the XPath expression


Well, what is a context or node? What should I use as argument context:
I am thinking of possibilities:
1. A jdom Document
2. A jdom Element
3. A sax InputSource
4. All of the above

IMPHO (in my projected humble opinion) it would be convenient (at least
for me) if context was a definite object similar to the way sax
InputSource so we would know determinately what is acceptable as a
"node" or "context".

Anyway, the question that led to this discussion is,
How do I extract from a jdom document using a jdom xpath (without
straying into jaxen).
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender immediately. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Even though this company takes every precaution to ensure this email is virus-free, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
Protedyne Corporation, 1000 Day Hill Rd, Windsor, CT 06095, USA,                                                                  
www.protedyne.com



More information about the jdom-interest mailing list