Examples of SourceLocator


Examples of client.net.sf.saxon.ce.tree.util.SourceLocator

                useWhen = startTag.getAttribute(xslUseWhenCode);
            }
            if (useWhen != null) {
                Expression expr = null;
                try {
                    SourceLocator loc = new SourceLocator() {
                        public String getSystemId() {
                            return UseWhenFilter.this.getSystemId();
                        }

                        public String getLocation() {
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.SourceLocator

   
    private SourceLocator getLastLocator() {
      int stackSize = stack.size();
      Expression[] expr = new Expression[stackSize];
      stack.toArray(expr);
      SourceLocator result = null;
      for (int i = stackSize -1; i > -1; i--) {
        if (expr[i].sourceLocator != null) {
          return expr[i].sourceLocator;
        }
      }
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.SourceLocator

      }
      return result;
    }
   
    public String getLocation() {
      SourceLocator sl = getLastLocator();
      String message = "";
      if (sl != null) {
        message = sl.getLocation();
        int pos = message.indexOf(" in ");
        if (pos > -1) {
          message = message.substring(0, pos);
        }
      }
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.SourceLocator

     * @param err the exception containing the location information
     * @return a message string describing the location
     */

    public String getLocationMessage(XPathException err) {
        SourceLocator loc = err.getLocator();
        while (loc == null) {
            if (err.getCause() instanceof XPathException) {
                err = (XPathException)err.getCause();
                loc = err.getLocator();
            } else if (err.getCause() instanceof XPathException) {
View Full Code Here

Examples of javax.xml.transform.SourceLocator

      }
      catch (TransformerConfigurationException e) {
         oLastXcpt = e;
         sMedia = null;

         SourceLocator sl = e.getLocator();

         if (DebugFile.trace) {
           if (sl == null) {
             DebugFile.writeln("ERROR TransformerConfigurationException " + e.getMessage());
           }
           else {
             DebugFile.writeln("ERROR TransformerConfigurationException " + e.getMessage() + " line=" + String.valueOf(sl.getLineNumber()) + " column=" + String.valueOf(sl.getColumnNumber()));
           }
         }
      }
      catch (TransformerException e) {
        oLastXcpt = e;
View Full Code Here

Examples of javax.xml.transform.SourceLocator

      }
      catch (TransformerConfigurationException e) {
         oLastXcpt = e;
         sMedia = null;

         SourceLocator sl = e.getLocator();

         if (DebugFile.trace) {
           if (sl == null) {
             DebugFile.writeln("ERROR TransformerConfigurationException " + e.getMessage());
           }
           else {
             DebugFile.writeln("ERROR TransformerConfigurationException " + e.getMessage() + " line=" + String.valueOf(sl.getLineNumber()) + " column=" + String.valueOf(sl.getColumnNumber()));
           }
         }
      }
      catch (TransformerException e) {
        oLastXcpt = e;
View Full Code Here

Examples of javax.xml.transform.SourceLocator

      ehandler.fatalError(new TransformerException(fmsg,
                              (SAXSourceLocator)xctxt.getSAXLocator()));
    }
    else
    {
      SourceLocator slocator = xctxt.getSAXLocator();
      System.out.println(fmsg + "; file " + slocator.getSystemId()
                         + "; line " + slocator.getLineNumber() + "; column "
                         + slocator.getColumnNumber());
    }
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

    public static void logExceptionLocation(PrintWriter pw, Throwable exception)
    {
        if (null == pw)
            pw = new PrintWriter(System.err, true);
       
        SourceLocator locator = null;
        Throwable cause = exception;

        // Try to find the locator closest to the cause.
        do
        {
            // Find the current locator, if one present
            if(cause instanceof SAXParseException)
            {
                // A SAXSourceLocator is a Xalan helper class
                //  that implements both a SourceLocator and a SAX Locator
                //@todo check that the new locator actually has
                //  as much or more information as the
                //  current one already does
                locator = new SAXSourceLocator((SAXParseException)cause);
            }
            else if (cause instanceof TransformerException)
            {
                SourceLocator causeLocator = ((TransformerException)cause).getLocator();
                if(null != causeLocator)
                {
                    locator = causeLocator;
                }
            }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

  }
 
  public static void ensureLocationSet(TransformerException exception)
  {
    // SourceLocator locator = exception.getLocator();
    SourceLocator locator = null;
    Throwable cause = exception;
   
    // Try to find the locator closest to the cause.
    do
    {
      if(cause instanceof SAXParseException)
      {
        locator = new SAXSourceLocator((SAXParseException)cause);
      }
      else if (cause instanceof TransformerException)
      {
        SourceLocator causeLocator = ((TransformerException)cause).getLocator();
        if(null != causeLocator)
          locator = causeLocator;
      }
     
      if(cause instanceof TransformerException)
View Full Code Here

Examples of javax.xml.transform.SourceLocator

    printLocation(new PrintWriter(pw), exception);
  }
 
  public static void printLocation(PrintWriter pw, Throwable exception)
  {
    SourceLocator locator = null;
    Throwable cause = exception;
   
    // Try to find the locator closest to the cause.
    do
    {
      if(cause instanceof SAXParseException)
      {
        locator = new SAXSourceLocator((SAXParseException)cause);
      }
      else if (cause instanceof TransformerException)
      {
        SourceLocator causeLocator = ((TransformerException)cause).getLocator();
        if(null != causeLocator)
          locator = causeLocator;
      }
      if(cause instanceof TransformerException)
        cause = ((TransformerException)cause).getCause();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.