cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Hutchinson <simon.hutchin...@misgl.com>
Subject Handling SAX Exceptions in sitemap
Date Mon, 24 Nov 2003 11:06:38 GMT
Hi,

Does anyone know if it is possible to handle SAX exceptions thrown by a 
transformer using a error handler defined in a sitemap.

Here is a brief test to explain what I am trying to achieve.

<map:pipeline>
  <map:match pattern="test">
	<map:generate src="fragments/test.xml"/>  		   		 
<map:transform src="xsl/testtrans.xsl"/>	       	        	 
<map:serialize type="xml"/>
  </map:match>
  <map:handle-errors>
  	<map:generate src="fragments/error.xml"/>
	<map:serialize/>				
  </map:handle-errors>
</map:pipeline>


If I rename the file "test.xml" to force a filenotfound exception in the 
generator then the pipeline level error handler is correctly invoked.

However if the generator stage succeeds but then a SAX exception occurs
in the transformer my error handler is not invoked and an
"XML Parsing Error: no element found "
is sent to my browser.


It may be that I am approaching this in the wrong way but is there
any way of defining an error handler that will be invoked despite
where in the pipeline the error occurs. ie can transform errors be 
caught in the sitemap.

Any help would be much appreciated.

Thanks

Si


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message