sboag 01/11/28 20:18:20
Modified: java/src/org/apache/xalan/transformer ResultTreeHandler.java
Log:
Catch exceptions from the output content handler in flush(), and throw a
SAXParseException with line numbers filled in.
If we don't do this, and the exception is a RuntimeException,
good line numbers of where the exception occured in the stylesheet
won't get reported. I tried just catching RuntimeException, but
for whatever reason it didn't seem to catch.
Fix for Christina's DOMException error problem.
Revision Changes Path
1.54 +18 -1
xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java
Index: ResultTreeHandler.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ResultTreeHandler.java 2001/11/09 19:46:45 1.53
+++ ResultTreeHandler.java 2001/11/29 04:18:20 1.54
@@ -853,8 +853,25 @@
{
if (null != m_name)
{
- m_contentHandler.startElement(m_url, m_localName, m_name,
+ try
+ {
+ m_contentHandler.startElement(m_url, m_localName, m_name,
m_attributes);
+ }
+ catch(Exception re)
+ {
+ // If we don't do this, and the exception is a RuntimeException,
+ // good line numbers of where the exception occured in the
stylesheet
+ // won't get reported. I tried just catching RuntimeException,
but
+ // for whatever reason it didn't seem to catch.
+ // Fix for Christina's DOMException error problem.
+ throw new SAXParseException(re.getMessage(),
+ m_transformer.getCurrentElement().getPublicId(),
+ m_transformer.getCurrentElement().getSystemId(),
+ m_transformer.getCurrentElement().getLineNumber(),
+ m_transformer.getCurrentElement().getColumnNumber(),
+ re);
+ }
if(null != m_tracer)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]