I'm currently focusing on error handling and I found a weird behavior by
messing around with the <handle-errors> subpipe.
I wrote
<map:handle-errors>
<map:serialize type="xml"/>
</map:handle-errors>
in my sitemap to see what the error-notify generator was emitting, but
Camino (formerly chimera, aka mozilla-light for macosX) which now has
pretty nice (nicer than IE, for that matter) built-in XML support,
complains that the XML is invalid.
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? [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]
comments?
|