commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <>
Subject Re: [JXPATH] Error when create DOM Element without prefix of namespace using createPathAndSetValue()
Date Fri, 11 Feb 2005 22:55:45 GMT
Thank you very much for the bug report.  I will apply the patch you provided.
- Dmitri

ijorge <> wrote:
I'm using JXPATH to generate a DOM Element. I have this structure:

PUBLIC "-//Example//DTD Example/EN"


I used this jxpath sentence: context.createPathAndSetValue(
"$root/example1[@name="aa"]/example2", "xx"); where "example2" must have 
the default namespace xmlns="".

But, I received this error:
Factory could not create a child node for path: 

I tried this other sentence:
"xx"); and this sentence worked correctly.

I have been investigating the source code of JXPATH and I think that the 
error is in org/apache/commons/jxpath/ri/model/dom/
I have modified this class because, in method createChild(), 
NodeNameTest didnīt have the default namespace when (prefix == null):

Diff between modified class and original class from commons-jxpath-1.2:
< nodeTest = new NodeNameTest(name);
> /*
> * When new child does not have a prefix, we search the
> * default namespace in the ancestors
> */
> nodeTest = new NodeNameTest(name, getDefaultNamespaceURI());

This change resolves my problem but I donīt know if this behavior is a bug.

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message