cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Woody binding of namespaced element
Date Mon, 16 Feb 2004 23:19:34 GMT
Considering the widespread use of JXPath in Cocoon, this seems like a 
good opportunity for some Cocoon developers to help Dmitri add this 
feature to JXPath:
http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=107454542000704&w=2

Regards,

Chris

Gianugo Rabellino wrote:

> Sylvain Wallez wrote:
>
>> 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.
>
>
> Will give it a try, thanks. It would work much better than what I'm 
> using now (a hacky transformer that gets prefix->namespace mappings 
> from external files and plugs them "on the fly" when it gets a null or 
> empty nsURI for a qualified start/endElement). Actually, however, my 
> problem was in SAX parsing to a SourcePropWritingTransfomer, where I 
> got a DOM Namespace error. Will see if your workaround fixex that.
>
> Thanks so much,
>


Mime
View raw message