Subject: | Perl error when using XML inside xsp:attribute |
The following code resulted in an obscure Perl error because
ESQL wasn't loaded. I understand why recognizing missing taglibs
is impossible, but a more informative error would have made tracking
this down easier.
<xsp:attribute name="image">
<esql:get-string column="header_image"/>
</xsp:attribute>
The error:
Compilation failed: syntax error at (eval 13) line 65, near "q||{ "
syntax error at (eval 13) line 68, near ";
."
The erroneous Perl code that appeared in apache's error.log:
60 { my $elem = $document->createElementNS(q|http://apache.org/xsp/SQL/v2|,q|esql:max-rows|);$parent->appendChild($elem); $parent = $elem; }
61 { my $text = $document->createTextNode(q|1|);$parent->appendChild($text); }
62 $parent = $parent->getParentNode;
63 { my $elem = $document->createElementNS(q|http://apache.org/xsp/SQL/v2|,q|esql:results|);$parent->appendChild($elem); $parent = $elem; }
64 { my $elem = $document->createElementNS(q|http://apache.org/xsp/SQL/v2|,q|esql:row-results|);$parent->appendChild($elem); $parent = $elem; }
65 $parent->setAttribute(q|image|, "". q||{ my $elem = $document->createElementNS(q|http://apache.org/xsp/SQL/v2|,q|esql:get-string|);$parent->appendChild($elem); $parent = $elem; }
66 $parent->setAttribute(q|column|,q|header_image|);