Package javax.xml.transform

Examples of javax.xml.transform.SourceLocator


            this.logger = messageLogger;
            this.parentClassReference = parentClassReference;
        }

        public void warning(TransformerException exception) {
            SourceLocator loc = exception.getLocator();
            if(loc != null) {
                logger.logMessage(
                    "Warning while " + errorMessageActionText + " at line " + loc.getLineNumber()
                            + ", column " + loc.getColumnNumber() + ": "
                            + getExceptionErrorMessage(exception),
                    parentClassReference,
                    MessageLogger.WARNING);

            } else {
View Full Code Here


            }
        }

        public void error(TransformerException exception) throws TransformerException {

            SourceLocator loc = exception.getLocator();
            if(loc != null) {
                logger.logMessage(
                    "Error " + errorMessageActionText + " at line " + loc.getLineNumber()
                            + ", column " + loc.getColumnNumber() + ": "
                            + getExceptionErrorMessage(exception),
                    parentClassReference,
                    MessageLogger.ERROR);
            } else {
                logger.logMessage(
View Full Code Here

            throw exception;

        }

        public void fatalError(TransformerException exception) throws TransformerException {
            SourceLocator loc = exception.getLocator();
            if(loc != null) {
                logger.logMessage(
                    "Fatal error " + errorMessageActionText + " at line " + loc.getLineNumber()
                            + ", column " + loc.getColumnNumber() + ": "
                            + getExceptionErrorMessage(exception),
                    parentClassReference,
                    MessageLogger.ERROR);

View Full Code Here

     
      // before we forget, lets make the created handler hold a reference
      // to the current TransformImpl object
      xoh.setTransformer(this);

      SourceLocator srcLocator = getStylesheet();
      xoh.setSourceLocator(srcLocator);
     
     
      return xoh;
View Full Code Here

    if (m_traceSelection) {
        ElemTemplateElement ete = (ElemTemplateElement) ev.m_styleNode;
        Node sourceNode = ev.m_sourceNode;

        SourceLocator locator = null;
        if (sourceNode instanceof DTMNodeProxy) {
            int nodeHandler = ((DTMNodeProxy) sourceNode).getDTMNodeNumber();
            locator =
                ((DTMNodeProxy) sourceNode).getDTM().getSourceLocatorFor(
                    nodeHandler);
View Full Code Here

          }
          vars.setStackFrame(nextFrame);
        }
      }
     
      SourceLocator savedLocator = xctxt.getSAXLocator();

      try
      {
        xctxt.setSAXLocator(m_template);
View Full Code Here

            if (e instanceof TransformerException)
            {
              TransformerException spe2 = (TransformerException) e;

              SourceLocator locator = spe2.getLocator();
              if ((null != locator) && (null != locator.getSystemId()))
                diagnosticsWriter.println("   ID: " + locator.getSystemId()
                                          + " Line #" + locator.getLineNumber()
                                          + " Column #"
                                          + locator.getColumnNumber());

              e = spe2.getException();

              if (e instanceof org.apache.xml.utils.WrappedRuntimeException)
                e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException();
View Full Code Here

      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

  }
 
  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

    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

Related Classes of javax.xml.transform.SourceLocator

Copyright © 2018 www.massapicom. 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.