Gianugo Rabellino wrote:

Christopher Oliver wrote:

That is a problem with JXPath. I may be wrong, but if IIRC it doesn't support namespaces properly or at all.


Bad bad news. Actually it seems to do selections just fine, but insertions are flawed. OK, time for tricks then :-/


AFAIK, even for selection you may encounter problems as the prefix is used, but the actual namespace URI is ignored.

There may be a workaround for the binding, however: the o.a.c.util.jxpath.DOMFactory class tries to guess the namespace URI when asked to create a prefixed element by crawling up the DOM tree up to finding an "xmlns:" namespace declaration attribute for that prefix.

So if you add that declaration on the root element of the document you bind to, prefixed elements should be correctly namespaced.

Hope this helps,
Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com





Reply via email to