cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hepabolu <hepab...@gmail.com>
Subject Re: CForms binding with namespaces error - advice wanted
Date Thu, 24 May 2007 14:05:18 GMT
Carsten Ziegeler said the following on 24/5/07 15:57:
> hepabolu schrieb:
>>>> So you can't rely that you get the namespace attributes in the dom 
>>>> builder.
>>
>> I think this is where things go wrong.
>>
>> Note that both binding file and source are generated with a pipeline 
>> and pipelineUtil.toDOM.
>>
>> I've done some debugging into pipelineUtil.toDOM and this is what I 
>> found:
>> - binding file has all the namespaces in pipeline. This is confirmed 
>> because I can save the output of the pipeline and see the namespaces 
>> in the root element:
>>
>> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>> xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" 
>> xmlns:oe="openEHR/v1/Version" path="/oe:version">
>>
>> - After returning from SourceUtil.toDOM (which uses the default 
>> DOMBuilder()), the only namespace left is 
>> fb="http://apache.org/cocoon/forms/1.0#binding".
>> Attributes of this node only holds 'path=/oe:version'.
>>
>> - This is true for the source=pipeline situation as well: only the 
>> oe="openEHR/v1/Version" is left.
>>
>> - The source=file situation has all namespaces in the attributes.
>>
>> I can understand that in the situation of source=pipeline there cannot 
>> be any matching because the oe namespace is not known in the binding 
>> file. However, this is also true for the situation of source=file and 
>> there matching happens on various fb:context until it fails on a 
>> difference in datatype.
>>
>> What I also don't understand is the fact that putting the 
>> source=pipeline through the savedocument function as I did this 
>> morning, gives me all the namespaces back.
>>
>> I'm not sure if this helps in the discussion and I have no clue on how 
>> to solve this.
>>
>> Anyone?
>>
> I must say that this is all a little bit strange to me as well. Now, are 
> you using the prefix oe somewhere in the xml? The prefix fb is definitly 
> used, so it might be that there is some optimization filtering unused 
> prefixes? Just a wild guess.

Yes. Source is:

<oe:version xmlns:oe="openEHR/v1/Version" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="ORIGINAL_VERSION">

So in fact I want the first line of the binding file to bind to /oe:version

I don't think there are unused prefixes in both binding and source.

Bye, Helma


Mime
View raw message