matts 2003/01/02 07:05:53
Modified: lib/Apache/AxKit/Language XSP.pm Log: Throw an error if no User_Root is given Revision Changes Path 1.23 +10 -2 xml-axkit/lib/Apache/AxKit/Language/XSP.pm Index: XSP.pm =================================================================== RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Language/XSP.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- XSP.pm 10 Sep 2002 16:27:30 -0000 1.22 +++ XSP.pm 2 Jan 2003 15:05:53 -0000 1.23 @@ -372,7 +372,15 @@ ## we assume that if $e->{XSP_User_Root} is true, somebody, somewhere ## (most likely the default start_element() sub) must have started the ## "sub handler {" declaration, and that we need to close it - $e->{XSP_Script} .= "return OK;\n}\n" if $e->{XSP_User_Root}; + if ($e->{XSP_User_Root}) { + $e->{XSP_Script} .= "return OK;\n}\n"; + } + else { + throw Apache::AxKit::Exception::Error( + -text => "No user root element found" + ) + unless $Apache::AxKit::Language::XSP::AllowNoUserRoot; + } return $e->{XSP_Script}; }