Examples of SourceLocator


Examples of javax.xml.transform.SourceLocator

   */
  public static String systemId(ExpressionContext context)
  {
    Node contextNode = context.getContextNode();
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getSystemId();
    else
      return null;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

    if (nodeList == null || nodeList.getLength() == 0)
      return null;
   
    Node node = nodeList.item(0);
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getSystemId();
    else
      return null;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

   */
  public static String publicId(ExpressionContext context)
  {
    Node contextNode = context.getContextNode();
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getPublicId();
    else
      return null;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

    if (nodeList == null || nodeList.getLength() == 0)
      return null;
   
    Node node = nodeList.item(0);
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getPublicId();
    else
      return null;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

   */
  public static int lineNumber(ExpressionContext context)
  {
    Node contextNode = context.getContextNode();
    int nodeHandler = ((DTMNodeProxy)contextNode).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)contextNode).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getLineNumber();
    else
      return -1;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

    if (nodeList == null || nodeList.getLength() == 0)
      return -1;
   
    Node node = nodeList.item(0);
    int nodeHandler = ((DTMNodeProxy)node).getDTMNodeNumber();
    SourceLocator locator = ((DTMNodeProxy)node).getDTM()
      .getSourceLocatorFor(nodeHandler);

    if (locator != null)
      return locator.getLineNumber();
    else
      return -1;
  }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

        }
        throw exception;
    }

    private String getMessage( TransformerException exception ) {
        SourceLocator locator = exception.getLocator();

        if ( null != locator ) {
            // System.out.println("Parser fatal error: "+exception.getMessage());
            String id = ( locator.getPublicId() != locator.getPublicId() )
                    ? locator.getPublicId()
                    : ( null != locator.getSystemId() )
                    ? locator.getSystemId() : "SystemId Unknown";
            return new StringBuffer( "Error in TraxTransformer: " )
                    .append( id ).append( "; Line " ).append( locator.getLineNumber() )
                    .append( "; Column " ).append( locator.getColumnNumber() )
                    .append( "; " ).toString();
        }
        return "Error in TraxTransformer: " + exception;
    }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

        }
        throw exception;
    }

    private String getMessage( TransformerException exception ) {
        SourceLocator locator = exception.getLocator();

        if ( null != locator ) {
            // System.out.println("Parser fatal error: "+exception.getMessage());
            String id = ( locator.getPublicId() != locator.getPublicId() )
                    ? locator.getPublicId()
                    : ( null != locator.getSystemId() )
                    ? locator.getSystemId() : "SystemId Unknown";
            return new StringBuffer( "Error in TraxTransformer: " )
                    .append( id ).append( "; Line " ).append( locator.getLineNumber() )
                    .append( "; Column " ).append( locator.getColumnNumber() )
                    .append( "; " ).toString();
        }
        return "Error in TraxTransformer: " + exception;
    }
View Full Code Here

Examples of javax.xml.transform.SourceLocator

            n.addExtraDescription("line"    , String.valueOf(saxParseException.getLineNumber())  );
            n.addExtraDescription("column"  , String.valueOf(saxParseException.getColumnNumber()));
        }
        else if (rootCauseThrowable instanceof TransformerException) {
            TransformerException transformerException = (TransformerException) rootCauseThrowable;
            SourceLocator sourceLocator = transformerException.getLocator();
            n.setMessage         (                           transformerException.getMessage());
            n.addExtraDescription("location",                sourceLocator.getSystemId()      );
            n.addExtraDescription("line"    , String.valueOf(sourceLocator.getLineNumber())   );
            n.addExtraDescription("column"  , String.valueOf(sourceLocator.getColumnNumber()) );
        }
        else{
                n.setMessage(t.getMessage());
         }
       
View Full Code Here

Examples of javax.xml.transform.SourceLocator

        if (logger == null) {
            return;
        }

        StringBuffer msg = new StringBuffer();
        SourceLocator locator = e.getLocator();
        if (locator != null) {
            String systemid = locator.getSystemId();
            if (systemid != null) {
                String url = systemid;
                if (url.startsWith("file:")) {
                    url = FileUtils.getFileUtils().fromURI(url);
                }
                msg.append(url);
            } else {
                msg.append("Unknown file");
            }
            int line = locator.getLineNumber();
            if (line != -1) {
                msg.append(":");
                msg.append(line);
                int column = locator.getColumnNumber();
                if (column != -1) {
                    msg.append(":");
                    msg.append(column);
                }
            }
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.