cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Bortman" <bacon_ea...@hotmail.com>
Subject catching an xsl transformation error
Date Tue, 24 Jan 2006 22:00:30 GMT
Hello,

I am relatively new to Cocoon and am currently working on an application 
that displays an XML file in a nicer html format for a user.  I am using 
cocoon to perform an xsl transformation on a user specified xml file, which 
will transform the xml into html.  The problem that I have run across is; if 
the user specifies a file that is not a valid xml file the xsl 
transformation fails.  When the transformation fails a blank page is 
displayed, instead of the html view of the xml file.  I think that this is 
because there is not a root element for the first xsl template to match.

Is there a way to catch this error and display a nice message on the screen 
letting the user know that the file selected was not a valid xml file?  Or 
could I add some sort of template in the xsl file that would match a file 
without a root element?  Or any other suggestions on how to handle a user 
entering a file that is not valid xml.

The error that appears in the Cocoon error log is:

FATAL_E (2006-01-24) 14:14.08:680  [core.xslt-processor] (/ui/core/XPathWiz) 
Http-0/TraxErrorHandler: java.lang.ArrayIndexOutOfBoundsException: -1
javax.xml.transform.TransformerException: 
java.lang.ArrayIndexOutOfBoundsException: -1



Thanks for your time,
Aaron Bortman



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


Mime
View raw message