You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Glenn Nielsen <gl...@voyager.apg.more.net> on 2001/08/01 08:39:44 UTC

factory.newTemplates() TransformerException - no location

The TransformerException being thrown for an XSL stylesheet which is not
well formed does not include any location information.  When I execute
the same file by hand from a shell, the error location in the stylesheet 
is printed.

Here is a snippet of code from a Servlet:

                InputStream is = getServletContext().getResourceAsStream(file);
                if( is != null ) {
                    StreamSource source = new StreamSource(is);
                    try {
                        Templates template = factory.newTemplates(source);
                    } catch(TransformerException e) {
/*                      throw new ServletException("XSL stylesheet " + e.getMessage()); */
                        throw new ServletException("XSL stylesheet " +
                            file + " location: " + e.getLocationAsString() +
                            " failure: " + e.getMessageAndLocation());
                    }
                }

Any ideas why I am not getting a location within the file where the
exception took place when running it within the servlet?

Thanks,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------