cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: CForms binding with namespaces error - advice wanted
Date Thu, 24 May 2007 15:47:13 GMT


Carsten Ziegeler wrote:
> Helma wrote:
>>
>> That's what I'm slowly starting to realise. For proper XML validation 
>> I do need it so I assumed the parser requires this too.
>>
>> That would partially explain why the binding file (without a 
>> namespaceURI for 'oe') still maps to the source (in the source=file 
>> situation). It would also explain the observations in
>>
>> https://issues.apache.org/jira/browse/COCOON-1671
>>
>> i.e. if the prefix is the same with a matching or a different 
>> namespaceURI it binds, but if the prefix is different but the 
>> namespaceURI is identical it fails.
>>
>> So how should this be solved then?
>>
> I think there are two areas:
> 
> The first one is the parsing of the binding. We have to ensure that the 
> namespace prefixes are correctly send to the cforms component parsing 
> the binding. So we should see that there is no namespace prefix 
> inbetween. Actually, I fear, we can't ensure this in general. So perhaps 
> in these cases a workaround is required and you have to add a dummy 
> attribute somewhere in the binding, like <fb:... oe:something="dummy">.
> This is not great, but hopefully solves this problem.
> 

good idea,

on the other hand we are looking here at xml representations on file, right?

so while this approach would force some xml-serializer to include the 
xmlns declaration it doesn't really guarantee that the SAX-stream will 
suddenly add a xmlns:oe="..."  as _attribute_ to the sax startElement 
method, does it?
(which is what we forced on the sax parser by adding the 'dangerous' 
parameter)


personally I think the safer bet is to change the harvesting logic of 
the xmlns declarations from the DOM tree
(although it is more work)


> Now, the second area is more complicated. When cforms parses a binding 
> it should parse the paths and test them for namespaces and if these 
> namespaces are properly defined - if not, throw exception.
> When the binding is applied, the namespaces have to be checked, if the 
> uri's are the same. This should then work even if different prefixes are 
> used. I looked into namespaces and jxpath a long time ago and I think to 
> remember that there were problems; so this could get ugly :(
> 

there were, but as mentioned in the bug (see my previous post), they 
should be solved in jxpath 1.2

> I think this is something for our cforms and jxpath experts!
> 
> Carsten
> 


regards,
-marc=

Mime
View raw message