[jdom-interest] What is a jdom context?

Michael Kay mike at saxonica.com
Tue Nov 7 09:14:36 PST 2006


I would assume it has to be a Document, Element, Attribute, Comment, etc:
one of the things that would be a Node if JDOM hadn't made the strange
decision not to have a Node class. A consequence of that decision is that
you find interfaces like this using "Object".

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: jdom-interest-bounces at jdom.org 
> [mailto:jdom-interest-bounces at jdom.org] On Behalf Of Syloke Soong
> Sent: 07 November 2006 16:08
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] What is a jdom context?
> 
> 
> 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
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> rhost.com



More information about the jdom-interest mailing list