commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudhir Rao <>
Subject Re: [JXPath] Registering namespace prefixes
Date Sat, 06 Dec 2003 23:41:36 GMT
I made some local modifications for this. I am not sure if adding  that 
registerNamespace is the right way to do it, as I am not very familiar 
with the codebase. The changes I did locally were to
a) Modify to include the 
namespace prefix (similar to the one in Apache Axis). Had to tweak it a 
bit to consider the prefix as the namespaceURI however to keep it 
compatible with existing code.
b) Maintain a HashMap of prefixes to namespace URIs in the TreeCompiler 
c) Modify the TreeCompiler.qName(..) to populate the namespace URI in 
the QName instance returned.
d) Add the registerNamespace method to JXPathContextReferenceImpl and 
JXPathContext which in turn call a registerNamespace in Compiler class.

I can send across my changes if someone would like to look into it.


>From: Prasad A. Chodavarapu <>
>Subject: [JXPath] Registering namespace prefixes
>Date: Wed, 3 Dec 2003 12:32:23 -0500
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Hi All:
>Is there a way of registering a namespace prefix upfront in a
>JXPathContext so that I can then use that prefix in xpath expressions?
>Here's what I'm looking for, in pseudo-code.
>JXPathContext domContext = JXPathContext.newContext(document);
>  (, "prefix");

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message