Bug 5872. We were using a constructor of TranformerException without the locator information. Changed to code to use a locator if info is available.

diff --git a/src/org/apache/xalan/transformer/TransformerImpl.java b/src/org/apache/xalan/transformer/TransformerImpl.java
index 588f438..12bd6e2 100644
--- a/src/org/apache/xalan/transformer/TransformerImpl.java
+++ b/src/org/apache/xalan/transformer/TransformerImpl.java
@@ -665,9 +665,8 @@
         }
         else if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
         {
-          m_errorHandler.fatalError(
-            new javax.xml.transform.TransformerException(
-              ((org.apache.xml.utils.WrappedRuntimeException) e).getException()));
+          fatalError(
+              ((org.apache.xml.utils.WrappedRuntimeException) e).getException());
         }
         else
         {
@@ -690,17 +689,13 @@
           ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException();
       }
 
-      m_errorHandler.fatalError(new TransformerException(wre.getException()));
+      fatalError(throwable);
     }
 
     // Patch attributed to David Eisenberg <david@catcode.com>
     catch (org.xml.sax.SAXParseException spe)
     {
-      String msg = spe.getMessage();
-      SAXSourceLocator loc = new SAXSourceLocator(spe);
-
-      //m_errorHandler.fatalError(new TransformerException( msg, loc ));
-      m_errorHandler.fatalError(new TransformerException(spe));
+      fatalError(spe);
     }
     catch (org.xml.sax.SAXException se)
     {
@@ -714,6 +709,15 @@
       reset();
     }
   }
+  
+  private void fatalError(Throwable throwable) throws TransformerException
+  {
+    if (throwable instanceof org.xml.sax.SAXParseException)
+      m_errorHandler.fatalError(new TransformerException(throwable.getMessage(),new SAXSourceLocator((org.xml.sax.SAXParseException)throwable)));
+    else
+      m_errorHandler.fatalError(new TransformerException(throwable));
+    
+  }
 
   /**
    * Get the base URL of the source.