commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smiley <DSMI...@mitre.org>
Subject [jxpath] namespace registration not remembered for JXPathContext.getRelativeContext
Date Wed, 23 May 2007 17:30:34 GMT

Hi.  JXPath is pretty darned cool by the way; thanks to all those who worked
on it. Any way, I am examining an XML document that uses several namespaces. 
There are a few string values I want to fetch out of it that are common
siblings at the same point in the document.  I could use the same
JXPathContext reference to fetch out the values I want, but then the
beginning part of the xpath expression would be the same and presumably
would incur redundant tree traversal.  I'd like for JXPath to get me to the
common ancestor of the elements I want, and then I'll evaluate simpler
expressions from there.  From the user guide, I am to follow these
instructions: 
http://jakarta.apache.org/commons/jxpath/users-guide.html#Relative_Contexts
Relative Contexts .  I registered the relevant XML namespaces on the first
JXPathContext I got ahold of so that I could use them in my expressions. 
Unfortunately, if you generate a Pointer and then a "relative" JXPathContext
(via the getRelativeContext(Pointer) method), the namespace registrations I
did are forgotten.  I could of course re-register them but I think JXPath
should be improved so that is not necessary.  Do people agree with me that
this is a shortcoming?

~ David
-- 
View this message in context: http://www.nabble.com/-jxpath--namespace-registration-not-remembered-for-JXPathContext.getRelativeContext-tf3805452.html#a10768895
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message