Sylvain Wallez wrote:
Michael Wechner wrote:

Hi

Is anybody using the class

org.apache.cocoon.transformation.AbstractDOMTransformer

successfully?

It seems to me that since Cocoon has moved from DOM level 1 to level 2 it doesn't work anymore.



I patched DOMStreamer this morning so that it correctly handles non-document nodes, but introduced a bug that well could affect AbstractDOMTransformer :-/
I fixed it just now. Could you please cross-check (in HEAD) ?
Sylvain Wallez wrote:

> Michael Wechner wrote:
>
>> Hi Sylvain
>>
>> Sorry for contacting you privately, but we currently have some connection
>> problems at our office and I can't use our mailserver there.
>>
>> Anyway, I saw your answer at marc.theaimsgroup.com and updated
>> my Cocoon at my home.
>>
>> Well, it's still not working, but I realised the problems only arise if I am having a
>> namespace within the document I send through "MyDOMTransformer". If the document
>> doesn't have any namespaces, then it will go through "MyDOMTransformer" without a
>> problem.
>>
>> For testing "MyDOMTransformer" is very simple:
>>
>> public class MyDOMTransformer extends AbstractDOMTransformer {
>> protected Document transform(Document doc) {
>> return doc;
>> }
>> }
>>
>>
>>
>> If I am piping through a document with namespaces then I will receive the following exceptions:
>>
>> java.lang.NullPointerException .... DOMStreamer.java:438, 259, 173 .... AbstractDOMTransformer.java: 179
>>
>
> I fixed DOMStreamer by preventing null to be insterted in the Map that causes the NPE at line 438. This doesnt' fix the cause, but may solve your problem.



No, unfortunately I still receive an exception (I tried the new cocoon-2.1 (co cocoon-2.1) and the old xml-cocoon2 module)




>
> Note that you can switch back to the "old" DOMStreamer behaviour by calling setNormalizeNamespaces(false).


that helped. I patched my local version of AbstractDOMTransformer:

public void notify(...

    DOMStreamer s = new DOMStreamer(...
    s.setNormalizeNamespaces(false);
    ...


If I will find some time, then I will take a closer look at AbstractDOMTransformer and DOMBuilder. I think the bug is at building the Document from SAX.


Thanks a lot for your help

Michael


> > Hope this helps, > Sylvain






Sylvain






Reply via email to