package fr.insee.eno.exception;

import net.sf.saxon.trans.XPathException;

public class Utils {

    public static String getErrorLocation(String styleSheet, Exception e){
        String errorMessage="";
        try{
            int line = ((XPathException) e).getLocator().getLineNumber();
            int column = ((XPathException) e).getLocator().getColumnNumber();
            errorMessage += String.format("Error in :%s [line :%d - column:%d]", styleSheet,line,column);
        } catch (Exception exception){
        }
        return errorMessage;
    }
}

@@ -227,91 +227,22 @@
     
-int line = ((XPathException) e).getLocator().getLineNumber();%0A            int colum
+String locatio
 n = 
@@ -274,28 +274,19 @@
 ocat
-or().getColumnNumber
+ionAsString
 ();%0A
@@ -345,30 +345,10 @@
 :%25s 
-%5Bline :%25d - column:%25d%5D
+%25s
 %22, s
@@ -361,18 +361,16 @@
 eet,
-line,colum
+ locatio
 n);%0A

Improve utils function for xslt exception