Sorry to follow up on this heated thread, but i got now the same
problem with an "incorrect user input" causing aolserver to restart.
The problem happens in connection with invalid numeric character
reference (missing closing semicolon). Below is a simple code example
with a real-world forum entry, where tDOM is used with the -html flag
to check, if the input is some reasonable HTML code (like a
lightweight tidy).
set html_fragment {
<p>We had some plain html content that had “left and right”
double quotes and ‘left and right’ single quotes that were
</p>
}
if {[catch {dom parse -html <body>$html_fragment doc} errorMsg]} {
# we got an error, so do tdom-free error processing
} else {
$doc documentElement root
return [$root asHTML]
}
I would certainly prefer here to get a tcl-error on "dom parse" rather
than to get a panic() on "$root asHTML".
best regards
-gustaf neumann
--- In tdom@yahoogroups.com, Rolf Ade <rolf@...> wrote:
>
> This is not about panic while feeding a broken document into tdom. If
> you feed a broken document - broken in any kind, as in tag not closed,
> including a character, that is not allowed in an XML document, used a
> not declared entity etc. ppp. - into tdom, then you get of course an
> 'ordinary' tcl error, which you could catch and notify your user:
> that's not XML.
>
> This panic fires, if there is strong evidence, that something inside
> gone deeply and untolerable und completely unexpected wrong. A
> possible error msg would be: "Something inside your software is
> broken!" Not in a user input, a document or something: the software is
> broken.
>
> If you see this panic then you must look into this. There is no other
> way. Therefor it's a panic.
>
> rolf
>