You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michael Wechner <mi...@wyona.org> on 2003/03/08 13:08:19 UTC

AbstractDOMTransformer

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.

Thanks

Michael


Re: AbstractDOMTransformer

Posted by Michael Wechner <mi...@wyona.org>.
Bruno Dumon wrote:
> On Mon, 2003-03-10 at 18:01, Michael Wechner wrote:
> 
>>Sylvain Wallez wrote:
> 
> [...]
> 
>> >> 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)
>>
> 
> 
> Sorry, my fault. Should be fixed now, could you try again (on
> cocoon-2.1, not yet applied on cocoon-2.0) and let me know if it's all
> ok now? Thanks
> 

yeah, it seems to work. Thanks a lot

Michael





Re: AbstractDOMTransformer

Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2003-03-10 at 18:01, Michael Wechner wrote:
> Sylvain Wallez wrote:
[...]
>  >> 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)
> 

Sorry, my fault. Should be fixed now, could you try again (on
cocoon-2.1, not yet applied on cocoon-2.0) and let me know if it's all
ok now? Thanks

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: AbstractDOMTransformer

Posted by Michael Wechner <mi...@wyona.org>.
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
> 



Re: AbstractDOMTransformer

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
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

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