cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: very weird sitemap error handling behavior
Date Wed, 12 Mar 2003 14:10:03 GMT


Stefano Mazzocchi wrote, On 12/03/2003 12.49:
...
> In fact, I get
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <error:notify>[snip]</error:notify>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>[the rest]</html>
> 
> Strangely enough, the contents appended are the correct result of the 
> xslt transformation, even if the welcome.xml page to generate has been 
> manually altered to be non-well-formed and trigger the error.
> 
> it seems that:
> 
> 1) the parser spits the events down the pipeline even if non-wellformed 
> content is found
> 2) thus the XSLT processing is still performed
> 3) but the exception is somewhat signaled
> 4) so the error notifier kicks in
> 5) but forget to close the output stream right after the error 
> notification.
> 
> Now, is this a bug or a feature?

IMHO a bug.

If there is an error, the pipeline should stop dead cold and hand all to 
the handle-errors part of the pipeline.

One thing though is if that is an error or a warning, in that case the 
handle-errors should not even be called.

Either way, it's a bug.


> [I personally don't think that cocoon 
> should even emit non-well-formed content, so I would consider this a 
> bug, but maybe there is something I overlooked]

Generally speaking this is not true. Cocoon can emit non-wellformed 
content, but it should look like:

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html>[the rest]</html>
  <error:notify>[snip]</error:notify>

This is because we don't want to buffer all the response for percieved 
speed reasons (and also debugging too, it's easy to see where it stops).

You came up with clever ideas about resetting via HTTP or something like 
that (chunking?) but I'm not able to understand a thing about it.

So currently with errors Cocoon is by design not giving well-formed 
content, but it's not your bug it seems, which looks real.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Mime
View raw message