You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Miles Egan <mi...@caddr.com> on 2003/02/27 22:14:16 UTC

Problem with HTMLGenerator

After updating cvs and rebuilding I get this error when using the 
HTMLGenerator:

[NamespaceNormalizingDOMStreamer] Encountered a DOM Element without a 
localName. DOM Level 1 trees are not supported by this DOMStreamer.

Is this a bug?  It was working fine earlier this week.

miles


Re: Problem with HTMLGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Ugo Cei wrote:
> 
> 
> Isn't there anything better than JTidy for converting HTML to XHTML?  

How about CyberNeko (http://www.apache.org/~andyc/neko/doc/index.html)?

I never tried it, but might start using it in a short timeframe if it 
proves to be useful...

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l.
http://www.pro-netics.com


Re: Problem with HTMLGenerator

Posted by Ugo Cei <u....@cbim.it>.
Bruno Dumon wrote:
> On Thu, 2003-02-27 at 22:14, Miles Egan wrote:
> 
>>After updating cvs and rebuilding I get this error when using the 
>>HTMLGenerator:
>>
>>[NamespaceNormalizingDOMStreamer] Encountered a DOM Element without a 
>>localName. DOM Level 1 trees are not supported by this DOMStreamer.
>>
>>Is this a bug?
> 
> 
> No, it's a feature :-)

Isn't there anything better than JTidy for converting HTML to XHTML? I 
am using it to convert HTML generated by Mozilla's Midas editor (why, oh 
why doesn't it produce valid markup? :-() and found the same problem 
(not surprisingly, since I pasted code from HTMLGenerator). I also tried 
using XOM to process the XML produced by JTidy and found another 
problem, so went back to the old, stupid DOM. I lost three hours working 
around these problems the other night. :-(

	Ugo


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


RE: Problem with HTMLGenerator

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-02-28 at 09:12, Carsten Ziegeler wrote:
> Bruno Dumon wrote:
> > 
> > On Thu, 2003-02-27 at 22:14, Miles Egan wrote:
> > > After updating cvs and rebuilding I get this error when using the 
> > > HTMLGenerator:
> > > 
> > > [NamespaceNormalizingDOMStreamer] Encountered a DOM Element without a 
> > > localName. DOM Level 1 trees are not supported by this DOMStreamer.
> > > 
> > > Is this a bug?
> > 
> > No, it's a feature :-)
> > 
> > Currently the NamespaceNormalizingDOMStreamer only supports
> > namespace-aware (= dom level 2) DOM trees. Extending it to support DOM
> > level 1 trees would require to put the namespace-processing that
> > normally happens in an XML parser, to be put in the DOM-streamer.
> > 
> > I think the easiest solution for now is to use the default DOM streamer
> > in the HTMLGenerator. I'll fix that in a moment...
> > 

BTW, I did this already last night, but my commit mails don't seem to
get through to the xml-cocoon2-cvs list. Do I need to subscribe with my
@apache.org address to that list?

> Is it possible to test the DOM if it is level 2 or level 1 in the
> DOMStreamer and then if it is level 1 perhaps use the streaming?
> 

A simple test would be just checking that getLocalName() on the root
node doesn't return null, so yes, it is possible.

> In general, most components in Cocoon assume that a DOM is level 2
> which means, namespace aware, so a level 1 DOM should really be avoided.

Yep, that's what I thought.

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


RE: Problem with HTMLGenerator

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Bruno Dumon wrote:
> 
> On Thu, 2003-02-27 at 22:14, Miles Egan wrote:
> > After updating cvs and rebuilding I get this error when using the 
> > HTMLGenerator:
> > 
> > [NamespaceNormalizingDOMStreamer] Encountered a DOM Element without a 
> > localName. DOM Level 1 trees are not supported by this DOMStreamer.
> > 
> > Is this a bug?
> 
> No, it's a feature :-)
> 
> Currently the NamespaceNormalizingDOMStreamer only supports
> namespace-aware (= dom level 2) DOM trees. Extending it to support DOM
> level 1 trees would require to put the namespace-processing that
> normally happens in an XML parser, to be put in the DOM-streamer.
> 
> I think the easiest solution for now is to use the default DOM streamer
> in the HTMLGenerator. I'll fix that in a moment...
> 
Is it possible to test the DOM if it is level 2 or level 1 in the
DOMStreamer and then if it is level 1 perhaps use the streaming?

In general, most components in Cocoon assume that a DOM is level 2
which means, namespace aware, so a level 1 DOM should really be avoided.

Carsten

Re: Problem with HTMLGenerator

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2003-02-27 at 22:14, Miles Egan wrote:
> After updating cvs and rebuilding I get this error when using the 
> HTMLGenerator:
> 
> [NamespaceNormalizingDOMStreamer] Encountered a DOM Element without a 
> localName. DOM Level 1 trees are not supported by this DOMStreamer.
> 
> Is this a bug?

No, it's a feature :-)

Currently the NamespaceNormalizingDOMStreamer only supports
namespace-aware (= dom level 2) DOM trees. Extending it to support DOM
level 1 trees would require to put the namespace-processing that
normally happens in an XML parser, to be put in the DOM-streamer.

I think the easiest solution for now is to use the default DOM streamer
in the HTMLGenerator. I'll fix that in a moment...

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