Exception Fact Sheet for "xalan"

The goal of an Exception Fact Sheet is to reveal the design of exception handling in an application.

--Maxence, Martin

For feedback, please contact Martin

Table of contents

Basic Statistics

Number of Classes 1219
Number of Domain Exception Types (Thrown or Caught) 23
Number of Domain Checked Exception Types 7
Number of Domain Runtime Exception Types 10
Number of Domain Unknown Exception Types 6
nTh = Number of Throw 1204
nTh = Number of Throw in Catch 611
Number of Catch-Rethrow (may not be correct) 97
nC = Number of Catch 1288
nCTh = Number of Catch with Throw 582
Number of Empty Catch (really Empty) 182
Number of Empty Catch (with comments) 85
Number of Empty Catch 267
nM = Number of Methods 9746
nbFunctionWithCatch = Number of Methods with Catch 732 / 9746
nbFunctionWithThrow = Number of Methods with Throw 795 / 9746
nbFunctionWithThrowS = Number of Methods with ThrowS 2089 / 9746
nbFunctionTransmitting = Number of Methods with "Throws" but NO catch, NO throw (only transmitting) 1499 / 9746
P1 = nCTh / nC 45.2% (0.452)
P2 = nMC / nM 7.5% (0.075)
P3 = nbFunctionWithThrow / nbFunction 8.2% (0.082)
P4 = nbFunctionTransmitting / nbFunction 15.4% (0.154)
P5 = nbThrowInCatch / nbThrow 50.7% (0.507)
R2 = nCatch / nThrow 1.07
A1 = Number of Caught Exception Types From External Libraries 46
A2 = Number of Reused Exception Types From External Libraries (thrown from application code) 28

W1 is a rough estimation of the richness of the exception model. It does not take into account the inheritance relationships between domain exceptions.

Proportion P1 measures the overall exception flow. According to our experience, it varies from 5% to 70%. Early-catch design generally yields a low P1, libraries that must warn clients about errors (e.g. databases) generally have a high P1.

Proportion P2 measures the dispersion of catch blocks in the application. According to our experience, it varies from 2% to 15%. A small P2 indicates a rather centralized management of errors.

R1 shows how many exceptions types from libraries (incl. JDK) are thrown from application code. For instance, IllegalArgumentException comes from the JDK but is used in many applications.

A1 measures the awareness of the application to library exceptions. A high value of A1 means either that the application is polluted with checked exceptions or that it is able to apply specific recovery depending on the library exception.

Exception Hierachy

Exception Map

Each exception that is used at least once in the project is a dot. A orange dot represents a domain exception that is defined in the application. A blue dot exception is defined in the JDK or in a library. The x-axis represents the number of times an exception is caught, the y-axis the number of times an exception is thrown.

Exceptions With State

State means fields. Number of exceptions with state: 6
TypeCheckError
              package org.apache.xalan.xsltc.compiler.util;public class TypeCheckError extends Exception {
    static final long serialVersionUID = 3246224233917854640L;
    ErrorMsg _error = null;
    SyntaxTreeNode _node = null;
	
    public TypeCheckError(SyntaxTreeNode node) {
	super();
	_node = node;
    }

    public TypeCheckError(ErrorMsg error) {
	super();
	_error = error;
    }
	
    public TypeCheckError(String code, Object param) {
	super();
	_error = new ErrorMsg(code, param);
    }

    public TypeCheckError(String code, Object param1, Object param2) {
	super();
	_error = new ErrorMsg(code, param1, param2);
    }

    public ErrorMsg getErrorMsg() {
        return _error;
    }

    public String getMessage() {
        return toString();
    }

    public String toString() {
	String result;

	if (_error == null) {
            if (_node != null) {
                _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_ERR,
                                      _node.toString());
	    } else {
	        _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_UNK_LOC_ERR);
	    }
        }

	return _error.toString();
    }
}
            
CompilerException
              package org.apache.xalan.xsltc.compiler;public final class CompilerException extends Exception {
    static final long serialVersionUID = 1732939618562742663L;

    private String _msg;

    public CompilerException() {
	super();
    }
    
    public CompilerException(Exception e) {
	super(e.toString());
	_msg = e.toString(); 
    }
    
    public CompilerException(String message) {
	super(message);
	_msg = message;
    }

    public String getMessage() {
	final int col = _msg.indexOf(':');

	if (col > -1)
	    return(_msg.substring(col));
	else
	    return(_msg);
    }
}
            
WrappedRuntimeException
              package org.apache.xml.utils;public class WrappedRuntimeException extends RuntimeException
{
    static final long serialVersionUID = 7140414456714658073L;

  /** Primary checked exception.
   *  @serial          */
  private Exception m_exception;

  /**
   * Construct a WrappedRuntimeException from a
   * checked exception.
   *
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(Exception e)
  {

    super(e.getMessage());

    m_exception = e;
  }

  /**
   * Constructor WrappedRuntimeException
   *
   *
   * @param msg Exception information.
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(String msg, Exception e)
  {

    super(msg);

    m_exception = e;
  }
  
  /**
   * Get the checked exception that this runtime exception wraps.
   *
   * @return The primary checked exception
   */
  public Exception getException()
  {
    return m_exception;
  }
}
              package org.apache.xml.serializer.utils;public final class WrappedRuntimeException extends RuntimeException
{
    static final long serialVersionUID = 7140414456714658073L;

  /** Primary checked exception.
   *  @serial          */
  private Exception m_exception;

  /**
   * Construct a WrappedRuntimeException from a
   * checked exception.
   *
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(Exception e)
  {

    super(e.getMessage());

    m_exception = e;
  }

  /**
   * Constructor WrappedRuntimeException
   *
   *
   * @param msg Exception information.
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(String msg, Exception e)
  {

    super(msg);

    m_exception = e;
  }
  
  /**
   * Get the checked exception that this runtime exception wraps.
   *
   * @return The primary checked exception
   */
  public Exception getException()
  {
    return m_exception;
  }
}
            
DTMException
              package org.apache.xml.dtm;public class DTMException extends RuntimeException {
    static final long serialVersionUID = -775576419181334734L;

    /** Field locator specifies where the error occured.
     *  @serial */
    SourceLocator locator;

    /**
     * Method getLocator retrieves an instance of a SourceLocator
     * object that specifies where an error occured.
     *
     * @return A SourceLocator object, or null if none was specified.
     */
    public SourceLocator getLocator() {
        return locator;
    }

    /**
     * Method setLocator sets an instance of a SourceLocator
     * object that specifies where an error occured.
     *
     * @param location A SourceLocator object, or null to clear the location.
     */
    public void setLocator(SourceLocator location) {
        locator = location;
    }

    /** Field containedException specifies a wrapped exception.  May be null.
     *  @serial */
    Throwable containedException;

    /**
     * This method retrieves an exception that this exception wraps.
     *
     * @return An Throwable object, or null.
     * @see #getCause
     */
    public Throwable getException() {
        return containedException;
    }

    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown.  (The cause is the throwable that
     * caused this throwable to get thrown.)
     */
    public Throwable getCause() {

        return ((containedException == this)
                ? null
                : containedException);
    }

    /**
     * Initializes the <i>cause</i> of this throwable to the specified value.
     * (The cause is the throwable that caused this throwable to get thrown.)
     *
     * <p>This method can be called at most once.  It is generally called from
     * within the constructor, or immediately after creating the
     * throwable.  If this throwable was created
     * with {@link #DTMException(Throwable)} or
     * {@link #DTMException(String,Throwable)}, this method cannot be called
     * even once.
     *
     * @param  cause the cause (which is saved for later retrieval by the
     *         {@link #getCause()} method).  (A <tt>null</tt> value is
     *         permitted, and indicates that the cause is nonexistent or
     *         unknown.)
     * @return  a reference to this <code>Throwable</code> instance.
     * @throws IllegalArgumentException if <code>cause</code> is this
     *         throwable.  (A throwable cannot
     *         be its own cause.)
     * @throws IllegalStateException if this throwable was
     *         created with {@link #DTMException(Throwable)} or
     *         {@link #DTMException(String,Throwable)}, or this method has already
     *         been called on this throwable.
     */
    public synchronized Throwable initCause(Throwable cause) {

        if ((this.containedException == null) && (cause != null)) {
            throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause");
        }

        if (cause == this) {
            throw new IllegalArgumentException(
                XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted");
        }

        this.containedException = cause;

        return this;
    }

    /**
     * Create a new DTMException.
     *
     * @param message The error or warning message.
     */
    public DTMException(String message) {

        super(message);

        this.containedException = null;
        this.locator            = null;
    }

    /**
     * Create a new DTMException wrapping an existing exception.
     *
     * @param e The exception to be wrapped.
     */
    public DTMException(Throwable e) {

        super(e.getMessage());

        this.containedException = e;
        this.locator            = null;
    }

    /**
     * Wrap an existing exception in a DTMException.
     *
     * <p>This is used for throwing processor exceptions before
     * the processing has started.</p>
     *
     * @param message The error or warning message, or null to
     *                use the message from the embedded exception.
     * @param e Any exception
     */
    public DTMException(String message, Throwable e) {

        super(((message == null) || (message.length() == 0))
              ? e.getMessage()
              : message);

        this.containedException = e;
        this.locator            = null;
    }

    /**
     * Create a new DTMException from a message and a Locator.
     *
     * <p>This constructor is especially useful when an application is
     * creating its own exception from within a DocumentHandler
     * callback.</p>
     *
     * @param message The error or warning message.
     * @param locator The locator object for the error or warning.
     */
    public DTMException(String message, SourceLocator locator) {

        super(message);

        this.containedException = null;
        this.locator            = locator;
    }

    /**
     * Wrap an existing exception in a DTMException.
     *
     * @param message The error or warning message, or null to
     *                use the message from the embedded exception.
     * @param locator The locator object for the error or warning.
     * @param e Any exception
     */
    public DTMException(String message, SourceLocator locator,
                                Throwable e) {

        super(message);

        this.containedException = e;
        this.locator            = locator;
    }

    /**
     * Get the error message with location information
     * appended.
     */
    public String getMessageAndLocation() {

        StringBuffer sbuffer = new StringBuffer();
        String       message = super.getMessage();

        if (null != message) {
            sbuffer.append(message);
        }

        if (null != locator) {
            String systemID = locator.getSystemId();
            int    line     = locator.getLineNumber();
            int    column   = locator.getColumnNumber();

            if (null != systemID) {
                sbuffer.append("; SystemID: ");
                sbuffer.append(systemID);
            }

            if (0 != line) {
                sbuffer.append("; Line#: ");
                sbuffer.append(line);
            }

            if (0 != column) {
                sbuffer.append("; Column#: ");
                sbuffer.append(column);
            }
        }

        return sbuffer.toString();
    }

    /**
     * Get the location information as a string.
     *
     * @return A string with location info, or null
     * if there is no location information.
     */
    public String getLocationAsString() {

        if (null != locator) {
            StringBuffer sbuffer  = new StringBuffer();
            String       systemID = locator.getSystemId();
            int          line     = locator.getLineNumber();
            int          column   = locator.getColumnNumber();

            if (null != systemID) {
                sbuffer.append("; SystemID: ");
                sbuffer.append(systemID);
            }

            if (0 != line) {
                sbuffer.append("; Line#: ");
                sbuffer.append(line);
            }

            if (0 != column) {
                sbuffer.append("; Column#: ");
                sbuffer.append(column);
            }

            return sbuffer.toString();
        } else {
            return null;
        }
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     */
    public void printStackTrace() {
        printStackTrace(new java.io.PrintWriter(System.err, true));
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     * @param s The stream where the dump will be sent to.
     */
    public void printStackTrace(java.io.PrintStream s) {
        printStackTrace(new java.io.PrintWriter(s));
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     * @param s The writer where the dump will be sent to.
     */
    public void printStackTrace(java.io.PrintWriter s) {

        if (s == null) {
            s = new java.io.PrintWriter(System.err, true);
        }

        try {
            String locInfo = getLocationAsString();

            if (null != locInfo) {
                s.println(locInfo);
            }

            super.printStackTrace(s);
        } catch (Throwable e) {}

        boolean isJdk14OrHigher = false;
        try {
            Throwable.class.getMethod("getCause",null);
            isJdk14OrHigher = true;
        } catch (NoSuchMethodException nsme) {
            // do nothing
        }        

        // The printStackTrace method of the Throwable class in jdk 1.4 
        // and higher will include the cause when printing the backtrace.
        // The following code is only required when using jdk 1.3 or lower                
        if (!isJdk14OrHigher) {
            Throwable exception = getException();
    
            for (int i = 0; (i < 10) && (null != exception); i++) {
                s.println("---------");
    
                try {
                    if (exception instanceof DTMException) {
                        String locInfo =
                            ((DTMException) exception)
                                .getLocationAsString();
    
                        if (null != locInfo) {
                            s.println(locInfo);
                        }
                    }
    
                    exception.printStackTrace(s);
                } catch (Throwable e) {
                    s.println("Could not print stack trace...");
                }
    
                try {
                    Method meth =
                        ((Object) exception).getClass().getMethod("getException",
                            null);
    
                    if (null != meth) {
                        Throwable prev = exception;
    
                        exception = (Throwable) meth.invoke(exception, null);
    
                        if (prev == exception) {
                            break;
                        }
                    } else {
                        exception = null;
                    }
                } catch (InvocationTargetException ite) {
                    exception = null;
                } catch (IllegalAccessException iae) {
                    exception = null;
                } catch (NoSuchMethodException nsme) {
                    exception = null;
                }
            }
        }
    }
              package org.apache.xml.dtm.ref;public static class DTMException extends org.w3c.dom.DOMException
  {
          static final long serialVersionUID = -8290238117162437678L;
    /**
     * Constructs a DOM/DTM exception.
     *
     * @param code
     * @param message
     */
    public DTMException(short code, String message)
    {
      super(code, message);
    }

    /**
     * Constructor DTMException
     *
     *
     * @param code
     */
    public DTMException(short code)
    {
      super(code, "");
    }
  }
            
XPathException
              package org.apache.xpath;public class XPathException extends TransformerException
{
    static final long serialVersionUID = 4263549717619045963L;

  /** The home of the expression that caused the error.
   *  @serial  */
  Object m_styleNode = null;

  /**
   * Get the stylesheet node from where this error originated.
   * @return The stylesheet node from where this error originated, or null.
   */
  public Object getStylesheetNode()
  {
    return m_styleNode;
  }
  
  /**
   * Set the stylesheet node from where this error originated.
   * @param styleNode The stylesheet node from where this error originated, or null.
   */
  public void setStylesheetNode(Object styleNode)
  {
    m_styleNode = styleNode;
  }


  /** A nested exception.
   *  @serial   */
  protected Exception m_exception;

  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message, ExpressionNode ex)
  {
    super(message);
    this.setLocator(ex);
    setStylesheetNode(getStylesheetNode(ex));
  }
  
  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message)
  {
    super(message);
  }

  
  /**
   * Get the XSLT ElemVariable that this sub-expression references.  In order for 
   * this to work, the SourceLocator must be the owning ElemTemplateElement.
   * @return The dereference to the ElemVariable, or null if not found.
   */
  public org.w3c.dom.Node getStylesheetNode(ExpressionNode ex)
  {
  	
    ExpressionNode owner = getExpressionOwner(ex);

    if (null != owner && owner instanceof org.w3c.dom.Node)
    {
		return ((org.w3c.dom.Node)owner);
    }
    return null;

  }
  
  /**
   * Get the first non-Expression parent of this node.
   * @return null or first ancestor that is not an Expression.
   */
  protected ExpressionNode getExpressionOwner(ExpressionNode ex)
  {
  	ExpressionNode parent = ex.exprGetParent();
  	while((null != parent) && (parent instanceof Expression))
  		parent = parent.exprGetParent();
  	return parent;
  }



  /**
   * Create an XPathException object that holds
   * an error message and the stylesheet node that
   * the error originated from.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   */
  public XPathException(String message, Object styleNode)
  {

    super(message);

    m_styleNode = styleNode;
  }

  /**
   * Create an XPathException object that holds
   * an error message, the stylesheet node that
   * the error originated from, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Node styleNode, Exception e)
  {

    super(message);

    m_styleNode = styleNode;
    this.m_exception = e;
  }

  /**
   * Create an XPathException object that holds
   * an error message, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Exception e)
  {

    super(message);

    this.m_exception = e;
  }

  /**
   * Print the the trace of methods from where the error
   * originated.  This will trace all nested exception
   * objects, as well as this object.
   * @param s The stream where the dump will be sent to.
   */
  public void printStackTrace(java.io.PrintStream s)
  {

    if (s == null)
      s = System.err;

    try
    {
      super.printStackTrace(s);
    }
    catch (Exception e){}

    Throwable exception = m_exception;

    for (int i = 0; (i < 10) && (null != exception); i++)
    {
      s.println("---------");
      exception.printStackTrace(s);

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }
  }
            
ConfigurationError
              package org.apache.xml.utils;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 2036619216663421552L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xml.dtm.ref;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 7772782876036961354L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xml.dtm;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 5122054096615067992L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xml.serializer;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 8859254254255146542L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.runtime;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -2293620736651286953L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.compiler.util;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -4417969773510154215L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.compiler;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 3326843611085065902L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.dom;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -5948733402959678002L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.cmdline;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -6072257854297546607L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xsltc.trax;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -1877553852268428278L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.xslt;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 2276082712114762609L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.lib.sql;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 3273432303767233578L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.lib;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -7640369932165775029L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xalan.extensions;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 8564305128443551853L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
              package org.apache.xpath.functions;static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -5782303800588797207L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
            

Thrown Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be thrown, thrown from within a catch, or declared in the signature of a method (usually for checked exceptions). Hovering over a number triggers showing code snippets from the application code.

Type Exception Thrown Thrown
from Catch
Declared
- Unknown 162
              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/ListingErrorHandler.java
throw mue;

              
//in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
//in src/org/apache/xml/utils/XMLReaderManager.java
throw pce;

              
//in src/org/apache/xml/utils/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xml/utils/ObjectFactory.java
throw e;

              
//in src/org/apache/xml/utils/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/utils/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/dtm/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw re;

              
//in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw re;

              
//in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw e;

              
//in src/org/apache/xml/dtm/ref/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw (RuntimeException)gotMore;

              
//in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw e;

              
//in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw e;

              
//in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw e;

              
//in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/dtm/ObjectFactory.java
throw e;

              
//in src/org/apache/xml/dtm/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/dtm/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/serializer/OutputPropertiesFactory.java
throw ioe;

              
//in src/org/apache/xml/serializer/OutputPropertiesFactory.java
throw se;

              
//in src/org/apache/xml/serializer/ToXMLStream.java
throw se;

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
//in src/org/apache/xml/serializer/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xml/serializer/ObjectFactory.java
throw e;

              
//in src/org/apache/xml/serializer/ObjectFactory.java
throw x;

              
//in src/org/apache/xml/serializer/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/dom/LoadDocument.java
throw e;

              
//in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
throw re;

              
//in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
throw re;

              
//in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
throw (new IllegalArgumentException(msg.toString()));

              
//in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
throw (new MissingOptArgException(msg.toString()));

              
//in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw exc;

              
//in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e1;

              
//in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e;

              
//in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e;

              
//in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
throw e;

              
//in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
throw e;

              
//in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
throw e1;

              
//in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw tce;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
//in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
//in src/org/apache/xalan/templates/ElemValueOf.java
throw te;

              
//in src/org/apache/xalan/templates/ElemLiteralResult.java
throw tException;

              
//in src/org/apache/xalan/templates/ElemLiteralResult.java
throw tException;

              
//in src/org/apache/xalan/transformer/TrAXFilter.java
throw (org.xml.sax.SAXException)e;

              
//in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
//in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
//in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
//in src/org/apache/xalan/transformer/TransformerImpl.java
throw (javax.xml.transform.TransformerException) e;

              
//in src/org/apache/xalan/transformer/TransformerImpl.java
throw te;

              
//in src/org/apache/xalan/transformer/TransformerImpl.java
throw e;

              
//in src/org/apache/xalan/transformer/ClonerToResultTree.java
throw new  TransformerException(
                         "Can't clone node: "+dtm.getNodeName(node));

              
//in src/org/apache/xalan/xslt/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/xslt/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/xslt/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/xslt/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/lib/sql/XConnection.java
throw e;

              
//in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
throw e;

              
//in src/org/apache/xalan/lib/sql/SQLDocument.java
throw e;

              
//in src/org/apache/xalan/lib/sql/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/lib/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/lib/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/lib/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/lib/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ite;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ite;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ((TransformerException)targetException);

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw (TransformerException)targetException;

              
//in src/org/apache/xalan/extensions/ExtensionsTable.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionsTable.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ((TransformerException)targetException);

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
//in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ((TransformerException)targetException);

              
//in src/org/apache/xalan/extensions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
throw e;

              
//in src/org/apache/xalan/extensions/ObjectFactory.java
throw e;

              
//in src/org/apache/xalan/extensions/ObjectFactory.java
throw x;

              
//in src/org/apache/xalan/extensions/ObjectFactory.java
throw x;

              
//in src/org/apache/xpath/XPath.java
throw te;

              
//in src/org/apache/xpath/XPath.java
throw te;

              
//in src/org/apache/xpath/XPath.java
throw te;

              
//in src/org/apache/xpath/XPath.java
throw te;

              
//in src/org/apache/xpath/compiler/XPathParser.java
throw e;

              
//in src/org/apache/xpath/compiler/XPathParser.java
throw te;

              
//in src/org/apache/xpath/compiler/XPathParser.java
throw te;

              
//in src/org/apache/xpath/functions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
//in src/org/apache/xpath/functions/ObjectFactory.java
throw e;

              
//in src/org/apache/xpath/functions/ObjectFactory.java
throw x;

              
//in src/org/apache/xpath/functions/ObjectFactory.java
throw x;

              
//in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
//in src/org/apache/xpath/jaxp/XPathImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
//in src/org/apache/xpath/jaxp/XPathImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
//in src/org/apache/xpath/axes/NodeSequence.java
throw rte;

            
- -
- Builder 25
              
// in src/org/apache/xml/utils/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/dtm/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
throw (new IllegalArgumentException(msg.toString()));

              
// in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
throw (new MissingOptArgException(msg.toString()));

              
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
throw new  TransformerException(
                         "Can't clone node: "+dtm.getNodeName(node));

              
// in src/org/apache/xalan/xslt/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/lib/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/extensions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xpath/functions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

            
- -
- Variable 159
              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/ListingErrorHandler.java
throw mue;

              
// in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/DefaultErrorHandler.java
throw exception;

              
// in src/org/apache/xml/utils/XMLReaderManager.java
throw pce;

              
// in src/org/apache/xml/utils/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/utils/ObjectFactory.java
throw e;

              
// in src/org/apache/xml/utils/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/utils/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/dtm/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw re;

              
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw re;

              
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
throw e;

              
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw (RuntimeException)gotMore;

              
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw e;

              
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
throw e;

              
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw e;

              
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/dtm/ObjectFactory.java
throw e;

              
// in src/org/apache/xml/dtm/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/dtm/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
throw ioe;

              
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
throw se;

              
// in src/org/apache/xml/serializer/ToXMLStream.java
throw se;

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw lse;

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace();

              
// in src/org/apache/xml/serializer/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xml/serializer/ObjectFactory.java
throw e;

              
// in src/org/apache/xml/serializer/ObjectFactory.java
throw x;

              
// in src/org/apache/xml/serializer/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
throw e;

              
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
throw re;

              
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
throw re;

              
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw exc;

              
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e1;

              
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e;

              
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
throw e;

              
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
throw e;

              
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
throw e;

              
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
throw e1;

              
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw tce;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
throw ex1;

              
// in src/org/apache/xalan/templates/ElemValueOf.java
throw te;

              
// in src/org/apache/xalan/templates/ElemLiteralResult.java
throw tException;

              
// in src/org/apache/xalan/templates/ElemLiteralResult.java
throw tException;

              
// in src/org/apache/xalan/transformer/TrAXFilter.java
throw (org.xml.sax.SAXException)e;

              
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
throw e;

              
// in src/org/apache/xalan/transformer/TransformerImpl.java
throw (javax.xml.transform.TransformerException) e;

              
// in src/org/apache/xalan/transformer/TransformerImpl.java
throw te;

              
// in src/org/apache/xalan/transformer/TransformerImpl.java
throw e;

              
// in src/org/apache/xalan/xslt/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/xslt/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/xslt/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/xslt/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/lib/sql/XConnection.java
throw e;

              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
throw e;

              
// in src/org/apache/xalan/lib/sql/SQLDocument.java
throw e;

              
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/lib/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/lib/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/lib/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/lib/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ite;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ite;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw ((TransformerException)targetException);

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
throw (TransformerException)targetException;

              
// in src/org/apache/xalan/extensions/ExtensionsTable.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionsTable.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ite;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ((TransformerException)targetException);

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw e;

              
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
throw ((TransformerException)targetException);

              
// in src/org/apache/xalan/extensions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
throw e;

              
// in src/org/apache/xalan/extensions/ObjectFactory.java
throw e;

              
// in src/org/apache/xalan/extensions/ObjectFactory.java
throw x;

              
// in src/org/apache/xalan/extensions/ObjectFactory.java
throw x;

              
// in src/org/apache/xpath/XPath.java
throw te;

              
// in src/org/apache/xpath/XPath.java
throw te;

              
// in src/org/apache/xpath/XPath.java
throw te;

              
// in src/org/apache/xpath/XPath.java
throw te;

              
// in src/org/apache/xpath/compiler/XPathParser.java
throw e;

              
// in src/org/apache/xpath/compiler/XPathParser.java
throw te;

              
// in src/org/apache/xpath/compiler/XPathParser.java
throw te;

              
// in src/org/apache/xpath/functions/SecuritySupport.java
throw (FileNotFoundException)e.getException();

              
// in src/org/apache/xpath/functions/ObjectFactory.java
throw e;

              
// in src/org/apache/xpath/functions/ObjectFactory.java
throw x;

              
// in src/org/apache/xpath/functions/ObjectFactory.java
throw x;

              
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
// in src/org/apache/xpath/jaxp/XPathImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
// in src/org/apache/xpath/jaxp/XPathImpl.java
throw (javax.xml.xpath.XPathFunctionException)nestedException;

              
// in src/org/apache/xpath/axes/NodeSequence.java
throw rte;

            
- -
(Lib) TransformerException 135
              
// in src/org/apache/xml/utils/DOM2Helper.java
public void parse(InputSource source) throws TransformerException { try { // I guess I should use JAXP factory here... when it's legal. // org.apache.xerces.parsers.DOMParser parser // = new org.apache.xerces.parsers.DOMParser(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); builderFactory.setValidating(true); DocumentBuilder parser = builderFactory.newDocumentBuilder(); /* // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true); if(m_useDOM2getNamespaceURI) { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true); parser.setFeature("http://xml.org/sax/features/namespaces", true); } else { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); } parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true); */ parser.setErrorHandler( new org.apache.xml.utils.DefaultErrorHandler()); // if(null != m_entityResolver) // { // System.out.println("Setting the entity resolver."); // parser.setEntityResolver(m_entityResolver); // } setDocument(parser.parse(source)); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } catch (IOException ioe) { throw new TransformerException(ioe); } // setDocument(((org.apache.xerces.parsers.DOMParser)parser).getDocument()); }
// in src/org/apache/xml/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void transform(Source source, Result result) throws TransformerException { if (!_isIdentity) { if (_translet == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR); throw new TransformerException(err.toString()); } // Pass output properties to the translet transferOutputProperties(_translet); } final SerializationHandler toHandler = getOutputHandler(result); if (toHandler == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR); throw new TransformerException(err.toString()); } if (_uriResolver != null && !_isIdentity) { _translet.setDOMCache(this); } // Pass output properties to handler if identity if (_isIdentity) { transferOutputProperties(toHandler); } transform(source, toHandler, _encoding); if (result instanceof DOMResult) { ((DOMResult)result).setNode(_tohFactory.getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public SerializationHandler getOutputHandler(Result result) throws TransformerException { // Get output method using get() to ignore defaults _method = (String) _properties.get(OutputKeys.METHOD); // Get encoding using getProperty() to use defaults _encoding = (String) _properties.getProperty(OutputKeys.ENCODING); _tohFactory = TransletOutputHandlerFactory.newInstance(); _tohFactory.setEncoding(_encoding); if (_method != null) { _tohFactory.setOutputMethod(_method); } // Set indentation number in the factory if (_indentNumber >= 0) { _tohFactory.setIndentNumber(_indentNumber); } // Return the content handler for this Result object try { // Result object could be SAXResult, DOMResult, or StreamResult if (result instanceof SAXResult) { final SAXResult target = (SAXResult)result; final ContentHandler handler = target.getHandler(); _tohFactory.setHandler(handler); /** * Fix for bug 24414 * If the lexicalHandler is set then we need to get that * for obtaining the lexical information */ LexicalHandler lexicalHandler = target.getLexicalHandler(); if (lexicalHandler != null ) { _tohFactory.setLexicalHandler(lexicalHandler); } _tohFactory.setOutputType(TransletOutputHandlerFactory.SAX); return _tohFactory.getSerializationHandler(); } else if (result instanceof DOMResult) { _tohFactory.setNode(((DOMResult) result).getNode()); _tohFactory.setNextSibling(((DOMResult) result).getNextSibling()); _tohFactory.setOutputType(TransletOutputHandlerFactory.DOM); return _tohFactory.getSerializationHandler(); } else if (result instanceof StreamResult) { // Get StreamResult final StreamResult target = (StreamResult) result; // StreamResult may have been created with a java.io.File, // java.io.Writer, java.io.OutputStream or just a String // systemId. _tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM); // try to get a Writer from Result object final Writer writer = target.getWriter(); if (writer != null) { _tohFactory.setWriter(writer); return _tohFactory.getSerializationHandler(); } // or try to get an OutputStream from Result object final OutputStream ostream = target.getOutputStream(); if (ostream != null) { _tohFactory.setOutputStream(ostream); return _tohFactory.getSerializationHandler(); } // or try to get just a systemId string from Result object String systemId = result.getSystemId(); if (systemId == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR); throw new TransformerException(err.toString()); } // System Id may be in one of several forms, (1) a uri // that starts with 'file:', (2) uri that starts with 'http:' // or (3) just a filename on the local system. URL url = null; if (systemId.startsWith("file:")) { url = new URL(systemId); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } else if (systemId.startsWith("http:")) { url = new URL(systemId); final URLConnection connection = url.openConnection(); _tohFactory.setOutputStream(_ostream = connection.getOutputStream()); return _tohFactory.getSerializationHandler(); } else { // system id is just a filename url = new File(systemId).toURL(); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } } } // If we cannot write to the location specified by the SystemId catch (UnknownServiceException e) { throw new TransformerException(e); } catch (ParserConfigurationException e) { throw new TransformerException(e); } // If we cannot create the file specified by the SystemId catch (IOException e) { throw new TransformerException(e); } return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private DOM getDOM(Source source) throws TransformerException { try { DOM dom = null; if (source != null) { DTMWSFilter wsfilter; if (_translet != null && _translet instanceof StripFilter) { wsfilter = new DOMWSFilter(_translet); } else { wsfilter = null; } boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; if (_dtmManager == null) { _dtmManager = (XSLTCDTMManager)_tfactory.getDTMManagerClass() .newInstance(); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, false, false, 0, hasIdCall); } else if (_dom != null) { dom = _dom; _dom = null; // use only once, so reset to 'null' } else { return null; } if (!_isIdentity) { // Give the translet the opportunity to make a prepass of // the document, in case it can extract useful information early _translet.prepassDocument(dom); } return dom; } catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transformIdentity(Source source, SerializationHandler handler) throws Exception { // Get systemId from source if (source != null) { _sourceSystemId = source.getSystemId(); } if (source instanceof StreamSource) { final StreamSource stream = (StreamSource) source; final InputStream streamInput = stream.getInputStream(); final Reader streamReader = stream.getReader(); final XMLReader reader = _readerManager.getXMLReader(); try { // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Create input source from source InputSource input; if (streamInput != null) { input = new InputSource(streamInput); input.setSystemId(_sourceSystemId); } else if (streamReader != null) { input = new InputSource(streamReader); input.setSystemId(_sourceSystemId); } else if (_sourceSystemId != null) { input = new InputSource(_sourceSystemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } // Start pushing SAX events reader.parse(input); } finally { _readerManager.releaseXMLReader(reader); } } else if (source instanceof SAXSource) { final SAXSource sax = (SAXSource) source; XMLReader reader = sax.getXMLReader(); final InputSource input = sax.getInputSource(); boolean userReader = true; try { // Create a reader if not set by user if (reader == null) { reader = _readerManager.getXMLReader(); userReader = false; } // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Start pushing SAX events reader.parse(input); } finally { if (!userReader) { _readerManager.releaseXMLReader(reader); } } } else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; new DOM2TO(domsrc.getNode(), handler).parse(); } else if (source instanceof XSLTCSource) { final DOM dom = ((XSLTCSource) source).getDOM(null, _translet); ((SAXImpl)dom).copy(handler); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transform(Source source, SerializationHandler handler, String encoding) throws TransformerException { try { /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 * situations, since there is no clear spec. how to create * an empty tree when both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new if (systemID != null) { source.setSystemId(systemID); } } if (_isIdentity) { transformIdentity(source, handler); } else { _translet.transform(getDOM(source), handler); } } catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } finally { _dtmManager = null; } // If we create an output stream for the Result, we need to close it after the transformation. if (_ostream != null) { try { _ostream.close(); } catch (IOException e) {} _ostream = null; } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; // Recreating Scott's kluge: // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced. // String localName = getLocalName(target); // String ns = m_stylesheet.getNamespaceFromStack(target); // // %REVIEW%: We need a better PI architecture String prefix="",ns="", localName=target; int colon=target.indexOf(':'); if(colon>=0) { ns=getNamespaceForPrefix(prefix=target.substring(0,colon)); localName=target.substring(colon+1); } try { // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced... but since the XML Namespaces // spec never defined namespaces as applying to PI's, and since // the testcase we're trying to support is inconsistant in whether // it binds the prefix, I'm going to make this sloppy for // testing purposes. if( "xalan-doc-cache-off".equals(target) || "xalan:doc-cache-off".equals(target) || ("doc-cache-off".equals(localName) && ns.equals("org.apache.xalan.xslt.extensions.Redirect") ) ) { if(!(m_elems.peek() instanceof ElemForEach)) throw new TransformerException ("xalan:doc-cache-off not allowed here!", getLocator()); ElemForEach elem = (ElemForEach)m_elems.peek(); elem.m_doc_cache_off = true; //System.out.println("JJK***** Recognized <? {"+ns+"}"+prefix+":"+localName+" "+data+"?>"); } } catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? } flushCharacters(); getCurrentProcessor().processingInstruction(this, target, data); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/templates/ElemElement.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { boolean shouldAddAttrs; try { SerializationHandler rhandler = transformer.getResultTreeHandler(); if (null == nodeName) { shouldAddAttrs = false; } else { if (null != prefix) { rhandler.startPrefixMapping(prefix, nodeNamespace, true); } rhandler.startElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); super.execute(transformer); shouldAddAttrs = true; } transformer.executeChildTemplates(this, shouldAddAttrs); // Now end the element if name was valid if (null != nodeName) { rhandler.endElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); if (null != prefix) { rhandler.endPrefixMapping(prefix); } } } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getStylesheet().isSecureProcessing()) throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { transformer.getResultTreeHandler().flushPending(); ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(m_extns); if (null == nsh) { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { TransformerException te = new TransformerException(XSLMessages.createMessage( XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); } return; } try { nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this); } catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } } } catch(TransformerException e) { transformer.getErrorListener().fatalError(e); } catch(SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemUse.java
private void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet, QName attributeSetsNames[]) throws TransformerException { if (null != attributeSetsNames) { int nNames = attributeSetsNames.length; for (int i = 0; i < nNames; i++) { QName qname = attributeSetsNames[i]; java.util.List attrSets = stylesheet.getAttributeSetComposed(qname); if (null != attrSets) { int nSets = attrSets.size(); // Highest priority attribute set will be at the top, // so process it last. for (int k = nSets-1; k >= 0 ; k--) { ElemAttributeSet attrSet = (ElemAttributeSet) attrSets.get(k); attrSet.execute(transformer); } } else { throw new TransformerException( XSLMessages.createMessage(XSLTErrorResources.ER_NO_ATTRIB_SET, new Object[] {qname}),this); } } } }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Optimize for "." if (false && m_isDot && !transformer.getDebug()) { int child = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(child); xctxt.pushCurrentNode(child); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { dtm.dispatchCharactersEvents(child, rth, false); } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); } } else { xctxt.pushNamespaceContext(this); int current = xctxt.getCurrentNode(); xctxt.pushCurrentNodeAndExpression(current, current); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { Expression expr = m_selectExpression.getExpression(); if (transformer.getDebug()) { XObject obj = expr.execute(xctxt); transformer.getTraceManager().fireSelectedEvent(current, this, "select", m_selectExpression, obj); obj.dispatchCharactersEvents(rth); } else { expr.executeCharsToContentHandler(xctxt, rth); } } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } } } catch (SAXException se) { throw new TransformerException(se); } catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemNumber.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); String countString = getCountString(transformer, sourceNode); try { transformer.getResultTreeHandler().characters(countString.toCharArray(), 0, countString.length()); } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); String lang = null; String srcURL = null; String scriptSrc = null; if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Register the extension namespace if it has not already been registered. ExtensionNamespaceSupport extNsSpt = null; ExtensionNamespacesManager extNsMgr = sroot.getExtensionNamespacesManager(); if (extNsMgr.namespaceIndex(declNamespace, extNsMgr.getExtensions()) == -1) { if (lang.equals("javaclass")) { if (null == srcURL) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace); } else if (extNsMgr.namespaceIndex(srcURL, extNsMgr.getExtensions()) == -1) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace, srcURL); } } else // not java { String handler = "org.apache.xalan.extensions.ExtensionHandlerGeneral"; Object [] args = {declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()}; extNsSpt = new ExtensionNamespaceSupport(declNamespace, handler, args); } } if (extNsSpt != null) extNsMgr.registerExtension(extNsSpt); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void execute(TransformerImpl transformer) throws TransformerException { SerializationHandler rhandler = transformer.getSerializationHandler(); try { if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. rhandler.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } // JJK Bugzilla 3464, test namespace85 -- make sure LRE's // namespace is asserted even if default, since xsl:element // may have changed the context. rhandler.startPrefixMapping(getPrefix(), getNamespace()); // Add namespace declarations. executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { throw new TransformerException(se); } /* * If we make it to here we have done a successful startElement() * we will do an endElement() call for balance, no matter what happens * in the middle. */ // tException remembers if we had an exception "in the middle" TransformerException tException = null; try { // Process any possible attributes from xsl:use-attribute-sets first super.execute(transformer); //xsl:version, excludeResultPrefixes??? // Process the list of avts next if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String stringedValue = avt.evaluate(xctxt, sourceNode, this); if (null != stringedValue) { // Important Note: I'm not going to check for excluded namespace // prefixes here. It seems like it's too expensive, and I'm not // even sure this is right. But I could be wrong, so this needs // to be tested against other implementations. rhandler.addAttribute( avt.getURI(), avt.getName(), avt.getRawName(), "CDATA", stringedValue, false); } } // end for } // Now process all the elements in this subtree // TODO: Process m_extensionElementPrefixes && m_attributeSetsNames transformer.executeChildTemplates(this, true); } catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; } catch (SAXException se) { tException = new TransformerException(se); } try { /* we need to do this endElement() to balance the * successful startElement() call even if * there was an exception in the middle. * Otherwise an exception in the middle could cause a system to hang. */ if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. //rhandler.flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } rhandler.endElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); } /* If an exception was thrown in the middle but not with startElement() or * or endElement() then its time to let it percolate. */ if (tException != null) throw tException; unexecuteNSDecls(transformer); // JJK Bugzilla 3464, test namespace85 -- balance explicit start. try { rhandler.endPrefixMapping(getPrefix()); } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/ElemPI.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String piName = m_name_atv == null ? null : m_name_atv.evaluate(xctxt, sourceNode, this); // Ignore processing instruction if name is null if (piName == null) return; if (piName.equalsIgnoreCase("xml")) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Only check if an avt was used (ie. this wasn't checked at compose time.) // Ignore processing instruction, if invalid else if ((!m_name_atv.isSimple()) && (!XML11Char.isXML11ValidNCName(piName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); try { transformer.getResultTreeHandler().processingInstruction(piName, data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemAttributeSet.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (transformer.isRecursiveAttrSet(this)) { throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF, new Object[]{ m_qname.getLocalPart() })); //"xsl:attribute-set '"+m_qname.m_localpart+ } transformer.pushElemAttributeSet(this); super.execute(transformer); ElemAttribute attr = (ElemAttribute) getFirstChildElem(); while (null != attr) { attr.execute(transformer); attr = (ElemAttribute) attr.getNextSiblingElem(); } transformer.popElemAttributeSet(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void execute(TransformerImpl transformer, XObject[] args) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); // Increment the frame bottom of the variable stack by the // frame size int thisFrame = vars.getStackFrame(); int nextFrame = vars.link(m_frameSize); if (m_inArgsSize < args.length) { throw new TransformerException ("function called with too many args"); } // Set parameters, // have to clear the section of the stack frame that has params. if (m_inArgsSize > 0) { vars.clearLocalSlots(0, m_inArgsSize); if (args.length > 0) { vars.setStackFrame(thisFrame); NodeList children = this.getChildNodes(); for (int i = 0; i < args.length; i ++) { Node child = children.item(i); if (children.item(i) instanceof ElemParam) { ElemParam param = (ElemParam)children.item(i); vars.setLocalVariable(param.getIndex(), args[i], nextFrame); } } vars.setStackFrame(nextFrame); } } // Removed ElemTemplate 'push' and 'pop' of RTFContext, in order to avoid losing the RTF context // before a value can be returned. ElemExsltFunction operates in the scope of the template that called // the function. // xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); vars.setStackFrame(nextFrame); transformer.executeChildTemplates(this, true); // Reset the stack frame after the function call vars.unlink(thisFrame); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // Following ElemTemplate 'pop' removed -- see above. // xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.endPrefixMapping(decl.getPrefix()); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemCopy.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode); short nodeType = dtm.getNodeType(sourceNode); if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType)) { SerializationHandler rthandler = transformer.getSerializationHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // TODO: Process the use-attribute-sets stuff ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, rthandler, false); if (DTM.ELEMENT_NODE == nodeType) { super.execute(transformer); SerializerUtils.processNSDecls(rthandler, sourceNode, nodeType, dtm); transformer.executeChildTemplates(this, true); String ns = dtm.getNamespaceURI(sourceNode); String localName = dtm.getLocalName(sourceNode); transformer.getResultTreeHandler().endElement(ns, localName, dtm.getNodeName(sourceNode)); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); super.execute(transformer); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { xctxt.popCurrentNode(); } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Call compose on each param no matter if this is apply-templates // or call templates. int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.compose(sroot); } if ((null != m_templateName) && (null == m_template)) { m_template = this.getStylesheetRoot().getTemplateComposed(m_templateName); if (null == m_template) { String themsg = XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[] { m_templateName }); throw new TransformerException(themsg, this); //"Could not find template named: '"+templateName+"'"); } length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.m_index = -1; // Find the position of the param in the template being called, // and set the index of the param slot. int etePos = 0; for (ElemTemplateElement ete = m_template.getFirstChildElem(); null != ete; ete = ete.getNextSiblingElem()) { if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE) { ElemParam ep = (ElemParam)ete; if(ep.getName().equals(ewp.getName())) { ewp.m_index = etePos; } } else break; etePos++; } } } }
// in src/org/apache/xalan/templates/ElemComment.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); transformer.getResultTreeHandler().comment(data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); XObject value = m_selectExpression.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectExpression, value); SerializationHandler handler = transformer.getSerializationHandler(); if (null != value) { int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); // Copy the tree. DTMTreeWalker tw = new TreeWalker2Result(transformer, handler); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = xctxt.getDTMManager().getDTM(pos); short t = dtm.getNodeType(pos); // If we just copy the whole document, a startDoc and endDoc get // generated, so we need to only walk the child nodes. if (t == DTM.DOCUMENT_NODE) { for (int child = dtm.getFirstChild(pos); child != DTM.NULL; child = dtm.getNextSibling(child)) { tw.traverse(child); } } else if (t == DTM.ATTRIBUTE_NODE) { SerializerUtils.addAttribute(handler, pos); } else { tw.traverse(pos); } } // nl.detach(); break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( handler, value, transformer.getXPathContext()); break; default : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; } } // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endSelect", m_selectExpression, value); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExsltFuncResult.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext context = transformer.getXPathContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // Verify that result has not already been set by another result // element. Recursion is allowed: intermediate results are cleared // in the owner ElemExsltFunction execute(). if (transformer.currentFuncResultSeen()) { throw new TransformerException("An EXSLT function cannot set more than one result!"); } int sourceNode = context.getCurrentNode(); // Set the return value; XObject var = getValue(transformer, sourceNode); transformer.popCurrentFuncResult(); transformer.pushCurrentFuncResult(var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
public void execute( TransformerImpl transformer) throws TransformerException { try { SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) { // flush any pending cached processing before the trace event. rth.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } rth.characters(m_ch, 0, m_ch.length); if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } } }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static void switchSerializerIfHTML( TransformerImpl transformer, String ns, String localName) throws TransformerException { if (null == transformer) return; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)) return; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = transformer.getOutputFormat().getProperties(); // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); try { // Serializer oldSerializer = transformer.getSerializer(); Serializer oldSerializer = null; if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = oldSerializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } // transformer.setSerializer(serializer); ContentHandler ch = serializer.asContentHandler(); transformer.setContentHandler(ch); } } catch (java.io.IOException e) { throw new TransformerException(e); } } }
// in src/org/apache/xalan/transformer/StackGuard.java
public void checkForInfinateLoop() throws TransformerException { int nTemplates = m_transformer.getCurrentTemplateElementsCount(); if(nTemplates < m_recursionLimit) return; if(m_recursionLimit <= 0) return; // Safety check. // loop from the top index down to the recursion limit (I don't think // there's any need to go below that). for (int i = (nTemplates - 1); i >= m_recursionLimit; i--) { ElemTemplate template = getNextMatchOrNamedTemplate(i); if(null == template) break; int loopCount = countLikeTemplates(template, i); if (loopCount >= m_recursionLimit) { // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+ // ", template "+((null == template.getName()) ? "name = " : "match = ")+ // ((null != template.getName()) ? template.getName().toString() // : template.getMatch().getPatternString())); String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null); Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs, ((null != template.getName()) ? template.getName().toString() : template.getMatch().getPatternString()) }; String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs); throw new TransformerException(msg); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source, boolean shouldRelease) throws TransformerException { try { // Patch for bugzilla #13863. If we don't reset the namespaceContext // then we will get a NullPointerException if transformer is reused // (for stylesheets that use xsl:key). Not sure if this should go // here or in reset(). -is if(getXPathContext().getNamespaceContext() == null){ getXPathContext().setNamespaceContext(getStylesheet()); } String base = source.getSystemId(); // If no systemID of the source, use the base of the stylesheet. if(null == base) { base = m_stylesheetRoot.getBaseIdentifier(); } // As a last resort, use the current user dir. if(null == base) { String currentDir = ""; try { currentDir = System.getProperty("user.dir"); } catch (SecurityException se) {}// user.dir not accessible from applet if (currentDir.startsWith(java.io.File.separator)) base = "file://" + currentDir; else base = "file:///" + currentDir; base = base + java.io.File.separatorChar + source.getClass().getName(); } setBaseURLOfSource(base); DTMManager mgr = m_xcontext.getDTMManager(); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e) { fatalError(e); } } DTM dtm = mgr.getDTM(source, false, this, true, true); dtm.setDocumentBaseURI(base); boolean hardDelete = true; // %REVIEW% I have to think about this. -sb try { // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, look at dtm.getDocumentRoot(nodeHandle). this.transformNode(dtm.getDocument()); } finally { if (shouldRelease) mgr.release(dtm, hardDelete); } // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). // reader.parse( xmlSource ); // This has to be done to catch exceptions thrown from // the transform thread spawned by the STree handler. Exception e = getExceptionThrown(); if (null != e) { if (e instanceof javax.xml.transform.TransformerException) { throw (javax.xml.transform.TransformerException) e; } else if (e instanceof org.apache.xml.utils.WrappedRuntimeException) { fatalError( ((org.apache.xml.utils.WrappedRuntimeException) e).getException()); } else { throw new javax.xml.transform.TransformerException(e); } } else if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); } // Patch attributed to David Eisenberg <david@catcode.com> catch (org.xml.sax.SAXParseException spe) { fatalError(spe); } catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); } finally { m_hasTransformThreadErrorCatcher = false; // This looks to be redundent to the one done in TransformNode. reset(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
private int transformToRTF(ElemTemplateElement templateParent,DTM dtmFrag) throws TransformerException { XPathContext xctxt = m_xcontext; ContentHandler rtfHandler = dtmFrag.getContentHandler(); // Obtain the ResultTreeFrag's root node. // NOTE: In SAX2RTFDTM, this value isn't available until after // the startDocument has been issued, so assignment has been moved // down a bit in the code. int resultFragment; // not yet reliably = dtmFrag.getDocument(); // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // And make a new handler for the RTF. ToSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(rtfHandler); h.setTransformer(this); // Replace the old handler (which was already saved) m_serializationHandler = h; // use local variable for the current handler SerializationHandler rth = m_serializationHandler; try { rth.startDocument(); // startDocument is "bottlenecked" in RTH. We need it acted upon immediately, // to set the DTM's state as in-progress, so that if the xsl:variable's body causes // further RTF activity we can keep that from bashing this DTM. rth.flushPending(); try { // Do the transformation of the child elements. executeChildTemplates(templateParent, true); // Make sure everything is flushed! rth.flushPending(); // Get the document ID. May not exist until the RTH has not only // received, but flushed, the startDocument, and may be invalid // again after the document has been closed (still debating that) // ... so waiting until just before the end seems simplest/safest. resultFragment = dtmFrag.getDocument(); } finally { rth.endDocument(); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { // Restore the previous result tree handler. this.m_serializationHandler = savedRTreeHandler; } return resultFragment; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean applyTemplateToNode(ElemTemplateElement xslInstruction, // xsl:apply-templates or xsl:for-each ElemTemplate template, int child) throws TransformerException { DTM dtm = m_xcontext.getDTM(child); short nodeType = dtm.getNodeType(child); boolean isDefaultTextRule = false; boolean isApplyImports = false; isApplyImports = ((xslInstruction == null) ? false : xslInstruction.getXSLToken() == Constants.ELEMNAME_APPLY_IMPORTS); if (null == template || isApplyImports) { int maxImportLevel, endImportLevel=0; if (isApplyImports) { maxImportLevel = template.getStylesheetComposed().getImportCountComposed() - 1; endImportLevel = template.getStylesheetComposed().getEndImportCountComposed(); } else { maxImportLevel = -1; } // If we're trying an xsl:apply-imports at the top level (ie there are no // imported stylesheets), we need to indicate that there is no matching template. // The above logic will calculate a maxImportLevel of -1 which indicates // that we should find any template. This is because a value of -1 for // maxImportLevel has a special meaning. But we don't want that. // We want to match -no- templates. See bugzilla bug 1170. if (isApplyImports && (maxImportLevel == -1)) { template = null; } else { // Find the XSL template that is the best match for the // element. XPathContext xctxt = m_xcontext; try { xctxt.pushNamespaceContext(xslInstruction); QName mode = this.getMode(); if (isApplyImports) template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, maxImportLevel, endImportLevel, m_quietConflictWarnings, dtm); else template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, m_quietConflictWarnings, dtm); } finally { xctxt.popNamespaceContext(); } } // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = m_stylesheetRoot.getDefaultRule(); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : case DTM.ATTRIBUTE_NODE : template = m_stylesheetRoot.getDefaultTextRule(); isDefaultTextRule = true; break; case DTM.DOCUMENT_NODE : template = m_stylesheetRoot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. return false; } } } // If we are processing the default text rule, then just clone // the value directly to the result tree. try { pushElemTemplateElement(template); m_xcontext.pushCurrentNode(child); pushPairCurrentMatched(template, child); // Fix copy copy29 test. if (!isApplyImports) { DTMIterator cnl = new org.apache.xpath.NodeSetDTM(child, m_xcontext.getDTMManager()); m_xcontext.pushContextNodeList(cnl); } if (isDefaultTextRule) { switch (nodeType) { case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : ClonerToResultTree.cloneToResultTree(child, nodeType, dtm, getResultTreeHandler(), false); break; case DTM.ATTRIBUTE_NODE : dtm.dispatchCharactersEvents(child, getResultTreeHandler(), false); break; } } else { // Fire a trace event for the template. if (m_debug) getTraceManager().fireTraceEvent(template); // And execute the child templates. // 9/11/00: If template has been compiled, hand off to it // since much (most? all?) of the processing has been inlined. // (It would be nice if there was a single entry point that // worked for both... but the interpretive system works by // having the Tranformer execute the children, while the // compiled obviously has to run its own code. It's // also unclear that "execute" is really the right name for // that entry point.) m_xcontext.setSAXLocator(template); // m_xcontext.getVarStack().link(); m_xcontext.getVarStack().link(template.m_frameSize); executeChildTemplates(template, true); if (m_debug) getTraceManager().fireTraceEndEvent(template); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); } return true; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, boolean shouldAddAttrs) throws TransformerException { // Does this element have any children? ElemTemplateElement t = elem.getFirstChildElem(); if (null == t) return; if(elem.hasTextLitOnly() && m_optimizer) { char[] chars = ((ElemTextLiteral)t).getChars(); try { // Have to push stuff on for tooling... this.pushElemTemplateElement(t); m_serializationHandler.characters(chars, 0, chars.length); } catch(SAXException se) { throw new TransformerException(se); } finally { this.popElemTemplateElement(); } return; } // // Check for infinite loops if we have to. // boolean check = (m_stackGuard.m_recursionLimit > -1); // // if (check) // getStackGuard().push(elem, xctxt.getCurrentNode()); XPathContext xctxt = m_xcontext; xctxt.pushSAXLocatorNull(); int currentTemplateElementsTop = m_currentTemplateElements.size(); m_currentTemplateElements.push(null); try { // Loop through the children of the template, calling execute on // each of them. for (; t != null; t = t.getNextSiblingElem()) { if (!shouldAddAttrs && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE) continue; xctxt.setSAXLocator(t); m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop); t.execute(this); } } catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; } finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); } // Check for infinite loops if we have to // if (check) // getStackGuard().pop(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, ContentHandler handler) throws TransformerException { SerializationHandler xoh = this.getSerializationHandler(); // These may well not be the same! In this case when calling // the Redirect extension, it has already set the ContentHandler // in the Transformer. SerializationHandler savedHandler = xoh; try { xoh.flushPending(); // %REVIEW% Make sure current node is being pushed. LexicalHandler lex = null; if (handler instanceof LexicalHandler) { lex = (LexicalHandler) handler; } m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding()); m_serializationHandler.setTransformer(this); executeChildTemplates(elem, true); } catch (TransformerException e) { throw e; } catch (SAXException se) { throw new TransformerException(se); } finally { m_serializationHandler = savedHandler; } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException { ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) { errHandler.warning(new TransformerException(msg, srcLctr)); } else { if (terminate) throw new TransformerException(msg, srcLctr); else System.out.println(msg); } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object args[], Exception e) throws TransformerException { //msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg; String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
public static void cloneToResultTree(int node, int nodeType, DTM dtm, SerializationHandler rth, boolean shouldCloneAttributes) throws TransformerException { try { switch (nodeType) { case DTM.TEXT_NODE : dtm.dispatchCharactersEvents(node, rth, false); break; case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.DOCUMENT_NODE : // Can't clone a document, but refrain from throwing an error // so that copy-of will work break; case DTM.ELEMENT_NODE : { // Note: SAX apparently expects "no namespace" to be // represented as "" rather than null. String ns = dtm.getNamespaceURI(node); if (ns==null) ns=""; String localName = dtm.getLocalName(node); // rth.startElement(ns, localName, dtm.getNodeNameX(node), null); // don't call a real SAX startElement (as commented out above), // call a SAX-like startElement, to be able to add attributes after this call rth.startElement(ns, localName, dtm.getNodeNameX(node)); // If outputting attrs as separate events, they must // _follow_ the startElement event. (Think of the // xsl:attribute directive.) if (shouldCloneAttributes) { SerializerUtils.addAttributes(rth, node); SerializerUtils.processNSDecls(rth, node, nodeType, dtm); } } break; case DTM.CDATA_SECTION_NODE : rth.startCDATA(); dtm.dispatchCharactersEvents(node, rth, false); rth.endCDATA(); break; case DTM.ATTRIBUTE_NODE : SerializerUtils.addAttribute(rth, node); break; case DTM.NAMESPACE_NODE: // %REVIEW% Normally, these should have been handled with element. // It's possible that someone may write a stylesheet that tries to // clone them explicitly. If so, we need the equivalent of // rth.addAttribute(). SerializerUtils.processNSDecls(rth,node,DTM.NAMESPACE_NODE,dtm); break; case DTM.COMMENT_NODE : XMLString xstr = dtm.getStringValue (node); xstr.dispatchAsComment(rth); break; case DTM.ENTITY_REFERENCE_NODE : rth.entityReference(dtm.getNodeNameX(node)); break; case DTM.PROCESSING_INSTRUCTION_NODE : { // %REVIEW% Is the node name the same as the "target"? rth.processingInstruction(dtm.getNodeNameX(node), dtm.getNodeValue(node)); } break; default : //"Can not create item in result tree: "+node.getNodeName()); throw new TransformerException( "Can't clone node: "+dtm.getNodeName(node)); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
private void createResultContentHandler(Result outputTarget) throws TransformerException { if (outputTarget instanceof SAXResult) { SAXResult saxResult = (SAXResult) outputTarget; m_resultContentHandler = saxResult.getHandler(); m_resultLexicalHandler = saxResult.getLexicalHandler(); if (m_resultContentHandler instanceof Serializer) { // Dubious but needed, I think. m_serializer = (Serializer) m_resultContentHandler; } } else if (outputTarget instanceof DOMResult) { DOMResult domResult = (DOMResult) outputTarget; Node outputNode = domResult.getNode(); Node nextSibling = domResult.getNextSibling(); Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (Node.DOCUMENT_NODE == type) ? (Document) outputNode : outputNode.getOwnerDocument(); } else { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); if (m_isSecureProcessing) { try { dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.newDocument(); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder domBuilder = (Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) domBuilder.setNextSibling(nextSibling); m_resultContentHandler = domBuilder; m_resultLexicalHandler = domBuilder; } else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { Serializer serializer = SerializerFactory.getSerializer(m_outputFormat.getProperties()); m_serializer = serializer; if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) { fileURL = fileURL.substring(8); } else { fileURL = fileURL.substring(7); } } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) { fileURL = fileURL.substring(6); } else { fileURL = fileURL.substring(5); } } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); m_resultContentHandler = serializer.asContentHandler(); } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " // + outputTarget.getClass().getName() // + "!"); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof DeclHandler) m_resultDeclHandler = (DeclHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void processNSDecls( SerializationHandler handler, int src, int type, DTM dtm) throws TransformerException { try { if (type == DTM.ELEMENT_NODE) { for (int namespace = dtm.getFirstNamespaceNode(src, true); DTM.NULL != namespace; namespace = dtm.getNextNamespaceNode(src, namespace, true)) { // String prefix = dtm.getPrefix(namespace); String prefix = dtm.getNodeNameX(namespace); String desturi = handler.getNamespaceURIFromPrefix(prefix); // String desturi = getURI(prefix); String srcURI = dtm.getNodeValue(namespace); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } else if (type == DTM.NAMESPACE_NODE) { String prefix = dtm.getNodeNameX(src); // Brian M. - some changes here to get desturi String desturi = handler.getNamespaceURIFromPrefix(prefix); String srcURI = dtm.getNodeValue(src); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/xslt/Process.java
public static void main(String argv[]) { // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off boolean doStackDumpOnError = false; boolean setQuietMode = false; boolean doDiag = false; String msg = null; boolean isSecureProcessing = false; // Runtime.getRuntime().traceMethodCalls(false); // Runtime.getRuntime().traceInstructions(false); /** * The default diagnostic writer... */ java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true); java.io.PrintWriter dumpWriter = diagnosticsWriter; ResourceBundle resbundle = (XSLMessages.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES)); String flavor = "s2s"; if (argv.length < 1) { printArgOptions(resbundle); } else { boolean useXSLTC = false; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { useXSLTC = true; } } TransformerFactory tfactory; if (useXSLTC) { String key = "javax.xml.transform.TransformerFactory"; String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"; Properties props = System.getProperties(); props.put(key, value); System.setProperties(props); } try { tfactory = TransformerFactory.newInstance(); tfactory.setErrorListener(new DefaultErrorHandler(false)); } catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); } boolean formatOutput = false; boolean useSourceLocation = false; String inFileName = null; String outFileName = null; String dumpFileName = null; String xslFileName = null; String treedumpFileName = null; PrintTraceListener tracer = null; String outputType = null; String media = null; Vector params = new Vector(); boolean quietConflictWarnings = false; URIResolver uriResolver = null; EntityResolver entityResolver = null; ContentHandler contentHandler = null; int recursionLimit=-1; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { // The -XSLTC option has been processed. } else if ("-TT".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceTemplates = true; } else printInvalidXSLTCOption("-TT"); // tfactory.setTraceTemplates(true); } else if ("-TG".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceGeneration = true; } else printInvalidXSLTCOption("-TG"); // tfactory.setTraceSelect(true); } else if ("-TS".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceSelection = true; } else printInvalidXSLTCOption("-TS"); // tfactory.setTraceTemplates(true); } else if ("-TTC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceElements = true; } else printInvalidXSLTCOption("-TTC"); // tfactory.setTraceTemplateChildren(true); } else if ("-INDENT".equalsIgnoreCase(argv[i])) { int indentAmount; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { indentAmount = Integer.parseInt(argv[++i]); } else { indentAmount = 0; } // TBD: // xmlProcessorLiaison.setIndent(indentAmount); } else if ("-IN".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') inFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-IN" })); //"Missing argument for); } else if ("-MEDIA".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) media = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-MEDIA" })); //"Missing argument for); } else if ("-OUT".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') outFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-OUT" })); //"Missing argument for); } else if ("-XSL".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') xslFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XSL" })); //"Missing argument for); } else if ("-FLAVOR".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { flavor = argv[++i]; } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-FLAVOR" })); //"Missing argument for); } else if ("-PARAM".equalsIgnoreCase(argv[i])) { if (i + 2 < argv.length) { String name = argv[++i]; params.addElement(name); String expression = argv[++i]; params.addElement(expression); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-PARAM" })); //"Missing argument for); } else if ("-E".equalsIgnoreCase(argv[i])) { // TBD: // xmlProcessorLiaison.setShouldExpandEntityRefs(false); } else if ("-V".equalsIgnoreCase(argv[i])) { diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version " + Version.getVersion() + ", " + /* xmlProcessorLiaison.getParserDescription()+ */ resbundle.getString("version2")); // "<<<<<<<"); } else if ("-QC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) quietConflictWarnings = true; else printInvalidXSLTCOption("-QC"); } else if ("-Q".equalsIgnoreCase(argv[i])) { setQuietMode = true; } else if ("-DIAG".equalsIgnoreCase(argv[i])) { doDiag = true; } else if ("-XML".equalsIgnoreCase(argv[i])) { outputType = "xml"; } else if ("-TEXT".equalsIgnoreCase(argv[i])) { outputType = "text"; } else if ("-HTML".equalsIgnoreCase(argv[i])) { outputType = "html"; } else if ("-EDUMP".equalsIgnoreCase(argv[i])) { doStackDumpOnError = true; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { dumpFileName = argv[++i]; } } else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { uriResolver = (URIResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); tfactory.setURIResolver(uriResolver); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); } } else { msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-URIResolver" }); //"Missing argument for); System.err.println(msg); doExit(msg); } } else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { entityResolver = (EntityResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { contentHandler = (ContentHandler) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else if ("-L".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); else printInvalidXSLTCOption("-L"); } else if ("-INCREMENTAL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/incremental", java.lang.Boolean.TRUE); else printInvalidXSLTCOption("-INCREMENTAL"); } else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i])) { // Default is true. // // %REVIEW% We should have a generalized syntax for negative // switches... and probably should accept the inverse even // if it is the default. if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/optimize", java.lang.Boolean.FALSE); else printInvalidXSLTCOption("-NOOPTIMIZE"); } else if ("-RL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (i + 1 < argv.length) recursionLimit = Integer.parseInt(argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-rl" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXSLTCOption("-RL"); } } // Generate the translet class and optionally specify the name // of the translet class. else if ("-XO".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("translet-name", argv[++i]); } else tfactory.setAttribute("generate-translet", "true"); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XO"); } } // Specify the destination directory for the translet classes. else if ("-XD".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("destination-directory", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XD" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XD"); } } // Specify the jar file name which the translet classes are packaged into. else if ("-XJ".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("jar-name", argv[++i]); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XJ" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XJ"); } } // Specify the package name prefix for the generated translet classes. else if ("-XP".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("package-name", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XP" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XP"); } } // Enable template inlining. else if ("-XN".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("enable-inlining", "true"); } else printInvalidXalanOption("-XN"); } // Turns on additional debugging message output else if ("-XX".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("debug", "true"); } else printInvalidXalanOption("-XX"); } // Create the Transformer from the translet if the translet class is newer // than the stylesheet. else if ("-XT".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("auto-translet", "true"); } else printInvalidXalanOption("-XT"); } else if ("-SECURE".equalsIgnoreCase(argv[i])) { isSecureProcessing = true; try { tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (TransformerConfigurationException e) {} } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] })); //"Invalid argument:); } // Print usage instructions if no xml and xsl file is specified in the command line if (inFileName == null && xslFileName == null) { msg = resbundle.getString("xslProc_no_input"); System.err.println(msg); doExit(msg); } // Note that there are usage cases for calling us without a -IN arg // The main XSL transformation occurs here! try { long start = System.currentTimeMillis(); if (null != dumpFileName) { dumpWriter = new PrintWriter(new FileWriter(dumpFileName)); } Templates stylesheet = null; if (null != xslFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Node xslDOM = docBuilder.parse(new InputSource(xslFileName)); stylesheet = tfactory.newTemplates(new DOMSource(xslDOM, xslFileName)); } else { // System.out.println("Calling newTemplates: "+xslFileName); stylesheet = tfactory.newTemplates(new StreamSource(xslFileName)); // System.out.println("Done calling newTemplates: "+xslFileName); } } PrintWriter resultWriter; StreamResult strResult; if (null != outFileName) { strResult = new StreamResult(new FileOutputStream(outFileName)); // One possible improvement might be to ensure this is // a valid URI before setting the systemId, but that // might have subtle changes that pre-existing users // might notice; we can think about that later -sc r1.46 strResult.setSystemId(outFileName); } else { strResult = new StreamResult(System.out); // We used to default to incremental mode in this case. // We've since decided that since the -INCREMENTAL switch is // available, that default is probably not necessary nor // necessarily a good idea. } SAXTransformerFactory stf = (SAXTransformerFactory) tfactory; // This is currently controlled via TransformerFactoryImpl. if (!useXSLTC && useSourceLocation) stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); // Did they pass in a stylesheet, or should we get it from the // document? if (null == stylesheet) { Source source = stf.getAssociatedStylesheet(new StreamSource(inFileName), media, null, null); if (null != source) stylesheet = tfactory.newTemplates(source); else { if (null != media) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: " // + inFileName + ", media=" // + media); else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: " //+ inFileName); } } if (null != stylesheet) { Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer(); transformer.setErrorListener(new DefaultErrorHandler(false)); // Override the output format? if (null != outputType) { transformer.setOutputProperty(OutputKeys.METHOD, outputType); } if (transformer instanceof org.apache.xalan.transformer.TransformerImpl) { org.apache.xalan.transformer.TransformerImpl impl = (org.apache.xalan.transformer.TransformerImpl)transformer; TraceManager tm = impl.getTraceManager(); if (null != tracer) tm.addTraceListener(tracer); impl.setQuietConflictWarnings(quietConflictWarnings); // This is currently controlled via TransformerFactoryImpl. if (useSourceLocation) impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); if(recursionLimit>0) impl.setRecursionLimit(recursionLimit); // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter ); } int nParams = params.size(); for (int i = 0; i < nParams; i += 2) { transformer.setParameter((String) params.elementAt(i), (String) params.elementAt(i + 1)); } if (uriResolver != null) transformer.setURIResolver(uriResolver); if (null != inFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setCoalescing(true); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); if (entityResolver != null) docBuilder.setEntityResolver(entityResolver); Node xmlDoc = docBuilder.parse(new InputSource(inFileName)); Document doc = docBuilder.newDocument(); org.w3c.dom.DocumentFragment outNode = doc.createDocumentFragment(); transformer.transform(new DOMSource(xmlDoc, inFileName), new DOMResult(outNode)); // Now serialize output to disk with identity transformer Transformer serializer = stf.newTransformer(); serializer.setErrorListener(new DefaultErrorHandler(false)); Properties serializationProps = stylesheet.getOutputProperties(); serializer.setOutputProperties(serializationProps); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); serializer.transform(new DOMSource(outNode), result); } else serializer.transform(new DOMSource(outNode), strResult); } else if (flavor.equals("th")) { for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior { // System.out.println("Testing the TransformerHandler..."); // =============== XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } if (!useXSLTC) stf.setAttribute(org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL, Boolean.TRUE); TransformerHandler th = stf.newTransformerHandler(stylesheet); reader.setContentHandler(th); reader.setDTDHandler(th); if(th instanceof org.xml.sax.ErrorHandler) reader.setErrorHandler((org.xml.sax.ErrorHandler)th); try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", th); } catch (org.xml.sax.SAXNotRecognizedException e){} catch (org.xml.sax.SAXNotSupportedException e){} try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) {} th.setResult(strResult); reader.parse(new InputSource(inFileName)); } } else { if (entityResolver != null) { XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } reader.setEntityResolver(entityResolver); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform( new SAXSource(reader, new InputSource(inFileName)), result); } else { transformer.transform( new SAXSource(reader, new InputSource(inFileName)), strResult); } } else if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform(new StreamSource(inFileName), result); } else { // System.out.println("Starting transform"); transformer.transform(new StreamSource(inFileName), strResult); // System.out.println("Done with transform"); } } } else { StringReader reader = new StringReader("<?xml version=\"1.0\"?> <doc/>"); transformer.transform(new StreamSource(reader), strResult); } } else { // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); doExit(msg); } // close output streams if (null != outFileName && strResult!=null) { java.io.OutputStream out = strResult.getOutputStream(); java.io.Writer writer = strResult.getWriter(); try { if (out != null) out.close(); if (writer != null) writer.close(); } catch(java.io.IOException ie) {} } long stop = System.currentTimeMillis(); long millisecondsDuration = stop - start; if (doDiag) { Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) }; msg = XSLMessages.createMessage("diagTiming", msgArgs); diagnosticsWriter.println('\n'); diagnosticsWriter.println(msg); } } catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); } if (null != dumpFileName) { dumpWriter.close(); } if (null != diagnosticsWriter) { // diagnosticsWriter.close(); } // if(!setQuietMode) // diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done"); // else // diagnosticsWriter.println(""); //"Xalan: done"); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.equals("new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = null; if (methodKey != null) c = (Constructor) getFromCache(methodKey, null, methodArgs); if (c != null && !trans.getDebug()) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } c = MethodResolver.getConstructor(m_classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else { int resolveType; Object targetObject = null; methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = null; if (methodKey != null) m = (Method) getFromCache(methodKey, null, methodArgs); if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); if (Modifier.isStatic(m.getModifiers())) return m.invoke(null, convertedArgs[0]); else { // This is tricky. We get the actual number of target arguments (excluding any // ExpressionContext). If we passed in the same number, we need the implied object. int nTargetArgs = convertedArgs[0].length; if (ExpressionContext.class.isAssignableFrom(paramTypes[0])) nTargetArgs--; if (methodArgs.length <= nTargetArgs) return m.invoke(m_defaultInstance, convertedArgs[0]); else { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); return m.invoke(targetObject, convertedArgs[0]); } } } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } if (args.size() > 0) { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); if (m_classObj.isAssignableFrom(targetObject.getClass())) resolveType = MethodResolver.DYNAMIC; else resolveType = MethodResolver.STATIC_AND_INSTANCE; } else { targetObject = null; resolveType = MethodResolver.STATIC_AND_INSTANCE; } m = MethodResolver.getMethod(m_classObj, funcName, methodArgs, convertedArgs, exprContext, resolveType); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (MethodResolver.DYNAMIC == resolveType) { // First argument was object type if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } else // First arg was not object. See if we need the implied object. { if (Modifier.isStatic(m.getModifiers())) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { if (null == m_defaultInstance) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, m_defaultInstance, convertedArgs[0]); Object result; try { result = m.invoke(m_defaultInstance, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); } return result; } else return m.invoke(m_defaultInstance, convertedArgs[0]); } } } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
public ExtensionHandler launch() throws TransformerException { ExtensionHandler handler = null; try { Class cl = ExtensionHandler.getClassForName(m_handlerClass); Constructor con = null; //System.out.println("class " + cl + " " + m_args + " " + m_args.length + " " + m_sig); if (m_sig != null) con = cl.getConstructor(m_sig); else // Pick the constructor based on number of args. { Constructor[] cons = cl.getConstructors(); for (int i = 0; i < cons.length; i ++) { if (cons[i].getParameterTypes().length == m_args.length) { con = cons[i]; break; } } } // System.out.println("constructor " + con); if (con != null) handler = (ExtensionHandler)con.newInstance(m_args); else throw new TransformerException("ExtensionHandler constructor not found"); } catch (Exception e) { throw new TransformerException(e); } return handler; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { String className; String methodName; Class classObj; Object targetObject; int lastDot = funcName.lastIndexOf('.'); Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.endsWith(".new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = (methodKey != null) ? (Constructor) getFromCache(methodKey, null, methodArgs) : null; if (c != null) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } c = MethodResolver.getConstructor(classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else if (-1 != lastDot) { // Handle static method call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, null, methodArgs) : null; if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(null, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); methodName = funcName.substring(lastDot + 1); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } m = MethodResolver.getMethod(classObj, methodName, methodArgs, convertedArgs, exprContext, MethodResolver.STATIC_ONLY); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { // Handle instance method call if (args.size() < 1) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INSTANCE_MTHD_CALL_REQUIRES, new Object[]{funcName })); //"Instance method call to method " + funcName //+ " requires an Object instance as first argument"); } targetObject = args.get(0); if (targetObject instanceof XObject) // Next level down for XObjects targetObject = ((XObject) targetObject).object(); methodArgs = new Object[args.size() - 1]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i+1); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, targetObject, methodArgs) : null; if (m != null) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(targetObject, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } classObj = targetObject.getClass(); m = MethodResolver.getMethod(classObj, funcName, methodArgs, convertedArgs, exprContext, MethodResolver.INSTANCE_ONLY); if (methodKey != null) putToCache(methodKey, targetObject, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] argArray; try { argArray = new Object[args.size()]; for (int i = 0; i < argArray.length; i++) { Object o = args.get(i); argArray[i] = (o instanceof XObject) ? ((XObject) o).object() : o; o = argArray[i]; if(null != o && o instanceof DTMIterator) { argArray[i] = new DTMNodeList((DTMIterator)o); } } if (m_engineCall == null) { m_engineCall = m_engine.getClass().getMethod("call", new Class[]{ Object.class, String.class, Object[].class }); } return m_engineCall.invoke(m_engine, new Object[]{ null, funcName, argArray }); } catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { throw new TransformerException("This method should not be called."); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { // Find the template which invokes this EXSLT function. ExpressionNode parent = extFunction.exprGetParent(); while (parent != null && !(parent instanceof ElemTemplate)) { parent = parent.exprGetParent(); } ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null; XObject[] methodArgs; methodArgs = new XObject[args.size()]; try { for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = XObject.create(args.get(i)); } ElemExsltFunction elemFunc = getFunction(extFunction.getFunctionName()); if (null != elemFunc) { XPathContext context = exprContext.getXPathContext(); TransformerImpl transformer = (TransformerImpl)context.getOwnerObject(); transformer.pushCurrentFuncResult(null); elemFunc.execute(transformer, methodArgs); XObject val = (XObject)transformer.popCurrentFuncResult(); return (val == null) ? new XString("") // value if no result element. : val; } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_FUNCTION_NOT_FOUND, new Object[] {extFunction.getFunctionName()})); } } catch (TransformerException e) { throw e; } catch (Exception e) { throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public XObject getVariableOrParam( XPathContext xctxt, org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver prefixResolver = xctxt.getNamespaceContext(); // Get the current ElemTemplateElement, which must be pushed in as the // prefix resolver, and then walk backwards in document order, searching // for an xsl:param element or xsl:variable element that matches our // qname. If we reach the top level, use the StylesheetRoot's composed // list of top level variables and parameters. if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement) { org.apache.xalan.templates.ElemVariable vvar; org.apache.xalan.templates.ElemTemplateElement prev = (org.apache.xalan.templates.ElemTemplateElement) prefixResolver; if (!(prev instanceof org.apache.xalan.templates.Stylesheet)) { while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) ) { org.apache.xalan.templates.ElemTemplateElement savedprev = prev; while (null != (prev = prev.getPreviousSiblingElem())) { if (prev instanceof org.apache.xalan.templates.ElemVariable) { vvar = (org.apache.xalan.templates.ElemVariable) prev; if (vvar.getName().equals(qname)) return getLocalVariable(xctxt, vvar.getIndex()); } } prev = savedprev.getParentElem(); } } vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname); if (null != vvar) return getGlobalVariable(xctxt, vvar.getIndex()); } throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname); }
// in src/org/apache/xpath/compiler/Compiler.java
public void error(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != m_errorHandler) { m_errorHandler.fatalError(new TransformerException(fmsg, m_locator)); } else { // System.out.println(te.getMessage() // +"; file "+te.getSystemId() // +"; line "+te.getLineNumber() // +"; column "+te.getColumnNumber()); throw new TransformerException(fmsg, (SAXSourceLocator)m_locator); } }
// in src/org/apache/xpath/compiler/FunctionTable.java
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
// in src/org/apache/xpath/compiler/OpMap.java
public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = org.apache.xalan.res.XSLMessages.createXPATHMessage(msg, args); throw new javax.xml.transform.TransformerException(fmsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.isSecureProcessing()) throw new javax.xml.transform.TransformerException( XPATHMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] {toString()})); XObject result; Vector argVec = new Vector(); int nArgs = m_argVec.size(); for (int i = 0; i < nArgs; i++) { Expression arg = (Expression) m_argVec.elementAt(i); XObject xobj = arg.execute(xctxt); /* * Should cache the arguments for func:function */ xobj.allowDetachToRelease(false); argVec.addElement(xobj); } //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); Object val = extProvider.extFunction(this, argVec); if (null != val) { result = XObject.create(val, xctxt); } else { result = new XNull(); } return result; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree( String base, String urlString, SourceLocator locator, XPathContext xctxt) throws TransformerException { // System.out.println("getSourceTree"); try { Source source = this.resolveURI(base, urlString, locator); // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId()); return getSourceTree(source, locator, xctxt); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); } /* catch (TransformerException te) { throw new TransformerException(te.getMessage(), locator, te); }*/ }
// in src/org/apache/xpath/SourceTreeManager.java
public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { try { Object xowner = xctxt.getOwnerObject(); DTM dtm; if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter) { dtm = xctxt.getDTM(source, false, (org.apache.xml.dtm.DTMWSFilter)xowner, false, true); } else { dtm = xctxt.getDTM(source, false, null, false, true); } return dtm.getDocument(); } catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
93
              
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
566
              
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void warning(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("warning: " + exception.getMessage()); m_pw.flush(); if (getThrowOnWarning()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void error(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void fatalError(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void warning(TransformerException exception) throws TransformerException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void error(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void fatalError(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
// in src/org/apache/xml/utils/DOMHelper.java
public boolean shouldStripSourceNode(Node textNode) throws javax.xml.transform.TransformerException { // return (null == m_envSupport) ? false : m_envSupport.shouldStripSourceNode(textNode); return false; }
// in src/org/apache/xml/utils/DOM2Helper.java
public void checkNode(Node node) throws TransformerException { // if(!(node instanceof org.apache.xerces.dom.NodeImpl)) // throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type" //+((Object)node).getClass()); }
// in src/org/apache/xml/utils/DOM2Helper.java
public void parse(InputSource source) throws TransformerException { try { // I guess I should use JAXP factory here... when it's legal. // org.apache.xerces.parsers.DOMParser parser // = new org.apache.xerces.parsers.DOMParser(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); builderFactory.setValidating(true); DocumentBuilder parser = builderFactory.newDocumentBuilder(); /* // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true); if(m_useDOM2getNamespaceURI) { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true); parser.setFeature("http://xml.org/sax/features/namespaces", true); } else { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); } parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true); */ parser.setErrorHandler( new org.apache.xml.utils.DefaultErrorHandler()); // if(null != m_entityResolver) // { // System.out.println("Setting the entity resolver."); // parser.setEntityResolver(m_entityResolver); // } setDocument(parser.parse(source)); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } catch (IOException ioe) { throw new TransformerException(ioe); } // setDocument(((org.apache.xerces.parsers.DOMParser)parser).getDocument()); }
// in src/org/apache/xml/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String getSource() throws TransformerException { StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); String text = ""; try { URL docURL = new URL(m_documentBase, m_treeURL); synchronized (m_tfactory) { Transformer transformer = m_tfactory.newTransformer(); StreamSource source = new StreamSource(docURL.toString()); StreamResult result = new StreamResult(pw); transformer.transform(source, result); text = osw.toString(); } } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } catch (Exception any_error) { any_error.printStackTrace(); } return text; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String processTransformation() throws TransformerException { String htmlData = null; this.showStatus("Waiting for Transformer and Parser to finish loading and JITing..."); synchronized (m_tfactory) { URL documentURL = null; URL styleURL = null; StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); StreamResult result = new StreamResult(pw); this.showStatus("Begin Transformation..."); try { documentURL = new URL(m_codeBase, m_documentURL); StreamSource xmlSource = new StreamSource(documentURL.toString()); styleURL = new URL(m_codeBase, m_styleURL); StreamSource xslSource = new StreamSource(styleURL.toString()); Transformer transformer = m_tfactory.newTransformer(xslSource); Iterator m_entries = m_parameters.entrySet().iterator(); while (m_entries.hasNext()) { Map.Entry entry = (Map.Entry) m_entries.next(); Object key = entry.getKey(); Object expression = entry.getValue(); transformer.setParameter((String) key, expression); } transformer.transform(xmlSource, result); } catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } this.showStatus("Transformation Done!"); htmlData = osw.toString(); } return htmlData; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
private void passWarningsToListener(Vector messages) throws TransformerException { if (_errorListener == null || messages == null) { return; } // Pass messages to listener, one by one final int count = messages.size(); for (int pos = 0; pos < count; pos++) { ErrorMsg msg = (ErrorMsg)messages.elementAt(pos); // Workaround for the TCK failure ErrorListener.errorTests.error001. if (msg.isWarningError()) _errorListener.error( new TransformerConfigurationException(msg.toString())); else _errorListener.warning( new TransformerConfigurationException(msg.toString())); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void transform(Source source, Result result) throws TransformerException { if (!_isIdentity) { if (_translet == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR); throw new TransformerException(err.toString()); } // Pass output properties to the translet transferOutputProperties(_translet); } final SerializationHandler toHandler = getOutputHandler(result); if (toHandler == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR); throw new TransformerException(err.toString()); } if (_uriResolver != null && !_isIdentity) { _translet.setDOMCache(this); } // Pass output properties to handler if identity if (_isIdentity) { transferOutputProperties(toHandler); } transform(source, toHandler, _encoding); if (result instanceof DOMResult) { ((DOMResult)result).setNode(_tohFactory.getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public SerializationHandler getOutputHandler(Result result) throws TransformerException { // Get output method using get() to ignore defaults _method = (String) _properties.get(OutputKeys.METHOD); // Get encoding using getProperty() to use defaults _encoding = (String) _properties.getProperty(OutputKeys.ENCODING); _tohFactory = TransletOutputHandlerFactory.newInstance(); _tohFactory.setEncoding(_encoding); if (_method != null) { _tohFactory.setOutputMethod(_method); } // Set indentation number in the factory if (_indentNumber >= 0) { _tohFactory.setIndentNumber(_indentNumber); } // Return the content handler for this Result object try { // Result object could be SAXResult, DOMResult, or StreamResult if (result instanceof SAXResult) { final SAXResult target = (SAXResult)result; final ContentHandler handler = target.getHandler(); _tohFactory.setHandler(handler); /** * Fix for bug 24414 * If the lexicalHandler is set then we need to get that * for obtaining the lexical information */ LexicalHandler lexicalHandler = target.getLexicalHandler(); if (lexicalHandler != null ) { _tohFactory.setLexicalHandler(lexicalHandler); } _tohFactory.setOutputType(TransletOutputHandlerFactory.SAX); return _tohFactory.getSerializationHandler(); } else if (result instanceof DOMResult) { _tohFactory.setNode(((DOMResult) result).getNode()); _tohFactory.setNextSibling(((DOMResult) result).getNextSibling()); _tohFactory.setOutputType(TransletOutputHandlerFactory.DOM); return _tohFactory.getSerializationHandler(); } else if (result instanceof StreamResult) { // Get StreamResult final StreamResult target = (StreamResult) result; // StreamResult may have been created with a java.io.File, // java.io.Writer, java.io.OutputStream or just a String // systemId. _tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM); // try to get a Writer from Result object final Writer writer = target.getWriter(); if (writer != null) { _tohFactory.setWriter(writer); return _tohFactory.getSerializationHandler(); } // or try to get an OutputStream from Result object final OutputStream ostream = target.getOutputStream(); if (ostream != null) { _tohFactory.setOutputStream(ostream); return _tohFactory.getSerializationHandler(); } // or try to get just a systemId string from Result object String systemId = result.getSystemId(); if (systemId == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR); throw new TransformerException(err.toString()); } // System Id may be in one of several forms, (1) a uri // that starts with 'file:', (2) uri that starts with 'http:' // or (3) just a filename on the local system. URL url = null; if (systemId.startsWith("file:")) { url = new URL(systemId); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } else if (systemId.startsWith("http:")) { url = new URL(systemId); final URLConnection connection = url.openConnection(); _tohFactory.setOutputStream(_ostream = connection.getOutputStream()); return _tohFactory.getSerializationHandler(); } else { // system id is just a filename url = new File(systemId).toURL(); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } } } // If we cannot write to the location specified by the SystemId catch (UnknownServiceException e) { throw new TransformerException(e); } catch (ParserConfigurationException e) { throw new TransformerException(e); } // If we cannot create the file specified by the SystemId catch (IOException e) { throw new TransformerException(e); } return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private DOM getDOM(Source source) throws TransformerException { try { DOM dom = null; if (source != null) { DTMWSFilter wsfilter; if (_translet != null && _translet instanceof StripFilter) { wsfilter = new DOMWSFilter(_translet); } else { wsfilter = null; } boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; if (_dtmManager == null) { _dtmManager = (XSLTCDTMManager)_tfactory.getDTMManagerClass() .newInstance(); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, false, false, 0, hasIdCall); } else if (_dom != null) { dom = _dom; _dom = null; // use only once, so reset to 'null' } else { return null; } if (!_isIdentity) { // Give the translet the opportunity to make a prepass of // the document, in case it can extract useful information early _translet.prepassDocument(dom); } return dom; } catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transform(Source source, SerializationHandler handler, String encoding) throws TransformerException { try { /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 * situations, since there is no clear spec. how to create * an empty tree when both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new if (systemID != null) { source.setSystemId(systemID); } } if (_isIdentity) { transformIdentity(source, handler); } else { _translet.transform(getDOM(source), handler); } } catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } finally { _dtmManager = null; } // If we create an output stream for the Result, we need to close it after the transformation. if (_ostream != null) { try { _ostream.close(); } catch (IOException e) {} _ostream = null; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
private Source getSourceFromUriResolver(StylesheetHandler handler) throws TransformerException { Source s = null; TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); if (uriresolver != null) { String href = getHref(); String base = handler.getBaseIdentifier(); s = uriresolver.resolve(href,base); } return s; }
// in src/org/apache/xalan/processor/ProcessorInclude.java
private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s) throws TransformerException { String baseURI; String idFromUriResolverSource; if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) { // We have a Source obtained from a users's URIResolver, // and the system ID is set on it, so return that as the base URI baseURI = idFromUriResolverSource; } else { // The user did not provide a URIResolver, or it did not // return a Source for the included stylesheet module, or // the Source has no system ID set, so we fall back to using // the system ID Resolver to take the href and base // to generate the baseURI of the included stylesheet. baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler .getBaseIdentifier()); } return baseURI; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public XPath createXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
XPath createMatchPatternXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.MATCH, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
// in src/org/apache/xalan/templates/ElemElement.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_name_avt) m_name_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_namespace_avt) m_namespace_avt.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemElement.java
protected String resolvePrefix(SerializationHandler rhandler, String prefix, String nodeNamespace) throws TransformerException { // if (null != prefix && prefix.length() == 0) // { // String foundPrefix = rhandler.getPrefix(nodeNamespace); // // // System.out.println("nsPrefix: "+nsPrefix); // if (null == foundPrefix) // foundPrefix = ""; // } return prefix; }
// in src/org/apache/xalan/templates/ElemElement.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); SerializationHandler rhandler = transformer.getSerializationHandler(); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String nodeName = m_name_avt == null ? null : m_name_avt.evaluate(xctxt, sourceNode, this); String prefix = null; String nodeNamespace = ""; // Only validate if an AVT was used. if ((nodeName != null) && (!m_name_avt.isSimple()) && (!XML11Char.isXML11ValidQName(nodeName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, nodeName }); nodeName = null; } else if (nodeName != null) { prefix = QName.getPrefixPart(nodeName); if (null != m_namespace_avt) { nodeNamespace = m_namespace_avt.evaluate(xctxt, sourceNode, this); if (null == nodeNamespace || (prefix != null && prefix.length()>0 && nodeNamespace.length()== 0) ) transformer.getMsgMgr().error( this, XSLTErrorResources.ER_NULL_URI_NAMESPACE); else { // Determine the actual prefix that we will use for this nodeNamespace prefix = resolvePrefix(rhandler, prefix, nodeNamespace); if (null == prefix) prefix = ""; if (prefix.length() > 0) nodeName = (prefix + ":" + QName.getLocalPart(nodeName)); else nodeName = QName.getLocalPart(nodeName); } } // No namespace attribute was supplied. Use the namespace declarations // currently in effect for the xsl:element element. else { try { // Maybe temporary, until I get this worked out. test: axes59 nodeNamespace = getNamespaceForPrefix(prefix); // If we get back a null nodeNamespace, that means that this prefix could // not be found in the table. This is okay only for a default namespace // that has never been declared. if ( (null == nodeNamespace) && (prefix.length() == 0) ) nodeNamespace = ""; else if (null == nodeNamespace) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; } } catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; } } } constructNode(nodeName, prefix, nodeNamespace, transformer); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemElement.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { boolean shouldAddAttrs; try { SerializationHandler rhandler = transformer.getResultTreeHandler(); if (null == nodeName) { shouldAddAttrs = false; } else { if (null != prefix) { rhandler.startPrefixMapping(prefix, nodeNamespace, true); } rhandler.startElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); super.execute(transformer); shouldAddAttrs = true; } transformer.executeChildTemplates(this, shouldAddAttrs); // Now end the element if name was valid if (null != nodeName) { rhandler.endElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); if (null != prefix) { rhandler.endPrefixMapping(prefix); } } } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemFallback.java
public void execute( TransformerImpl transformer) throws TransformerException { }
// in src/org/apache/xalan/templates/ElemFallback.java
public void executeFallback( TransformerImpl transformer) throws TransformerException { int parentElemType = m_parentNode.getXSLToken(); if (Constants.ELEMNAME_EXTENSIONCALL == parentElemType || Constants.ELEMNAME_UNDEFINED == parentElemType) { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { // Should never happen System.out.println( "Error! parent of xsl:fallback must be an extension or unknown element!"); } }
// in src/org/apache/xalan/templates/XUnresolvedVariable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (!m_doneEval) { this.m_transformer.getMsgMgr().error (xctxt.getSAXLocator(), XSLTErrorResources.ER_REFERENCING_ITSELF, new Object[]{((ElemVariable)this.object()).getName().getLocalName()}); } VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int currentFrame = vars.getStackFrame(); //// vars.setStackFrame(m_varStackPos); ElemVariable velem = (ElemVariable)m_obj; try { m_doneEval = false; if(-1 != velem.m_frameSize) vars.link(velem.m_frameSize); XObject var = velem.getValue(m_transformer, m_context); m_doneEval = true; return var; } finally { // These two statements need to be combined into one operation. // vars.setStackFrame(currentFrame); if(-1 != velem.m_frameSize) vars.unlink(currentFrame); } }
// in src/org/apache/xalan/templates/ElemParam.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_qnameID = sroot.getComposeState().getQNameID(m_qname); int parentToken = m_parentNode.getXSLToken(); if (parentToken == Constants.ELEMNAME_TEMPLATE || parentToken == Constants.EXSLT_ELEMNAME_FUNCTION) ((ElemTemplate)m_parentNode).m_inArgsSize++; }
// in src/org/apache/xalan/templates/ElemParam.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); VariableStack vars = transformer.getXPathContext().getVarStack(); if(!vars.isLocalSet(m_index)) { int sourceNode = transformer.getXPathContext().getCurrentNode(); XObject var = getValue(transformer, sourceNode); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_extns = this.getNamespace(); m_decl = getElemExtensionDecl(sroot, m_extns); // Register the extension namespace if the extension does not have // an ElemExtensionDecl ("component"). if (m_decl == null) sroot.getExtensionNamespacesManager().registerExtension(m_extns); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
private void executeFallbacks( TransformerImpl transformer) throws TransformerException { for (ElemTemplateElement child = m_firstChild; child != null; child = child.m_nextSibling) { if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) { try { transformer.pushElemTemplateElement(child); ((ElemFallback) child).executeFallback(transformer); } finally { transformer.popElemTemplateElement(); } } } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getStylesheet().isSecureProcessing()) throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { transformer.getResultTreeHandler().flushPending(); ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(m_extns); if (null == nsh) { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { TransformerException te = new TransformerException(XSLMessages.createMessage( XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); } return; } try { nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this); } catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } } } catch(TransformerException e) { transformer.getErrorListener().fatalError(e); } catch(SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public String getAttribute( String rawName, org.w3c.dom.Node sourceNode, TransformerImpl transformer) throws TransformerException { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt) && avt.getRawName().equals(rawName)) { XPathContext xctxt = transformer.getXPathContext(); return avt.evaluate(xctxt, xctxt.getDTMHandleFromNode(sourceNode), this); } return null; }
// in src/org/apache/xalan/templates/ElemUse.java
public void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet) throws TransformerException { applyAttrSets(transformer, stylesheet, m_attributeSetsNames); }
// in src/org/apache/xalan/templates/ElemUse.java
private void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet, QName attributeSetsNames[]) throws TransformerException { if (null != attributeSetsNames) { int nNames = attributeSetsNames.length; for (int i = 0; i < nNames; i++) { QName qname = attributeSetsNames[i]; java.util.List attrSets = stylesheet.getAttributeSetComposed(qname); if (null != attrSets) { int nSets = attrSets.size(); // Highest priority attribute set will be at the top, // so process it last. for (int k = nSets-1; k >= 0 ; k--) { ElemAttributeSet attrSet = (ElemAttributeSet) attrSets.get(k); attrSet.execute(transformer); } } else { throw new TransformerException( XSLMessages.createMessage(XSLTErrorResources.ER_NO_ATTRIB_SET, new Object[] {qname}),this); } } } }
// in src/org/apache/xalan/templates/ElemUse.java
public void execute( TransformerImpl transformer) throws TransformerException { if (null != m_attributeSetsNames) { applyAttrSets(transformer, getStylesheetRoot(), m_attributeSetsNames); } }
// in src/org/apache/xalan/templates/ElemChoose.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); boolean found = false; for (ElemTemplateElement childElem = getFirstChildElem(); childElem != null; childElem = childElem.getNextSiblingElem()) { int type = childElem.getXSLToken(); if (Constants.ELEMNAME_WHEN == type) { found = true; ElemWhen when = (ElemWhen) childElem; // must be xsl:when XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); // System.err.println("\""+when.getTest().getPatternString()+"\""); // if(when.getTest().getPatternString().equals("COLLECTION/icuser/ictimezone/LITERAL='GMT +13:00 Pacific/Tongatapu'")) // System.err.println("Found COLLECTION/icuser/ictimezone/LITERAL"); if (transformer.getDebug()) { XObject test = when.getTest().execute(xctxt, sourceNode, when); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, when, "test", when.getTest(), test); if (test.bool()) { transformer.getTraceManager().fireTraceEvent(when); transformer.executeChildTemplates(when, true); transformer.getTraceManager().fireTraceEndEvent(when); return; } } else if (when.getTest().bool(xctxt, sourceNode, when)) { transformer.executeChildTemplates(when, true); return; } } else if (Constants.ELEMNAME_OTHERWISE == type) { found = true; if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(childElem); // xsl:otherwise transformer.executeChildTemplates(childElem, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(childElem); return; } } if (!found) transformer.getMsgMgr().error( this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/FuncDocument.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocumentRoot(context); XObject arg = (XObject) this.getArg0().execute(xctxt); String base = ""; Expression arg1Expr = this.getArg1(); if (null != arg1Expr) { // The URI reference may be relative. The base URI (see [3.2 Base URI]) // of the node in the second argument node-set that is first in document // order is used as the base URI for resolving the // relative URI into an absolute URI. XObject arg2 = arg1Expr.execute(xctxt); if (XObject.CLASS_NODESET == arg2.getType()) { int baseNode = arg2.iter().nextNode(); if (baseNode == DTM.NULL) { // See http://www.w3.org/1999/11/REC-xslt-19991116-errata#E14. // If the second argument is an empty nodeset, this is an error. // The processor can recover by returning an empty nodeset. warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null); XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); return nodes; } else{ DTM baseDTM = xctxt.getDTM(baseNode); base = baseDTM.getDocumentBaseURI(); } // %REVIEW% This doesn't seem to be a problem with the conformance // suite, but maybe it's just not doing a good test? // int baseDoc = baseDTM.getDocument(); // // if (baseDoc == DTM.NULL /* || baseDoc instanceof Stylesheet -->What to do?? */) // { // // // base = ((Stylesheet)baseDoc).getBaseIdentifier(); // base = xctxt.getNamespaceContext().getBaseIdentifier(); // } // else // base = xctxt.getSourceTreeManager().findURIFromDoc(baseDoc); } else { //Can not convert other type to a node-set!; arg2.iter(); } } else { // If the second argument is omitted, then it defaults to // the node in the stylesheet that contains the expression that // includes the call to the document function. Note that a // zero-length URI reference is a reference to the document // relative to which the URI reference is being resolved; thus // document("") refers to the root node of the stylesheet; // the tree representation of the stylesheet is exactly // the same as if the XML document containing the stylesheet // was the initial source document. assertion(null != xctxt.getNamespaceContext(), "Namespace context can not be null!"); base = xctxt.getNamespaceContext().getBaseIdentifier(); } XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM mnl = nodes.mutableNodeset(); DTMIterator iterator = (XObject.CLASS_NODESET == arg.getType()) ? arg.iter() : null; int pos = DTM.NULL; while ((null == iterator) || (DTM.NULL != (pos = iterator.nextNode()))) { XMLString ref = (null != iterator) ? xctxt.getDTM(pos).getStringValue(pos) : arg.xstr(); // The first and only argument was a nodeset, the base in that // case is the base URI of the node from the first argument nodeset. // Remember, when the document function has exactly one argument and // the argument is a node-set, then the result is the union, for each // node in the argument node-set, of the result of calling the document // function with the first argument being the string-value of the node, // and the second argument being a node-set with the node as its only // member. if (null == arg1Expr && DTM.NULL != pos) { DTM baseDTM = xctxt.getDTM(pos); base = baseDTM.getDocumentBaseURI(); } if (null == ref) continue; if (DTM.NULL == docContext) { error(xctxt, XSLTErrorResources.ER_NO_CONTEXT_OWNERDOC, null); //"context does not have an owner document!"); } // From http://www.ics.uci.edu/pub/ietf/uri/rfc1630.txt // A partial form can be distinguished from an absolute form in that the // latter must have a colon and that colon must occur before any slash // characters. Systems not requiring partial forms should not use any // unencoded slashes in their naming schemes. If they do, absolute URIs // will still work, but confusion may result. int indexOfColon = ref.indexOf(':'); int indexOfSlash = ref.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url (or filename, for that matter) is absolute. base = null; } int newDoc = getDoc(xctxt, context, ref.toString(), base); // nodes.mutableNodeset().addNode(newDoc); if (DTM.NULL != newDoc) { // TODO: mnl.addNodeInDocOrder(newDoc, true, xctxt); ?? if (!mnl.contains(newDoc)) { mnl.addElement(newDoc); } } if (null == iterator || newDoc == DTM.NULL) break; } return nodes; }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/FuncDocument.java
public void error(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.error(spe); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/templates/FuncDocument.java
public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_selectExpression) m_selectExpression.fixupVariables( vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Optimize for "." if (false && m_isDot && !transformer.getDebug()) { int child = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(child); xctxt.pushCurrentNode(child); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { dtm.dispatchCharactersEvents(child, rth, false); } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); } } else { xctxt.pushNamespaceContext(this); int current = xctxt.getCurrentNode(); xctxt.pushCurrentNodeAndExpression(current, current); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { Expression expr = m_selectExpression.getExpression(); if (transformer.getDebug()) { XObject obj = expr.execute(xctxt); transformer.getTraceManager().fireSelectedEvent(current, this, "select", m_selectExpression, obj); obj.dispatchCharactersEvents(rth); } else { expr.executeCharsToContentHandler(xctxt, rth); } } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } } } catch (SAXException se) { throw new TransformerException(se); } catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public void recompose() throws TransformerException { // Now we make a Vector that is going to hold all of the recomposable elements Vector recomposableElements = new Vector(); // First, we build the global import tree. if (null == m_globalImportList) { Vector importList = new Vector(); addImports(this, true, importList); // Now we create an array and reverse the order of the importList vector. // We built the importList vector backwards so that we could use addElement // to append to the end of the vector instead of constantly pushing new // stylesheets onto the front of the vector and having to shift the rest // of the vector each time. m_globalImportList = new StylesheetComposed[importList.size()]; for (int i = 0, j= importList.size() -1; i < importList.size(); i++) { m_globalImportList[j] = (StylesheetComposed) importList.elementAt(i); // Build the global include list for this stylesheet. // This needs to be done ahead of the recomposeImports // because we need the info from the composed includes. m_globalImportList[j].recomposeIncludes(m_globalImportList[j]); // Calculate the number of this import. m_globalImportList[j--].recomposeImports(); } } // Next, we walk the import tree and add all of the recomposable elements to the vector. int n = getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = getGlobalImport(i); imported.recompose(recomposableElements); } // We sort the elements into ascending order. QuickSort2(recomposableElements, 0, recomposableElements.size() - 1); // We set up the global variables that will hold the recomposed information. m_outputProperties = new OutputProperties(org.apache.xml.serializer.Method.UNKNOWN); // m_outputProperties = new OutputProperties(Method.XML); m_attrSets = new HashMap(); m_decimalFormatSymbols = new Hashtable(); m_keyDecls = new Vector(); m_namespaceAliasComposed = new Hashtable(); m_templateList = new TemplateList(); m_variables = new Vector(); // Now we sequence through the sorted elements, // calling the recompose() function on each one. This will call back into the // appropriate routine here to actually do the recomposition. // Note that we're going backwards, encountering the highest precedence items first. for (int i = recomposableElements.size() - 1; i >= 0; i--) ((ElemTemplateElement) recomposableElements.elementAt(i)).recompose(this); /* * Backing out REE again, as it seems to cause some new failures * which need to be investigated. -is */ // This has to be done before the initialization of the compose state, because // eleminateRedundentGlobals will add variables to the m_variables vector, which // it then copied in the ComposeState constructor. // if(true && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize) // { // RedundentExprEliminator ree = new RedundentExprEliminator(); // callVisitors(ree); // ree.eleminateRedundentGlobals(this); // } initComposeState(); // Need final composition of TemplateList. This adds the wild cards onto the chains. m_templateList.compose(this); // Need to clear check for properties at the same import level. m_outputProperties.compose(this); m_outputProperties.endCompose(this); // Now call the compose() method on every element to give it a chance to adjust // based on composed values. n = getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = this.getGlobalImport(i); int includedCount = imported.getIncludeCountComposed(); for (int j = -1; j < includedCount; j++) { Stylesheet included = imported.getIncludeComposed(j); composeTemplates(included); } } // Attempt to register any remaining unregistered extension namespaces. if (m_extNsMgr != null) m_extNsMgr.registerUnregisteredNamespaces(); clearComposeState(); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
void composeTemplates(ElemTemplateElement templ) throws TransformerException { templ.compose(this); for (ElemTemplateElement child = templ.getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { composeTemplates(child); } templ.endCompose(this); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
void recomposeOutput(OutputProperties oprops) throws TransformerException { m_outputProperties.copyFrom(oprops); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, boolean quietConflictWarnings, DTM dtm) throws TransformerException { return m_templateList.getTemplate(xctxt, targetNode, mode, quietConflictWarnings, dtm); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, int maxImportLevel, int endImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { return m_templateList.getTemplate(xctxt, targetNode, mode, maxImportLevel, endImportLevel, quietConflictWarnings, dtm); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public WhiteSpaceInfo getWhiteSpaceInfo( XPathContext support, int targetElement, DTM dtm) throws TransformerException { if (null != m_whiteSpaceInfoList) return (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support, targetElement, null, false, dtm); else return null; }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public boolean shouldStripWhiteSpace( XPathContext support, int targetElement) throws TransformerException { if (null != m_whiteSpaceInfoList) { while(DTM.NULL != targetElement) { DTM dtm = support.getDTM(targetElement); WhiteSpaceInfo info = (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support, targetElement, null, false, dtm); if(null != info) return info.getShouldStripSpace(); int parent = dtm.getParent(targetElement); if(DTM.NULL != parent && DTM.ELEMENT_NODE == dtm.getNodeType(parent)) targetElement = parent; else targetElement = DTM.NULL; } } return false; }
// in src/org/apache/xalan/templates/StylesheetRoot.java
private void initDefaultRule(ErrorListener errorListener) throws TransformerException { // Then manufacture a default m_defaultRule = new ElemTemplate(); m_defaultRule.setStylesheet(this); XPath defMatch = new XPath("*", this, this, XPath.MATCH, errorListener); m_defaultRule.setMatch(defMatch); ElemApplyTemplates childrenElement = new ElemApplyTemplates(); childrenElement.setIsDefaultTemplate(true); childrenElement.setSelect(m_selectDefault); m_defaultRule.appendChild(childrenElement); m_startRule = m_defaultRule; // ----------------------------- m_defaultTextRule = new ElemTemplate(); m_defaultTextRule.setStylesheet(this); defMatch = new XPath("text() | @*", this, this, XPath.MATCH, errorListener); m_defaultTextRule.setMatch(defMatch); ElemValueOf elemValueOf = new ElemValueOf(); m_defaultTextRule.appendChild(elemValueOf); XPath selectPattern = new XPath(".", this, this, XPath.SELECT, errorListener); elemValueOf.setSelect(selectPattern); //-------------------------------- m_defaultRootRule = new ElemTemplate(); m_defaultRootRule.setStylesheet(this); defMatch = new XPath("/", this, this, XPath.MATCH, errorListener); m_defaultRootRule.setMatch(defMatch); childrenElement = new ElemApplyTemplates(); childrenElement.setIsDefaultTemplate(true); m_defaultRootRule.appendChild(childrenElement); childrenElement.setSelect(m_selectDefault); }
// in src/org/apache/xalan/templates/AVT.java
public String evaluate( XPathContext xctxt, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { if (null != m_simpleString){ return m_simpleString; }else if (null != m_parts){ final FastStringBuffer buf =getBuffer(); String out = null; int n = m_parts.size(); try{ for (int i = 0; i < n; i++){ AVTPart part = (AVTPart) m_parts.elementAt(i); part.evaluate(xctxt, buf, context, nsNode); } out = buf.toString(); }finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); } } return out; }else{ return ""; } }
// in src/org/apache/xalan/templates/ElemWhen.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_test) m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemForEach.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); int length = getSortElemCount(); for (int i = 0; i < length; i++) { getSortElem(i).compose(sroot); } java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_selectExpression) m_selectExpression.fixupVariables( vnames, sroot.getComposeState().getGlobalsSize()); else { m_selectExpression = getStylesheetRoot().m_selectDefault.getExpression(); } }
// in src/org/apache/xalan/templates/ElemForEach.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { int length = getSortElemCount(); for (int i = 0; i < length; i++) { getSortElem(i).endCompose(sroot); } super.endCompose(sroot); }
// in src/org/apache/xalan/templates/ElemForEach.java
public void execute(TransformerImpl transformer) throws TransformerException { transformer.pushCurrentTemplateRuleIsNull(true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this);//trigger for-each element event try { transformSelectedNodes(transformer); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); } }
// in src/org/apache/xalan/templates/ElemForEach.java
public DTMIterator sortNodes( XPathContext xctxt, Vector keys, DTMIterator sourceNodes) throws TransformerException { NodeSorter sorter = new NodeSorter(xctxt); sourceNodes.setShouldCacheNodes(true); sourceNodes.runTo(-1); xctxt.pushContextNodeList(sourceNodes); try { sorter.sort(sourceNodes, keys, xctxt); sourceNodes.setCurrentPos(0); } finally { xctxt.popContextNodeList(); } return sourceNodes; }
// in src/org/apache/xalan/templates/ElemForEach.java
public void transformSelectedNodes(TransformerImpl transformer) throws TransformerException { final XPathContext xctxt = transformer.getXPathContext(); final int sourceNode = xctxt.getCurrentNode(); DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); try { final Vector keys = (m_sortElems == null) ? null : transformer.processSortKeys(this, sourceNode); // Sort if we need to. if (null != keys) sourceNodes = sortNodes(xctxt, keys, sourceNodes); if (transformer.getDebug()) { // The original code, which is broken for bug#16889, // which fails to get the original select expression in the select event. /* transformer.getTraceManager().fireSelectedEvent( * sourceNode, * this, * "select", * new XPath(m_selectExpression), * new org.apache.xpath.objects.XNodeSet(sourceNodes)); */ // The following code fixes bug#16889 // Solution: Store away XPath in setSelect(Xath), and use it here. // Pass m_xath, which the current node is associated with, onto the TraceManager. Expression expr = m_xpath.getExpression(); org.apache.xpath.objects.XObject xObject = expr.execute(xctxt); int current = xctxt.getCurrentNode(); transformer.getTraceManager().fireSelectedEvent( current, this, "select", m_xpath, xObject); } xctxt.pushCurrentNode(DTM.NULL); IntStack currentNodes = xctxt.getCurrentNodeStack(); xctxt.pushCurrentExpressionNode(DTM.NULL); IntStack currentExpressionNodes = xctxt.getCurrentExpressionNodeStack(); xctxt.pushSAXLocatorNull(); xctxt.pushContextNodeList(sourceNodes); transformer.pushElemTemplateElement(null); // pushParams(transformer, xctxt); // Should be able to get this from the iterator but there must be a bug. DTM dtm = xctxt.getDTM(sourceNode); int docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT; int child; while (DTM.NULL != (child = sourceNodes.nextNode())) { currentNodes.setTop(child); currentExpressionNodes.setTop(child); if ((child & DTMManager.IDENT_DTM_DEFAULT) != docID) { dtm = xctxt.getDTM(child); docID = child & DTMManager.IDENT_DTM_DEFAULT; } //final int exNodeType = dtm.getExpandedTypeID(child); final int nodeType = dtm.getNodeType(child); // Fire a trace event for the template. if (transformer.getDebug()) { transformer.getTraceManager().fireTraceEvent(this); } // And execute the child templates. // Loop through the children of the template, calling execute on // each of them. for (ElemTemplateElement t = this.m_firstChild; t != null; t = t.m_nextSibling) { xctxt.setSAXLocator(t); transformer.setCurrentElement(t); t.execute(transformer); } if (transformer.getDebug()) { // We need to make sure an old current element is not // on the stack. See TransformerImpl#getElementCallstack. transformer.setCurrentElement(null); transformer.getTraceManager().fireTraceEndEvent(this); } // KLUGE: Implement <?xalan:doc_cache_off?> // ASSUMPTION: This will be set only when the XPath was indeed // a call to the Document() function. Calling it in other // situations is likely to fry Xalan. // // %REVIEW% We need a MUCH cleaner solution -- one that will // handle cleaning up after document() and getDTM() in other // contexts. The whole SourceTreeManager mechanism should probably // be moved into DTMManager rather than being explicitly invoked in // FuncDocument and here. if(m_doc_cache_off) { if(DEBUG) System.out.println("JJK***** CACHE RELEASE *****\n"+ "\tdtm="+dtm.getDocumentBaseURI()); // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, this would require substantial rework. xctxt.getSourceTreeManager().removeDocumentFromCache(dtm.getDocument()); xctxt.release(dtm,false); } } } finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); } }
// in src/org/apache/xalan/templates/AVTPartXPath.java
public void evaluate( XPathContext xctxt, FastStringBuffer buf, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { XObject xobj = m_xpath.execute(xctxt, context, nsNode); if (null != xobj) { xobj.appendToFsb(buf); } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // A bit of an ugly hack to get our context. ElemTemplateElement templElem = (ElemTemplateElement) xctxt.getNamespaceContext(); StylesheetRoot ss = templElem.getStylesheetRoot(); java.text.DecimalFormat formatter = null; java.text.DecimalFormatSymbols dfs = null; double num = getArg0().execute(xctxt).num(); String patternStr = getArg1().execute(xctxt).str(); // TODO: what should be the behavior here?? if (patternStr.indexOf(0x00A4) > 0) ss.error(XSLTErrorResources.ER_CURRENCY_SIGN_ILLEGAL); // currency sign not allowed // this third argument is not a locale name. It is the name of a // decimal-format declared in the stylesheet!(xsl:decimal-format try { Expression arg2Expr = getArg2(); if (null != arg2Expr) { String dfName = arg2Expr.execute(xctxt).str(); QName qname = new QName(dfName, xctxt.getNamespaceContext()); dfs = ss.getDecimalFormatComposed(qname); if (null == dfs) { warn(xctxt, XSLTErrorResources.WG_NO_DECIMALFORMAT_DECLARATION, new Object[]{ dfName }); //"not found!!! //formatter = new java.text.DecimalFormat(patternStr); } else { //formatter = new java.text.DecimalFormat(patternStr, dfs); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); } } //else if (null == formatter) { // look for a possible default decimal-format dfs = ss.getDecimalFormatComposed(new QName("")); if (dfs != null) { formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); } else { dfs = new java.text.DecimalFormatSymbols(java.util.Locale.US); dfs.setInfinity(Constants.ATTRVAL_INFINITY); dfs.setNaN(Constants.ATTRVAL_NAN); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); if (null != patternStr) formatter.applyLocalizedPattern(patternStr); } } return new XString(formatter.format(num)); } catch (Exception iae) { templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{ patternStr }); return XString.EMPTYSTRING; //throw new XSLProcessorException(iae); } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
// in src/org/apache/xalan/templates/ElemNumber.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_countMatchPattern) m_countMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_format_avt) m_format_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_fromMatchPattern) m_fromMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_groupingSeparator_avt) m_groupingSeparator_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_groupingSize_avt) m_groupingSize_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lang_avt) m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lettervalue_avt) m_lettervalue_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_valueExpr) m_valueExpr.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemNumber.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); String countString = getCountString(transformer, sourceNode); try { transformer.getResultTreeHandler().characters(countString.toCharArray(), 0, countString.length()); } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemNumber.java
int findAncestor( XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, int context, ElemNumber namespaceContext) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); while (DTM.NULL != context) { if (null != fromMatchPattern) { if (fromMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { //context = null; break; } } if (null != countMatchPattern) { if (countMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { break; } } context = dtm.getParent(context); } return context; }
// in src/org/apache/xalan/templates/ElemNumber.java
private int findPrecedingOrAncestorOrSelf( XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, int context, ElemNumber namespaceContext) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); while (DTM.NULL != context) { if (null != fromMatchPattern) { if (fromMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { context = DTM.NULL; break; } } if (null != countMatchPattern) { if (countMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { break; } } int prevSibling = dtm.getPreviousSibling(context); if (DTM.NULL == prevSibling) { context = dtm.getParent(context); } else { // Now go down the chain of children of this sibling context = dtm.getLastChild(prevSibling); if (context == DTM.NULL) context = prevSibling; } } return context; }
// in src/org/apache/xalan/templates/ElemNumber.java
XPath getCountMatchPattern(XPathContext support, int contextNode) throws javax.xml.transform.TransformerException { XPath countMatchPattern = m_countMatchPattern; DTM dtm = support.getDTM(contextNode); if (null == countMatchPattern) { switch (dtm.getNodeType(contextNode)) { case DTM.ELEMENT_NODE : MyPrefixResolver resolver; if (dtm.getNamespaceURI(contextNode) == null) { resolver = new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, false); } else { resolver = new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, true); } countMatchPattern = new XPath(dtm.getNodeName(contextNode), this, resolver, XPath.MATCH, support.getErrorListener()); break; case DTM.ATTRIBUTE_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this); countMatchPattern = new XPath("@" + dtm.getNodeName(contextNode), this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("text()", this); countMatchPattern = new XPath("text()", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.COMMENT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this); countMatchPattern = new XPath("comment()", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.DOCUMENT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("/", this); countMatchPattern = new XPath("/", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.PROCESSING_INSTRUCTION_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this); countMatchPattern = new XPath("pi(" + dtm.getNodeName(contextNode) + ")", this, this, XPath.MATCH, support.getErrorListener()); break; default : countMatchPattern = null; } } return countMatchPattern; }
// in src/org/apache/xalan/templates/ElemNumber.java
String getCountString(TransformerImpl transformer, int sourceNode) throws TransformerException { long[] list = null; XPathContext xctxt = transformer.getXPathContext(); CountersTable ctable = transformer.getCountersTable(); if (null != m_valueExpr) { XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this); //According to Errata E24 double d_count = java.lang.Math.floor(countObj.num()+ 0.5); if (Double.isNaN(d_count)) return "NaN"; else if (d_count < 0 && Double.isInfinite(d_count)) return "-Infinity"; else if (Double.isInfinite(d_count)) return "Infinity"; else if (d_count == 0) return "0"; else{ long count = (long)d_count; list = new long[1]; list[0] = count; } } else { if (Constants.NUMBERLEVEL_ANY == m_level) { list = new long[1]; list[0] = ctable.countNode(xctxt, this, sourceNode); } else { NodeVector ancestors = getMatchingAncestors(xctxt, sourceNode, Constants.NUMBERLEVEL_SINGLE == m_level); int lastIndex = ancestors.size() - 1; if (lastIndex >= 0) { list = new long[lastIndex + 1]; for (int i = lastIndex; i >= 0; i--) { int target = ancestors.elementAt(i); list[lastIndex - i] = ctable.countNode(xctxt, this, target); } } } } return (null != list) ? formatNumberList(transformer, list, sourceNode) : ""; }
// in src/org/apache/xalan/templates/ElemNumber.java
public int getPreviousNode(XPathContext xctxt, int pos) throws TransformerException { XPath countMatchPattern = getCountMatchPattern(xctxt, pos); DTM dtm = xctxt.getDTM(pos); if (Constants.NUMBERLEVEL_ANY == m_level) { XPath fromMatchPattern = m_fromMatchPattern; // Do a backwards document-order walk 'till a node is found that matches // the 'from' pattern, or a node is found that matches the 'count' pattern, // or the top of the tree is found. while (DTM.NULL != pos) { // Get the previous sibling, if there is no previous sibling, // then count the parent, but if there is a previous sibling, // dive down to the lowest right-hand (last) child of that sibling. int next = dtm.getPreviousSibling(pos); if (DTM.NULL == next) { next = dtm.getParent(pos); if ((DTM.NULL != next) && ((((null != fromMatchPattern) && (fromMatchPattern.getMatchScore( xctxt, next) != XPath.MATCH_SCORE_NONE))) || (dtm.getNodeType(next) == DTM.DOCUMENT_NODE))) { pos = DTM.NULL; // return null from function. break; // from while loop } } else { // dive down to the lowest right child. int child = next; while (DTM.NULL != child) { child = dtm.getLastChild(next); if (DTM.NULL != child) next = child; } } pos = next; if ((DTM.NULL != pos) && ((null == countMatchPattern) || (countMatchPattern.getMatchScore(xctxt, pos) != XPath.MATCH_SCORE_NONE))) { break; } } } else // NUMBERLEVEL_MULTI or NUMBERLEVEL_SINGLE { while (DTM.NULL != pos) { pos = dtm.getPreviousSibling(pos); if ((DTM.NULL != pos) && ((null == countMatchPattern) || (countMatchPattern.getMatchScore(xctxt, pos) != XPath.MATCH_SCORE_NONE))) { break; } } } return pos; }
// in src/org/apache/xalan/templates/ElemNumber.java
public int getTargetNode(XPathContext xctxt, int sourceNode) throws TransformerException { int target = DTM.NULL; XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode); if (Constants.NUMBERLEVEL_ANY == m_level) { target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } else { target = findAncestor(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } return target; }
// in src/org/apache/xalan/templates/ElemNumber.java
NodeVector getMatchingAncestors( XPathContext xctxt, int node, boolean stopAtFirstFound) throws javax.xml.transform.TransformerException { NodeSetDTM ancestors = new NodeSetDTM(xctxt.getDTMManager()); XPath countMatchPattern = getCountMatchPattern(xctxt, node); DTM dtm = xctxt.getDTM(node); while (DTM.NULL != node) { if ((null != m_fromMatchPattern) && (m_fromMatchPattern.getMatchScore(xctxt, node) != XPath.MATCH_SCORE_NONE)) { // The following if statement gives level="single" different // behavior from level="multiple", which seems incorrect according // to the XSLT spec. For now we are leaving this in to replicate // the same behavior in XT, but, for all intents and purposes we // think this is a bug, or there is something about level="single" // that we still don't understand. if (!stopAtFirstFound) break; } if (null == countMatchPattern) System.out.println( "Programmers error! countMatchPattern should never be null!"); if (countMatchPattern.getMatchScore(xctxt, node) != XPath.MATCH_SCORE_NONE) { ancestors.addElement(node); if (stopAtFirstFound) break; } node = dtm.getParent(node); } return ancestors; }
// in src/org/apache/xalan/templates/ElemNumber.java
Locale getLocale(TransformerImpl transformer, int contextNode) throws TransformerException { Locale locale = null; if (null != m_lang_avt) { XPathContext xctxt = transformer.getXPathContext(); String langValue = m_lang_avt.evaluate(xctxt, contextNode, this); if (null != langValue) { // Not really sure what to do about the country code, so I use the // default from the system. // TODO: fix xml:lang handling. locale = new Locale(langValue.toUpperCase(), ""); //Locale.getDefault().getDisplayCountry()); if (null == locale) { transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode), XSLTErrorResources.WG_LOCALE_NOT_FOUND, new Object[]{ langValue }); //"Warning: Could not find locale for xml:lang="+langValue); locale = Locale.getDefault(); } } } else { locale = Locale.getDefault(); } return locale; }
// in src/org/apache/xalan/templates/ElemNumber.java
private DecimalFormat getNumberFormatter( TransformerImpl transformer, int contextNode) throws TransformerException { // Patch from Steven Serocki // Maybe we really want to do the clone in getLocale() and return // a clone of the default Locale?? Locale locale = (Locale)getLocale(transformer, contextNode).clone(); // Helper to format local specific numbers to strings. DecimalFormat formatter = null; //synchronized (locale) //{ // formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale); //} String digitGroupSepValue = (null != m_groupingSeparator_avt) ? m_groupingSeparator_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; // Validate grouping separator if an AVT was used; otherwise this was // validated statically in XSLTAttributeDef.java. if ((digitGroupSepValue != null) && (!m_groupingSeparator_avt.isSimple()) && (digitGroupSepValue.length() != 1)) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, m_groupingSeparator_avt.getName()}); } String nDigitsPerGroupValue = (null != m_groupingSize_avt) ? m_groupingSize_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; // TODO: Handle digit-group attributes if ((null != digitGroupSepValue) && (null != nDigitsPerGroupValue) && // Ignore if separation value is empty string (digitGroupSepValue.length() > 0)) { try { formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale); formatter.setGroupingSize( Integer.valueOf(nDigitsPerGroupValue).intValue()); DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); symbols.setGroupingSeparator(digitGroupSepValue.charAt(0)); formatter.setDecimalFormatSymbols(symbols); formatter.setGroupingUsed(true); } catch (NumberFormatException ex) { formatter.setGroupingUsed(false); } } return formatter; }
// in src/org/apache/xalan/templates/ElemNumber.java
String formatNumberList( TransformerImpl transformer, long[] list, int contextNode) throws TransformerException { String numStr; FastStringBuffer formattedNumber = StringBufferPool.get(); try { int nNumbers = list.length, numberWidth = 1; char numberType = '1'; String formatToken, lastSepString = null, formatTokenString = null; // If a seperator hasn't been specified, then use "." // as a default separator. // For instance: [2][1][5] with a format value of "1 " // should format to "2.1.5 " (I think). // Otherwise, use the seperator specified in the format string. // For instance: [2][1][5] with a format value of "01-001. " // should format to "02-001-005 ". String lastSep = "."; boolean isFirstToken = true; // true if first token String formatValue = (null != m_format_avt) ? m_format_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; if (null == formatValue) formatValue = "1"; NumberFormatStringTokenizer formatTokenizer = new NumberFormatStringTokenizer(formatValue); // int sepCount = 0; // keep track of seperators // Loop through all the numbers in the list. for (int i = 0; i < nNumbers; i++) { // Loop to the next digit, letter, or separator. if (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); // If the first character of this token is a character or digit, then // it is a number format directive. if (Character.isLetterOrDigit( formatToken.charAt(formatToken.length() - 1))) { numberWidth = formatToken.length(); numberType = formatToken.charAt(numberWidth - 1); } // If there is a number format directive ahead, // then append the formatToken. else if (formatTokenizer.isLetterOrDigitAhead()) { final StringBuffer formatTokenStringBuffer = new StringBuffer(formatToken); // Append the formatToken string... // For instance [2][1][5] with a format value of "1--1. " // should format to "2--1--5. " (I guess). while (formatTokenizer.nextIsSep()) { formatToken = formatTokenizer.nextToken(); formatTokenStringBuffer.append(formatToken); } formatTokenString = formatTokenStringBuffer.toString(); // Record this separator, so it can be used as the // next separator, if the next is the last. // For instance: [2][1][5] with a format value of "1-1 " // should format to "2-1-5 ". if (!isFirstToken) lastSep = formatTokenString; // Since we know the next is a number or digit, we get it now. formatToken = formatTokenizer.nextToken(); numberWidth = formatToken.length(); numberType = formatToken.charAt(numberWidth - 1); } else // only separators left { // Set up the string for the trailing characters after // the last number is formatted (i.e. after the loop). lastSepString = formatToken; // And append any remaining characters to the lastSepString. while (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); lastSepString += formatToken; } } // else } // end if(formatTokenizer.hasMoreTokens()) // if this is the first token and there was a prefix // append the prefix else, append the separator // For instance, [2][1][5] with a format value of "(1-1.) " // should format to "(2-1-5.) " (I guess). if (null != formatTokenString && isFirstToken) { formattedNumber.append(formatTokenString); } else if (null != lastSep &&!isFirstToken) formattedNumber.append(lastSep); getFormattedNumber(transformer, contextNode, numberType, numberWidth, list[i], formattedNumber); isFirstToken = false; // After the first pass, this should be false } // end for loop // Check to see if we finished up the format string... // Skip past all remaining letters or digits while (formatTokenizer.isLetterOrDigitAhead()) { formatTokenizer.nextToken(); } if (lastSepString != null) formattedNumber.append(lastSepString); while (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); formattedNumber.append(formatToken); } numStr = formattedNumber.toString(); } finally { StringBufferPool.free(formattedNumber); } return numStr; }
// in src/org/apache/xalan/templates/ElemNumber.java
private void getFormattedNumber( TransformerImpl transformer, int contextNode, char numberType, int numberWidth, long listElement, FastStringBuffer formattedNumber) throws javax.xml.transform.TransformerException { String letterVal = (m_lettervalue_avt != null) ? m_lettervalue_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; /** * Wrapper of Chars for converting integers into alpha counts. */ CharArrayWrapper alphaCountTable = null; XResourceBundle thisBundle = null; switch (numberType) { case 'A' : if (null == m_alphaCountTable){ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); } int2alphaCount(listElement, m_alphaCountTable, formattedNumber); break; case 'a' : if (null == m_alphaCountTable){ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); } FastStringBuffer stringBuf = StringBufferPool.get(); try { int2alphaCount(listElement, m_alphaCountTable, stringBuf); formattedNumber.append( stringBuf.toString().toLowerCase( getLocale(transformer, contextNode))); } finally { StringBufferPool.free(stringBuf); } break; case 'I' : formattedNumber.append(long2roman(listElement, true)); break; case 'i' : formattedNumber.append( long2roman(listElement, true).toLowerCase( getLocale(transformer, contextNode))); break; case 0x3042 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HA")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x3044 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HI")); if ((letterVal != null) && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x30A2 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "A")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x30A4 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "I")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x4E00 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "CN")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) { formattedNumber.append(tradAlphaCount(listElement, thisBundle)); } else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x58F9 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "TW")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x0E51 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("th", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x05D0 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("he", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x10D0 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ka", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x03B1 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("el", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x0430 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("cy", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } default : // "1" DecimalFormat formatter = getNumberFormatter(transformer, contextNode); String padString = formatter == null ? String.valueOf(0) : formatter.format(0); String numString = formatter == null ? String.valueOf(listElement) : formatter.format(listElement); int nPadding = numberWidth - numString.length(); for (int k = 0; k < nPadding; k++) { formattedNumber.append(padString); } formattedNumber.append(numString); } }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplateFast(XPathContext xctxt, int targetNode, int expTypeID, QName mode, int maxImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head; switch (dtm.getNodeType(targetNode)) { case DTM.ELEMENT_NODE : case DTM.ATTRIBUTE_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getLocalNameFromExpandedNameID(expTypeID)); break; case DTM.TEXT_NODE : case DTM.CDATA_SECTION_NODE : head = m_textPatterns; break; case DTM.ENTITY_REFERENCE_NODE : case DTM.ENTITY_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getNodeName(targetNode)); // %REVIEW% I think this is right break; case DTM.PROCESSING_INSTRUCTION_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getLocalName(targetNode)); break; case DTM.COMMENT_NODE : head = m_commentPatterns; break; case DTM.DOCUMENT_NODE : case DTM.DOCUMENT_FRAGMENT_NODE : head = m_docPatterns; break; case DTM.NOTATION_NODE : default : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getNodeName(targetNode)); // %REVIEW% I think this is right } if(null == head) { head = m_wildCardPatterns; if(null == head) return null; } // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); try { do { if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) ) { continue; } ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode, dtm, expTypeID) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popNamespaceContext(); } return null; }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplate(XPathContext xctxt, int targetNode, QName mode, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head = getHead(xctxt, targetNode, dtm); if (null != head) { // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try { do { ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); } } return null; }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplate(XPathContext xctxt, int targetNode, QName mode, int maxImportLevel, int endImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head = getHead(xctxt, targetNode, dtm); if (null != head) { // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try { do { if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel)) { continue; } if (head.getImportLevel()<= maxImportLevel - endImportLevel) return null; ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); } } return null; }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); String lang = null; String srcURL = null; String scriptSrc = null; if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Register the extension namespace if it has not already been registered. ExtensionNamespaceSupport extNsSpt = null; ExtensionNamespacesManager extNsMgr = sroot.getExtensionNamespacesManager(); if (extNsMgr.namespaceIndex(declNamespace, extNsMgr.getExtensions()) == -1) { if (lang.equals("javaclass")) { if (null == srcURL) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace); } else if (extNsMgr.namespaceIndex(srcURL, extNsMgr.getExtensions()) == -1) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace, srcURL); } } else // not java { String handler = "org.apache.xalan.extensions.ExtensionHandlerGeneral"; Object [] args = {declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()}; extNsSpt = new ExtensionNamespaceSupport(declNamespace, handler, args); } } if (extNsSpt != null) extNsMgr.registerExtension(extNsSpt); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void runtimeInit(TransformerImpl transformer) throws TransformerException { /* //System.out.println("ElemExtensionDecl.runtimeInit()"); String lang = null; String srcURL = null; String scriptSrc = null; String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Instantiate a handler for this extension namespace. ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(declNamespace); // If we have no prior ExtensionHandler for this namespace, we need to // create one. // If the script element is for javaclass, this is our special compiled java. // Element content is not supported for this so we throw an exception if // it is provided. Otherwise, we look up the srcURL to see if we already have // an ExtensionHandler. if (null == nsh) { if (lang.equals("javaclass")) { if (null == srcURL) { nsh = etable.makeJavaNamespace(declNamespace); } else { nsh = etable.get(srcURL); if (null == nsh) { nsh = etable.makeJavaNamespace(srcURL); } } } else // not java { nsh = new ExtensionHandlerGeneral(declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()); // System.out.println("Adding NS Handler: declNamespace = "+ // declNamespace+", lang = "+lang+", srcURL = "+ // srcURL+", scriptSrc="+scriptSrc); } etable.addExtensionNamespace(declNamespace, nsh); }*/ }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); avt.fixupVariables(vnames, cstate.getGlobalsSize()); } } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void resolvePrefixTables() throws TransformerException { super.resolvePrefixTables(); StylesheetRoot stylesheet = getStylesheetRoot(); if ((null != m_namespace) && (m_namespace.length() > 0)) { NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace); if (null != nsa) { m_namespace = nsa.getResultNamespace(); // String resultPrefix = nsa.getResultPrefix(); String resultPrefix = nsa.getStylesheetPrefix(); // As per xsl WG, Mike Kay if ((null != resultPrefix) && (resultPrefix.length() > 0)) m_rawName = resultPrefix + ":" + m_localName; else m_rawName = m_localName; } } if (null != m_avts) { int n = m_avts.size(); for (int i = 0; i < n; i++) { AVT avt = (AVT) m_avts.get(i); // Should this stuff be a method on AVT? String ns = avt.getURI(); if ((null != ns) && (ns.length() > 0)) { NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace); // %REVIEW% ns? if (null != nsa) { String namespace = nsa.getResultNamespace(); // String resultPrefix = nsa.getResultPrefix(); String resultPrefix = nsa.getStylesheetPrefix(); // As per XSL WG String rawName = avt.getName(); if ((null != resultPrefix) && (resultPrefix.length() > 0)) rawName = resultPrefix + ":" + rawName; avt.setURI(namespace); avt.setRawName(rawName); } } } } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
private boolean excludeResultNSDecl(String prefix, String uri) throws TransformerException { if (null != m_excludeResultPrefixes) { return containsExcludeResultPrefix(prefix, uri); } return false; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void execute(TransformerImpl transformer) throws TransformerException { SerializationHandler rhandler = transformer.getSerializationHandler(); try { if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. rhandler.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } // JJK Bugzilla 3464, test namespace85 -- make sure LRE's // namespace is asserted even if default, since xsl:element // may have changed the context. rhandler.startPrefixMapping(getPrefix(), getNamespace()); // Add namespace declarations. executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { throw new TransformerException(se); } /* * If we make it to here we have done a successful startElement() * we will do an endElement() call for balance, no matter what happens * in the middle. */ // tException remembers if we had an exception "in the middle" TransformerException tException = null; try { // Process any possible attributes from xsl:use-attribute-sets first super.execute(transformer); //xsl:version, excludeResultPrefixes??? // Process the list of avts next if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String stringedValue = avt.evaluate(xctxt, sourceNode, this); if (null != stringedValue) { // Important Note: I'm not going to check for excluded namespace // prefixes here. It seems like it's too expensive, and I'm not // even sure this is right. But I could be wrong, so this needs // to be tested against other implementations. rhandler.addAttribute( avt.getURI(), avt.getName(), avt.getRawName(), "CDATA", stringedValue, false); } } // end for } // Now process all the elements in this subtree // TODO: Process m_extensionElementPrefixes && m_attributeSetsNames transformer.executeChildTemplates(this, true); } catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; } catch (SAXException se) { tException = new TransformerException(se); } try { /* we need to do this endElement() to balance the * successful startElement() call even if * there was an exception in the middle. * Otherwise an exception in the middle could cause a system to hang. */ if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. //rhandler.flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } rhandler.endElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); } /* If an exception was thrown in the middle but not with startElement() or * or endElement() then its time to let it percolate. */ if (tException != null) throw tException; unexecuteNSDecls(transformer); // JJK Bugzilla 3464, test namespace85 -- balance explicit start. try { rhandler.endPrefixMapping(getPrefix()); } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/XUnresolvedVariableSimple.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { Expression expr = ((ElemVariable)m_obj).getSelect().getExpression(); XObject xobj = expr.execute(xctxt); xobj.allowDetachToRelease(false); return xobj; }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void execute(TransformerImpl transformer) throws TransformerException { transformer.pushCurrentTemplateRuleIsNull(false); boolean pushMode = false; try { // %REVIEW% Do we need this check?? // if (null != sourceNode) // { // boolean needToTurnOffInfiniteLoopCheck = false; QName mode = transformer.getMode(); if (!m_isDefaultTemplate) { if (((null == mode) && (null != m_mode)) || ((null != mode) &&!mode.equals(m_mode))) { pushMode = true; transformer.pushMode(m_mode); } } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); transformSelectedNodes(transformer); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); } }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void transformSelectedNodes(TransformerImpl transformer) throws TransformerException { final XPathContext xctxt = transformer.getXPathContext(); final int sourceNode = xctxt.getCurrentNode(); DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); VariableStack vars = xctxt.getVarStack(); int nParams = getParamElemCount(); int thisframe = vars.getStackFrame(); StackGuard guard = transformer.getStackGuard(); boolean check = (guard.getRecursionLimit() > -1) ? true : false; boolean pushContextNodeListFlag = false; try { xctxt.pushCurrentNode(DTM.NULL); xctxt.pushCurrentExpressionNode(DTM.NULL); xctxt.pushSAXLocatorNull(); transformer.pushElemTemplateElement(null); final Vector keys = (m_sortElems == null) ? null : transformer.processSortKeys(this, sourceNode); // Sort if we need to. if (null != keys) sourceNodes = sortNodes(xctxt, keys, sourceNodes); if (transformer.getDebug()) { transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); } final SerializationHandler rth = transformer.getSerializationHandler(); // ContentHandler chandler = rth.getContentHandler(); final StylesheetRoot sroot = transformer.getStylesheet(); final TemplateList tl = sroot.getTemplateListComposed(); final boolean quiet = transformer.getQuietConflictWarnings(); // Should be able to get this from the iterator but there must be a bug. DTM dtm = xctxt.getDTM(sourceNode); int argsFrame = -1; if(nParams > 0) { // This code will create a section on the stack that is all the // evaluated arguments. These will be copied into the real params // section of each called template. argsFrame = vars.link(nParams); vars.setStackFrame(thisframe); for (int i = 0; i < nParams; i++) { ElemWithParam ewp = m_paramElems[i]; if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(ewp); XObject obj = ewp.getValue(transformer, sourceNode); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(ewp); vars.setLocalVariable(i, obj, argsFrame); } vars.setStackFrame(argsFrame); } xctxt.pushContextNodeList(sourceNodes); pushContextNodeListFlag = true; IntStack currentNodes = xctxt.getCurrentNodeStack(); IntStack currentExpressionNodes = xctxt.getCurrentExpressionNodeStack(); // pushParams(transformer, xctxt); int child; while (DTM.NULL != (child = sourceNodes.nextNode())) { currentNodes.setTop(child); currentExpressionNodes.setTop(child); if(xctxt.getDTM(child) != dtm) { dtm = xctxt.getDTM(child); } final int exNodeType = dtm.getExpandedTypeID(child); final int nodeType = dtm.getNodeType(child); final QName mode = transformer.getMode(); ElemTemplate template = tl.getTemplateFast(xctxt, child, exNodeType, mode, -1, quiet, dtm); // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = sroot.getDefaultRule(); // %OPT% direct faster? break; case DTM.ATTRIBUTE_NODE : case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : // if(rth.m_elemIsPending || rth.m_docPending) // rth.flushPending(true); transformer.pushPairCurrentMatched(sroot.getDefaultTextRule(), child); transformer.setCurrentElement(sroot.getDefaultTextRule()); // dtm.dispatchCharactersEvents(child, chandler, false); dtm.dispatchCharactersEvents(child, rth, false); transformer.popCurrentMatched(); continue; case DTM.DOCUMENT_NODE : template = sroot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. continue; } } else { transformer.setCurrentElement(template); } transformer.pushPairCurrentMatched(template, child); if (check) guard.checkForInfinateLoop(); int currentFrameBottom; // See comment with unlink, below if(template.m_frameSize > 0) { xctxt.pushRTFContext(); currentFrameBottom = vars.getStackFrame(); // See comment with unlink, below vars.link(template.m_frameSize); // You can't do the check for nParams here, otherwise the // xsl:params might not be nulled. if(/* nParams > 0 && */ template.m_inArgsSize > 0) { int paramIndex = 0; for (ElemTemplateElement elem = template.getFirstChildElem(); null != elem; elem = elem.getNextSiblingElem()) { if(Constants.ELEMNAME_PARAMVARIABLE == elem.getXSLToken()) { ElemParam ep = (ElemParam)elem; int i; for (i = 0; i < nParams; i++) { ElemWithParam ewp = m_paramElems[i]; if(ewp.m_qnameID == ep.m_qnameID) { XObject obj = vars.getLocalVariable(i, argsFrame); vars.setLocalVariable(paramIndex, obj); break; } } if(i == nParams) vars.setLocalVariable(paramIndex, null); } else break; paramIndex++; } } } else currentFrameBottom = 0; // Fire a trace event for the template. if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(template); // And execute the child templates. // Loop through the children of the template, calling execute on // each of them. for (ElemTemplateElement t = template.m_firstChild; t != null; t = t.m_nextSibling) { xctxt.setSAXLocator(t); try { transformer.pushElemTemplateElement(t); t.execute(transformer); } finally { transformer.popElemTemplateElement(); } } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(template); if(template.m_frameSize > 0) { // See Frank Weiss bug around 03/19/2002 (no Bugzilla report yet). // While unlink will restore to the proper place, the real position // may have been changed for xsl:with-param, so that variables // can be accessed. // of right now. // More: // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(currentFrameBottom); xctxt.popRTFContext(); } transformer.popCurrentMatched(); } // end while (DTM.NULL != (child = sourceNodes.nextNode())) } catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); } }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemTemplate getTemplate(int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); return (ElemTemplate) m_templates.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i)); m_templates.setElementAt(v, i); v.setStylesheet(this); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public void recompose(Vector recomposableElements) throws TransformerException { //recomposeImports(); // Calculate the number of this import. //recomposeIncludes(this); // Build the global include list for this stylesheet. // Now add in all of the recomposable elements at this precedence level int n = getIncludeCountComposed(); for (int i = -1; i < n; i++) { Stylesheet included = getIncludeComposed(i); // Add in the output elements int s = included.getOutputCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getOutput(j)); } // Next, add in the attribute-set elements s = included.getAttributeSetCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getAttributeSet(j)); } // Now the decimal-formats s = included.getDecimalFormatCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getDecimalFormat(j)); } // Now the keys s = included.getKeyCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getKey(j)); } // And the namespace aliases s = included.getNamespaceAliasCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getNamespaceAlias(j)); } // Next comes the templates s = included.getTemplateCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getTemplate(j)); } // Then, the variables s = included.getVariableOrParamCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getVariableOrParam(j)); } // And lastly the whitespace preserving and stripping elements s = included.getStripSpaceCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getStripSpace(j)); } s = included.getPreserveSpaceCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getPreserveSpace(j)); } } }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public void recomposeTemplates(boolean flushFirst) throws TransformerException { /*************************************** KEEP METHOD IN FOR COMPILATION if (flushFirst) m_templateList = new TemplateList(this); recomposeTemplates(); *****************************************/ }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_matchPattern) m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); cstate.resetStackFrameSize(); m_inArgsSize = 0; }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); super.endCompose(sroot); m_frameSize = cstate.getFrameSize(); cstate.resetStackFrameSize(); }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); transformer.getStackGuard().checkForInfinateLoop(); xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // %REVIEW% commenting out of the code below. // if (null != sourceNode) // { transformer.executeChildTemplates(this, true); // } // else // if(null == sourceNode) // { // transformer.getMsgMgr().error(this, // this, sourceNode, // XSLTErrorResources.ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES); // // //"sourceNode is null in handleApplyTemplatesInstruction!"); // } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/FuncKey.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // TransformerImpl transformer = (TransformerImpl)xctxt; TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject(); XNodeSet nodes = null; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocumentRoot(context); if (DTM.NULL == docContext) { // path.error(context, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC); //"context does not have an owner document!"); } String xkeyname = getArg0().execute(xctxt).str(); QName keyname = new QName(xkeyname, xctxt.getNamespaceContext()); XObject arg = getArg1().execute(xctxt); boolean argIsNodeSetDTM = (XObject.CLASS_NODESET == arg.getType()); KeyManager kmgr = transformer.getKeyManager(); // Don't bother with nodeset logic if the thing is only one node. if(argIsNodeSetDTM) { XNodeSet ns = (XNodeSet)arg; ns.setShouldCacheNodes(true); int len = ns.getLength(); if(len <= 1) argIsNodeSetDTM = false; } if (argIsNodeSetDTM) { Hashtable usedrefs = null; DTMIterator ni = arg.iter(); int pos; UnionPathIterator upi = new UnionPathIterator(); upi.exprSetParent(this); while (DTM.NULL != (pos = ni.nextNode())) { dtm = xctxt.getDTM(pos); XMLString ref = dtm.getStringValue(pos); if (null == ref) continue; if (null == usedrefs) usedrefs = new Hashtable(); if (usedrefs.get(ref) != null) { continue; // We already have 'em. } else { // ISTRUE being used as a dummy value. usedrefs.put(ref, ISTRUE); } XNodeSet nl = kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname, ref, xctxt.getNamespaceContext()); nl.setRoot(xctxt.getCurrentNode(), xctxt); // try // { upi.addIterator(nl); // } // catch(CloneNotSupportedException cnse) // { // // will never happen. // } //mnodeset.addNodesInDocOrder(nl, xctxt); needed?? } int current = xctxt.getCurrentNode(); upi.setRoot(current, xctxt); nodes = new XNodeSet(upi); } else { XMLString ref = arg.xstr(); nodes = kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname, ref, xctxt.getNamespaceContext()); nodes.setRoot(xctxt.getCurrentNode(), xctxt); } return nodes; }
// in src/org/apache/xalan/templates/ElemWithParam.java
public void compose(StylesheetRoot sroot) throws TransformerException { // See if we can reduce an RTF to a select with a string expression. if(null == m_selectPattern && sroot.getOptimizer()) { XPath newSelect = ElemVariable.rewriteChildToExpression(this); if(null != newSelect) m_selectPattern = newSelect; } m_qnameID = sroot.getComposeState().getQNameID(m_qname); super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_selectPattern) m_selectPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); // m_index must be resolved by ElemApplyTemplates and ElemCallTemplate! }
// in src/org/apache/xalan/templates/ElemWithParam.java
public XObject getValue(TransformerImpl transformer, int sourceNode) throws TransformerException { XObject var; XPathContext xctxt = transformer.getXPathContext(); xctxt.pushCurrentNode(sourceNode); try { if (null != m_selectPattern) { var = m_selectPattern.execute(xctxt, sourceNode, this); var.allowDetachToRelease(false); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectPattern, var); } else if (null == getFirstChildElem()) { var = XString.EMPTYSTRING; } else { // Use result tree fragment int df = transformer.transformToRTF(this); var = new XRTreeFrag(df, xctxt, this); } } finally { xctxt.popCurrentNode(); } return var; }
// in src/org/apache/xalan/templates/ElemPI.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_name_atv) m_name_atv.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemPI.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String piName = m_name_atv == null ? null : m_name_atv.evaluate(xctxt, sourceNode, this); // Ignore processing instruction if name is null if (piName == null) return; if (piName.equalsIgnoreCase("xml")) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Only check if an avt was used (ie. this wasn't checked at compose time.) // Ignore processing instruction, if invalid else if ((!m_name_atv.isSimple()) && (!XML11Char.isXML11ValidNCName(piName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); try { transformer.getResultTreeHandler().processingInstruction(piName, data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemSort.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_caseorder_avt) m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_dataType_avt) m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lang_avt) m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_order_avt) m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_selectExpression) m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemAttributeSet.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (transformer.isRecursiveAttrSet(this)) { throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF, new Object[]{ m_qname.getLocalPart() })); //"xsl:attribute-set '"+m_qname.m_localpart+ } transformer.pushElemAttributeSet(this); super.execute(transformer); ElemAttribute attr = (ElemAttribute) getFirstChildElem(); while (null != attr) { attr.execute(transformer); attr = (ElemAttribute) attr.getNextSiblingElem(); } transformer.popElemAttributeSet(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemApplyImport.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.currentTemplateRuleIsNull()) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH); //"xsl:apply-imports not allowed in a xsl:for-each"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); if (DTM.NULL != sourceNode) { // supply the current templated (matched, not named) ElemTemplate matchTemplate = transformer.getMatchedTemplate(); transformer.applyTemplateToNode(this, matchTemplate, sourceNode); } else // if(null == sourceNode) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS); //"sourceNode is null in xsl:apply-imports!"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void execute(TransformerImpl transformer, XObject[] args) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); // Increment the frame bottom of the variable stack by the // frame size int thisFrame = vars.getStackFrame(); int nextFrame = vars.link(m_frameSize); if (m_inArgsSize < args.length) { throw new TransformerException ("function called with too many args"); } // Set parameters, // have to clear the section of the stack frame that has params. if (m_inArgsSize > 0) { vars.clearLocalSlots(0, m_inArgsSize); if (args.length > 0) { vars.setStackFrame(thisFrame); NodeList children = this.getChildNodes(); for (int i = 0; i < args.length; i ++) { Node child = children.item(i); if (children.item(i) instanceof ElemParam) { ElemParam param = (ElemParam)children.item(i); vars.setLocalVariable(param.getIndex(), args[i], nextFrame); } } vars.setStackFrame(nextFrame); } } // Removed ElemTemplate 'push' and 'pop' of RTFContext, in order to avoid losing the RTF context // before a value can be returned. ElemExsltFunction operates in the scope of the template that called // the function. // xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); vars.setStackFrame(nextFrame); transformer.executeChildTemplates(this, true); // Reset the stack frame after the function call vars.unlink(thisFrame); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // Following ElemTemplate 'pop' removed -- see above. // xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Register the function namespace (if not already registered). String namespace = getName().getNamespace(); String handlerClass = sroot.getExtensionHandlerClass(); Object[] args ={namespace, sroot}; ExtensionNamespaceSupport extNsSpt = new ExtensionNamespaceSupport(namespace, handlerClass, args); sroot.getExtensionNamespacesManager().registerExtension(extNsSpt); // Make sure there is a handler for the EXSLT functions namespace // -- for isElementAvailable(). if (!(namespace.equals(Constants.S_EXSLT_FUNCTIONS_URL))) { namespace = Constants.S_EXSLT_FUNCTIONS_URL; args = new Object[]{namespace, sroot}; extNsSpt = new ExtensionNamespaceSupport(namespace, handlerClass, args); sroot.getExtensionNamespacesManager().registerExtension(extNsSpt); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void runtimeInit(TransformerImpl transformer) throws TransformerException{}
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void execute( TransformerImpl transformer) throws TransformerException{}
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void recompose(StylesheetRoot root) throws TransformerException { }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void compose(StylesheetRoot sroot) throws TransformerException { resolvePrefixTables(); ElemTemplateElement t = getFirstChildElem(); m_hasTextLitOnly = ((t != null) && (t.getXSLToken() == Constants.ELEMNAME_TEXTLITERALRESULT) && (t.getNextSiblingElem() == null)); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); cstate.pushStackMark(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); cstate.popStackMark(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void setPrefixes(NamespaceSupport nsSupport) throws TransformerException { setPrefixes(nsSupport, false); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException { Enumeration decls = nsSupport.getDeclaredPrefixes(); while (decls.hasMoreElements()) { String prefix = (String) decls.nextElement(); if (null == m_declaredPrefixes) m_declaredPrefixes = new ArrayList(); String uri = nsSupport.getURI(prefix); if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL)) continue; // System.out.println("setPrefixes - "+prefix+", "+uri); XMLNSDecl decl = new XMLNSDecl(prefix, uri, false); m_declaredPrefixes.add(decl); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
private boolean excludeResultNSDecl(String prefix, String uri) throws TransformerException { if (uri != null) { if (uri.equals(Constants.S_XSLNAMESPACEURL) || getStylesheet().containsExtensionElementURI(uri)) return true; if (containsExcludeResultPrefix(prefix, uri)) return true; } return false; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void resolvePrefixTables() throws TransformerException { // Always start with a fresh prefix table! setPrefixTable(null); // If we have declared declarations, then we look for // a parent that has namespace decls, and add them // to this element's decls. Otherwise we just point // to the parent that has decls. if (null != this.m_declaredPrefixes) { StylesheetRoot stylesheet = this.getStylesheetRoot(); // Add this element's declared prefixes to the // prefix table. int n = m_declaredPrefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_declaredPrefixes.get(i); String prefix = decl.getPrefix(); String uri = decl.getURI(); if(null == uri) uri = ""; boolean shouldExclude = excludeResultNSDecl(prefix, uri); // Create a new prefix table if one has not already been created. if (null == m_prefixTable) setPrefixTable(new ArrayList()); NamespaceAlias nsAlias = stylesheet.getNamespaceAliasComposed(uri); if(null != nsAlias) { // Should I leave the non-aliased element in the table as // an excluded element? // The exclusion should apply to the non-aliased prefix, so // we don't calculate it here. -sb // Use stylesheet prefix, as per xsl WG decl = new XMLNSDecl(nsAlias.getStylesheetPrefix(), nsAlias.getResultNamespace(), shouldExclude); } else decl = new XMLNSDecl(prefix, uri, shouldExclude); m_prefixTable.add(decl); } } ElemTemplateElement parent = this.getParentNodeElem(); if (null != parent) { // The prefix table of the parent should never be null! List prefixes = parent.m_prefixTable; if (null == m_prefixTable && !needToCheckExclude()) { // Nothing to combine, so just use parent's table! setPrefixTable(parent.m_prefixTable); } else { // Add the prefixes from the parent's prefix table. int n = prefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) prefixes.get(i); boolean shouldExclude = excludeResultNSDecl(decl.getPrefix(), decl.getURI()); if (shouldExclude != decl.getIsExcluded()) { decl = new XMLNSDecl(decl.getPrefix(), decl.getURI(), shouldExclude); } //m_prefixTable.addElement(decl); addOrReplaceDecls(decl); } } } else if (null == m_prefixTable) { // Must be stylesheet element without any result prefixes! setPrefixTable(new ArrayList()); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer) throws TransformerException { executeNSDecls(transformer, null); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer) throws TransformerException { unexecuteNSDecls(transformer, null); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.endPrefixMapping(decl.getPrefix()); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public boolean shouldStripWhiteSpace( org.apache.xpath.XPathContext support, org.w3c.dom.Element targetElement) throws TransformerException { StylesheetRoot sroot = this.getStylesheetRoot(); return (null != sroot) ? sroot.shouldStripWhiteSpace(support, targetElement) :false; }
// in src/org/apache/xalan/templates/ElemCopy.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode); short nodeType = dtm.getNodeType(sourceNode); if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType)) { SerializationHandler rthandler = transformer.getSerializationHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // TODO: Process the use-attribute-sets stuff ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, rthandler, false); if (DTM.ELEMENT_NODE == nodeType) { super.execute(transformer); SerializerUtils.processNSDecls(rthandler, sourceNode, nodeType, dtm); transformer.executeChildTemplates(this, true); String ns = dtm.getNamespaceURI(sourceNode); String localName = dtm.getLocalName(sourceNode); transformer.getResultTreeHandler().endElement(ns, localName, dtm.getNodeName(sourceNode)); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); super.execute(transformer); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { xctxt.popCurrentNode(); } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Call compose on each param no matter if this is apply-templates // or call templates. int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.compose(sroot); } if ((null != m_templateName) && (null == m_template)) { m_template = this.getStylesheetRoot().getTemplateComposed(m_templateName); if (null == m_template) { String themsg = XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[] { m_templateName }); throw new TransformerException(themsg, this); //"Could not find template named: '"+templateName+"'"); } length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.m_index = -1; // Find the position of the param in the template being called, // and set the index of the param slot. int etePos = 0; for (ElemTemplateElement ete = m_template.getFirstChildElem(); null != ete; ete = ete.getNextSiblingElem()) { if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE) { ElemParam ep = (ElemParam)ete; if(ep.getName().equals(ewp.getName())) { ewp.m_index = etePos; } } else break; etePos++; } } } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.endCompose(sroot); } super.endCompose(sroot); }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (null != m_template) { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); int thisframe = vars.getStackFrame(); int nextFrame = vars.link(m_template.m_frameSize); // We have to clear the section of the stack frame that has params // so that the default param evaluation will work correctly. if(m_template.m_inArgsSize > 0) { vars.clearLocalSlots(0, m_template.m_inArgsSize); if(null != m_paramElems) { int currentNode = xctxt.getCurrentNode(); vars.setStackFrame(thisframe); int size = m_paramElems.length; for (int i = 0; i < size; i++) { ElemWithParam ewp = m_paramElems[i]; if(ewp.m_index >= 0) { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(ewp); XObject obj = ewp.getValue(transformer, currentNode); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(ewp); // Note here that the index for ElemWithParam must have been // statically made relative to the xsl:template being called, // NOT this xsl:template. vars.setLocalVariable(ewp.m_index, obj, nextFrame); } } vars.setStackFrame(nextFrame); } } SourceLocator savedLocator = xctxt.getSAXLocator(); try { xctxt.setSAXLocator(m_template); // template.executeChildTemplates(transformer, sourceNode, mode, true); transformer.pushElemTemplateElement(m_template); m_template.execute(transformer); } finally { transformer.popElemTemplateElement(); xctxt.setSAXLocator(savedLocator); // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(thisframe); } } else { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_TEMPLATE_NOT_FOUND, new Object[]{ m_templateName }); //"Could not find template named: '"+templateName+"'"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemVariable.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); XObject var = getValue(transformer, sourceNode); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemVariable.java
public XObject getValue(TransformerImpl transformer, int sourceNode) throws TransformerException { XObject var; XPathContext xctxt = transformer.getXPathContext(); xctxt.pushCurrentNode(sourceNode); try { if (null != m_selectPattern) { var = m_selectPattern.execute(xctxt, sourceNode, this); var.allowDetachToRelease(false); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectPattern, var); } else if (null == getFirstChildElem()) { var = XString.EMPTYSTRING; } else { // Use result tree fragment. // Global variables may be deferred (see XUnresolvedVariable) and hence // need to be assigned to a different set of DTMs than local variables // so they aren't popped off the stack on return from a template. int df; // Bugzilla 7118: A variable set via an RTF may create local // variables during that computation. To keep them from overwriting // variables at this level, push a new variable stack. ////// PROBLEM: This is provoking a variable-used-before-set ////// problem in parameters. Needs more study. try { //////////xctxt.getVarStack().link(0); if(m_parentNode instanceof Stylesheet) // Global variable df = transformer.transformToGlobalRTF(this); else df = transformer.transformToRTF(this); } finally{ //////////////xctxt.getVarStack().unlink(); } var = new XRTreeFrag(df, xctxt, this); } } finally { xctxt.popCurrentNode(); } return var; }
// in src/org/apache/xalan/templates/ElemVariable.java
public void compose(StylesheetRoot sroot) throws TransformerException { // See if we can reduce an RTF to a select with a string expression. if(null == m_selectPattern && sroot.getOptimizer()) { XPath newSelect = rewriteChildToExpression(this); if(null != newSelect) m_selectPattern = newSelect; } StylesheetRoot.ComposeState cstate = sroot.getComposeState(); // This should be done before addVariableName, so we don't have visibility // to the variable now being defined. java.util.Vector vnames = cstate.getVariableNames(); if(null != m_selectPattern) m_selectPattern.fixupVariables(vnames, cstate.getGlobalsSize()); // Only add the variable if this is not a global. If it is a global, // it was already added by stylesheet root. if(!(m_parentNode instanceof Stylesheet) && m_qname != null) { m_index = cstate.addVariableName(m_qname) - cstate.getGlobalsSize(); } else if (m_parentNode instanceof Stylesheet) { // If this is a global, then we need to treat it as if it's a xsl:template, // and count the number of variables it contains. So we set the count to // zero here. cstate.resetStackFrameSize(); } // This has to be done after the addVariableName, so that the variable // pushed won't be immediately popped again in endCompose. super.compose(sroot); }
// in src/org/apache/xalan/templates/ElemVariable.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { super.endCompose(sroot); if(m_parentNode instanceof Stylesheet) { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); m_frameSize = cstate.getFrameSize(); cstate.resetStackFrameSize(); } }
// in src/org/apache/xalan/templates/ElemVariable.java
static XPath rewriteChildToExpression(ElemTemplateElement varElem) throws TransformerException { ElemTemplateElement t = varElem.getFirstChildElem(); // Down the line this can be done with multiple string objects using // the concat function. if (null != t && null == t.getNextSiblingElem()) { int etype = t.getXSLToken(); if (Constants.ELEMNAME_VALUEOF == etype) { ElemValueOf valueof = (ElemValueOf) t; // %TBD% I'm worried about extended attributes here. if (valueof.getDisableOutputEscaping() == false && valueof.getDOMBackPointer() == null) { varElem.m_firstChild = null; return new XPath(new XRTreeFragSelectWrapper(valueof.getSelect().getExpression())); } } else if (Constants.ELEMNAME_TEXTLITERALRESULT == etype) { ElemTextLiteral lit = (ElemTextLiteral) t; if (lit.getDisableOutputEscaping() == false && lit.getDOMBackPointer() == null) { String str = lit.getNodeValue(); XString xstr = new XString(str); varElem.m_firstChild = null; return new XPath(new XRTreeFragSelectWrapper(xstr)); } } } return null; }
// in src/org/apache/xalan/templates/KeyDeclaration.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_matchPattern) m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); if(null != m_use) m_use.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemAttribute.java
protected String resolvePrefix(SerializationHandler rhandler, String prefix, String nodeNamespace) throws TransformerException { if (null != prefix && (prefix.length() == 0 || prefix.equals("xmlns"))) { // Since we can't use default namespace, in this case we try and // see if a prefix has already been defined or this namespace. prefix = rhandler.getPrefix(nodeNamespace); // System.out.println("nsPrefix: "+nsPrefix); if (null == prefix || prefix.length() == 0 || prefix.equals("xmlns")) { if(nodeNamespace.length() > 0) { NamespaceMappings prefixMapping = rhandler.getNamespaceMappings(); prefix = prefixMapping.generateNextPrefix(); } else prefix = ""; } } return prefix; }
// in src/org/apache/xalan/templates/ElemAttribute.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { if(null != nodeName && nodeName.length() > 0) { SerializationHandler rhandler = transformer.getSerializationHandler(); // Evaluate the value of this attribute String val = transformer.transformToString(this); try { // Let the result tree handler add the attribute and its String value. String localName = QName.getLocalPart(nodeName); if(prefix != null && prefix.length() > 0){ rhandler.addAttribute(nodeNamespace, localName, nodeName, "CDATA", val, true); }else{ rhandler.addAttribute("", localName, nodeName, "CDATA", val, true); } } catch (SAXException e) { } } }
// in src/org/apache/xalan/templates/ElemComment.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); transformer.getResultTreeHandler().comment(data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); m_selectExpression.fixupVariables(cstate.getVariableNames(), cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); XObject value = m_selectExpression.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectExpression, value); SerializationHandler handler = transformer.getSerializationHandler(); if (null != value) { int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); // Copy the tree. DTMTreeWalker tw = new TreeWalker2Result(transformer, handler); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = xctxt.getDTMManager().getDTM(pos); short t = dtm.getNodeType(pos); // If we just copy the whole document, a startDoc and endDoc get // generated, so we need to only walk the child nodes. if (t == DTM.DOCUMENT_NODE) { for (int child = dtm.getFirstChild(pos); child != DTM.NULL; child = dtm.getNextSibling(child)) { tw.traverse(child); } } else if (t == DTM.ATTRIBUTE_NODE) { SerializerUtils.addAttribute(handler, pos); } else { tw.traverse(pos); } } // nl.detach(); break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( handler, value, transformer.getXPathContext()); break; default : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; } } // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endSelect", m_selectExpression, value); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExsltFuncResult.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext context = transformer.getXPathContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // Verify that result has not already been set by another result // element. Recursion is allowed: intermediate results are cleared // in the owner ElemExsltFunction execute(). if (transformer.currentFuncResultSeen()) { throw new TransformerException("An EXSLT function cannot set more than one result!"); } int sourceNode = context.getCurrentNode(); // Set the return value; XObject var = getValue(transformer, sourceNode); transformer.popCurrentFuncResult(); transformer.pushCurrentFuncResult(var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemIf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_test) m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemIf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); if (transformer.getDebug()) { XObject test = m_test.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "test", m_test, test); // xsl:for-each now fires one trace event + one for every // iteration; changing xsl:if to fire one regardless of true/false if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (test.bool()) { transformer.executeChildTemplates(this, true); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endTest", m_test, test); } else if (m_test.bool(xctxt, sourceNode, this)) { transformer.executeChildTemplates(this, true); } }
// in src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
public boolean matches(XPathContext xctxt, int targetNode, QName mode) throws TransformerException { double score = m_stepPattern.getMatchScore(xctxt, targetNode); return (XPath.MATCH_SCORE_NONE != score) && matchModes(mode, m_template.getMode()); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
public void execute( TransformerImpl transformer) throws TransformerException { try { SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) { // flush any pending cached processing before the trace event. rth.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } rth.characters(m_ch, 0, m_ch.length); if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } } }
// in src/org/apache/xalan/templates/ElemVariablePsuedo.java
public void execute(TransformerImpl transformer) throws TransformerException { // if (TransformerImpl.S_DEBUG) // transformer.getTraceManager().fireTraceEvent(this); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, m_lazyVar); }
// in src/org/apache/xalan/templates/ElemUnknown.java
private void executeFallbacks( TransformerImpl transformer) throws TransformerException { for (ElemTemplateElement child = m_firstChild; child != null; child = child.m_nextSibling) { if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) { try { transformer.pushElemTemplateElement(child); ((ElemFallback) child).executeFallback(transformer); } finally { transformer.popElemTemplateElement(); } } } }
// in src/org/apache/xalan/templates/ElemUnknown.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { // do nothing } } catch (TransformerException e) { transformer.getErrorListener().fatalError(e); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void recompose(StylesheetRoot root) throws TransformerException { root.recomposeOutput(this); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void copyFrom(OutputProperties opsrc) throws TransformerException { // Bugzilla 6157: recover from xsl:output statements // checkDuplicates(opsrc); copyFrom(opsrc.getProperties()); }
// in src/org/apache/xalan/templates/ElemMessage.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); String data = transformer.transformToString(this); transformer.getMsgMgr().message(this, data, m_terminate); if(m_terminate) transformer.getErrorListener().fatalError(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); //"Stylesheet directed termination")); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static void switchSerializerIfHTML( TransformerImpl transformer, String ns, String localName) throws TransformerException { if (null == transformer) return; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)) return; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = transformer.getOutputFormat().getProperties(); // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); try { // Serializer oldSerializer = transformer.getSerializer(); Serializer oldSerializer = null; if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = oldSerializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } // transformer.setSerializer(serializer); ContentHandler ch = serializer.asContentHandler(); transformer.setContentHandler(ch); } } catch (java.io.IOException e) { throw new TransformerException(e); } } }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static Serializer switchSerializerIfHTML( String ns, String localName, Properties props, Serializer oldSerializer) throws TransformerException { Serializer newSerializer = oldSerializer; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != getOutputPropertyNoDefault(OutputKeys.METHOD, props)) return newSerializer; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = props; // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); // try { if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = serializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } newSerializer = serializer; } } // catch (java.io.IOException e) // { // throw new TransformerException(e); // } } return newSerializer; }
// in src/org/apache/xalan/transformer/NodeSorter.java
public void sort(DTMIterator v, Vector keys, XPathContext support) throws javax.xml.transform.TransformerException { m_keys = keys; // QuickSort2(v, 0, v.size() - 1 ); int n = v.getLength(); // %OPT% Change mergesort to just take a DTMIterator? // We would also have to adapt DTMIterator to have the function // of NodeCompareElem. // Create a vector of node compare elements // based on the input vector of nodes Vector nodes = new Vector(); for (int i = 0; i < n; i++) { NodeCompareElem elem = new NodeCompareElem(v.item(i)); nodes.addElement(elem); } Vector scratchVector = new Vector(); mergesort(nodes, scratchVector, 0, n - 1, support); // return sorted vector of nodes for (int i = 0; i < n; i++) { v.setItem(((NodeCompareElem) nodes.elementAt(i)).m_node, i); } v.setCurrentPos(0); // old code... //NodeVector scratchVector = new NodeVector(n); //mergesort(v, scratchVector, 0, n - 1, support); }
// in src/org/apache/xalan/transformer/NodeSorter.java
int compare( NodeCompareElem n1, NodeCompareElem n2, int kIndex, XPathContext support) throws TransformerException { int result = 0; NodeSortKey k = (NodeSortKey) m_keys.elementAt(kIndex); if (k.m_treatAsNumbers) { double n1Num, n2Num; if (kIndex == 0) { n1Num = ((Double) n1.m_key1Value).doubleValue(); n2Num = ((Double) n2.m_key1Value).doubleValue(); } else if (kIndex == 1) { n1Num = ((Double) n1.m_key2Value).doubleValue(); n2Num = ((Double) n2.m_key2Value).doubleValue(); } /* Leave this in case we decide to use an array later if (kIndex < maxkey) { double n1Num = (double)n1.m_keyValue[kIndex]; double n2Num = (double)n2.m_keyValue[kIndex]; }*/ else { // Get values dynamically XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node, k.m_namespaceContext); XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node, k.m_namespaceContext); n1Num = r1.num(); // Can't use NaN for compare. They are never equal. Use zero instead. // That way we can keep elements in document order. //n1Num = Double.isNaN(d) ? 0.0 : d; n2Num = r2.num(); //n2Num = Double.isNaN(d) ? 0.0 : d; } if ((n1Num == n2Num) && ((kIndex + 1) < m_keys.size())) { result = compare(n1, n2, kIndex + 1, support); } else { double diff; if (Double.isNaN(n1Num)) { if (Double.isNaN(n2Num)) diff = 0.0; else diff = -1; } else if (Double.isNaN(n2Num)) diff = 1; else diff = n1Num - n2Num; // process order parameter result = (int) ((diff < 0.0) ? (k.m_descending ? 1 : -1) : (diff > 0.0) ? (k.m_descending ? -1 : 1) : 0); } } // end treat as numbers else { CollationKey n1String, n2String; if (kIndex == 0) { n1String = (CollationKey) n1.m_key1Value; n2String = (CollationKey) n2.m_key1Value; } else if (kIndex == 1) { n1String = (CollationKey) n1.m_key2Value; n2String = (CollationKey) n2.m_key2Value; } /* Leave this in case we decide to use an array later if (kIndex < maxkey) { String n1String = (String)n1.m_keyValue[kIndex]; String n2String = (String)n2.m_keyValue[kIndex]; }*/ else { // Get values dynamically XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node, k.m_namespaceContext); XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node, k.m_namespaceContext); n1String = k.m_col.getCollationKey(r1.str()); n2String = k.m_col.getCollationKey(r2.str()); } // Use collation keys for faster compare, but note that whitespaces // etc... are treated differently from if we were comparing Strings. result = n1String.compareTo(n2String); //Process caseOrder parameter if (k.m_caseOrderUpper) { String tempN1 = n1String.getSourceString().toLowerCase(); String tempN2 = n2String.getSourceString().toLowerCase(); if (tempN1.equals(tempN2)) { //java defaults to upper case is greater. result = result == 0 ? 0 : -result; } } //Process order parameter if (k.m_descending) { result = -result; } } //end else if (0 == result) { if ((kIndex + 1) < m_keys.size()) { result = compare(n1, n2, kIndex + 1, support); } } if (0 == result) { // I shouldn't have to do this except that there seems to // be a glitch in the mergesort // if(r1.getType() == r1.CLASS_NODESET) // { DTM dtm = support.getDTM(n1.m_node); // %OPT% result = dtm.isNodeAfter(n1.m_node, n2.m_node) ? -1 : 1; // } } return result; }
// in src/org/apache/xalan/transformer/NodeSorter.java
void mergesort(Vector a, Vector b, int l, int r, XPathContext support) throws TransformerException { if ((r - l) > 0) { int m = (r + l) / 2; mergesort(a, b, l, m, support); mergesort(a, b, m + 1, r, support); int i, j, k; for (i = m; i >= l; i--) { // b[i] = a[i]; // Use insert if we need to increment vector size. if (i >= b.size()) b.insertElementAt(a.elementAt(i), i); else b.setElementAt(a.elementAt(i), i); } i = l; for (j = (m + 1); j <= r; j++) { // b[r+m+1-j] = a[j]; if (r + m + 1 - j >= b.size()) b.insertElementAt(a.elementAt(j), r + m + 1 - j); else b.setElementAt(a.elementAt(j), r + m + 1 - j); } j = r; int compVal; for (k = l; k <= r; k++) { // if(b[i] < b[j]) if (i == j) compVal = -1; else compVal = compare((NodeCompareElem) b.elementAt(i), (NodeCompareElem) b.elementAt(j), 0, support); if (compVal < 0) { // a[k]=b[i]; a.setElementAt(b.elementAt(i), k); i++; } else if (compVal > 0) { // a[k]=b[j]; a.setElementAt(b.elementAt(j), k); j--; } } } }
// in src/org/apache/xalan/transformer/StackGuard.java
public void checkForInfinateLoop() throws TransformerException { int nTemplates = m_transformer.getCurrentTemplateElementsCount(); if(nTemplates < m_recursionLimit) return; if(m_recursionLimit <= 0) return; // Safety check. // loop from the top index down to the recursion limit (I don't think // there's any need to go below that). for (int i = (nTemplates - 1); i >= m_recursionLimit; i--) { ElemTemplate template = getNextMatchOrNamedTemplate(i); if(null == template) break; int loopCount = countLikeTemplates(template, i); if (loopCount >= m_recursionLimit) { // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+ // ", template "+((null == template.getName()) ? "name = " : "match = ")+ // ((null != template.getName()) ? template.getName().toString() // : template.getMatch().getPatternString())); String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null); Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs, ((null != template.getName()) ? template.getName().toString() : template.getMatch().getPatternString()) }; String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs); throw new TransformerException(msg); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
void setExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { try { if (sroot.getExtensions() != null) m_extensionsTable = new ExtensionsTable(sroot); } catch (javax.xml.transform.TransformerException te) {te.printStackTrace();} }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { return getExtensionsTable().functionAvailable(ns, funcName); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { return getExtensionsTable().elementAvailable(ns, elemName); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException {//System.out.println("TransImpl.extFunction() " + ns + " " + funcName +" " + getExtensionsTable()); return getExtensionsTable().extFunction(ns, funcName, argVec, methodKey, getXPathContext().getExpressionContext()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { return getExtensionsTable().extFunction(extFunction, argVec, getXPathContext().getExpressionContext()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source) throws TransformerException { transform(source, true); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source, boolean shouldRelease) throws TransformerException { try { // Patch for bugzilla #13863. If we don't reset the namespaceContext // then we will get a NullPointerException if transformer is reused // (for stylesheets that use xsl:key). Not sure if this should go // here or in reset(). -is if(getXPathContext().getNamespaceContext() == null){ getXPathContext().setNamespaceContext(getStylesheet()); } String base = source.getSystemId(); // If no systemID of the source, use the base of the stylesheet. if(null == base) { base = m_stylesheetRoot.getBaseIdentifier(); } // As a last resort, use the current user dir. if(null == base) { String currentDir = ""; try { currentDir = System.getProperty("user.dir"); } catch (SecurityException se) {}// user.dir not accessible from applet if (currentDir.startsWith(java.io.File.separator)) base = "file://" + currentDir; else base = "file:///" + currentDir; base = base + java.io.File.separatorChar + source.getClass().getName(); } setBaseURLOfSource(base); DTMManager mgr = m_xcontext.getDTMManager(); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e) { fatalError(e); } } DTM dtm = mgr.getDTM(source, false, this, true, true); dtm.setDocumentBaseURI(base); boolean hardDelete = true; // %REVIEW% I have to think about this. -sb try { // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, look at dtm.getDocumentRoot(nodeHandle). this.transformNode(dtm.getDocument()); } finally { if (shouldRelease) mgr.release(dtm, hardDelete); } // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). // reader.parse( xmlSource ); // This has to be done to catch exceptions thrown from // the transform thread spawned by the STree handler. Exception e = getExceptionThrown(); if (null != e) { if (e instanceof javax.xml.transform.TransformerException) { throw (javax.xml.transform.TransformerException) e; } else if (e instanceof org.apache.xml.utils.WrappedRuntimeException) { fatalError( ((org.apache.xml.utils.WrappedRuntimeException) e).getException()); } else { throw new javax.xml.transform.TransformerException(e); } } else if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); } // Patch attributed to David Eisenberg <david@catcode.com> catch (org.xml.sax.SAXParseException spe) { fatalError(spe); } catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); } finally { m_hasTransformThreadErrorCatcher = false; // This looks to be redundent to the one done in TransformNode. reset(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
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)); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler(Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget, getOutputFormat()); return xoh; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source xmlSource, Result outputTarget) throws TransformerException { transform(xmlSource, outputTarget, true); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source xmlSource, Result outputTarget, boolean shouldRelease) throws TransformerException { synchronized (m_reentryGuard) { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transform(xmlSource, shouldRelease); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transformNode(int node, Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transformNode(node); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transformNode(int node) throws TransformerException { //dml setExtensionsTable(getStylesheet()); // Make sure we're not writing to the same output content handler. synchronized (m_serializationHandler) { m_hasBeenReset = false; XPathContext xctxt = getXPathContext(); DTM dtm = xctxt.getDTM(node); try { pushGlobalVars(node); // ========== // Give the top-level templates a chance to pass information into // the context (this is mainly for setting up tables for extensions). StylesheetRoot stylesheet = this.getStylesheet(); int n = stylesheet.getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = stylesheet.getGlobalImport(i); int includedCount = imported.getIncludeCountComposed(); for (int j = -1; j < includedCount; j++) { Stylesheet included = imported.getIncludeComposed(j); included.runtimeInit(this); for (ElemTemplateElement child = included.getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { child.runtimeInit(this); } } } // =========== // System.out.println("Calling applyTemplateToNode - "+Thread.currentThread().getName()); DTMIterator dtmIter = new org.apache.xpath.axes.SelfIteratorNoPredicate(); dtmIter.setRoot(node, xctxt); xctxt.pushContextNodeList(dtmIter); try { this.applyTemplateToNode(null, null, node); } finally { xctxt.popContextNodeList(); } // m_stylesheetRoot.getStartRule().execute(this); // System.out.println("Done with applyTemplateToNode - "+Thread.currentThread().getName()); if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } } finally { this.reset(); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
protected void pushGlobalVars(int contextNode) throws TransformerException { XPathContext xctxt = m_xcontext; VariableStack vs = xctxt.getVarStack(); StylesheetRoot sr = getStylesheet(); Vector vars = sr.getVariablesAndParamsComposed(); int i = vars.size(); vs.link(i); while (--i >= 0) { ElemVariable v = (ElemVariable) vars.elementAt(i); // XObject xobj = v.getValue(this, contextNode); XObject xobj = new XUnresolvedVariable(v, contextNode, this, vs.getStackFrame(), 0, true); if(null == vs.elementAt(i)) vs.setGlobalVariable(i, xobj); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public int transformToRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public int transformToGlobalRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getGlobalRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
private int transformToRTF(ElemTemplateElement templateParent,DTM dtmFrag) throws TransformerException { XPathContext xctxt = m_xcontext; ContentHandler rtfHandler = dtmFrag.getContentHandler(); // Obtain the ResultTreeFrag's root node. // NOTE: In SAX2RTFDTM, this value isn't available until after // the startDocument has been issued, so assignment has been moved // down a bit in the code. int resultFragment; // not yet reliably = dtmFrag.getDocument(); // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // And make a new handler for the RTF. ToSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(rtfHandler); h.setTransformer(this); // Replace the old handler (which was already saved) m_serializationHandler = h; // use local variable for the current handler SerializationHandler rth = m_serializationHandler; try { rth.startDocument(); // startDocument is "bottlenecked" in RTH. We need it acted upon immediately, // to set the DTM's state as in-progress, so that if the xsl:variable's body causes // further RTF activity we can keep that from bashing this DTM. rth.flushPending(); try { // Do the transformation of the child elements. executeChildTemplates(templateParent, true); // Make sure everything is flushed! rth.flushPending(); // Get the document ID. May not exist until the RTH has not only // received, but flushed, the startDocument, and may be invalid // again after the document has been closed (still debating that) // ... so waiting until just before the end seems simplest/safest. resultFragment = dtmFrag.getDocument(); } finally { rth.endDocument(); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { // Restore the previous result tree handler. this.m_serializationHandler = savedRTreeHandler; } return resultFragment; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean applyTemplateToNode(ElemTemplateElement xslInstruction, // xsl:apply-templates or xsl:for-each ElemTemplate template, int child) throws TransformerException { DTM dtm = m_xcontext.getDTM(child); short nodeType = dtm.getNodeType(child); boolean isDefaultTextRule = false; boolean isApplyImports = false; isApplyImports = ((xslInstruction == null) ? false : xslInstruction.getXSLToken() == Constants.ELEMNAME_APPLY_IMPORTS); if (null == template || isApplyImports) { int maxImportLevel, endImportLevel=0; if (isApplyImports) { maxImportLevel = template.getStylesheetComposed().getImportCountComposed() - 1; endImportLevel = template.getStylesheetComposed().getEndImportCountComposed(); } else { maxImportLevel = -1; } // If we're trying an xsl:apply-imports at the top level (ie there are no // imported stylesheets), we need to indicate that there is no matching template. // The above logic will calculate a maxImportLevel of -1 which indicates // that we should find any template. This is because a value of -1 for // maxImportLevel has a special meaning. But we don't want that. // We want to match -no- templates. See bugzilla bug 1170. if (isApplyImports && (maxImportLevel == -1)) { template = null; } else { // Find the XSL template that is the best match for the // element. XPathContext xctxt = m_xcontext; try { xctxt.pushNamespaceContext(xslInstruction); QName mode = this.getMode(); if (isApplyImports) template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, maxImportLevel, endImportLevel, m_quietConflictWarnings, dtm); else template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, m_quietConflictWarnings, dtm); } finally { xctxt.popNamespaceContext(); } } // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = m_stylesheetRoot.getDefaultRule(); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : case DTM.ATTRIBUTE_NODE : template = m_stylesheetRoot.getDefaultTextRule(); isDefaultTextRule = true; break; case DTM.DOCUMENT_NODE : template = m_stylesheetRoot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. return false; } } } // If we are processing the default text rule, then just clone // the value directly to the result tree. try { pushElemTemplateElement(template); m_xcontext.pushCurrentNode(child); pushPairCurrentMatched(template, child); // Fix copy copy29 test. if (!isApplyImports) { DTMIterator cnl = new org.apache.xpath.NodeSetDTM(child, m_xcontext.getDTMManager()); m_xcontext.pushContextNodeList(cnl); } if (isDefaultTextRule) { switch (nodeType) { case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : ClonerToResultTree.cloneToResultTree(child, nodeType, dtm, getResultTreeHandler(), false); break; case DTM.ATTRIBUTE_NODE : dtm.dispatchCharactersEvents(child, getResultTreeHandler(), false); break; } } else { // Fire a trace event for the template. if (m_debug) getTraceManager().fireTraceEvent(template); // And execute the child templates. // 9/11/00: If template has been compiled, hand off to it // since much (most? all?) of the processing has been inlined. // (It would be nice if there was a single entry point that // worked for both... but the interpretive system works by // having the Tranformer execute the children, while the // compiled obviously has to run its own code. It's // also unclear that "execute" is really the right name for // that entry point.) m_xcontext.setSAXLocator(template); // m_xcontext.getVarStack().link(); m_xcontext.getVarStack().link(template.m_frameSize); executeChildTemplates(template, true); if (m_debug) getTraceManager().fireTraceEndEvent(template); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); } return true; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler) throws TransformerException { XPathContext xctxt = m_xcontext; try { if(null != mode) pushMode(mode); xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler); } finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, boolean shouldAddAttrs) throws TransformerException { // Does this element have any children? ElemTemplateElement t = elem.getFirstChildElem(); if (null == t) return; if(elem.hasTextLitOnly() && m_optimizer) { char[] chars = ((ElemTextLiteral)t).getChars(); try { // Have to push stuff on for tooling... this.pushElemTemplateElement(t); m_serializationHandler.characters(chars, 0, chars.length); } catch(SAXException se) { throw new TransformerException(se); } finally { this.popElemTemplateElement(); } return; } // // Check for infinite loops if we have to. // boolean check = (m_stackGuard.m_recursionLimit > -1); // // if (check) // getStackGuard().push(elem, xctxt.getCurrentNode()); XPathContext xctxt = m_xcontext; xctxt.pushSAXLocatorNull(); int currentTemplateElementsTop = m_currentTemplateElements.size(); m_currentTemplateElements.push(null); try { // Loop through the children of the template, calling execute on // each of them. for (; t != null; t = t.getNextSiblingElem()) { if (!shouldAddAttrs && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE) continue; xctxt.setSAXLocator(t); m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop); t.execute(this); } } catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; } finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); } // Check for infinite loops if we have to // if (check) // getStackGuard().pop(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, ContentHandler handler) throws TransformerException { SerializationHandler xoh = this.getSerializationHandler(); // These may well not be the same! In this case when calling // the Redirect extension, it has already set the ContentHandler // in the Transformer. SerializationHandler savedHandler = xoh; try { xoh.flushPending(); // %REVIEW% Make sure current node is being pushed. LexicalHandler lex = null; if (handler instanceof LexicalHandler) { lex = (LexicalHandler) handler; } m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding()); m_serializationHandler.setTransformer(this); executeChildTemplates(elem, true); } catch (TransformerException e) { throw e; } catch (SAXException se) { throw new TransformerException(se); } finally { m_serializationHandler = savedHandler; } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Vector processSortKeys(ElemForEach foreach, int sourceNodeContext) throws TransformerException { Vector keys = null; XPathContext xctxt = m_xcontext; int nElems = foreach.getSortElemCount(); if (nElems > 0) keys = new Vector(); // March backwards, collecting the sort keys. for (int i = 0; i < nElems; i++) { ElemSort sort = foreach.getSortElem(i); if (m_debug) getTraceManager().fireTraceEvent(sort); String langString = (null != sort.getLang()) ? sort.getLang().evaluate(xctxt, sourceNodeContext, foreach) : null; String dataTypeString = sort.getDataType().evaluate(xctxt, sourceNodeContext, foreach); if (dataTypeString.indexOf(":") >= 0) System.out.println( "TODO: Need to write the hooks for QNAME sort data type"); else if (!(dataTypeString.equalsIgnoreCase(Constants.ATTRVAL_DATATYPE_TEXT)) &&!(dataTypeString.equalsIgnoreCase( Constants.ATTRVAL_DATATYPE_NUMBER))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_DATATYPE, dataTypeString }); boolean treatAsNumbers = ((null != dataTypeString) && dataTypeString.equals( Constants.ATTRVAL_DATATYPE_NUMBER)) ? true : false; String orderString = sort.getOrder().evaluate(xctxt, sourceNodeContext, foreach); if (!(orderString.equalsIgnoreCase(Constants.ATTRVAL_ORDER_ASCENDING)) &&!(orderString.equalsIgnoreCase( Constants.ATTRVAL_ORDER_DESCENDING))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_ORDER, orderString }); boolean descending = ((null != orderString) && orderString.equals( Constants.ATTRVAL_ORDER_DESCENDING)) ? true : false; AVT caseOrder = sort.getCaseOrder(); boolean caseOrderUpper; if (null != caseOrder) { String caseOrderString = caseOrder.evaluate(xctxt, sourceNodeContext, foreach); if (!(caseOrderString.equalsIgnoreCase(Constants.ATTRVAL_CASEORDER_UPPER)) &&!(caseOrderString.equalsIgnoreCase( Constants.ATTRVAL_CASEORDER_LOWER))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_CASEORDER, caseOrderString }); caseOrderUpper = ((null != caseOrderString) && caseOrderString.equals( Constants.ATTRVAL_CASEORDER_UPPER)) ? true : false; } else { caseOrderUpper = false; } keys.addElement(new NodeSortKey(this, sort.getSelect(), treatAsNumbers, descending, langString, caseOrderUpper, foreach)); if (m_debug) getTraceManager().fireTraceEndEvent(sort); } return keys; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeFromSnapshot(TransformSnapshot ts) throws TransformerException { ElemTemplateElement template = getMatchedTemplate(); int child = getMatchedNode(); pushElemTemplateElement(template); //needed?? m_xcontext.pushCurrentNode(child); //needed?? this.executeChildTemplates(template, true); // getResultTreeHandler()); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException { ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) { errHandler.warning(new TransformerException(msg, srcLctr)); } else { if (terminate) throw new TransformerException(msg, srcLctr); else System.out.println(msg); } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, String msg) throws TransformerException { warn(srcLctr, null, null, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, String msg, Object[] args) throws TransformerException { warn(srcLctr, null, null, msg, args); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg) throws TransformerException { warn(srcLctr, styleNode, sourceNode, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.warning(new TransformerException(formattedMsg, srcLctr)); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg) throws TransformerException { error(srcLctr, null, null, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object[] args) throws TransformerException { error(srcLctr, null, null, msg, args); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Exception e) throws TransformerException { error(srcLctr, msg, null, e); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object args[], Exception e) throws TransformerException { //msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg; String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg) throws TransformerException { error(srcLctr, styleNode, sourceNode, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
public static void cloneToResultTree(int node, int nodeType, DTM dtm, SerializationHandler rth, boolean shouldCloneAttributes) throws TransformerException { try { switch (nodeType) { case DTM.TEXT_NODE : dtm.dispatchCharactersEvents(node, rth, false); break; case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.DOCUMENT_NODE : // Can't clone a document, but refrain from throwing an error // so that copy-of will work break; case DTM.ELEMENT_NODE : { // Note: SAX apparently expects "no namespace" to be // represented as "" rather than null. String ns = dtm.getNamespaceURI(node); if (ns==null) ns=""; String localName = dtm.getLocalName(node); // rth.startElement(ns, localName, dtm.getNodeNameX(node), null); // don't call a real SAX startElement (as commented out above), // call a SAX-like startElement, to be able to add attributes after this call rth.startElement(ns, localName, dtm.getNodeNameX(node)); // If outputting attrs as separate events, they must // _follow_ the startElement event. (Think of the // xsl:attribute directive.) if (shouldCloneAttributes) { SerializerUtils.addAttributes(rth, node); SerializerUtils.processNSDecls(rth, node, nodeType, dtm); } } break; case DTM.CDATA_SECTION_NODE : rth.startCDATA(); dtm.dispatchCharactersEvents(node, rth, false); rth.endCDATA(); break; case DTM.ATTRIBUTE_NODE : SerializerUtils.addAttribute(rth, node); break; case DTM.NAMESPACE_NODE: // %REVIEW% Normally, these should have been handled with element. // It's possible that someone may write a stylesheet that tries to // clone them explicitly. If so, we need the equivalent of // rth.addAttribute(). SerializerUtils.processNSDecls(rth,node,DTM.NAMESPACE_NODE,dtm); break; case DTM.COMMENT_NODE : XMLString xstr = dtm.getStringValue (node); xstr.dispatchAsComment(rth); break; case DTM.ENTITY_REFERENCE_NODE : rth.entityReference(dtm.getNodeNameX(node)); break; case DTM.PROCESSING_INSTRUCTION_NODE : { // %REVIEW% Is the node name the same as the "target"? rth.processingInstruction(dtm.getNodeNameX(node), dtm.getNodeValue(node)); } break; default : //"Can not create item in result tree: "+node.getNodeName()); throw new TransformerException( "Can't clone node: "+dtm.getNodeName(node)); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/transformer/CountersTable.java
public int countNode(XPathContext support, ElemNumber numberElem, int node) throws TransformerException { int count = 0; Vector counters = getCounters(numberElem); int nCounters = counters.size(); // XPath countMatchPattern = numberElem.getCountMatchPattern(support, node); // XPath fromMatchPattern = numberElem.m_fromMatchPattern; int target = numberElem.getTargetNode(support, node); if (DTM.NULL != target) { for (int i = 0; i < nCounters; i++) { Counter counter = (Counter) counters.elementAt(i); count = counter.getPreviouslyCounted(support, target); if (count > 0) return count; } // In the loop below, we collect the nodes in backwards doc order, so // we don't have to do inserts, but then we store the nodes in forwards // document order, so we don't have to insert nodes into that list, // so that's what the appendBtoFList stuff is all about. In cases // of forward counting by one, this will mean a single node copy from // the backwards list (m_newFound) to the forwards list (counter.m_countNodes). count = 0; if (m_newFound == null) m_newFound = new NodeSetDTM(support.getDTMManager()); for (; DTM.NULL != target; target = numberElem.getPreviousNode(support, target)) { // First time in, we should not have to check for previous counts, // since the original target node was already checked in the // block above. if (0 != count) { for (int i = 0; i < nCounters; i++) { Counter counter = (Counter) counters.elementAt(i); int cacheLen = counter.m_countNodes.size(); if ((cacheLen > 0) && (counter.m_countNodes.elementAt(cacheLen - 1) == target)) { count += (cacheLen + counter.m_countNodesStartCount); if (cacheLen > 0) appendBtoFList(counter.m_countNodes, m_newFound); m_newFound.removeAllElements(); return count; } } } m_newFound.addElement(target); count++; } // If we got to this point, then we didn't find a counter, so make // one and add it to the list. Counter counter = new Counter(numberElem, new NodeSetDTM(support.getDTMManager())); m_countersMade++; // for diagnostics appendBtoFList(counter.m_countNodes, m_newFound); m_newFound.removeAllElements(); counters.addElement(counter); } return count; }
// in src/org/apache/xalan/transformer/KeyManager.java
public XNodeSet getNodeSetDTMByKey( XPathContext xctxt, int doc, QName name, XMLString ref, PrefixResolver nscontext) throws javax.xml.transform.TransformerException { XNodeSet nl = null; ElemTemplateElement template = (ElemTemplateElement) nscontext; // yuck -sb if ((null != template) && null != template.getStylesheetRoot().getKeysComposed()) { boolean foundDoc = false; if (null == m_key_tables) { m_key_tables = new Vector(4); } else { int nKeyTables = m_key_tables.size(); for (int i = 0; i < nKeyTables; i++) { KeyTable kt = (KeyTable) m_key_tables.elementAt(i); if (kt.getKeyTableName().equals(name) && doc == kt.getDocKey()) { nl = kt.getNodeSetDTMByKey(name, ref); if (nl != null) { foundDoc = true; break; } } } } if ((null == nl) &&!foundDoc /* && m_needToBuildKeysTable */) { KeyTable kt = new KeyTable(doc, nscontext, name, template.getStylesheetRoot().getKeysComposed(), xctxt); m_key_tables.addElement(kt); if (doc == kt.getDocKey()) { foundDoc = true; nl = kt.getNodeSetDTMByKey(name, ref); } } } return nl; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
private void createResultContentHandler(Result outputTarget) throws TransformerException { if (outputTarget instanceof SAXResult) { SAXResult saxResult = (SAXResult) outputTarget; m_resultContentHandler = saxResult.getHandler(); m_resultLexicalHandler = saxResult.getLexicalHandler(); if (m_resultContentHandler instanceof Serializer) { // Dubious but needed, I think. m_serializer = (Serializer) m_resultContentHandler; } } else if (outputTarget instanceof DOMResult) { DOMResult domResult = (DOMResult) outputTarget; Node outputNode = domResult.getNode(); Node nextSibling = domResult.getNextSibling(); Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (Node.DOCUMENT_NODE == type) ? (Document) outputNode : outputNode.getOwnerDocument(); } else { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); if (m_isSecureProcessing) { try { dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.newDocument(); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder domBuilder = (Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) domBuilder.setNextSibling(nextSibling); m_resultContentHandler = domBuilder; m_resultLexicalHandler = domBuilder; } else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { Serializer serializer = SerializerFactory.getSerializer(m_outputFormat.getProperties()); m_serializer = serializer; if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) { fileURL = fileURL.substring(8); } else { fileURL = fileURL.substring(7); } } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) { fileURL = fileURL.substring(6); } else { fileURL = fileURL.substring(5); } } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); m_resultContentHandler = serializer.asContentHandler(); } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " // + outputTarget.getClass().getName() // + "!"); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof DeclHandler) m_resultDeclHandler = (DeclHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void addAttribute(SerializationHandler handler, int attr) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(attr); if (SerializerUtils.isDefinedNSDecl(handler, attr, dtm)) return; String ns = dtm.getNamespaceURI(attr); if (ns == null) ns = ""; // %OPT% ...can I just store the node handle? try { handler.addAttribute( ns, dtm.getLocalName(attr), dtm.getNodeName(attr), "CDATA", dtm.getNodeValue(attr), false); } catch (SAXException e) { // do something? } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void addAttributes(SerializationHandler handler, int src) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(src); for (int node = dtm.getFirstAttribute(src); DTM.NULL != node; node = dtm.getNextAttribute(node)) { addAttribute(handler, node); } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void processNSDecls( SerializationHandler handler, int src, int type, DTM dtm) throws TransformerException { try { if (type == DTM.ELEMENT_NODE) { for (int namespace = dtm.getFirstNamespaceNode(src, true); DTM.NULL != namespace; namespace = dtm.getNextNamespaceNode(src, namespace, true)) { // String prefix = dtm.getPrefix(namespace); String prefix = dtm.getNodeNameX(namespace); String desturi = handler.getNamespaceURIFromPrefix(prefix); // String desturi = getURI(prefix); String srcURI = dtm.getNodeValue(namespace); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } else if (type == DTM.NAMESPACE_NODE) { String prefix = dtm.getNodeNameX(src); // Brian M. - some changes here to get desturi String desturi = handler.getNamespaceURIFromPrefix(prefix); String srcURI = dtm.getNodeValue(src); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEvent( int sourceNode, ElemTemplateElement styleNode, String attributeName, XPath xpath, XObject selection) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { Node source = getDOMNodeFromDTM(sourceNode); fireSelectedEvent(new SelectionEvent(m_transformer, source, styleNode, attributeName, xpath, selection)); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEndEvent( int sourceNode, ElemTemplateElement styleNode, String attributeName, XPath xpath, XObject selection) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { Node source = getDOMNodeFromDTM(sourceNode); fireSelectedEndEvent(new EndSelectionEvent(m_transformer, source, styleNode, attributeName, xpath, selection)); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEndEvent(EndSelectionEvent se) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { int nListeners = m_traceListeners.size(); for (int i = 0; i < nListeners; i++) { TraceListener tl = (TraceListener) m_traceListeners.elementAt(i); if(tl instanceof TraceListenerEx) ((TraceListenerEx)tl).selectEnd(se); } } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEvent(SelectionEvent se) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { int nListeners = m_traceListeners.size(); for (int i = 0; i < nListeners; i++) { TraceListener tl = (TraceListener) m_traceListeners.elementAt(i); tl.selected(se); } } }
// in src/org/apache/xalan/trace/PrintTraceListener.java
public void selected(SelectionEvent ev) throws javax.xml.transform.TransformerException { 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); } if (locator != null) m_pw.println( "Selected source node '" + sourceNode.getNodeName() + "', at " + locator); else m_pw.println( "Selected source node '" + sourceNode.getNodeName() + "'"); if (ev.m_styleNode.getLineNumber() == 0) { // You may not have line numbers if the selection is occuring from a // default template. ElemTemplateElement parent = (ElemTemplateElement) ete.getParentElem(); if (parent == ete.getStylesheetRoot().getDefaultRootRule()) { m_pw.print("(default root rule) "); } else if ( parent == ete.getStylesheetRoot().getDefaultTextRule()) { m_pw.print("(default text rule) "); } else if (parent == ete.getStylesheetRoot().getDefaultRule()) { m_pw.print("(default rule) "); } m_pw.print( ete.getNodeName() + ", " + ev.m_attributeName + "='" + ev.m_xpath.getPatternString() + "': "); } else { m_pw.print( ev.m_styleNode.getSystemId() + " Line #" + ev.m_styleNode.getLineNumber() + ", " + "Column #" + ev.m_styleNode.getColumnNumber() + ": " + ete.getNodeName() + ", " + ev.m_attributeName + "='" + ev.m_xpath.getPatternString() + "': "); } if (ev.m_selection.getType() == ev.m_selection.CLASS_NODESET) { m_pw.println(); org.apache.xml.dtm.DTMIterator nl = ev.m_selection.iter(); // The following lines are added to fix bug#16222. // The main cause is that the following loop change the state of iterator, which is shared // with the transformer. The fix is that we record the initial state before looping, then // restore the state when we finish it, which is done in the following lines added. int currentPos = DTM.NULL; currentPos = nl.getCurrentPos(); nl.setShouldCacheNodes(true); // This MUST be done before we clone the iterator! org.apache.xml.dtm.DTMIterator clone = null; // End of block try { clone = nl.cloneWithReset(); } catch (CloneNotSupportedException cnse) { m_pw.println( " [Can't trace nodelist because it it threw a CloneNotSupportedException]"); return; } int pos = clone.nextNode(); if (DTM.NULL == pos) { m_pw.println(" [empty node list]"); } else { while (DTM.NULL != pos) { // m_pw.println(" " + ev.m_processor.getXPathContext().getDTM(pos).getNode(pos)); DTM dtm = ev.m_processor.getXPathContext().getDTM(pos); m_pw.print(" "); m_pw.print(Integer.toHexString(pos)); m_pw.print(": "); m_pw.println(dtm.getNodeName(pos)); pos = clone.nextNode(); } } // Restore the initial state of the iterator, part of fix for bug#16222. nl.runTo(-1); nl.setCurrentPos(currentPos); // End of fix for bug#16222 } else { m_pw.println(ev.m_selection.str()); } } }
// in src/org/apache/xalan/trace/PrintTraceListener.java
public void selectEnd(EndSelectionEvent ev) throws javax.xml.transform.TransformerException { // Nothing for right now. }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/lib/Redirect.java
public SerializationHandler createSerializationHandler( TransformerImpl transformer, FileOutputStream ostream, File file, OutputProperties format) throws java.io.IOException, TransformerException { SerializationHandler serializer = transformer.createSerializationHandler( new StreamResult(ostream), format); return serializer; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.equals("new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = null; if (methodKey != null) c = (Constructor) getFromCache(methodKey, null, methodArgs); if (c != null && !trans.getDebug()) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } c = MethodResolver.getConstructor(m_classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else { int resolveType; Object targetObject = null; methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = null; if (methodKey != null) m = (Method) getFromCache(methodKey, null, methodArgs); if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); if (Modifier.isStatic(m.getModifiers())) return m.invoke(null, convertedArgs[0]); else { // This is tricky. We get the actual number of target arguments (excluding any // ExpressionContext). If we passed in the same number, we need the implied object. int nTargetArgs = convertedArgs[0].length; if (ExpressionContext.class.isAssignableFrom(paramTypes[0])) nTargetArgs--; if (methodArgs.length <= nTargetArgs) return m.invoke(m_defaultInstance, convertedArgs[0]); else { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); return m.invoke(targetObject, convertedArgs[0]); } } } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } if (args.size() > 0) { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); if (m_classObj.isAssignableFrom(targetObject.getClass())) resolveType = MethodResolver.DYNAMIC; else resolveType = MethodResolver.STATIC_AND_INSTANCE; } else { targetObject = null; resolveType = MethodResolver.STATIC_AND_INSTANCE; } m = MethodResolver.getMethod(m_classObj, funcName, methodArgs, convertedArgs, exprContext, resolveType); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (MethodResolver.DYNAMIC == resolveType) { // First argument was object type if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } else // First arg was not object. See if we need the implied object. { if (Modifier.isStatic(m.getModifiers())) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { if (null == m_defaultInstance) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, m_defaultInstance, convertedArgs[0]); Object result; try { result = m.invoke(m_defaultInstance, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); } return result; } else return m.invoke(m_defaultInstance, convertedArgs[0]); } } } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
public ExtensionHandler launch() throws TransformerException { ExtensionHandler handler = null; try { Class cl = ExtensionHandler.getClassForName(m_handlerClass); Constructor con = null; //System.out.println("class " + cl + " " + m_args + " " + m_args.length + " " + m_sig); if (m_sig != null) con = cl.getConstructor(m_sig); else // Pick the constructor based on number of args. { Constructor[] cons = cl.getConstructors(); for (int i = 0; i < cons.length; i ++) { if (cons[i].getParameterTypes().length == m_args.length) { con = cons[i]; break; } } } // System.out.println("constructor " + con); if (con != null) handler = (ExtensionHandler)con.newInstance(m_args); else throw new TransformerException("ExtensionHandler constructor not found"); } catch (Exception e) { throw new TransformerException(e); } return handler; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { boolean isAvailable = false; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (extNS != null) isAvailable = extNS.isFunctionAvailable(funcName); } return isAvailable; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { boolean isAvailable = false; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (extNS != null) // defensive isAvailable = extNS.isElementAvailable(elemName); } return isAvailable; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { String className; String methodName; Class classObj; Object targetObject; int lastDot = funcName.lastIndexOf('.'); Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.endsWith(".new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = (methodKey != null) ? (Constructor) getFromCache(methodKey, null, methodArgs) : null; if (c != null) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } c = MethodResolver.getConstructor(classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else if (-1 != lastDot) { // Handle static method call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, null, methodArgs) : null; if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(null, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); methodName = funcName.substring(lastDot + 1); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } m = MethodResolver.getMethod(classObj, methodName, methodArgs, convertedArgs, exprContext, MethodResolver.STATIC_ONLY); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { // Handle instance method call if (args.size() < 1) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INSTANCE_MTHD_CALL_REQUIRES, new Object[]{funcName })); //"Instance method call to method " + funcName //+ " requires an Object instance as first argument"); } targetObject = args.get(0); if (targetObject instanceof XObject) // Next level down for XObjects targetObject = ((XObject) targetObject).object(); methodArgs = new Object[args.size() - 1]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i+1); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, targetObject, methodArgs) : null; if (m != null) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(targetObject, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } classObj = targetObject.getClass(); m = MethodResolver.getMethod(classObj, funcName, methodArgs, convertedArgs, exprContext, MethodResolver.INSTANCE_ONLY); if (methodKey != null) putToCache(methodKey, targetObject, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] argArray; try { argArray = new Object[args.size()]; for (int i = 0; i < argArray.length; i++) { Object o = args.get(i); argArray[i] = (o instanceof XObject) ? ((XObject) o).object() : o; o = argArray[i]; if(null != o && o instanceof DTMIterator) { argArray[i] = new DTMNodeList((DTMIterator)o); } } if (m_engineCall == null) { m_engineCall = m_engine.getClass().getMethod("call", new Class[]{ Object.class, String.class, Object[].class }); } return m_engineCall.invoke(m_engine, new Object[]{ null, funcName, argArray }); } catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException {}
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { throw new TransformerException("This method should not be called."); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { // Find the template which invokes this EXSLT function. ExpressionNode parent = extFunction.exprGetParent(); while (parent != null && !(parent instanceof ElemTemplate)) { parent = parent.exprGetParent(); } ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null; XObject[] methodArgs; methodArgs = new XObject[args.size()]; try { for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = XObject.create(args.get(i)); } ElemExsltFunction elemFunc = getFunction(extFunction.getFunctionName()); if (null != elemFunc) { XPathContext context = exprContext.getXPathContext(); TransformerImpl transformer = (TransformerImpl)context.getOwnerObject(); transformer.pushCurrentFuncResult(null); elemFunc.execute(transformer, methodArgs); XObject val = (XObject)transformer.popCurrentFuncResult(); return (val == null) ? new XString("") // value if no result element. : val; } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_FUNCTION_NOT_FOUND, new Object[] {extFunction.getFunctionName()})); } } catch (TransformerException e) { throw e; } catch (Exception e) { throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static void convertParams(Object[] argsIn, Object[][] argsOut, Class[] paramTypes, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { // System.out.println("In convertParams"); if (paramTypes == null) argsOut[0] = null; else { int nParams = paramTypes.length; argsOut[0] = new Object[nParams]; int paramIndex = 0; if((nParams > 0) && ExpressionContext.class.isAssignableFrom(paramTypes[0])) { argsOut[0][0] = exprContext; // System.out.println("Incrementing paramIndex in convertParams: "+paramIndex); paramIndex++; } if (argsIn != null) { for(int i = argsIn.length - nParams + paramIndex ; paramIndex < nParams; i++, paramIndex++) { // System.out.println("paramTypes[i]: "+paramTypes[i]); argsOut[0][paramIndex] = convert(argsIn[i], paramTypes[paramIndex]); } } } }
// in src/org/apache/xalan/extensions/MethodResolver.java
static Object convert(Object xsltObj, Class javaClass) throws javax.xml.transform.TransformerException { if(xsltObj instanceof XObject) { XObject xobj = ((XObject)xsltObj); int xsltClassType = xobj.getType(); switch(xsltClassType) { case XObject.CLASS_NULL: return null; case XObject.CLASS_BOOLEAN: { if(javaClass == java.lang.String.class) return xobj.str(); else return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } // break; Unreachable case XObject.CLASS_NUMBER: { if(javaClass == java.lang.String.class) return xobj.str(); else if(javaClass == Boolean.TYPE) return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; else { return convertDoubleToNumber(xobj.num(), javaClass); } } // break; Unreachable case XObject.CLASS_STRING: { if((javaClass == java.lang.String.class) || (javaClass == java.lang.Object.class)) return xobj.str(); else if(javaClass == Character.TYPE) { String str = xobj.str(); if(str.length() > 0) return new Character(str.charAt(0)); else return null; // ?? } else if(javaClass == Boolean.TYPE) return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; else { return convertDoubleToNumber(xobj.num(), javaClass); } } // break; Unreachable case XObject.CLASS_RTREEFRAG: { // GLP: I don't see the reason for the isAssignableFrom call // instead of an == test as is used everywhere else. // Besides, if the javaClass is a subclass of NodeIterator // the condition will be true and we'll create a NodeIterator // which may not match the javaClass, causing a RuntimeException. // if((NodeIterator.class.isAssignableFrom(javaClass)) || if ( (javaClass == NodeIterator.class) || (javaClass == java.lang.Object.class) ) { DTMIterator dtmIter = ((XRTreeFrag) xobj).asNodeIterator(); return new DTMNodeIterator(dtmIter); } else if (javaClass == NodeList.class) { return ((XRTreeFrag) xobj).convertToNodeset(); } // Same comment as above // else if(Node.class.isAssignableFrom(javaClass)) else if(javaClass == Node.class) { DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator(); int rootHandle = iter.nextNode(); DTM dtm = iter.getDTM(rootHandle); return dtm.getNode(dtm.getFirstChild(rootHandle)); } else if(javaClass == java.lang.String.class) { return xobj.str(); } else if(javaClass == Boolean.TYPE) { return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } else if(javaClass.isPrimitive()) { return convertDoubleToNumber(xobj.num(), javaClass); } else { DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator(); int rootHandle = iter.nextNode(); DTM dtm = iter.getDTM(rootHandle); Node child = dtm.getNode(dtm.getFirstChild(rootHandle)); if(javaClass.isAssignableFrom(child.getClass())) return child; else return null; } } // break; Unreachable case XObject.CLASS_NODESET: { // GLP: I don't see the reason for the isAssignableFrom call // instead of an == test as is used everywhere else. // Besides, if the javaClass is a subclass of NodeIterator // the condition will be true and we'll create a NodeIterator // which may not match the javaClass, causing a RuntimeException. // if((NodeIterator.class.isAssignableFrom(javaClass)) || if ( (javaClass == NodeIterator.class) || (javaClass == java.lang.Object.class) ) { return xobj.nodeset(); } // Same comment as above // else if(NodeList.class.isAssignableFrom(javaClass)) else if(javaClass == NodeList.class) { return xobj.nodelist(); } // Same comment as above // else if(Node.class.isAssignableFrom(javaClass)) else if(javaClass == Node.class) { // Xalan ensures that iter() always returns an // iterator positioned at the beginning. DTMIterator ni = xobj.iter(); int handle = ni.nextNode(); if (handle != DTM.NULL) return ni.getDTM(handle).getNode(handle); // may be null. else return null; } else if(javaClass == java.lang.String.class) { return xobj.str(); } else if(javaClass == Boolean.TYPE) { return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } else if(javaClass.isPrimitive()) { return convertDoubleToNumber(xobj.num(), javaClass); } else { DTMIterator iter = xobj.iter(); int childHandle = iter.nextNode(); DTM dtm = iter.getDTM(childHandle); Node child = dtm.getNode(childHandle); if(javaClass.isAssignableFrom(child.getClass())) return child; else return null; } } // break; Unreachable // No default:, fall-through on purpose } // end switch xsltObj = xobj.object(); } // end if if(xsltObj instanceof XObject) // At this point, we have a raw java object, not an XObject. if (null != xsltObj) { if(javaClass == java.lang.String.class) { return xsltObj.toString(); } else if(javaClass.isPrimitive()) { // Assume a number conversion XString xstr = new XString(xsltObj.toString()); double num = xstr.num(); return convertDoubleToNumber(num, javaClass); } else if(javaClass == java.lang.Class.class) { return xsltObj.getClass(); } else { // Just pass the object directly, and hope for the best. return xsltObj; } } else { // Just pass the object directly, and hope for the best. return xsltObj; } }
// in src/org/apache/xpath/XPath.java
public XObject execute( XPathContext xctxt, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { return execute( xctxt, xctxt.getDTMHandleFromNode(contextNode), namespaceContext); }
// in src/org/apache/xpath/XPath.java
public XObject execute( XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { xctxt.pushNamespaceContext(namespaceContext); xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XObject xobj = null; try { xobj = m_mainExp.execute(xctxt); } catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; } catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; } finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } return xobj; }
// in src/org/apache/xpath/XPath.java
public boolean bool( XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { xctxt.pushNamespaceContext(namespaceContext); xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); try { return m_mainExp.bool(xctxt); } catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; } catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; } finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } return false; }
// in src/org/apache/xpath/XPath.java
public double getMatchScore(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { xctxt.pushCurrentNode(context); xctxt.pushCurrentExpressionNode(context); try { XObject score = m_mainExp.execute(xctxt); if (DEBUG_MATCHES) { DTM dtm = xctxt.getDTM(context); System.out.println("score: " + score.num() + " for " + dtm.getNodeName(context) + " for xpath " + this.getPatternString()); } return score.num(); } finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); } // return XPath.MATCH_SCORE_NONE; }
// in src/org/apache/xpath/XPath.java
public void warn( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator())); } }
// in src/org/apache/xpath/XPath.java
public void error( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { 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()); } }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(int index, int frame) throws TransformerException { index += frame; XObject val = _stackFrames[index]; return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public boolean isLocalSet(int index) throws TransformerException { return (_stackFrames[index + _currentFrameBottom] != null); }
// in src/org/apache/xpath/VariableStack.java
public XObject getGlobalVariable(XPathContext xctxt, final int index) throws TransformerException { XObject val = _stackFrames[index]; // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getGlobalVariable(XPathContext xctxt, final int index, boolean destructiveOK) throws TransformerException { XObject val = _stackFrames[index]; // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public XObject getVariableOrParam( XPathContext xctxt, org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver prefixResolver = xctxt.getNamespaceContext(); // Get the current ElemTemplateElement, which must be pushed in as the // prefix resolver, and then walk backwards in document order, searching // for an xsl:param element or xsl:variable element that matches our // qname. If we reach the top level, use the StylesheetRoot's composed // list of top level variables and parameters. if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement) { org.apache.xalan.templates.ElemVariable vvar; org.apache.xalan.templates.ElemTemplateElement prev = (org.apache.xalan.templates.ElemTemplateElement) prefixResolver; if (!(prev instanceof org.apache.xalan.templates.Stylesheet)) { while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) ) { org.apache.xalan.templates.ElemTemplateElement savedprev = prev; while (null != (prev = prev.getPreviousSiblingElem())) { if (prev instanceof org.apache.xalan.templates.ElemVariable) { vvar = (org.apache.xalan.templates.ElemVariable) prev; if (vvar.getName().equals(qname)) return getLocalVariable(xctxt, vvar.getIndex()); } } prev = savedprev.getParentElem(); } } vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname); if (null != vvar) return getGlobalVariable(xctxt, vvar.getIndex()); } throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname); }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression compile(int opPos) throws TransformerException { int op = getOp(opPos); Expression expr = null; // System.out.println(getPatternString()+"op: "+op); switch (op) { case OpCodes.OP_XPATH : expr = compile(opPos + 2); break; case OpCodes.OP_OR : expr = or(opPos); break; case OpCodes.OP_AND : expr = and(opPos); break; case OpCodes.OP_NOTEQUALS : expr = notequals(opPos); break; case OpCodes.OP_EQUALS : expr = equals(opPos); break; case OpCodes.OP_LTE : expr = lte(opPos); break; case OpCodes.OP_LT : expr = lt(opPos); break; case OpCodes.OP_GTE : expr = gte(opPos); break; case OpCodes.OP_GT : expr = gt(opPos); break; case OpCodes.OP_PLUS : expr = plus(opPos); break; case OpCodes.OP_MINUS : expr = minus(opPos); break; case OpCodes.OP_MULT : expr = mult(opPos); break; case OpCodes.OP_DIV : expr = div(opPos); break; case OpCodes.OP_MOD : expr = mod(opPos); break; // case OpCodes.OP_QUO : // expr = quo(opPos); break; case OpCodes.OP_NEG : expr = neg(opPos); break; case OpCodes.OP_STRING : expr = string(opPos); break; case OpCodes.OP_BOOL : expr = bool(opPos); break; case OpCodes.OP_NUMBER : expr = number(opPos); break; case OpCodes.OP_UNION : expr = union(opPos); break; case OpCodes.OP_LITERAL : expr = literal(opPos); break; case OpCodes.OP_VARIABLE : expr = variable(opPos); break; case OpCodes.OP_GROUP : expr = group(opPos); break; case OpCodes.OP_NUMBERLIT : expr = numberlit(opPos); break; case OpCodes.OP_ARGUMENT : expr = arg(opPos); break; case OpCodes.OP_EXTFUNCTION : expr = compileExtension(opPos); break; case OpCodes.OP_FUNCTION : expr = compileFunction(opPos); break; case OpCodes.OP_LOCATIONPATH : expr = locationPath(opPos); break; case OpCodes.OP_PREDICATE : expr = null; break; // should never hit this here. case OpCodes.OP_MATCHPATTERN : expr = matchPattern(opPos + 2); break; case OpCodes.OP_LOCATIONPATHPATTERN : expr = locationPathPattern(opPos); break; case OpCodes.OP_QUO: error(XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ "quo" }); //"ERROR! Unknown op code: "+m_opMap[opPos]); break; default : error(XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ Integer.toString(getOp(opPos)) }); //"ERROR! Unknown op code: "+m_opMap[opPos]); } // if(null != expr) // expr.setSourceLocator(m_locator); return expr; }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileOperation(Operation operation, int opPos) throws TransformerException { int leftPos = getFirstChildPos(opPos); int rightPos = getNextOpPos(leftPos); operation.setLeftRight(compile(leftPos), compile(rightPos)); return operation; }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileUnary(UnaryOperation unary, int opPos) throws TransformerException { int rightPos = getFirstChildPos(opPos); unary.setRight(compile(rightPos)); return unary; }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression or(int opPos) throws TransformerException { return compileOperation(new Or(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression and(int opPos) throws TransformerException { return compileOperation(new And(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression notequals(int opPos) throws TransformerException { return compileOperation(new NotEquals(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression equals(int opPos) throws TransformerException { return compileOperation(new Equals(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression lte(int opPos) throws TransformerException { return compileOperation(new Lte(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression lt(int opPos) throws TransformerException { return compileOperation(new Lt(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression gte(int opPos) throws TransformerException { return compileOperation(new Gte(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression gt(int opPos) throws TransformerException { return compileOperation(new Gt(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression plus(int opPos) throws TransformerException { return compileOperation(new Plus(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression minus(int opPos) throws TransformerException { return compileOperation(new Minus(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression mult(int opPos) throws TransformerException { return compileOperation(new Mult(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression div(int opPos) throws TransformerException { return compileOperation(new Div(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression mod(int opPos) throws TransformerException { return compileOperation(new Mod(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression neg(int opPos) throws TransformerException { return compileUnary(new Neg(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression string(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.String(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression bool(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.Bool(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression number(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.Number(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression variable(int opPos) throws TransformerException { Variable var = new Variable(); opPos = getFirstChildPos(opPos); int nsPos = getOp(opPos); java.lang.String namespace = (OpCodes.EMPTY == nsPos) ? null : (java.lang.String) getTokenQueue().elementAt(nsPos); java.lang.String localname = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1)); QName qname = new QName(namespace, localname); var.setQName(qname); return var; }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression group(int opPos) throws TransformerException { // no-op return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression arg(int opPos) throws TransformerException { // no-op return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression union(int opPos) throws TransformerException { locPathDepth++; try { return UnionPathIterator.createUnionIterator(this, opPos); } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression locationPath(int opPos) throws TransformerException { locPathDepth++; try { DTMIterator iter = WalkerFactory.newDTMIterator(this, opPos, (locPathDepth == 0)); return (Expression)iter; // cast OK, I guess. } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression predicate(int opPos) throws TransformerException { return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression matchPattern(int opPos) throws TransformerException { locPathDepth++; try { // First, count... int nextOpPos = opPos; int i; for (i = 0; getOp(nextOpPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++) { nextOpPos = getNextOpPos(nextOpPos); } if (i == 1) return compile(opPos); UnionPattern up = new UnionPattern(); StepPattern[] patterns = new StepPattern[i]; for (i = 0; getOp(opPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++) { nextOpPos = getNextOpPos(opPos); patterns[i] = (StepPattern) compile(opPos); opPos = nextOpPos; } up.setPatterns(patterns); return up; } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression locationPathPattern(int opPos) throws TransformerException { opPos = getFirstChildPos(opPos); return stepPattern(opPos, 0, null); }
// in src/org/apache/xpath/compiler/Compiler.java
protected StepPattern stepPattern( int opPos, int stepCount, StepPattern ancestorPattern) throws TransformerException { int startOpPos = opPos; int stepType = getOp(opPos); if (OpCodes.ENDOP == stepType) { return null; } boolean addMagicSelf = true; int endStep = getNextOpPos(opPos); // int nextStepType = getOpMap()[endStep]; StepPattern pattern; // boolean isSimple = ((OpCodes.ENDOP == nextStepType) && (stepCount == 0)); int argLen; switch (stepType) { case OpCodes.OP_FUNCTION : if(DEBUG) System.out.println("MATCH_FUNCTION: "+m_currentPattern); addMagicSelf = false; argLen = getOp(opPos + OpMap.MAPINDEX_LENGTH); pattern = new FunctionPattern(compileFunction(opPos), Axis.PARENT, Axis.CHILD); break; case OpCodes.FROM_ROOT : if(DEBUG) System.out.println("FROM_ROOT, "+m_currentPattern); addMagicSelf = false; argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, Axis.PARENT, Axis.CHILD); break; case OpCodes.MATCH_ATTRIBUTE : if(DEBUG) System.out.println("MATCH_ATTRIBUTE: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(DTMFilter.SHOW_ATTRIBUTE, getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.PARENT, Axis.ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : if(DEBUG) System.out.println("MATCH_ANY_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); int what = getWhatToShow(startOpPos); // bit-o-hackery, but this code is due for the morgue anyway... if(0x00000500 == what) addMagicSelf = false; pattern = new StepPattern(getWhatToShow(startOpPos), getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.ANCESTOR, Axis.CHILD); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : if(DEBUG) System.out.println("MATCH_IMMEDIATE_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(getWhatToShow(startOpPos), getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.PARENT, Axis.CHILD); break; default : error(XPATHErrorResources.ER_UNKNOWN_MATCH_OPERATION, null); //"unknown match operation!"); return null; } pattern.setPredicates(getCompiledPredicates(opPos + argLen)); if(null == ancestorPattern) { // This is the magic and invisible "." at the head of every // match pattern, and corresponds to the current node in the context // list, from where predicates are counted. // So, in order to calculate "foo[3]", it has to count from the // current node in the context list, so, from that current node, // the full pattern is really "self::node()/child::foo[3]". If you // translate this to a select pattern from the node being tested, // which is really how we're treating match patterns, it works out to // self::foo/parent::node[child::foo[3]]", or close enough. /* if(addMagicSelf && pattern.getPredicateCount() > 0) { StepPattern selfPattern = new StepPattern(DTMFilter.SHOW_ALL, Axis.PARENT, Axis.CHILD); // We need to keep the new nodetest from affecting the score... XNumber score = pattern.getStaticScore(); pattern.setRelativePathPattern(selfPattern); pattern.setStaticScore(score); selfPattern.setStaticScore(score); }*/ } else { // System.out.println("Setting "+ancestorPattern+" as relative to "+pattern); pattern.setRelativePathPattern(ancestorPattern); } StepPattern relativePathPattern = stepPattern(endStep, stepCount + 1, pattern); return (null != relativePathPattern) ? relativePathPattern : pattern; }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression[] getCompiledPredicates(int opPos) throws TransformerException { int count = countPredicates(opPos); if (count > 0) { Expression[] predicates = new Expression[count]; compilePredicates(opPos, predicates); return predicates; } return null; }
// in src/org/apache/xpath/compiler/Compiler.java
public int countPredicates(int opPos) throws TransformerException { int count = 0; while (OpCodes.OP_PREDICATE == getOp(opPos)) { count++; opPos = getNextOpPos(opPos); } return count; }
// in src/org/apache/xpath/compiler/Compiler.java
private void compilePredicates(int opPos, Expression[] predicates) throws TransformerException { for (int i = 0; OpCodes.OP_PREDICATE == getOp(opPos); i++) { predicates[i] = predicate(opPos); opPos = getNextOpPos(opPos); } }
// in src/org/apache/xpath/compiler/Compiler.java
Expression compileFunction(int opPos) throws TransformerException { int endFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); int funcID = getOp(opPos); opPos++; if (-1 != funcID) { Function func = m_functionTable.getFunction(funcID); /** * It is a trick for function-available. Since the function table is an * instance field, insert this table at compilation time for later usage */ if (func instanceof FuncExtFunctionAvailable) ((FuncExtFunctionAvailable) func).setFunctionTable(m_functionTable); func.postCompileStep(this); try { int i = 0; for (int p = opPos; p < endFunc; p = getNextOpPos(p), i++) { // System.out.println("argPos: "+ p); // System.out.println("argCode: "+ m_opMap[p]); func.setArg(compile(p), i); } func.checkNumberArgs(i); } catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); } return func; } else { error(XPATHErrorResources.ER_FUNCTION_TOKEN_NOT_FOUND, null); //"function token not found."); return null; } }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileExtension(int opPos) throws TransformerException { int endExtFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); java.lang.String ns = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; java.lang.String funcName = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; // We create a method key to uniquely identify this function so that we // can cache the object needed to invoke it. This way, we only pay the // reflection overhead on the first call. Function extension = new FuncExtFunction(ns, funcName, String.valueOf(getNextMethodId())); try { int i = 0; while (opPos < endExtFunc) { int nextOpPos = getNextOpPos(opPos); extension.setArg(this.compile(opPos), i); opPos = nextOpPos; i++; } } catch (WrongNumberArgsException wnae) { ; // should never happen } return extension; }
// in src/org/apache/xpath/compiler/Compiler.java
public void warn(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != m_errorHandler) { m_errorHandler.warning(new TransformerException(fmsg, m_locator)); } else { System.out.println(fmsg +"; file "+m_locator.getSystemId() +"; line "+m_locator.getLineNumber() +"; column "+m_locator.getColumnNumber()); } }
// in src/org/apache/xpath/compiler/Compiler.java
public void error(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != m_errorHandler) { m_errorHandler.fatalError(new TransformerException(fmsg, m_locator)); } else { // System.out.println(te.getMessage() // +"; file "+te.getSystemId() // +"; line "+te.getLineNumber() // +"; column "+te.getColumnNumber()); throw new TransformerException(fmsg, (SAXSourceLocator)m_locator); } }
// in src/org/apache/xpath/compiler/FunctionTable.java
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
// in src/org/apache/xpath/compiler/XPathParser.java
public void initXPath( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compiler, namespaceContext, this); lexer.tokenize(expression); m_ops.setOp(0,OpCodes.OP_XPATH); m_ops.setOp(OpMap.MAPINDEX_LENGTH,2); // Patch for Christine's gripe. She wants her errorHandler to return from // a fatal error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. // // %REVIEW% Is there a better way of doing this? // %REVIEW% Are there any other cases which need the safety net? // (and if so do we care right now, or should we rewrite the XPath // grammar engine and can fix it at that time?) try { nextToken(); Expr(); if (null != m_token) { String extraTokens = ""; while (null != m_token) { extraTokens += "'" + m_token + "'"; nextToken(); if (null != m_token) extraTokens += ", "; } error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS, new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens); } } catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; } compiler.shrink(); }
// in src/org/apache/xpath/compiler/XPathParser.java
public void initMatchPattern( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compiler, namespaceContext, this); lexer.tokenize(expression); m_ops.setOp(0, OpCodes.OP_MATCHPATTERN); m_ops.setOp(OpMap.MAPINDEX_LENGTH, 2); nextToken(); Pattern(); if (null != m_token) { String extraTokens = ""; while (null != m_token) { extraTokens += "'" + m_token + "'"; nextToken(); if (null != m_token) extraTokens += ", "; } error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS, new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens); } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH)+1); m_ops.shrink(); }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(String expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected, m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
void warn(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = this.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, m_sourceLocator)); } else { // Should never happen. System.err.println(fmsg); } }
// in src/org/apache/xpath/compiler/XPathParser.java
void error(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = this.getErrorListener(); TransformerException te = new TransformerException(fmsg, m_sourceLocator); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.fatalError(te); } else { // System.err.println(fmsg); throw te; } }
// in src/org/apache/xpath/compiler/XPathParser.java
void errorForDOM3(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = this.getErrorListener(); TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.fatalError(te); } else { // System.err.println(fmsg); throw te; } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Expr() throws javax.xml.transform.TransformerException { OrExpr(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void OrExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); AndExpr(); if ((null != m_token) && tokenIs("or")) { nextToken(); insertOp(opPos, 2, OpCodes.OP_OR); OrExpr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void AndExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); EqualityExpr(-1); if ((null != m_token) && tokenIs("and")) { nextToken(); insertOp(opPos, 2, OpCodes.OP_AND); AndExpr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int EqualityExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; RelationalExpr(-1); if (null != m_token) { if (tokenIs('!') && lookahead('=', 1)) { nextToken(); nextToken(); insertOp(addPos, 2, OpCodes.OP_NOTEQUALS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = EqualityExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_EQUALS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = EqualityExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int RelationalExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; AdditiveExpr(-1); if (null != m_token) { if (tokenIs('<')) { nextToken(); if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_LTE); } else { insertOp(addPos, 2, OpCodes.OP_LT); } int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = RelationalExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('>')) { nextToken(); if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_GTE); } else { insertOp(addPos, 2, OpCodes.OP_GT); } int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = RelationalExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int AdditiveExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; MultiplicativeExpr(-1); if (null != m_token) { if (tokenIs('+')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_PLUS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = AdditiveExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('-')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MINUS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = AdditiveExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int MultiplicativeExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; UnaryExpr(); if (null != m_token) { if (tokenIs('*')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MULT); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("div")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_DIV); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("mod")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MOD); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("quo")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_QUO); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void UnaryExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean isNeg = false; if (m_tokenChar == '-') { nextToken(); appendOp(2, OpCodes.OP_NEG); isNeg = true; } UnionExpr(); if (isNeg) m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void StringExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_STRING); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void BooleanExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_BOOL); Expr(); int opLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos; if (opLen == 2) { error(XPATHErrorResources.ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, null); //"boolean(...) argument is no longer optional with 19990709 XPath draft."); } m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, opLen); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void NumberExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_NUMBER); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void UnionExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean continueOrLoop = true; boolean foundUnion = false; do { PathExpr(); if (tokenIs('|')) { if (false == foundUnion) { foundUnion = true; insertOp(opPos, 2, OpCodes.OP_UNION); } nextToken(); } else { break; } // this.m_testForDocOrder = true; } while (continueOrLoop); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void PathExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int filterExprMatch = FilterExpr(); if (filterExprMatch != FILTER_MATCH_FAILED) { // If FilterExpr had Predicates, a OP_LOCATIONPATH opcode would already // have been inserted. boolean locationPathStarted = (filterExprMatch==FILTER_MATCH_PREDICATES); if (tokenIs('/')) { nextToken(); if (!locationPathStarted) { // int locationPathOpPos = opPos; insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH); locationPathStarted = true; } if (!RelativeLocationPath()) { // "Relative location path expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_REL_LOC_PATH, null); } } // Terminate for safety. if (locationPathStarted) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } } else { LocationPath(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int FilterExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int filterMatch; if (PrimaryExpr()) { if (tokenIs('[')) { // int locationPathOpPos = opPos; insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH); while (tokenIs('[')) { Predicate(); } filterMatch = FILTER_MATCH_PREDICATES; } else { filterMatch = FILTER_MATCH_PRIMARY; } } else { filterMatch = FILTER_MATCH_FAILED; } return filterMatch; /* * if(tokenIs('[')) * { * Predicate(); * m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos; * } */ }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean PrimaryExpr() throws javax.xml.transform.TransformerException { boolean matchFound; int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if ((m_tokenChar == '\'') || (m_tokenChar == '"')) { appendOp(2, OpCodes.OP_LITERAL); Literal(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (m_tokenChar == '$') { nextToken(); // consume '$' appendOp(2, OpCodes.OP_VARIABLE); QName(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (m_tokenChar == '(') { nextToken(); appendOp(2, OpCodes.OP_GROUP); Expr(); consumeExpected(')'); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if ((null != m_token) && ((('.' == m_tokenChar) && (m_token.length() > 1) && Character.isDigit( m_token.charAt(1))) || Character.isDigit(m_tokenChar))) { appendOp(2, OpCodes.OP_NUMBERLIT); Number(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (lookahead('(', 1) || (lookahead(':', 1) && lookahead('(', 3))) { matchFound = FunctionCall(); } else { matchFound = false; } return matchFound; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Argument() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_ARGUMENT); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean FunctionCall() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (lookahead(':', 1)) { appendOp(4, OpCodes.OP_EXTFUNCTION); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_queueMark - 1); nextToken(); consumeExpected(':'); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 2, m_queueMark - 1); nextToken(); } else { int funcTok = getFunctionToken(m_token); if (-1 == funcTok) { error(XPATHErrorResources.ER_COULDNOT_FIND_FUNCTION, new Object[]{ m_token }); //"Could not find function: "+m_token+"()"); } switch (funcTok) { case OpCodes.NODETYPE_PI : case OpCodes.NODETYPE_COMMENT : case OpCodes.NODETYPE_TEXT : case OpCodes.NODETYPE_NODE : // Node type tests look like function calls, but they're not return false; default : appendOp(3, OpCodes.OP_FUNCTION); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, funcTok); } nextToken(); } consumeExpected('('); while (!tokenIs(')') && m_token != null) { if (tokenIs(',')) { error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG, null); //"Found ',' but no preceding argument!"); } Argument(); if (!tokenIs(')')) { consumeExpected(','); if (tokenIs(')')) { error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG, null); //"Found ',' but no following argument!"); } } } consumeExpected(')'); // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void LocationPath() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); // int locationPathOpPos = opPos; appendOp(2, OpCodes.OP_LOCATIONPATH); boolean seenSlash = tokenIs('/'); if (seenSlash) { appendOp(4, OpCodes.FROM_ROOT); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT); nextToken(); } else if (m_token == null) { error(XPATHErrorResources.ER_EXPECTED_LOC_PATH_AT_END_EXPR, null); } if (m_token != null) { if (!RelativeLocationPath() && !seenSlash) { // Neither a '/' nor a RelativeLocationPath - i.e., matched nothing // "Location path expected, but found "+m_token+" was encountered." error(XPATHErrorResources.ER_EXPECTED_LOC_PATH, new Object [] {m_token}); } } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean RelativeLocationPath() throws javax.xml.transform.TransformerException { if (!Step()) { return false; } while (tokenIs('/')) { nextToken(); if (!Step()) { // RelativeLocationPath can't end with a trailing '/' // "Location step expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null); } } return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean Step() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean doubleSlash = tokenIs('/'); // At most a single '/' before each Step is consumed by caller; if the // first thing is a '/', that means we had '//' and the Step must not // be empty. if (doubleSlash) { nextToken(); appendOp(2, OpCodes.FROM_DESCENDANTS_OR_SELF); // Have to fix up for patterns such as '//@foo' or '//attribute::foo', // which translate to 'descendant-or-self::node()/attribute::foo'. // notice I leave the '/' on the queue, so the next will be processed // by a regular step pattern. // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODETYPE_NODE); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); // Tell how long the step is with the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); } if (tokenIs(".")) { nextToken(); if (tokenIs('[')) { error(XPATHErrorResources.ER_PREDICATE_ILLEGAL_SYNTAX, null); //"'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead."); } appendOp(4, OpCodes.FROM_SELF); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE); } else if (tokenIs("..")) { nextToken(); appendOp(4, OpCodes.FROM_PARENT); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE); } // There is probably a better way to test for this // transition... but it gets real hairy if you try // to do it in basis(). else if (tokenIs('*') || tokenIs('@') || tokenIs('_') || (m_token!= null && Character.isLetter(m_token.charAt(0)))) { Basis(); while (tokenIs('[')) { Predicate(); } // Tell how long the entire step is. m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } else { // No Step matched - that's an error if previous thing was a '//' if (doubleSlash) { // "Location step expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null); } return false; } return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Basis() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int axesType; // The next blocks guarantee that a FROM_XXX will be added. if (lookahead("::", 1)) { axesType = AxisName(); nextToken(); nextToken(); } else if (tokenIs('@')) { axesType = OpCodes.FROM_ATTRIBUTES; appendOp(2, axesType); nextToken(); } else { axesType = OpCodes.FROM_CHILDREN; appendOp(2, axesType); } // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); NodeTest(axesType); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int AxisName() throws javax.xml.transform.TransformerException { Object val = Keywords.getAxisName(m_token); if (null == val) { error(XPATHErrorResources.ER_ILLEGAL_AXIS_NAME, new Object[]{ m_token }); //"illegal axis name: "+m_token); } int axesType = ((Integer) val).intValue(); appendOp(2, axesType); return axesType; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void NodeTest(int axesType) throws javax.xml.transform.TransformerException { if (lookahead('(', 1)) { Object nodeTestOp = Keywords.getNodeType(m_token); if (null == nodeTestOp) { error(XPATHErrorResources.ER_UNKNOWN_NODETYPE, new Object[]{ m_token }); //"Unknown nodetype: "+m_token); } else { nextToken(); int nt = ((Integer) nodeTestOp).intValue(); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), nt); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); consumeExpected('('); if (OpCodes.NODETYPE_PI == nt) { if (!tokenIs(')')) { Literal(); } } consumeExpected(')'); } } else { // Assume name of attribute or element. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODENAME); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); if (lookahead(':', 1)) { if (tokenIs('*')) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); // Minimalist check for an NCName - just check first character // to distinguish from other possible tokens if (!Character.isLetter(m_tokenChar) && !tokenIs('_')) { // "Node test that matches either NCName:* or QName was expected." error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null); } } nextToken(); consumeExpected(':'); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY); } m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); if (tokenIs('*')) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); // Minimalist check for an NCName - just check first character // to distinguish from other possible tokens if (!Character.isLetter(m_tokenChar) && !tokenIs('_')) { // "Node test that matches either NCName:* or QName was expected." error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null); } } m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Predicate() throws javax.xml.transform.TransformerException { if (tokenIs('[')) { nextToken(); PredicateExpr(); consumeExpected(']'); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void PredicateExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_PREDICATE); Expr(); // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void QName() throws javax.xml.transform.TransformerException { // Namespace if(lookahead(':', 1)) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); consumeExpected(':'); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); } // Local name m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Literal() throws javax.xml.transform.TransformerException { int last = m_token.length() - 1; char c0 = m_tokenChar; char cX = m_token.charAt(last); if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\''))) { // Mutate the token to remove the quotes and have the XString object // already made. int tokenQueuePos = m_queueMark - 1; m_ops.m_tokenQueue.setElementAt(null,tokenQueuePos); Object obj = new XString(m_token.substring(1, last)); m_ops.m_tokenQueue.setElementAt(obj,tokenQueuePos); // lit = m_token.substring(1, last); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), tokenQueuePos); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } else { error(XPATHErrorResources.ER_PATTERN_LITERAL_NEEDS_BE_QUOTED, new Object[]{ m_token }); //"Pattern literal ("+m_token+") needs to be quoted!"); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Number() throws javax.xml.transform.TransformerException { if (null != m_token) { // Mutate the token to remove the quotes and have the XNumber object // already made. double num; try { // XPath 1.0 does not support number in exp notation if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1)) throw new NumberFormatException(); num = Double.valueOf(m_token).doubleValue(); } catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); } m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Pattern() throws javax.xml.transform.TransformerException { while (true) { LocationPathPattern(); if (tokenIs('|')) { nextToken(); } else { break; } } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void LocationPathPattern() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); final int RELATIVE_PATH_NOT_PERMITTED = 0; final int RELATIVE_PATH_PERMITTED = 1; final int RELATIVE_PATH_REQUIRED = 2; int relativePathStatus = RELATIVE_PATH_NOT_PERMITTED; appendOp(2, OpCodes.OP_LOCATIONPATHPATTERN); if (lookahead('(', 1) && (tokenIs(Keywords.FUNC_ID_STRING) || tokenIs(Keywords.FUNC_KEY_STRING))) { IdKeyPattern(); if (tokenIs('/')) { nextToken(); if (tokenIs('/')) { appendOp(4, OpCodes.MATCH_ANY_ANCESTOR); nextToken(); } else { appendOp(4, OpCodes.MATCH_IMMEDIATE_ANCESTOR); } // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_FUNCTEST); relativePathStatus = RELATIVE_PATH_REQUIRED; } } else if (tokenIs('/')) { if (lookahead('/', 1)) { appendOp(4, OpCodes.MATCH_ANY_ANCESTOR); // Added this to fix bug reported by Myriam for match="//x/a" // patterns. If you don't do this, the 'x' step will think it's part // of a '//' pattern, and so will cause 'a' to be matched when it has // any ancestor that is 'x'. nextToken(); relativePathStatus = RELATIVE_PATH_REQUIRED; } else { appendOp(4, OpCodes.FROM_ROOT); relativePathStatus = RELATIVE_PATH_PERMITTED; } // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT); nextToken(); } else { relativePathStatus = RELATIVE_PATH_REQUIRED; } if (relativePathStatus != RELATIVE_PATH_NOT_PERMITTED) { if (!tokenIs('|') && (null != m_token)) { RelativePathPattern(); } else if (relativePathStatus == RELATIVE_PATH_REQUIRED) { // "A relative path pattern was expected." error(XPATHErrorResources.ER_EXPECTED_REL_PATH_PATTERN, null); } } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void IdKeyPattern() throws javax.xml.transform.TransformerException { FunctionCall(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void RelativePathPattern() throws javax.xml.transform.TransformerException { // Caller will have consumed any '/' or '//' preceding the // RelativePathPattern, so let StepPattern know it can't begin with a '/' boolean trailingSlashConsumed = StepPattern(false); while (tokenIs('/')) { nextToken(); // StepPattern() may consume first slash of pair in "a//b" while // processing StepPattern "a". On next iteration, let StepPattern know // that happened, so it doesn't match ill-formed patterns like "a///b". trailingSlashConsumed = StepPattern(!trailingSlashConsumed); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean StepPattern(boolean isLeadingSlashPermitted) throws javax.xml.transform.TransformerException { return AbbreviatedNodeTestStep(isLeadingSlashPermitted); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean AbbreviatedNodeTestStep(boolean isLeadingSlashPermitted) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int axesType; // The next blocks guarantee that a MATCH_XXX will be added. int matchTypePos = -1; if (tokenIs('@')) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); nextToken(); } else if (this.lookahead("::", 1)) { if (tokenIs("attribute")) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); } else if (tokenIs("child")) { matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } else { axesType = -1; this.error(XPATHErrorResources.ER_AXES_NOT_ALLOWED, new Object[]{ this.m_token }); } nextToken(); nextToken(); } else if (tokenIs('/')) { if (!isLeadingSlashPermitted) { // "A step was expected in the pattern, but '/' was encountered." error(XPATHErrorResources.ER_EXPECTED_STEP_PATTERN, null); } axesType = OpCodes.MATCH_ANY_ANCESTOR; appendOp(2, axesType); nextToken(); } else { matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); NodeTest(axesType); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); while (tokenIs('[')) { Predicate(); } boolean trailingSlashConsumed; // For "a//b", where "a" is current step, we need to mark operation of // current step as "MATCH_ANY_ANCESTOR". Then we'll consume the first // slash and subsequent step will be treated as a MATCH_IMMEDIATE_ANCESTOR // (unless it too is followed by '//'.) // // %REVIEW% Following is what happens today, but I'm not sure that's // %REVIEW% correct behaviour. Perhaps no valid case could be constructed // %REVIEW% where it would matter? // // If current step is on the attribute axis (e.g., "@x//b"), we won't // change the current step, and let following step be marked as // MATCH_ANY_ANCESTOR on next call instead. if ((matchTypePos > -1) && tokenIs('/') && lookahead('/', 1)) { m_ops.setOp(matchTypePos, OpCodes.MATCH_ANY_ANCESTOR); nextToken(); trailingSlashConsumed = true; } else { trailingSlashConsumed = false; } // Tell how long the entire step is. m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); return trailingSlashConsumed; }
// in src/org/apache/xpath/compiler/OpMap.java
public int getFirstPredicateOpPos(int opPos) throws javax.xml.transform.TransformerException { int stepType = m_opMap.elementAt(opPos); if ((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES)) { return opPos + m_opMap.elementAt(opPos + 2); } else if ((stepType >= OpCodes.FIRST_NODESET_OP) && (stepType <= OpCodes.LAST_NODESET_OP)) { return opPos + m_opMap.elementAt(opPos + 1); } else if(-2 == stepType) { return -2; } else { error(org.apache.xpath.res.XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ String.valueOf(stepType) }); //"ERROR! Unknown op code: "+m_opMap[opPos]); return -1; } }
// in src/org/apache/xpath/compiler/OpMap.java
public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = org.apache.xalan.res.XSLMessages.createXPATHMessage(msg, args); throw new javax.xml.transform.TransformerException(fmsg); }
// in src/org/apache/xpath/compiler/Lexer.java
void tokenize(String pat) throws javax.xml.transform.TransformerException { tokenize(pat, null); }
// in src/org/apache/xpath/compiler/Lexer.java
void tokenize(String pat, Vector targetStrings) throws javax.xml.transform.TransformerException { m_compiler.m_currentPattern = pat; m_patternMapSize = 0; // This needs to grow too. Use a conservative estimate that the OpMapVector // needs about five time the length of the input path expression - to a // maximum of MAXTOKENQUEUESIZE*5. If the OpMapVector needs to grow, grow // it freely (second argument to constructor). int initTokQueueSize = ((pat.length() < OpMap.MAXTOKENQUEUESIZE) ? pat.length() : OpMap.MAXTOKENQUEUESIZE) * 5; m_compiler.m_opMap = new OpMapVector(initTokQueueSize, OpMap.BLOCKTOKENQUEUESIZE * 5, OpMap.MAPINDEX_LENGTH); int nChars = pat.length(); int startSubstring = -1; int posOfNSSep = -1; boolean isStartOfPat = true; boolean isAttrName = false; boolean isNum = false; // Nesting of '[' so we can know if the given element should be // counted inside the m_patternMap. int nesting = 0; // char[] chars = pat.toCharArray(); for (int i = 0; i < nChars; i++) { char c = pat.charAt(i); switch (c) { case '\"' : { if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++); if (c == '\"' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE, null); //"misquoted literal... expected double quote!"); } } break; case '\'' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++); if (c == '\'' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE, null); //"misquoted literal... expected single quote!"); } break; case 0x0A : case 0x0D : case ' ' : case '\t' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } break; case '@' : isAttrName = true; // fall-through on purpose case '-' : if ('-' == c) { if (!(isNum || (startSubstring == -1))) { break; } isNum = false; } // fall-through on purpose case '(' : case '[' : case ')' : case ']' : case '|' : case '/' : case '*' : case '+' : case '=' : case ',' : case '\\' : // Unused at the moment case '^' : // Unused at the moment case '!' : // Unused at the moment case '$' : case '<' : case '>' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } else if (('/' == c) && isStartOfPat) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); } else if ('*' == c) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; } if (0 == nesting) { if ('|' == c) { if (null != targetStrings) { recordTokenString(targetStrings); } isStartOfPat = true; } } if ((')' == c) || (']' == c)) { nesting--; } else if (('(' == c) || ('[' == c)) { nesting++; } addToTokenQueue(pat.substring(i, i + 1)); break; case ':' : if (i>0) { if (posOfNSSep == (i - 1)) { if (startSubstring != -1) { if (startSubstring < (i - 1)) addToTokenQueue(pat.substring(startSubstring, i - 1)); } isNum = false; isAttrName = false; startSubstring = -1; posOfNSSep = -1; addToTokenQueue(pat.substring(i - 1, i + 1)); break; } else { posOfNSSep = i; } } // fall through on purpose default : if (-1 == startSubstring) { startSubstring = i; isNum = Character.isDigit(c); } else if (isNum) { isNum = Character.isDigit(c); } }
// in src/org/apache/xpath/compiler/Lexer.java
private int mapNSTokens(String pat, int startSubstring, int posOfNSSep, int posOfScan) throws javax.xml.transform.TransformerException { String prefix = ""; if ((startSubstring >= 0) && (posOfNSSep >= 0)) { prefix = pat.substring(startSubstring, posOfNSSep); } String uName; if ((null != m_namespaceContext) &&!prefix.equals("*") &&!prefix.equals("xmlns")) { try { if (prefix.length() > 0) uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); else { // Assume last was wildcard. This is not legal according // to the draft. Set the below to true to make namespace // wildcards work. if (false) { addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); return -1; } else { uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); } } } catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); } } else { uName = prefix; } if ((null != uName) && (uName.length() > 0)) { addToTokenQueue(uName); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); } else { // To older XPath code it doesn't matter if // error() is called or errorForDOM3(). m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; /** old code commented out 17-Sep-2004 // error("Could not locate namespace for prefix: "+prefix); // m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, // new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; */ /*** Old code commented out 10-Jan-2001 addToTokenQueue(prefix); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); ***/ } return -1; }
// in src/org/apache/xpath/objects/XObject.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return this; }
// in src/org/apache/xpath/objects/XObject.java
public double num() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number"); return 0.0; }
// in src/org/apache/xpath/objects/XObject.java
public double numWithSideEffects() throws javax.xml.transform.TransformerException { return num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean bool() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number"); return false; }
// in src/org/apache/xpath/objects/XObject.java
public boolean boolWithSideEffects() throws javax.xml.transform.TransformerException { return bool(); }
// in src/org/apache/xpath/objects/XObject.java
public DTMIterator iter() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeSetDTM mutableNodeset() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeSetDTM!"); return (NodeSetDTM) m_obj; }
// in src/org/apache/xpath/objects/XObject.java
public Object castToType(int t, XPathContext support) throws javax.xml.transform.TransformerException { Object result; switch (t) { case CLASS_STRING : result = str(); break; case CLASS_NUMBER : result = new Double(num()); break; case CLASS_NODESET : result = iter(); break; case CLASS_BOOLEAN : result = bool() ? Boolean.TRUE : Boolean.FALSE; break; case CLASS_UNKNOWN : result = m_obj; break; // %TBD% What to do here? // case CLASS_RTREEFRAG : // result = rtree(support); // break; default : error(XPATHErrorResources.ER_CANT_CONVERT_TO_TYPE, new Object[]{ getTypeString(), Integer.toString(t) }); //"Can not convert "+getTypeString()+" to a type#"+t); result = null; } return result; }
// in src/org/apache/xpath/objects/XObject.java
public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.greaterThan(this); return this.num() < obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.greaterThanOrEqual(this); return this.num() <= obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.lessThan(this); return this.num() > obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean greaterThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.lessThanOrEqual(this); return this.num() >= obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.notEquals(this); return !equals(obj2); }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg) throws javax.xml.transform.TransformerException { error(msg, null); }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR, // m_support.ERROR, // null, // null, fmsg, 0, 0); // if(shouldThrow) { throw new XPathException(fmsg, this); } }
// in src/org/apache/xpath/objects/XNumber.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_val; }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject m_selected; m_selected = ((Expression)m_obj).execute(xctxt); m_selected.allowDetachToRelease(m_allowRelease); if (m_selected.getType() == CLASS_STRING) return m_selected; else return new XString(m_selected.str()); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public double num() throws javax.xml.transform.TransformerException { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XNodeSetForDOM.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { return (m_origObj instanceof NodeIterator) ? (NodeIterator)m_origObj : super.nodeset(); }
// in src/org/apache/xpath/objects/XNodeSetForDOM.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { return (m_origObj instanceof NodeList) ? (NodeList)m_origObj : super.nodelist(); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
public double num() throws javax.xml.transform.TransformerException { XMLString s = xstr(); return s.toDouble(); }
// in src/org/apache/xpath/objects/XNodeSet.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { return new org.apache.xml.dtm.ref.DTMNodeIterator(iter()); }
// in src/org/apache/xpath/objects/XNodeSet.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { org.apache.xml.dtm.ref.DTMNodeList nodelist = new org.apache.xml.dtm.ref.DTMNodeList(this); // Creating a DTMNodeList has the side-effect that it will create a clone // XNodeSet with cache and run m_iter to the end. You cannot get any node // from m_iter after this call. As a fix, we call SetVector() on the clone's // cache. See Bugzilla 14406. XNodeSet clone = (XNodeSet)nodelist.getDTMIterator(); SetVector(clone.getVector()); return nodelist; }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean compare(XObject obj2, Comparator comparator) throws javax.xml.transform.TransformerException { boolean result = false; int type = obj2.getType(); if (XObject.CLASS_NODESET == type) { // %OPT% This should be XMLString based instead of string based... // From http://www.w3.org/TR/xpath: // If both objects to be compared are node-sets, then the comparison // will be true if and only if there is a node in the first node-set // and a node in the second node-set such that the result of performing // the comparison on the string-values of the two nodes is true. // Note this little gem from the draft: // NOTE: If $x is bound to a node-set, then $x="foo" // does not mean the same as not($x!="foo"): the former // is true if and only if some node in $x has the string-value // foo; the latter is true if and only if all nodes in $x have // the string-value foo. DTMIterator list1 = iterRaw(); DTMIterator list2 = ((XNodeSet) obj2).iterRaw(); int node1; java.util.Vector node2Strings = null; while (DTM.NULL != (node1 = list1.nextNode())) { XMLString s1 = getStringFromNode(node1); if (null == node2Strings) { int node2; while (DTM.NULL != (node2 = list2.nextNode())) { XMLString s2 = getStringFromNode(node2); if (comparator.compareStrings(s1, s2)) { result = true; break; } if (null == node2Strings) node2Strings = new java.util.Vector(); node2Strings.addElement(s2); } } else { int n = node2Strings.size(); for (int i = 0; i < n; i++) { if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i))) { result = true; break; } } } } list1.reset(); list2.reset(); } else if (XObject.CLASS_BOOLEAN == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a boolean, // then the comparison will be true if and only if the result of // performing the comparison on the boolean and on the result of // converting the node-set to a boolean using the boolean function // is true. double num1 = bool() ? 1.0 : 0.0; double num2 = obj2.num(); result = comparator.compareNumbers(num1, num2); } else if (XObject.CLASS_NUMBER == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a number, // then the comparison will be true if and only if there is a // node in the node-set such that the result of performing the // comparison on the number to be compared and on the result of // converting the string-value of that node to a number using // the number function is true. DTMIterator list1 = iterRaw(); double num2 = obj2.num(); int node; while (DTM.NULL != (node = list1.nextNode())) { double num1 = getNumberFromNode(node); if (comparator.compareNumbers(num1, num2)) { result = true; break; } } list1.reset(); } else if (XObject.CLASS_RTREEFRAG == type) { XMLString s2 = obj2.xstr(); DTMIterator list1 = iterRaw(); int node; while (DTM.NULL != (node = list1.nextNode())) { XMLString s1 = getStringFromNode(node); if (comparator.compareStrings(s1, s2)) { result = true; break; } } list1.reset(); } else if (XObject.CLASS_STRING == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a // string, then the comparison will be true if and only if there // is a node in the node-set such that the result of performing // the comparison on the string-value of the node and the other // string is true. XMLString s2 = obj2.xstr(); DTMIterator list1 = iterRaw(); int node; while (DTM.NULL != (node = list1.nextNode())) { XMLString s1 = getStringFromNode(node); if (comparator.compareStrings(s1, s2)) { result = true; break; } } list1.reset(); } else { result = comparator.compareNumbers(this.num(), obj2.num()); } return result; }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_LT); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_LTE); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_GT); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean greaterThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_GTE); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_NEQ); }
// in src/org/apache/xpath/XPathContext.java
private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException { if (!b) { ErrorListener errorHandler = getErrorListener(); if (errorHandler != null) { errorHandler.fatalError( new TransformerException( XSLMessages.createMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator())); } } }
// in src/org/apache/xpath/XPathContext.java
public final XObject getVariableOrParam(org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { return m_variableStacks.getVariableOrParam(XPathContext.this, qname); }
// in src/org/apache/xpath/functions/FuncUnparsedEntityURI.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String name = m_arg0.execute(xctxt).str(); int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int doc = dtm.getDocument(); String uri = dtm.getUnparsedEntityURI(name); return new XString(uri); }
// in src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String prefix; String namespace; String methName; String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); if (indexOfNSSep < 0) { prefix = ""; namespace = Constants.S_XSLNAMESPACEURL; methName = fullName; } else { prefix = fullName.substring(0, indexOfNSSep); namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); if (null == namespace) return XBoolean.S_FALSE; methName = fullName.substring(indexOfNSSep + 1); } if (namespace.equals(Constants.S_XSLNAMESPACEURL)) { try { if (null == m_functionTable) m_functionTable = new FunctionTable(); return m_functionTable.functionAvailable(methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } catch (Exception e) { return XBoolean.S_FALSE; } } else { //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); return extProvider.functionAvailable(namespace, methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
// in src/org/apache/xpath/functions/FuncNumber.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(getArg0AsNumber(xctxt)); }
// in src/org/apache/xpath/functions/FuncTranslate.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String theFirstString = m_arg0.execute(xctxt).str(); String theSecondString = m_arg1.execute(xctxt).str(); String theThirdString = m_arg2.execute(xctxt).str(); int theFirstStringLength = theFirstString.length(); int theThirdStringLength = theThirdString.length(); // A vector to contain the new characters. We'll use it to construct // the result string. StringBuffer sbuffer = new StringBuffer(); for (int i = 0; i < theFirstStringLength; i++) { char theCurrentChar = theFirstString.charAt(i); int theIndex = theSecondString.indexOf(theCurrentChar); if (theIndex < 0) { // Didn't find the character in the second string, so it // is not translated. sbuffer.append(theCurrentChar); } else if (theIndex < theThirdStringLength) { // OK, there's a corresponding character in the // third string, so do the translation... sbuffer.append(theThirdString.charAt(theIndex)); } else { // There's no corresponding character in the // third string, since it's shorter than the // second string. In this case, the character // is removed from the output string, so don't // do anything. } } return new XString(sbuffer.toString()); }
// in src/org/apache/xpath/functions/FuncSubstringBefore.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : new XString(s1.substring(0, index)); }
// in src/org/apache/xpath/functions/FuncString.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (XString)getArg0AsString(xctxt); }
// in src/org/apache/xpath/functions/FuncTrue.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return XBoolean.S_TRUE; }
// in src/org/apache/xpath/functions/FuncExtElementAvailable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String prefix; String namespace; String methName; String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); if (indexOfNSSep < 0) { prefix = ""; namespace = Constants.S_XSLNAMESPACEURL; methName = fullName; } else { prefix = fullName.substring(0, indexOfNSSep); namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); if (null == namespace) return XBoolean.S_FALSE; methName= fullName.substring(indexOfNSSep + 1); } if (namespace.equals(Constants.S_XSLNAMESPACEURL) || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) { try { TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject(); return transformer.getStylesheet().getAvailableElements().containsKey( new QName(namespace, methName)) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } catch (Exception e) { return XBoolean.S_FALSE; } } else { //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); return extProvider.elementAvailable(namespace, methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
// in src/org/apache/xpath/functions/Function.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // Programmer's assert. (And, no, I don't want the method to be abstract). System.out.println("Error! Function.execute should not be called!"); return null; }
// in src/org/apache/xpath/functions/FuncStringLength.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(getArg0AsString(xctxt).length()); }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = getArg0AsString(xctxt); return (XString)s1.fixWhiteSpace(true, true, false); }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { if(Arg0IsNodesetExpr()) { int node = getArg0AsNode(xctxt); if(DTM.NULL != node) { DTM dtm = xctxt.getDTM(node); dtm.dispatchCharactersEvents(node, handler, true); } } else { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); } }
// in src/org/apache/xpath/functions/FuncSubstring.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); double start = m_arg1.execute(xctxt).num(); int lenOfS1 = s1.length(); XMLString substr; if (lenOfS1 <= 0) return XString.EMPTYSTRING; else { int startIndex; if (Double.isNaN(start)) { // Double.MIN_VALUE doesn't work with math below // so just use a big number and hope I never get caught. start = -1000000; startIndex = 0; } else { start = Math.round(start); startIndex = (start > 0) ? (int) start - 1 : 0; } if (null != m_arg2) { double len = m_arg2.num(xctxt); int end = (int) (Math.round(len) + start) - 1; // Normalize end index. if (end < 0) end = 0; else if (end > lenOfS1) end = lenOfS1; if (startIndex > lenOfS1) startIndex = lenOfS1; substr = s1.substring(startIndex, end); } else { if (startIndex > lenOfS1) startIndex = lenOfS1; substr = s1.substring(startIndex); } } return (XString)substr; // cast semi-safe }
// in src/org/apache/xpath/functions/FuncBoolean.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncRound.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { final XObject obj = m_arg0.execute(xctxt); final double val= obj.num(); if (val >= -0.5 && val < 0) return new XNumber(-0.0); if (val == 0.0) return new XNumber(val); return new XNumber(java.lang.Math.floor(val + 0.5)); }
// in src/org/apache/xpath/functions/FuncLang.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String lang = m_arg0.execute(xctxt).str(); int parent = xctxt.getCurrentNode(); boolean isLang = false; DTM dtm = xctxt.getDTM(parent); while (DTM.NULL != parent) { if (DTM.ELEMENT_NODE == dtm.getNodeType(parent)) { int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang"); if (DTM.NULL != langAttr) { String langVal = dtm.getNodeValue(langAttr); // %OPT% if (langVal.toLowerCase().startsWith(lang.toLowerCase())) { int valLen = lang.length(); if ((langVal.length() == valLen) || (langVal.charAt(valLen) == '-')) { isLang = true; } } break; } } parent = dtm.getParent(parent); } return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncCount.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); // // We should probably make a function on the iterator for this, // // as a given implementation could optimize. // int i = 0; // // while (DTM.NULL != nl.nextNode()) // { // i++; // } // nl.detach(); DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); int i = nl.getLength(); nl.detach(); return new XNumber((double) i); }
// in src/org/apache/xpath/functions/FuncFalse.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); String result; String propName = ""; // List of properties where the name of the // property argument is to be looked for. Properties xsltInfo = new Properties(); loadPropertyFile(XSLT_PROPERTIES, xsltInfo); if (indexOfNSSep > 0) { String prefix = (indexOfNSSep >= 0) ? fullName.substring(0, indexOfNSSep) : ""; String namespace; namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); propName = (indexOfNSSep < 0) ? fullName : fullName.substring(indexOfNSSep + 1); if (namespace.startsWith("http://www.w3.org/XSL/Transform") || namespace.equals("http://www.w3.org/1999/XSL/Transform")) { result = xsltInfo.getProperty(propName); if (null == result) { warn(xctxt, XPATHErrorResources.WG_PROPERTY_NOT_SUPPORTED, new Object[]{ fullName }); //"XSL Property not supported: "+fullName); return XString.EMPTYSTRING; } } else { warn(xctxt, XPATHErrorResources.WG_DONT_DO_ANYTHING_WITH_NS, new Object[]{ namespace, fullName }); //"Don't currently do anything with namespace "+namespace+" in property: "+fullName); try { result = System.getProperty(propName); if (null == result) { // result = System.getenv(propName); return XString.EMPTYSTRING; } } catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; } } } else { try { result = System.getProperty(fullName); if (null == result) { // result = System.getenv(fullName); return XString.EMPTYSTRING; } } catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; } } if (propName.equals("version") && result.length() > 0) { try { // Needs to return the version number of the spec we conform to. return new XString("1.0"); } catch (Exception ex) { return new XString(result); } } else return new XString(result); }
// in src/org/apache/xpath/functions/FuncDoclocation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int whereNode = getArg0AsNode(xctxt); String fileLocation = null; if (DTM.NULL != whereNode) { DTM dtm = xctxt.getDTM(whereNode); // %REVIEW% if (DTM.DOCUMENT_FRAGMENT_NODE == dtm.getNodeType(whereNode)) { whereNode = dtm.getFirstChild(whereNode); } if (DTM.NULL != whereNode) { fileLocation = dtm.getDocumentBaseURI(); // int owner = dtm.getDocument(); // fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner); } } return new XString((null != fileLocation) ? fileLocation : ""); }
// in src/org/apache/xpath/functions/FuncCurrent.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
// in src/org/apache/xpath/functions/FuncStartsWith.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr()) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSum.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); double sum = 0.0; int pos; while (DTM.NULL != (pos = nodes.nextNode())) { DTM dtm = nodes.getDTM(pos); XMLString s = dtm.getStringValue(pos); if (null != s) sum += s.toDouble(); } nodes.detach(); return new XNumber(sum); }
// in src/org/apache/xpath/functions/FuncLocalPart.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); if(DTM.NULL == context) return XString.EMPTYSTRING; DTM dtm = xctxt.getDTM(context); String s = (context != DTM.NULL) ? dtm.getLocalName(context) : ""; if(s.startsWith("#") || s.equals("xmlns")) return XString.EMPTYSTRING; return new XString(s); }
// in src/org/apache/xpath/functions/FuncGenerateId.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int which = getArg0AsNode(xctxt); if (DTM.NULL != which) { // Note that this is a different value than in previous releases // of Xalan. It's sensitive to the exact encoding of the node // handle anyway, so fighting to maintain backward compatability // really didn't make sense; it may change again as we continue // to experiment with balancing document and node numbers within // that value. return new XString("N" + Integer.toHexString(which).toUpperCase()); } else return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/FuncId.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocument(); if (DTM.NULL == docContext) error(xctxt, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC, null); XObject arg = m_arg0.execute(xctxt); int argType = arg.getType(); XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM nodeSet = nodes.mutableNodeset(); if (XObject.CLASS_NODESET == argType) { DTMIterator ni = arg.iter(); StringVector usedrefs = null; int pos = ni.nextNode(); while (DTM.NULL != pos) { DTM ndtm = ni.getDTM(pos); String refval = ndtm.getStringValue(pos).toString(); pos = ni.nextNode(); usedrefs = getNodesByID(xctxt, docContext, refval, usedrefs, nodeSet, DTM.NULL != pos); } // ni.detach(); } else if (XObject.CLASS_NULL == argType) { return nodes; } else { String refval = arg.str(); getNodesByID(xctxt, docContext, refval, null, nodeSet, false); } return nodes; }
// in src/org/apache/xpath/functions/FuncContains.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); // Add this check for JDK consistency for empty strings. if (s1.length() == 0 && s2.length() == 0) return XBoolean.S_TRUE; int index = s1.indexOf(s2); return (index > -1) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncQname.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); XObject val; if (DTM.NULL != context) { DTM dtm = xctxt.getDTM(context); String qname = dtm.getNodeNameX(context); val = (null == qname) ? XString.EMPTYSTRING : new XString(qname); } else { val = XString.EMPTYSTRING; } return val; }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected int getArg0AsNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (null == m_arg0) ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected XMLString getArg0AsString(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(null == m_arg0) { int currentNode = xctxt.getCurrentNode(); if(DTM.NULL == currentNode) return XString.EMPTYSTRING; else { DTM dtm = xctxt.getDTM(currentNode); return dtm.getStringValue(currentNode); } } else return m_arg0.execute(xctxt).xstr(); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected double getArg0AsNumber(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(null == m_arg0) { int currentNode = xctxt.getCurrentNode(); if(DTM.NULL == currentNode) return 0; else { DTM dtm = xctxt.getDTM(currentNode); XMLString str = dtm.getStringValue(currentNode); return str.toDouble(); } } else return m_arg0.execute(xctxt).num(); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.isSecureProcessing()) throw new javax.xml.transform.TransformerException( XPATHMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] {toString()})); XObject result; Vector argVec = new Vector(); int nArgs = m_argVec.size(); for (int i = 0; i < nArgs; i++) { Expression arg = (Expression) m_argVec.elementAt(i); XObject xobj = arg.execute(xctxt); /* * Should cache the arguments for func:function */ xobj.allowDetachToRelease(false); argVec.addElement(xobj); } //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); Object val = extProvider.extFunction(this, argVec); if (null != val) { result = XObject.create(val, xctxt); } else { result = new XNull(); } return result; }
// in src/org/apache/xpath/functions/FuncConcat.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { StringBuffer sb = new StringBuffer(); // Compiler says we must have at least two arguments. sb.append(m_arg0.execute(xctxt).str()); sb.append(m_arg1.execute(xctxt).str()); if (null != m_arg2) sb.append(m_arg2.execute(xctxt).str()); if (null != m_args) { for (int i = 0; i < m_args.length; i++) { sb.append(m_args[i].execute(xctxt).str()); } } return new XString(sb.toString()); }
// in src/org/apache/xpath/functions/FuncNot.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE; }
// in src/org/apache/xpath/functions/FuncCeiling.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(Math.ceil(m_arg0.execute(xctxt).num())); }
// in src/org/apache/xpath/functions/FuncNamespace.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); String s; if(context != DTM.NULL) { DTM dtm = xctxt.getDTM(context); int t = dtm.getNodeType(context); if(t == DTM.ELEMENT_NODE) { s = dtm.getNamespaceURI(context); } else if(t == DTM.ATTRIBUTE_NODE) { // This function always returns an empty string for namespace nodes. // We check for those here. Fix inspired by Davanum Srinivas. s = dtm.getNodeName(context); if(s.startsWith("xmlns:") || s.equals("xmlns")) return XString.EMPTYSTRING; s = dtm.getNamespaceURI(context); } else return XString.EMPTYSTRING; } else return XString.EMPTYSTRING; return ((null == s) ? XString.EMPTYSTRING : new XString(s)); }
// in src/org/apache/xpath/functions/FuncSubstringAfter.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); XMLString s2 = m_arg1.execute(xctxt).xstr(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : (XString)s1.substring(index + s2.length()); }
// in src/org/apache/xpath/functions/FuncFloor.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num())); }
// in src/org/apache/xpath/functions/FuncLast.java
public int getCountOfContextNodeList(XPathContext xctxt) throws javax.xml.transform.TransformerException { // assert(null != m_contextNodeList, "m_contextNodeList must be non-null"); // If we're in a predicate, then this will return non-null. SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList(); // System.out.println("iter: "+iter); if (null != iter) return iter.getLastPos(xctxt); DTMIterator cnl = xctxt.getContextNodeList(); int count; if(null != cnl) { count = cnl.getLength(); // System.out.println("count: "+count); } else count = 0; return count; }
// in src/org/apache/xpath/functions/FuncLast.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt)); // System.out.println("last: "+xnum.num()); return xnum; }
// in src/org/apache/xpath/functions/FuncPosition.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { double pos = (double) getPositionInContextNodeList(xctxt); return new XNumber(pos); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object eval(Object item, QName returnType) throws javax.xml.transform.TransformerException { XObject resultObject = eval ( item ); return getResultAsType( resultObject, returnType ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private XObject eval ( Object contextItem ) throws javax.xml.transform.TransformerException { org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); XObject xobj = null; Node contextNode = (Node)contextItem; // We always need to have a ContextNode with Xalan XPath implementation // To allow simple expression evaluation like 1+1 we are setting // dummy Document as Context Node if ( contextNode == null ) { contextNode = getDummyDocument(); } xobj = xpath.execute(xpathSupport, contextNode, prefixResolver ); return xobj; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } // If isSupported check is already done then the execution path // shouldn't come here. Being defensive String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException ( fmsg ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, 0 ); if ( xpathFunction == null ) { return false; } return true; } catch ( Exception e ) { return false; } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { return false; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private XObject eval(String expression, Object contextItem) throws javax.xml.transform.TransformerException { org.apache.xpath.XPath xpath = new org.apache.xpath.XPath( expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } XObject xobj = null; xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); // If item is null, then we will create a a Dummy contextNode if ( contextItem instanceof Node ) { xobj = xpath.execute (xpathSupport, (Node)contextItem, prefixResolver ); } else { xobj = xpath.execute ( xpathSupport, DTM.NULL, prefixResolver ); } return xobj; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
// in src/org/apache/xpath/SourceTreeManager.java
public Source resolveURI( String base, String urlString, SourceLocator locator) throws TransformerException, IOException { Source source = null; if (null != m_uriResolver) { source = m_uriResolver.resolve(urlString, base); } if (null == source) { String uri = SystemIDResolver.getAbsoluteURI(urlString, base); source = new StreamSource(uri); } return source; }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree( String base, String urlString, SourceLocator locator, XPathContext xctxt) throws TransformerException { // System.out.println("getSourceTree"); try { Source source = this.resolveURI(base, urlString, locator); // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId()); return getSourceTree(source, locator, xctxt); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); } /* catch (TransformerException te) { throw new TransformerException(te.getMessage(), locator, te); }*/ }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { int n = getNode(source); if (DTM.NULL != n) return n; n = parseToNode(source, locator, xctxt); if (DTM.NULL != n) putDocumentInCache(n, source); return n; }
// in src/org/apache/xpath/SourceTreeManager.java
public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { try { Object xowner = xctxt.getOwnerObject(); DTM dtm; if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter) { dtm = xctxt.getDTM(source, false, (org.apache.xml.dtm.DTMWSFilter)xowner, false, true); } else { dtm = xctxt.getDTM(source, false, null, false, true); } return dtm.getDocument(); } catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
// in src/org/apache/xpath/XPathAPI.java
public static Node selectSingleNode(Node contextNode, String str) throws TransformerException { return selectSingleNode(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static Node selectSingleNode( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Have the XObject return its result as a NodeSetDTM. NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode); // Return the first node, or null return nl.nextNode(); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeIterator selectNodeIterator(Node contextNode, String str) throws TransformerException { return selectNodeIterator(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeList selectNodeList(Node contextNode, String str) throws TransformerException { return selectNodeList(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeList selectNodeList( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Return a NodeList. return list.nodelist(); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval(Node contextNode, String str) throws TransformerException { return eval(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval(Node contextNode, String str, Node namespaceNode) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Create an object to resolve namespace prefixes. // XPath namespaces are resolved from the input context node's document element // if it is a root node, or else the current context node (for lack of a better // resolution space, given the simplicity of this sample code). PrefixResolverDefault prefixResolver = new PrefixResolverDefault( (namespaceNode.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) namespaceNode).getDocumentElement() : namespaceNode); // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Execute the XPath, and have it return the result // return xpath.execute(xpathSupport, contextNode, prefixResolver); int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval( Node contextNode, String str, PrefixResolver prefixResolver) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Execute the XPath, and have it return the result int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
public static LocPathIterator createUnionIterator(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { // For the moment, I'm going to first create a full UnionPathIterator, and // then see if I can reduce it to a UnionChildIterator. It would obviously // be more effecient to just test for the conditions for a UnionChildIterator, // and then create that directly. UnionPathIterator upi = new UnionPathIterator(compiler, opPos); int nPaths = upi.m_exprs.length; boolean isAllChildIterators = true; for(int i = 0; i < nPaths; i++) { LocPathIterator lpi = upi.m_exprs[i]; if(lpi.getAxis() != Axis.CHILD) { isAllChildIterators = false; break; } else { // check for positional predicates or position function, which won't work. if(HasPositionalPredChecker.check(lpi)) { isAllChildIterators = false; break; } } } if(isAllChildIterators) { UnionChildIterator uci = new UnionChildIterator(); for(int i = 0; i < nPaths; i++) { PredicatedNodeTest lpi = upi.m_exprs[i]; // I could strip the lpi down to a pure PredicatedNodeTest, but // I don't think it's worth it. Note that the test can be used // as a static object... so it doesn't have to be cloned. uci.addNodeTest(lpi); } return uci; } else return upi; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
protected LocPathIterator createDTMIterator( Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos, (compiler.getLocationPathDepth() <= 0)); return lpi; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws javax.xml.transform.TransformerException { // TODO: Handle unwrapped FilterExpr int steptype = compiler.getOp(opPos); if (steptype == OpCodes.OP_LOCATIONPATH) { loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); m_exprs[count] = createDTMIterator(compiler, opPos); m_exprs[count].exprSetParent(this); } else { // Have to check for unwrapped functions, which the LocPathIterator // doesn't handle. switch (steptype) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); WalkingIterator iter = new WalkingIterator(compiler.getNamespaceContext()); iter.exprSetParent(this); if(compiler.getLocationPathDepth() <= 0) iter.setIsTopLevel(true); iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter); iter.m_firstWalker.init(compiler, opPos, steptype); m_exprs[count] = iter; break; default : m_exprs = new LocPathIterator[count]; } } }
// in src/org/apache/xpath/axes/FilterExprWalker.java
public void init(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { super.init(compiler, opPos, stepType); // Smooth over an anomily in the opcode map... switch (stepType) { case OpCodes.OP_FUNCTION : case OpCodes.OP_EXTFUNCTION : m_mustHardReset = true; case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : m_expr = compiler.compile(opPos); m_expr.exprSetParent(this); //if((OpCodes.OP_FUNCTION == stepType) && (m_expr instanceof org.apache.xalan.templates.FuncKey)) if(m_expr instanceof org.apache.xpath.operations.Variable) { // hack/temp workaround m_canDetachNodeset = false; } break; default : m_expr = compiler.compile(opPos + 2); m_expr.exprSetParent(this); } // if(m_expr instanceof WalkingIterator) // { // WalkingIterator wi = (WalkingIterator)m_expr; // if(wi.getFirstWalker() instanceof FilterExprWalker) // { // FilterExprWalker fw = (FilterExprWalker)wi.getFirstWalker(); // if(null == fw.getNextWalker()) // { // m_expr = fw.m_expr; // m_expr.exprSetParent(this); // } // } // // } }
// in src/org/apache/xpath/axes/AxesWalker.java
public void init(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { initPredicateInfo(compiler, opPos); // int testType = compiler.getOp(nodeTestOpPos); }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public void executeCharsToContentHandler( XPathContext xctxt, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { LocPathIterator clone = (LocPathIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); clone.setRoot(current, xctxt); int node = clone.nextNode(); DTM dtm = clone.getDTM(node); clone.detach(); if(node != DTM.NULL) { dtm.dispatchCharactersEvents(node, handler, false); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = (DTMIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); iter.setRoot(current, xctxt); int next = iter.nextNode(); // m_clones.freeInstance(iter); iter.detach(); return next; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (asNode(xctxt) != DTM.NULL); }
// in src/org/apache/xpath/axes/ChildIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { int current = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(current); return dtm.getFirstChild(current); }
// in src/org/apache/xpath/axes/SelfIteratorNoPredicate.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return xctxt.getCurrentNode(); }
// in src/org/apache/xpath/axes/WalkerFactory.java
static AxesWalker loadOneWalker( WalkingIterator lpi, Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { AxesWalker firstWalker = null; int stepType = compiler.getOp(stepOpCodePos); if (stepType != OpCodes.ENDOP) { // m_axesWalkers = new AxesWalker[1]; // As we unwind from the recursion, create the iterators. firstWalker = createDefaultWalker(compiler, stepType, lpi, 0); firstWalker.init(compiler, stepOpCodePos, stepType); } return firstWalker; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static AxesWalker loadWalkers( WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; AxesWalker firstWalker = null; AxesWalker walker, prevWalker = null; int analysis = analyze(compiler, stepOpCodePos, stepIndex); while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis); walker.init(compiler, stepOpCodePos, stepType); walker.exprSetParent(lpi); // walker.setAnalysis(analysis); if (null == firstWalker) { firstWalker = walker; } else { prevWalker.setNextWalker(walker); walker.setPrevWalker(prevWalker); } prevWalker = walker; stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } return firstWalker; }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static DTMIterator newDTMIterator( Compiler compiler, int opPos, boolean isTopLevel) throws javax.xml.transform.TransformerException { int firstStepPos = OpMap.getFirstChildPos(opPos); int analysis = analyze(compiler, firstStepPos, 0); boolean isOneStep = isOneStep(analysis); DTMIterator iter; // Is the iteration a one-step attribute pattern (i.e. select="@foo")? if (isOneStep && walksSelfOnly(analysis) && isWild(analysis) && !hasPredicate(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("SelfIteratorNoPredicate", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new SelfIteratorNoPredicate(compiler, opPos, analysis); } // Is the iteration exactly one child step? else if (walksChildrenOnly(analysis) && isOneStep) { // Does the pattern specify *any* child with no predicate? (i.e. select="child::node()". if (isWild(analysis) && !hasPredicate(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("ChildIterator", analysis, compiler); // Use simple child iteration without any test. iter = new ChildIterator(compiler, opPos, analysis); } else { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("ChildTestIterator", analysis, compiler); // Else use simple node test iteration with predicate test. iter = new ChildTestIterator(compiler, opPos, analysis); } } // Is the iteration a one-step attribute pattern (i.e. select="@foo")? else if (isOneStep && walksAttributes(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("AttributeIterator", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new AttributeIterator(compiler, opPos, analysis); } else if(isOneStep && !walksFilteredList(analysis)) { if( !walksNamespaces(analysis) && (walksInDocOrder(analysis) || isSet(analysis, BIT_PARENT))) { if (false || DEBUG_ITERATOR_CREATION) diagnoseIterator("OneStepIteratorForward", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new OneStepIteratorForward(compiler, opPos, analysis); } else { if (false || DEBUG_ITERATOR_CREATION) diagnoseIterator("OneStepIterator", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new OneStepIterator(compiler, opPos, analysis); } } // Analysis of "//center": // bits: 1001000000001010000000000000011 // count: 3 // root // child:node() // BIT_DESCENDANT_OR_SELF // It's highly possible that we should have a seperate bit set for // "//foo" patterns. // For at least the time being, we can't optimize patterns like // "//table[3]", because this has to be analyzed as // "/descendant-or-self::node()/table[3]" in order for the indexes // to work right. else if (isOptimizableForDescendantIterator(compiler, firstStepPos, 0) // && getStepCount(analysis) <= 3 // && walksDescendants(analysis) // && walksSubtreeOnlyFromRootOrContext(analysis) ) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("DescendantIterator", analysis, compiler); iter = new DescendantIterator(compiler, opPos, analysis); } else { if(isNaturalDocOrder(compiler, firstStepPos, 0, analysis)) { if (false || DEBUG_ITERATOR_CREATION) { diagnoseIterator("WalkingIterator", analysis, compiler); } iter = new WalkingIterator(compiler, opPos, analysis, true); } else { // if (DEBUG_ITERATOR_CREATION) // diagnoseIterator("MatchPatternIterator", analysis, compiler); // // return new MatchPatternIterator(compiler, opPos, analysis); if (DEBUG_ITERATOR_CREATION) diagnoseIterator("WalkingIteratorSorted", analysis, compiler); iter = new WalkingIteratorSorted(compiler, opPos, analysis, true); } } if(iter instanceof LocPathIterator) ((LocPathIterator)iter).setIsTopLevel(isTopLevel); return iter; }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static int getAxisFromStep( Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(stepOpCodePos); switch (stepType) { case OpCodes.FROM_FOLLOWING : return Axis.FOLLOWING; case OpCodes.FROM_FOLLOWING_SIBLINGS : return Axis.FOLLOWINGSIBLING; case OpCodes.FROM_PRECEDING : return Axis.PRECEDING; case OpCodes.FROM_PRECEDING_SIBLINGS : return Axis.PRECEDINGSIBLING; case OpCodes.FROM_PARENT : return Axis.PARENT; case OpCodes.FROM_NAMESPACE : return Axis.NAMESPACE; case OpCodes.FROM_ANCESTORS : return Axis.ANCESTOR; case OpCodes.FROM_ANCESTORS_OR_SELF : return Axis.ANCESTORORSELF; case OpCodes.FROM_ATTRIBUTES : return Axis.ATTRIBUTE; case OpCodes.FROM_ROOT : return Axis.ROOT; case OpCodes.FROM_CHILDREN : return Axis.CHILD; case OpCodes.FROM_DESCENDANTS_OR_SELF : return Axis.DESCENDANTORSELF; case OpCodes.FROM_DESCENDANTS : return Axis.DESCENDANT; case OpCodes.FROM_SELF : return Axis.SELF; case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : return Axis.FILTEREDLIST; } throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static boolean mightBeProximate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { boolean mightBeProximate = false; int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen = compiler.getArgLength(opPos); break; default : argLen = compiler.getArgLengthOfStep(opPos); } int predPos = compiler.getFirstPredicateOpPos(opPos); int count = 0; while (OpCodes.OP_PREDICATE == compiler.getOp(predPos)) { count++; int innerExprOpPos = predPos+2; int predOp = compiler.getOp(innerExprOpPos); switch(predOp) { case OpCodes.OP_VARIABLE: return true; // Would need more smarts to tell if this could be a number or not! case OpCodes.OP_LOCATIONPATH: // OK. break; case OpCodes.OP_NUMBER: case OpCodes.OP_NUMBERLIT: return true; // that's all she wrote! case OpCodes.OP_FUNCTION: boolean isProx = functionProximateOrContainsProximate(compiler, innerExprOpPos); if(isProx) return true; break; case OpCodes.OP_GT: case OpCodes.OP_GTE: case OpCodes.OP_LT: case OpCodes.OP_LTE: case OpCodes.OP_EQUALS: int leftPos = OpMap.getFirstChildPos(innerExprOpPos); int rightPos = compiler.getNextOpPos(leftPos); isProx = isProximateInnerExpr(compiler, leftPos); if(isProx) return true; isProx = isProximateInnerExpr(compiler, rightPos); if(isProx) return true; break; default: return true; // be conservative... } predPos = compiler.getNextOpPos(predPos); } return mightBeProximate; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isOptimizableForDescendantIterator( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; boolean foundDorDS = false; boolean foundSelf = false; boolean foundDS = false; int nodeTestType = OpCodes.NODETYPE_NODE; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { // The DescendantIterator can only do one node test. If there's more // than one, use another iterator. if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT) return false; stepCount++; if(stepCount > 3) return false; boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType); if(mightBeProximate) return false; switch (stepType) { case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : return false; case OpCodes.FROM_ROOT : if(1 != stepCount) return false; break; case OpCodes.FROM_CHILDREN : if(!foundDS && !(foundDorDS && foundSelf)) return false; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : foundDS = true; case OpCodes.FROM_DESCENDANTS : if(3 == stepCount) return false; foundDorDS = true; break; case OpCodes.FROM_SELF : if(1 != stepCount) return false; foundSelf = true; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } nodeTestType = compiler.getStepTestType(stepOpCodePos); int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; if(OpCodes.ENDOP != compiler.getOp(nextStepOpCodePos)) { if(compiler.countPredicates(stepOpCodePos) > 0) { return false; } } stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static int analyze( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; int analysisResult = 0x00000000; // 32 bits of analysis while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; // String namespace = compiler.getStepNS(stepOpCodePos); // boolean isNSWild = (null != namespace) // ? namespace.equals(NodeTest.WILD) : false; // String localname = compiler.getStepLocalName(stepOpCodePos); // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false; boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos, stepType); if (predAnalysis) analysisResult |= BIT_PREDICATE; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : analysisResult |= BIT_FILTER; break; case OpCodes.FROM_ROOT : analysisResult |= BIT_ROOT; break; case OpCodes.FROM_ANCESTORS : analysisResult |= BIT_ANCESTOR; break; case OpCodes.FROM_ANCESTORS_OR_SELF : analysisResult |= BIT_ANCESTOR_OR_SELF; break; case OpCodes.FROM_ATTRIBUTES : analysisResult |= BIT_ATTRIBUTE; break; case OpCodes.FROM_NAMESPACE : analysisResult |= BIT_NAMESPACE; break; case OpCodes.FROM_CHILDREN : analysisResult |= BIT_CHILD; break; case OpCodes.FROM_DESCENDANTS : analysisResult |= BIT_DESCENDANT; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : // Use a special bit to to make sure we get the right analysis of "//foo". if (2 == stepCount && BIT_ROOT == analysisResult) { analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT; } analysisResult |= BIT_DESCENDANT_OR_SELF; break; case OpCodes.FROM_FOLLOWING : analysisResult |= BIT_FOLLOWING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : analysisResult |= BIT_FOLLOWING_SIBLING; break; case OpCodes.FROM_PRECEDING : analysisResult |= BIT_PRECEDING; break; case OpCodes.FROM_PRECEDING_SIBLINGS : analysisResult |= BIT_PRECEDING_SIBLING; break; case OpCodes.FROM_PARENT : analysisResult |= BIT_PARENT; break; case OpCodes.FROM_SELF : analysisResult |= BIT_SELF; break; case OpCodes.MATCH_ATTRIBUTE : analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node() { analysisResult |= BIT_NODETEST_ANY; } stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } analysisResult |= (stepCount & BITS_COUNT); return analysisResult; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static StepPattern loadSteps( MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { if (DEBUG_PATTERN_CREATION) { System.out.println("================"); System.out.println("loadSteps for: "+compiler.getPatternString()); } int stepType; StepPattern step = null; StepPattern firstStep = null, prevStep = null; int analysis = analyze(compiler, stepOpCodePos, stepIndex); while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { step = createDefaultStepPattern(compiler, stepOpCodePos, mpi, analysis, firstStep, prevStep); if (null == firstStep) { firstStep = step; } else { //prevStep.setNextWalker(step); step.setRelativePathPattern(prevStep); } prevStep = step; stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } int axis = Axis.SELF; int paxis = Axis.SELF; StepPattern tail = step; for (StepPattern pat = step; null != pat; pat = pat.getRelativePathPattern()) { int nextAxis = pat.getAxis(); //int nextPaxis = pat.getPredicateAxis(); pat.setAxis(axis); // The predicate axis can't be moved!!! Test Axes103 // pat.setPredicateAxis(paxis); // If we have an attribute or namespace axis that went up, then // it won't find the attribute in the inverse, since the select-to-match // axes are not invertable (an element is a parent of an attribute, but // and attribute is not a child of an element). // If we don't do the magic below, then "@*/ancestor-or-self::*" gets // inverted for match to "self::*/descendant-or-self::@*/parent::node()", // which obviously won't work. // So we will rewrite this as: // "self::*/descendant-or-self::*/attribute::*/parent::node()" // Child has to be rewritten a little differently: // select: "@*/parent::*" // inverted match: "self::*/child::@*/parent::node()" // rewrite: "self::*/attribute::*/parent::node()" // Axes that go down in the select, do not have to have special treatment // in the rewrite. The following inverted match will still not select // anything. // select: "@*/child::*" // inverted match: "self::*/parent::@*/parent::node()" // Lovely business, this. // -sb int whatToShow = pat.getWhatToShow(); if(whatToShow == DTMFilter.SHOW_ATTRIBUTE || whatToShow == DTMFilter.SHOW_NAMESPACE) { int newAxis = (whatToShow == DTMFilter.SHOW_ATTRIBUTE) ? Axis.ATTRIBUTE : Axis.NAMESPACE; if(isDownwardAxisOfMany(axis)) { StepPattern attrPat = new StepPattern(whatToShow, pat.getNamespace(), pat.getLocalName(), //newAxis, pat.getPredicateAxis); newAxis, 0); // don't care about the predicate axis XNumber score = pat.getStaticScore(); pat.setNamespace(null); pat.setLocalName(NodeTest.WILD); attrPat.setPredicates(pat.getPredicates()); pat.setPredicates(null); pat.setWhatToShow(DTMFilter.SHOW_ELEMENT); StepPattern rel = pat.getRelativePathPattern(); pat.setRelativePathPattern(attrPat); attrPat.setRelativePathPattern(rel); attrPat.setStaticScore(score); // This is needed to inverse a following pattern, because of the // wacky Xalan rules for following from an attribute. See axes108. // By these rules, following from an attribute is not strictly // inverseable. if(Axis.PRECEDING == pat.getAxis()) pat.setAxis(Axis.PRECEDINGANDANCESTOR); else if(Axis.DESCENDANT == pat.getAxis()) pat.setAxis(Axis.DESCENDANTORSELF); pat = attrPat; } else if(Axis.CHILD == pat.getAxis()) { // In this case just change the axis. // pat.setWhatToShow(whatToShow); pat.setAxis(Axis.ATTRIBUTE); } } axis = nextAxis; //paxis = nextPaxis; tail = pat; } if(axis < Axis.ALL) { StepPattern selfPattern = new ContextMatchStepPattern(axis, paxis); // We need to keep the new nodetest from affecting the score... XNumber score = tail.getStaticScore(); tail.setRelativePathPattern(selfPattern); tail.setStaticScore(score); selfPattern.setStaticScore(score); } if (DEBUG_PATTERN_CREATION) { System.out.println("Done loading steps: "+step.toString()); System.out.println(""); } return step; // start from last pattern?? //firstStep; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static StepPattern createDefaultStepPattern( Compiler compiler, int opPos, MatchPatternIterator mpi, int analysis, StepPattern tail, StepPattern head) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(opPos); boolean simpleInit = false; boolean prevIsOneStepDown = true; int whatToShow = compiler.getWhatToShow(opPos); StepPattern ai = null; int axis, predicateAxis; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; Expression expr; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : expr = compiler.compile(opPos); break; default : expr = compiler.compile(opPos + 2); } axis = Axis.FILTEREDLIST; predicateAxis = Axis.FILTEREDLIST; ai = new FunctionPattern(expr, axis, predicateAxis); simpleInit = true; break; case OpCodes.FROM_ROOT : whatToShow = DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT; axis = Axis.ROOT; predicateAxis = Axis.ROOT; ai = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, axis, predicateAxis); break; case OpCodes.FROM_ATTRIBUTES : whatToShow = DTMFilter.SHOW_ATTRIBUTE; axis = Axis.PARENT; predicateAxis = Axis.ATTRIBUTE; // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF); break; case OpCodes.FROM_NAMESPACE : whatToShow = DTMFilter.SHOW_NAMESPACE; axis = Axis.PARENT; predicateAxis = Axis.NAMESPACE; // ai = new StepPattern(whatToShow, axis, predicateAxis); break; case OpCodes.FROM_ANCESTORS : axis = Axis.DESCENDANT; predicateAxis = Axis.ANCESTOR; break; case OpCodes.FROM_CHILDREN : axis = Axis.PARENT; predicateAxis = Axis.CHILD; break; case OpCodes.FROM_ANCESTORS_OR_SELF : axis = Axis.DESCENDANTORSELF; predicateAxis = Axis.ANCESTORORSELF; break; case OpCodes.FROM_SELF : axis = Axis.SELF; predicateAxis = Axis.SELF; break; case OpCodes.FROM_PARENT : axis = Axis.CHILD; predicateAxis = Axis.PARENT; break; case OpCodes.FROM_PRECEDING_SIBLINGS : axis = Axis.FOLLOWINGSIBLING; predicateAxis = Axis.PRECEDINGSIBLING; break; case OpCodes.FROM_PRECEDING : axis = Axis.FOLLOWING; predicateAxis = Axis.PRECEDING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : axis = Axis.PRECEDINGSIBLING; predicateAxis = Axis.FOLLOWINGSIBLING; break; case OpCodes.FROM_FOLLOWING : axis = Axis.PRECEDING; predicateAxis = Axis.FOLLOWING; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : axis = Axis.ANCESTORORSELF; predicateAxis = Axis.DESCENDANTORSELF; break; case OpCodes.FROM_DESCENDANTS : axis = Axis.ANCESTOR; predicateAxis = Axis.DESCENDANT; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if(null == ai) { whatToShow = compiler.getWhatToShow(opPos); // %REVIEW% ai = new StepPattern(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos), axis, predicateAxis); } if (false || DEBUG_PATTERN_CREATION) { System.out.print("new step: "+ ai); System.out.print(", axis: " + Axis.getNames(ai.getAxis())); System.out.print(", predAxis: " + Axis.getNames(ai.getAxis())); System.out.print(", what: "); System.out.print(" "); ai.debugWhatToShow(ai.getWhatToShow()); } int argLen = compiler.getFirstPredicateOpPos(opPos); ai.setPredicates(compiler.getCompiledPredicates(argLen)); return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen = compiler.getArgLength(opPos); break; default : argLen = compiler.getArgLengthOfStep(opPos); } int pos = compiler.getFirstPredicateOpPos(opPos); int nPredicates = compiler.countPredicates(pos); return (nPredicates > 0) ? true : false; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isNaturalDocOrder( Compiler compiler, int stepOpCodePos, int stepIndex, int analysis) throws javax.xml.transform.TransformerException { if(canCrissCross(analysis)) return false; // Namespaces can present some problems, so just punt if we're looking for // these. if(isSet(analysis, BIT_NAMESPACE)) return false; // The following, preceding, following-sibling, and preceding sibling can // be found in doc order if we get to this point, but if they occur // together, they produce // duplicates, so it's better for us to eliminate this case so we don't // have to check for duplicates during runtime if we're using a // WalkingIterator. if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) && isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING)) return false; // OK, now we have to check for select="@*/axis::*" patterns, which // can also cause duplicates to happen. But select="axis*/@::*" patterns // are OK, as are select="@foo/axis::*" patterns. // Unfortunately, we can't do this just via the analysis bits. int stepType; int stepCount = 0; boolean foundWildAttribute = false; // Steps that can traverse anything other than down a // subtree or that can produce duplicates when used in // combonation are counted with this variable. int potentialDuplicateMakingStepCount = 0; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; switch (stepType) { case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : if(foundWildAttribute) // Maybe not needed, but be safe. return false; // This doesn't seem to work as a test for wild card. Hmph. // int nodeTestType = compiler.getStepTestType(stepOpCodePos); String localName = compiler.getStepLocalName(stepOpCodePos); // System.err.println("localName: "+localName); if(localName.equals("*")) { foundWildAttribute = true; } break; case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : case OpCodes.FROM_DESCENDANTS_OR_SELF : case OpCodes.FROM_DESCENDANTS : if(potentialDuplicateMakingStepCount > 0) return false; potentialDuplicateMakingStepCount++; case OpCodes.FROM_ROOT : case OpCodes.FROM_CHILDREN : case OpCodes.FROM_SELF : if(foundWildAttribute) return false; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
protected void initPredicateInfo(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { int pos = compiler.getFirstPredicateOpPos(opPos); if(pos > 0) { m_predicates = compiler.getCompiledPredicates(pos); if(null != m_predicates) { for(int i = 0; i < m_predicates.length; i++) { m_predicates[i].exprSetParent(this); } } } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public void initProximityPosition(int i) throws javax.xml.transform.TransformerException { m_proximityPositions[i] = 0; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
boolean executePredicates(int context, XPathContext xctxt) throws javax.xml.transform.TransformerException { int nPredicates = getPredicateCount(); // System.out.println("nPredicates: "+nPredicates); if (nPredicates == 0) return true; PrefixResolver savedResolver = xctxt.getNamespaceContext(); try { m_predicateIndex = 0; xctxt.pushSubContextList(this); xctxt.pushNamespaceContext(m_lpi.getPrefixResolver()); xctxt.pushCurrentNode(context); for (int i = 0; i < nPredicates; i++) { // System.out.println("Executing predicate expression - waiting count: "+m_lpi.getWaitingCount()); XObject pred = m_predicates[i].execute(xctxt); // System.out.println("\nBack from executing predicate expression - waiting count: "+m_lpi.getWaitingCount()); // System.out.println("pred.getType(): "+pred.getType()); if (XObject.CLASS_NUMBER == pred.getType()) { if (DEBUG_PREDICATECOUNTING) { System.out.flush(); System.out.println("\n===== start predicate count ========"); System.out.println("m_predicateIndex: " + m_predicateIndex); // System.out.println("getProximityPosition(m_predicateIndex): " // + getProximityPosition(m_predicateIndex)); System.out.println("pred.num(): " + pred.num()); } int proxPos = this.getProximityPosition(m_predicateIndex); int predIndex = (int) pred.num(); if (proxPos != predIndex) { if (DEBUG_PREDICATECOUNTING) { System.out.println("\nnode context: "+nodeToString(context)); System.out.println("index predicate is false: "+proxPos); System.out.println("\n===== end predicate count ========"); } return false; } else if (DEBUG_PREDICATECOUNTING) { System.out.println("\nnode context: "+nodeToString(context)); System.out.println("index predicate is true: "+proxPos); System.out.println("\n===== end predicate count ========"); } // If there is a proximity index that will not change during the // course of itteration, then we know there can be no more true // occurances of this predicate, so flag that we're done after // this. // // bugzilla 14365 // We can't set m_foundLast = true unless we're sure that -all- // remaining parameters are stable, or else last() fails. Fixed so // only sets m_foundLast if on the last predicate if(m_predicates[i].isStableNumber() && i == nPredicates - 1) { m_foundLast = true; } } else if (!pred.bool()) return false; countProximityPosition(++m_predicateIndex); } } finally { xctxt.popCurrentNode(); xctxt.popNamespaceContext(); xctxt.popSubContextList(); m_predicateIndex = -1; } return true; }
// in src/org/apache/xpath/axes/DescendantIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(getPredicateCount() > 0) return super.asNode(xctxt); int current = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(current); DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis); String localName = getLocalName(); String namespace = getNamespace(); int what = m_whatToShow; // System.out.print(" (DescendantIterator) "); // System.out.println("what: "); // NodeTest.debugWhatToShow(what); if(DTMFilter.SHOW_ALL == what || localName == NodeTest.WILD || namespace == NodeTest.WILD) { return traverser.first(current); } else { int type = getNodeTypeTest(what); int extendedType = dtm.getExpandedTypeID(namespace, localName, type); return traverser.first(current, extendedType); } }
// in src/org/apache/xpath/operations/Variable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, false); }
// in src/org/apache/xpath/operations/Variable.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver xprefixResolver = xctxt.getNamespaceContext(); XObject result; // Is the variable fetched always the same? // XObject result = xctxt.getVariable(m_qname); if(m_fixUpWasCalled) { if(m_isGlobal) result = xctxt.getVarStack().getGlobalVariable(xctxt, m_index, destructiveOK); else result = xctxt.getVarStack().getLocalVariable(xctxt, m_index, destructiveOK); } else { result = xctxt.getVarStack().getVariableOrParam(xctxt,m_qname); } if (null == result) { // This should now never happen... warn(xctxt, XPATHErrorResources.WG_ILLEGAL_VARIABLE_REFERENCE, new Object[]{ m_qname.getLocalPart() }); //"VariableReference given for variable out "+ // (new RuntimeException()).printStackTrace(); // error(xctxt, XPATHErrorResources.ER_COULDNOT_GET_VAR_NAMED, // new Object[]{ m_qname.getLocalPart() }); //"Could not get variable named "+varName); result = new XNodeSet(xctxt.getDTMManager()); } return result; // } // else // { // // Hack city... big time. This is needed to evaluate xpaths from extensions, // // pending some bright light going off in my head. Some sort of callback? // synchronized(this) // { // org.apache.xalan.templates.ElemVariable vvar= getElemVariable(); // if(null != vvar) // { // m_index = vvar.getIndex(); // m_isGlobal = vvar.getIsTopLevel(); // m_fixUpWasCalled = true; // return execute(xctxt); // } // } // throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{m_qname.toString()})); //"Variable not resolvable: "+m_qname); // } }
// in src/org/apache/xpath/operations/Div.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() / right.num()); }
// in src/org/apache/xpath/operations/Div.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) / m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Bool.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_BOOLEAN == right.getType()) return right; else return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Bool.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.bool(xctxt); }
// in src/org/apache/xpath/operations/NotEquals.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return (left.notEquals(right)) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Minus.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() - right.num()); }
// in src/org/apache/xpath/operations/Minus.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) - m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Quo.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber((int) (left.num() / right.num())); }
// in src/org/apache/xpath/operations/Lte.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.lessThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Number.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_NUMBER == right.getType()) return right; else return new XNumber(right.num()); }
// in src/org/apache/xpath/operations/Number.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.num(xctxt); }
// in src/org/apache/xpath/operations/String.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return (XString)right.xstr(); // semi-safe cast. }
// in src/org/apache/xpath/operations/UnaryOperation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return operate(m_right.execute(xctxt)); }
// in src/org/apache/xpath/operations/Operation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); XObject result = operate(left, right); left.detach(); right.detach(); return result; }
// in src/org/apache/xpath/operations/Operation.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return null; // no-op }
// in src/org/apache/xpath/operations/Lt.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.lessThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/VariableSafeAbsRef.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK); DTMManager dtmMgr = xctxt.getDTMManager(); int context = xctxt.getContextNode(); if(dtmMgr.getDTM(xns.getRoot()).getDocument() != dtmMgr.getDTM(context).getDocument()) { Expression expr = (Expression)xns.getContainedIter(); xns = (XNodeSet)expr.asIterator(xctxt, context); } return xns; }
// in src/org/apache/xpath/operations/Neg.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return new XNumber(-right.num()); }
// in src/org/apache/xpath/operations/Neg.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return -(m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Gte.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.greaterThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Mult.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() * right.num()); }
// in src/org/apache/xpath/operations/Mult.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) * m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Mod.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() % right.num()); }
// in src/org/apache/xpath/operations/Mod.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) % m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Or.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject expr1 = m_left.execute(xctxt); if (!expr1.bool()) { XObject expr2 = m_right.execute(xctxt); return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; } else return XBoolean.S_TRUE; }
// in src/org/apache/xpath/operations/Or.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.bool(xctxt) || m_right.bool(xctxt)); }
// in src/org/apache/xpath/operations/And.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject expr1 = m_left.execute(xctxt); if (expr1.bool()) { XObject expr2 = m_right.execute(xctxt); return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; } else return XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/And.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.bool(xctxt) && m_right.bool(xctxt)); }
// in src/org/apache/xpath/operations/Equals.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Equals.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); boolean result = left.equals(right) ? true : false; left.detach(); right.detach(); return result; }
// in src/org/apache/xpath/operations/Plus.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() + right.num()); }
// in src/org/apache/xpath/operations/Plus.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_right.num(xctxt) + m_left.num(xctxt)); }
// in src/org/apache/xpath/operations/Gt.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.greaterThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } // nl.detach(); } nl.detach(); return score; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } nl.detach(); } return score; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } nl.detach(); } return score; }
// in src/org/apache/xpath/patterns/UnionPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject bestScore = null; int n = m_patterns.length; for (int i = 0; i < n; i++) { XObject score = m_patterns[i].execute(xctxt); if (score != NodeTest.SCORE_NONE) { if (null == bestScore) bestScore = score; else if (score.num() > bestScore.num()) bestScore = score; } } if (null == bestScore) { bestScore = NodeTest.SCORE_NONE; } return bestScore; }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(currentNode); if (dtm != null) { int expType = dtm.getExpandedTypeID(currentNode); return execute(xctxt, currentNode, dtm, expType); } return NodeTest.SCORE_NONE; }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, xctxt.getCurrentNode()); }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute( XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException { if (m_whatToShow == NodeTest.SHOW_BYFUNCTION) { if (null != m_relativePathPattern) { return m_relativePathPattern.execute(xctxt); } else return NodeTest.SCORE_NONE; } XObject score; score = super.execute(xctxt, currentNode, dtm, expType); if (score == NodeTest.SCORE_NONE) return NodeTest.SCORE_NONE; if (getPredicateCount() != 0) { if (!executePredicates(xctxt, dtm, currentNode)) return NodeTest.SCORE_NONE; } if (null != m_relativePathPattern) return m_relativePathPattern.executeRelativePathPattern(xctxt, dtm, currentNode); return score; }
// in src/org/apache/xpath/patterns/StepPattern.java
protected final XObject executeRelativePathPattern( XPathContext xctxt, DTM dtm, int currentNode) throws javax.xml.transform.TransformerException { XObject score = NodeTest.SCORE_NONE; int context = currentNode; DTMAxisTraverser traverser; traverser = dtm.getAxisTraverser(m_axis); for (int relative = traverser.first(context); DTM.NULL != relative; relative = traverser.next(context, relative)) { try { xctxt.pushCurrentNode(relative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) break; } finally { xctxt.popCurrentNode(); } } return score; }
// in src/org/apache/xpath/patterns/StepPattern.java
protected final boolean executePredicates( XPathContext xctxt, DTM dtm, int currentNode) throws javax.xml.transform.TransformerException { boolean result = true; boolean positionAlreadySeen = false; int n = getPredicateCount(); try { xctxt.pushSubContextList(this); for (int i = 0; i < n; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { int pos = (int) pred.num(); if (positionAlreadySeen) { result = (pos == 1); break; } else { positionAlreadySeen = true; if (!checkProximityPosition(xctxt, i, dtm, currentNode, pos)) { result = false; break; } } } else if (!pred.boolWithSideEffects()) { result = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } return result; }
// in src/org/apache/xpath/patterns/StepPattern.java
public double getMatchScore(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { xctxt.pushCurrentNode(context); xctxt.pushCurrentExpressionNode(context); try { XObject score = execute(xctxt); return score.num(); } finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); } // return XPath.MATCH_SCORE_NONE; }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.getIteratorRoot() == xctxt.getCurrentNode()) return getStaticScore(); else return this.SCORE_NONE; }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
public XObject executeRelativePathPattern( XPathContext xctxt, StepPattern prevStep) throws javax.xml.transform.TransformerException { XObject score = NodeTest.SCORE_NONE; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); if (null != dtm) { int predContext = xctxt.getCurrentNode(); DTMAxisTraverser traverser; int axis = m_axis; boolean needToTraverseAttrs = WalkerFactory.isDownwardAxisOfMany(axis); boolean iterRootIsAttr = (dtm.getNodeType(xctxt.getIteratorRoot()) == DTM.ATTRIBUTE_NODE); if((Axis.PRECEDING == axis) && iterRootIsAttr) { axis = Axis.PRECEDINGANDANCESTOR; } traverser = dtm.getAxisTraverser(axis); for (int relative = traverser.first(context); DTM.NULL != relative; relative = traverser.next(context, relative)) { try { xctxt.pushCurrentNode(relative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) { //score = executePredicates( xctxt, prevStep, SCORE_OTHER, // predContext, relative); if (executePredicates(xctxt, dtm, context)) return score; score = NodeTest.SCORE_NONE; } if(needToTraverseAttrs && iterRootIsAttr && (DTM.ELEMENT_NODE == dtm.getNodeType(relative))) { int xaxis = Axis.ATTRIBUTE; for (int i = 0; i < 2; i++) { DTMAxisTraverser atraverser = dtm.getAxisTraverser(xaxis); for (int arelative = atraverser.first(relative); DTM.NULL != arelative; arelative = atraverser.next(relative, arelative)) { try { xctxt.pushCurrentNode(arelative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) { //score = executePredicates( xctxt, prevStep, SCORE_OTHER, // predContext, arelative); if (score != NodeTest.SCORE_NONE) return score; } } finally { xctxt.popCurrentNode(); } } xaxis = Axis.NAMESPACE; } } } finally { xctxt.popCurrentNode(); } } } return score; }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); short nodeType = dtm.getNodeType(context); if (m_whatToShow == DTMFilter.SHOW_ALL) return m_score; int nodeBit = (m_whatToShow & (0x00000001 << (nodeType - 1))); switch (nodeBit) { case DTMFilter.SHOW_DOCUMENT_FRAGMENT : case DTMFilter.SHOW_DOCUMENT : return SCORE_OTHER; case DTMFilter.SHOW_COMMENT : return m_score; case DTMFilter.SHOW_CDATA_SECTION : case DTMFilter.SHOW_TEXT : // was: // return (!xctxt.getDOMHelper().shouldStripSourceNode(context)) // ? m_score : SCORE_NONE; return m_score; case DTMFilter.SHOW_PROCESSING_INSTRUCTION : return subPartMatch(dtm.getNodeName(context), m_name) ? m_score : SCORE_NONE; // From the draft: "Two expanded names are equal if they // have the same local part, and either both have no URI or // both have the same URI." // "A node test * is true for any node of the principal node type. // For example, child::* will select all element children of the // context node, and attribute::* will select all attributes of // the context node." // "A node test can have the form NCName:*. In this case, the prefix // is expanded in the same way as with a QName using the context // namespace declarations. The node test will be true for any node // of the principal type whose expanded name has the URI to which // the prefix expands, regardless of the local part of the name." case DTMFilter.SHOW_NAMESPACE : { String ns = dtm.getLocalName(context); return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE; } case DTMFilter.SHOW_ATTRIBUTE : case DTMFilter.SHOW_ELEMENT : { return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name))) ? m_score : SCORE_NONE; } default : return SCORE_NONE; } // end switch(testType) }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws javax.xml.transform.TransformerException { if (m_whatToShow == DTMFilter.SHOW_ALL) return m_score; int nodeBit = (m_whatToShow & (0x00000001 << ((dtm.getNodeType(context)) - 1))); switch (nodeBit) { case DTMFilter.SHOW_DOCUMENT_FRAGMENT : case DTMFilter.SHOW_DOCUMENT : return SCORE_OTHER; case DTMFilter.SHOW_COMMENT : return m_score; case DTMFilter.SHOW_CDATA_SECTION : case DTMFilter.SHOW_TEXT : // was: // return (!xctxt.getDOMHelper().shouldStripSourceNode(context)) // ? m_score : SCORE_NONE; return m_score; case DTMFilter.SHOW_PROCESSING_INSTRUCTION : return subPartMatch(dtm.getNodeName(context), m_name) ? m_score : SCORE_NONE; // From the draft: "Two expanded names are equal if they // have the same local part, and either both have no URI or // both have the same URI." // "A node test * is true for any node of the principal node type. // For example, child::* will select all element children of the // context node, and attribute::* will select all attributes of // the context node." // "A node test can have the form NCName:*. In this case, the prefix // is expanded in the same way as with a QName using the context // namespace declarations. The node test will be true for any node // of the principal type whose expanded name has the URI to which // the prefix expands, regardless of the local part of the name." case DTMFilter.SHOW_NAMESPACE : { String ns = dtm.getLocalName(context); return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE; } case DTMFilter.SHOW_ATTRIBUTE : case DTMFilter.SHOW_ELEMENT : { return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name))) ? m_score : SCORE_NONE; } default : return SCORE_NONE; } // end switch(testType) }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, xctxt.getCurrentNode()); }
// in src/org/apache/xpath/CachedXPathAPI.java
public Node selectSingleNode(Node contextNode, String str) throws TransformerException { return selectSingleNode(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public Node selectSingleNode( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Have the XObject return its result as a NodeSetDTM. NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode); // Return the first node, or null return nl.nextNode(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeIterator selectNodeIterator(Node contextNode, String str) throws TransformerException { return selectNodeIterator(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeList selectNodeList(Node contextNode, String str) throws TransformerException { return selectNodeList(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeList selectNodeList( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Return a NodeList. return list.nodelist(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval(Node contextNode, String str) throws TransformerException { return eval(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval(Node contextNode, String str, Node namespaceNode) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create an object to resolve namespace prefixes. // XPath namespaces are resolved from the input context node's document element // if it is a root node, or else the current context node (for lack of a better // resolution space, given the simplicity of this sample code). PrefixResolverDefault prefixResolver = new PrefixResolverDefault( (namespaceNode.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) namespaceNode).getDocumentElement() : namespaceNode); // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Execute the XPath, and have it return the result // return xpath.execute(xpathSupport, contextNode, prefixResolver); int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval( Node contextNode, String str, PrefixResolver prefixResolver) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Execute the XPath, and have it return the result int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/Expression.java
public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException { // For now, the current node is already pushed. return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public XObject execute( XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException { // For now, the current node is already pushed. return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).num(); }
// in src/org/apache/xpath/Expression.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).bool(); }
// in src/org/apache/xpath/Expression.java
public XMLString xstr(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).xstr(); }
// in src/org/apache/xpath/Expression.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = execute(xctxt).iter(); return iter.nextNode(); }
// in src/org/apache/xpath/Expression.java
public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
// in src/org/apache/xpath/Expression.java
public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XNodeSet nodeset = (XNodeSet)execute(xctxt); return nodeset.iterRaw(); } finally { xctxt.popCurrentNodeAndExpression(); } }
// in src/org/apache/xpath/Expression.java
public void executeCharsToContentHandler( XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); obj.detach(); }
// in src/org/apache/xpath/Expression.java
public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }
// in src/org/apache/xpath/Expression.java
public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); TransformerException te = new TransformerException(fmsg, this); eh.fatalError(te); } }
(Lib) RuntimeException 121
              
// in src/org/apache/xml/utils/DOMHelper.java
public static Document createDocument(boolean isSecureProcessing) { try { // Use an implementation of the JAVA API for XML Parsing 1.0 to // create a DOM Document node to contain the result. DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); dfactory.setValidating(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Document outNode = docBuilder.newDocument(); return outNode; } catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; } }
// in src/org/apache/xml/utils/DOMHelper.java
public static Node getParentOfNode(Node node) throws RuntimeException { Node parent; short nodeType = node.getNodeType(); if (Node.ATTRIBUTE_NODE == nodeType) { Document doc = node.getOwnerDocument(); /* TBD: if(null == doc) { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!"); } */ // Given how expensive the tree walk may be, we should first ask // whether this DOM can answer the question for us. The additional // test does slow down Level 1 DOMs slightly. DOMHelper2, which // is currently specialized for Xerces, assumes it can use the // Level 2 solution. We might want to have an intermediate stage, // which would assume DOM Level 2 but not assume Xerces. // // (Shouldn't have to check whether impl is null in a compliant DOM, // but let's be paranoid for a moment...) DOMImplementation impl=doc.getImplementation(); if(impl!=null && impl.hasFeature("Core","2.0")) { parent=((Attr)node).getOwnerElement(); return parent; } // DOM Level 1 solution, as fallback. Hugely expensive. Element rootElem = doc.getDocumentElement(); if (null == rootElem) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT, null)); //"Attribute child does not have an owner document element!"); } parent = locateAttrParent(rootElem, node); } else { parent = node.getParentNode(); // if((Node.DOCUMENT_NODE != nodeType) && (null == parent)) // { // throw new RuntimeException("Child does not have parent!"); // } } return parent; }
// in src/org/apache/xml/utils/ObjectPool.java
public synchronized Object getInstance() { // Check if the pool is empty. if (freeStack.isEmpty()) { // Create a new object if so. try { return objectType.newInstance(); } catch (InstantiationException ex){} catch (IllegalAccessException ex){} // Throw unchecked exception for error in pool configuration. throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool"); } else { // Remove object from end of free pool. Object result = freeStack.remove(freeStack.size() - 1); return result; } }
// in src/org/apache/xml/utils/UnImplNode.java
public void error(String msg) { System.out.println("DOM ERROR! class: " + this.getClass().getName()); throw new RuntimeException(XMLMessages.createXMLMessage(msg, null)); }
// in src/org/apache/xml/utils/UnImplNode.java
public void error(String msg, Object[] args) { System.out.println("DOM ERROR! class: " + this.getClass().getName()); throw new RuntimeException(XMLMessages.createXMLMessage(msg, args)); //"UnImplNode error: "+msg); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void init( CoroutineManager co, int controllerCoroutineID, int sourceCoroutineID) { if(co==null) co = new CoroutineManager(); fCoroutineManager = co; fControllerCoroutineID = co.co_joinCoroutineSet(controllerCoroutineID); fSourceCoroutineID = co.co_joinCoroutineSet(sourceCoroutineID); if (fControllerCoroutineID == -1 || fSourceCoroutineID == -1) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed"); fNoMoreEvents=false; eventcounter=frequency; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node) { if(null == node) throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!"); if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy) return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber(); else { // Find the DOM2DTMs wrapped around this Document (if any) // and check whether they contain the Node in question. // // NOTE that since a DOM2DTM may represent a subtree rather // than a full document, we have to be prepared to check more // than one -- and there is no guarantee that we will find // one that contains ancestors or siblings of the node we're // seeking. // // %REVIEW% We could search for the one which contains this // node at the deepest level, and thus covers the widest // subtree, but that's going to entail additional work // checking more DTMs... and getHandleOfNode is not a // cheap operation in most implementations. // // TODO: %REVIEW% If overflow addressing, we may recheck a DTM // already examined. Ouch. But with the increased number of DTMs, // scanning back to check this is painful. // POSSIBLE SOLUTIONS: // Generate a list of _unique_ DTM objects? // Have each DTM cache last DOM node search? int max = m_dtms.length; for(int i = 0; i < max; i++) { DTM thisDTM=m_dtms[i]; if((null != thisDTM) && thisDTM instanceof DOM2DTM) { int handle=((DOM2DTM)thisDTM).getHandleOfNode(node); if(handle!=DTM.NULL) return handle; } } // Not found; generate a new DTM. // // %REVIEW% Is this really desirable, or should we return null // and make folks explicitly instantiate from a DOMSource? The // latter is more work but gives the caller the opportunity to // explicitly add the DTM to a DTMManager... and thus to know when // it can be discarded again, which is something we need to pay much // more attention to. (Especially since only DTMs which are assigned // to a manager can use the overflow addressing scheme.) // // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode // and the DTM wasn't registered with this DTMManager, we will create // a new DTM and _still_ not be able to find the node (since it will // be resynthesized). Another reason to push hard on making all DTMs // be managed DTMs. // Since the real root of our tree may be a DocumentFragment, we need to // use getParent to find the root, instead of getOwnerDocument. Otherwise // DOM2DTM#getHandleOfNode will be very unhappy. Node root = node; Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode(); for (; p != null; p = p.getParentNode()) { root = p; } DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root), false, null, true, true); int handle; if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode) { // Can't return the same node since it's unique to a specific DTM, // but can return the equivalent node -- find the corresponding // Document Element, then ask it for the xml: namespace decl. handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement()); handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName()); } else handle = ((DOM2DTM)dtm).getHandleOfNode(node); if(DTM.NULL == handle) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!"); return handle; } }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
public void dumpDTM(OutputStream os) { try { if(os==null) { File f = new File("DTMDump"+((Object)this).hashCode()+".txt"); System.err.println("Dumping... "+f.getAbsolutePath()); os=new FileOutputStream(f); } PrintStream ps = new PrintStream(os); while (nextNode()){} int nRecords = m_size; ps.println("Total nodes: " + nRecords); for (int index = 0; index < nRecords; ++index) { int i=makeNodeHandle(index); ps.println("=========== index=" + index + " handle=" + i + " ==========="); ps.println("NodeName: " + getNodeName(i)); ps.println("NodeNameX: " + getNodeNameX(i)); ps.println("LocalName: " + getLocalName(i)); ps.println("NamespaceURI: " + getNamespaceURI(i)); ps.println("Prefix: " + getPrefix(i)); int exTypeID = _exptype(index); ps.println("Expanded Type ID: " + Integer.toHexString(exTypeID)); int type = _type(index); String typestring; switch (type) { case DTM.ATTRIBUTE_NODE : typestring = "ATTRIBUTE_NODE"; break; case DTM.CDATA_SECTION_NODE : typestring = "CDATA_SECTION_NODE"; break; case DTM.COMMENT_NODE : typestring = "COMMENT_NODE"; break; case DTM.DOCUMENT_FRAGMENT_NODE : typestring = "DOCUMENT_FRAGMENT_NODE"; break; case DTM.DOCUMENT_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.DOCUMENT_TYPE_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.ELEMENT_NODE : typestring = "ELEMENT_NODE"; break; case DTM.ENTITY_NODE : typestring = "ENTITY_NODE"; break; case DTM.ENTITY_REFERENCE_NODE : typestring = "ENTITY_REFERENCE_NODE"; break; case DTM.NAMESPACE_NODE : typestring = "NAMESPACE_NODE"; break; case DTM.NOTATION_NODE : typestring = "NOTATION_NODE"; break; case DTM.NULL : typestring = "NULL"; break; case DTM.PROCESSING_INSTRUCTION_NODE : typestring = "PROCESSING_INSTRUCTION_NODE"; break; case DTM.TEXT_NODE : typestring = "TEXT_NODE"; break; default : typestring = "Unknown!"; break; } ps.println("Type: " + typestring); int firstChild = _firstch(index); if (DTM.NULL == firstChild) ps.println("First child: DTM.NULL"); else if (NOTPROCESSED == firstChild) ps.println("First child: NOTPROCESSED"); else ps.println("First child: " + firstChild); if (m_prevsib != null) { int prevSibling = _prevsib(index); if (DTM.NULL == prevSibling) ps.println("Prev sibling: DTM.NULL"); else if (NOTPROCESSED == prevSibling) ps.println("Prev sibling: NOTPROCESSED"); else ps.println("Prev sibling: " + prevSibling); } int nextSibling = _nextsib(index); if (DTM.NULL == nextSibling) ps.println("Next sibling: DTM.NULL"); else if (NOTPROCESSED == nextSibling) ps.println("Next sibling: NOTPROCESSED"); else ps.println("Next sibling: " + nextSibling); int parent = _parent(index); if (DTM.NULL == parent) ps.println("Parent: DTM.NULL"); else if (NOTPROCESSED == parent) ps.println("Parent: NOTPROCESSED"); else ps.println("Parent: " + parent); int level = _level(index); ps.println("Level: " + level); ps.println("Node Value: " + getNodeValue(i)); ps.println("String Value: " + getStringValue(i)); } } catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
// in src/org/apache/xml/res/XMLMessages.java
public static final String createMsg(ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); if (msg == null) { msg = fResourceBundle.getString(BAD_CODE); throwex = true; } if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); } catch (Exception e) { fmsg = fResourceBundle.getString(FORMAT_FAILED); fmsg += " " + msg; } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xml/serializer/utils/Messages.java
private final String createMsg( ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); else msgKey = ""; if (msg == null) { throwex = true; /* The message is not in the bundle . . . this is bad, * so try to get the message that the message is not in the bundle */ try { msg = java.text.MessageFormat.format( MsgKey.BAD_MSGKEY, new Object[] { msgKey, m_resourceBundleName }); } catch (Exception e) { /* even the message that the message is not in the bundle is * not there ... this is really bad */ msg = "The message key '" + msgKey + "' is not in the message class '" + m_resourceBundleName+"'"; } } else if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); // if we get past the line above we have create the message ... hurray! } catch (Exception e) { throwex = true; try { // Get the message that the format failed. fmsg = java.text.MessageFormat.format( MsgKey.BAD_MSGFORMAT, new Object[] { msgKey, m_resourceBundleName }); fmsg += " " + msg; } catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; } } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xml/serializer/SerializerBase.java
public String getNamespaceURI(String qname, boolean isElement) { String uri = EMPTYSTRING; int col = qname.lastIndexOf(':'); final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING; if (!EMPTYSTRING.equals(prefix) || isElement) { if (m_prefixMap != null) { uri = m_prefixMap.lookupNamespace(prefix); if (uri == null && !prefix.equals(XMLNS_PREFIX)) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_NAMESPACE_PREFIX, new Object[] { qname.substring(0, col) } )); } } } return uri; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void flush() { try { if (m_firstTagNotEmitted) { emitFirstTag(); } if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } } catch(SAXException e) { throw new RuntimeException(e.toString()); } }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String escapeString(String s) { StringBuffer sb = new StringBuffer(); int length = s.length(); for (int i = 0; i < length; i++) { char ch = s.charAt(i); if ('<' == ch) { sb.append("&lt;"); } else if ('>' == ch) { sb.append("&gt;"); } else if ('&' == ch) { sb.append("&amp;"); } else if (0xd800 <= ch && ch < 0xdc00) { // UTF-16 surrogate int next; if (i + 1 >= length) { throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_UTF16_SURROGATE, new Object[]{ Integer.toHexString(ch) })); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = s.charAt(++i); if (!(0xdc00 <= next && next < 0xe000)) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_UTF16_SURROGATE, new Object[]{ Integer.toHexString(ch) + " " + Integer.toHexString(next) })); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); next = ((ch - 0xd800) << 10) + next - 0xdc00 + 0x00010000; } sb.append("&#x"); sb.append(Integer.toHexString(next)); sb.append(";"); } else { sb.append(ch); } } return sb.toString(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String getSource() throws TransformerException { StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); String text = ""; try { URL docURL = new URL(m_documentBase, m_treeURL); synchronized (m_tfactory) { Transformer transformer = m_tfactory.newTransformer(); StreamSource source = new StreamSource(docURL.toString()); StreamResult result = new StreamResult(pw); transformer.transform(source, result); text = osw.toString(); } } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } catch (Exception any_error) { any_error.printStackTrace(); } return text; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String processTransformation() throws TransformerException { String htmlData = null; this.showStatus("Waiting for Transformer and Parser to finish loading and JITing..."); synchronized (m_tfactory) { URL documentURL = null; URL styleURL = null; StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); StreamResult result = new StreamResult(pw); this.showStatus("Begin Transformation..."); try { documentURL = new URL(m_codeBase, m_documentURL); StreamSource xmlSource = new StreamSource(documentURL.toString()); styleURL = new URL(m_codeBase, m_styleURL); StreamSource xslSource = new StreamSource(styleURL.toString()); Transformer transformer = m_tfactory.newTransformer(xslSource); Iterator m_entries = m_parameters.entrySet().iterator(); while (m_entries.hasNext()) { Map.Entry entry = (Map.Entry) m_entries.next(); Object key = entry.getKey(); Object expression = entry.getValue(); transformer.setParameter((String) key, expression); } transformer.transform(xmlSource, result); } catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } this.showStatus("Transformation Done!"); htmlData = osw.toString(); } return htmlData; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static String startXslElement(String qname, String namespace, SerializationHandler handler, DOM dom, int node) { try { // Get prefix from qname String prefix; final int index = qname.indexOf(':'); if (index > 0) { prefix = qname.substring(0, index); // Handle case when prefix is not known at compile time if (namespace == null || namespace.length() == 0) { runTimeError(NAMESPACE_PREFIX_ERR,prefix); } handler.startElement(namespace, qname.substring(index+1), qname); handler.namespaceAfterStartElement(prefix, namespace); } else { // Need to generate a prefix? if (namespace != null && namespace.length() > 0) { prefix = generatePrefix(); qname = prefix + ':' + qname; handler.startElement(namespace, qname, qname); handler.namespaceAfterStartElement(prefix, namespace); } else { handler.startElement(null, null, qname); } } } catch (SAXException e) { throw new RuntimeException(e.getMessage()); } return qname; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static void runTimeError(String code) { throw new RuntimeException(m_bundle.getString(code)); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static void runTimeError(String code, Object[] args) { final String message = MessageFormat.format(m_bundle.getString(code), args); throw new RuntimeException(message); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public String close() { try { _writer.flush(); } catch (IOException e) { throw new RuntimeException(e.toString()); } return ""; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(String s) { try { _writer.write(s); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(char[] s, int from, int to) { try { _writer.write(s, from, to); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(char ch) { try { _writer.write(ch); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
public static void main (String args[]) { // If we should call System.exit or not //@todo make this settable for use inside other java progs boolean systemExitOK = true; // This is the stream we'll set as our System.in InputStream input = null; // The number of arguments final int argc = args.length; // The arguments we'll pass to the real 'main()' String[] new_args = new String[argc - 2]; int new_argc = 0; // Parse all parameters passed to this class for (int i = 0; i < argc; i++) { // Parse option '-stdin <filename>' if (args[i].equals("-stdin")) { // This option must have an argument if ((++i >= argc) || (args[i].startsWith("-"))) { System.err.println(ERRMSG); throw new RuntimeException(ERRMSG); } try { input = new FileInputStream(args[i]); } catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); } catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); } } else { if (new_argc == new_args.length) { System.err.println("Missing -stdin option!"); throw new RuntimeException(); } new_args[new_argc++] = args[i]; } } System.setIn(input); try { java_cup.Main.main(new_args); } catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void assertion(boolean condition, String msg) throws RuntimeException { if (!condition) throw new RuntimeException(msg); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemTemplateElement getElemFromExpression(Expression expr) { ExpressionNode parent = expr.exprGetParent(); while(null != parent) { if(parent instanceof ElemTemplateElement) return (ElemTemplateElement)parent; parent = parent.exprGetParent(); } throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_NO_TEMPLATE_PARENT, null)); // "Programmer's error! expr has no ElemTemplateElement parent!"); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private final void assertIsLocPathIterator(Expression expr1, ExpressionOwner eo) throws RuntimeException { if(!(expr1 instanceof LocPathIterator)) { String errMsg; if(expr1 instanceof Variable) { errMsg = "Programmer's assertion: expr1 not an iterator: "+ ((Variable)expr1).getQName(); } else { errMsg = "Programmer's assertion: expr1 not an iterator: "+ expr1.getClass().getName(); } throw new RuntimeException(errMsg + ", "+ eo.getClass().getName()+" "+ expr1.exprGetParent()); } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected static void assertion(boolean b, String msg) { if(!b) { throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR, new Object[]{msg})); // "Programmer's assertion in RundundentExprEliminator: "+msg); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void error(String msg, Object[] args) { String themsg = XSLMessages.createMessage(msg, args); throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[]{ themsg })); }
// in src/org/apache/xalan/transformer/KeyIterator.java
public short acceptNode(int testNode) { boolean foundKey = false; KeyIterator ki = (KeyIterator) m_lpi; org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); Vector keys = ki.getKeyDeclarations(); QName name = ki.getName(); try { // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // See if our node matches the given key declaration according to // the match attribute on xsl:key. XPath matchExpr = kd.getMatch(); double score = matchExpr.getMatchScore(xctxt, testNode); if (score == kd.getMatch().MATCH_SCORE_NONE) continue; return DTMIterator.FILTER_ACCEPT; } // end for(int i = 0; i < nDeclarations; i++) } catch (TransformerException se) { // TODO: What to do? } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void run() { m_hasBeenReset = false; try { // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot(); // transformNode(n); try { m_isTransformDone = false; // Should no longer be needed... // if(m_inputContentHandler instanceof TransformerHandlerImpl) // { // TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler; // thi.waitForInitialEvents(); // } transformNode(m_doc); } catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); } finally { m_isTransformDone = true; if (m_inputContentHandler instanceof TransformerHandlerImpl) { ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine(); } // synchronized (this) // { // notifyAll(); // } } } catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. } }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
public short filterNode(int testNode) { boolean foundKey = false; Vector keys = m_keyDeclarations; QName name = m_name; KeyIterator ki = (KeyIterator)(((XNodeSet)m_keysNodes).getContainedIter()); org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); if(null == xctxt) assertion(false, "xctxt can not be null here!"); try { XMLString lookupKey = m_ref; // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // Query from the node, according the the select pattern in the // use attribute in xsl:key. XObject xuse = kd.getUse().execute(xctxt, testNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); if (lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } else { DTMIterator nl = ((XNodeSet)xuse).iterRaw(); int useNode; while (DTM.NULL != (useNode = nl.nextNode())) { DTM dtm = getDTM(useNode); XMLString exprResult = dtm.getStringValue(useNode); if ((null != exprResult) && lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } } } // end for(int i = 0; i < nDeclarations; i++) } catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/xslt/Process.java
static void doExit(String msg) { throw new RuntimeException(msg); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dumpDTM( ) { try { // File f = new File("DTMDump"+((Object)this).hashCode()+".txt"); File f = new File("DTMDump.txt"); System.err.println("Dumping... "+f.getAbsolutePath()); PrintStream ps = new PrintStream(new FileOutputStream(f)); while (nextNode()){} int nRecords = m_size; ps.println("Total nodes: " + nRecords); for (int i = 0; i < nRecords; i++) { ps.println("=========== " + i + " ==========="); ps.println("NodeName: " + getNodeName(makeNodeHandle(i))); ps.println("NodeNameX: " + getNodeNameX(makeNodeHandle(i))); ps.println("LocalName: " + getLocalName(makeNodeHandle(i))); ps.println("NamespaceURI: " + getNamespaceURI(makeNodeHandle(i))); ps.println("Prefix: " + getPrefix(makeNodeHandle(i))); int exTypeID = getExpandedTypeID(makeNodeHandle(i)); ps.println("Expanded Type ID: " + Integer.toHexString(exTypeID)); int type = getNodeType(makeNodeHandle(i)); String typestring; switch (type) { case DTM.ATTRIBUTE_NODE : typestring = "ATTRIBUTE_NODE"; break; case DTM.CDATA_SECTION_NODE : typestring = "CDATA_SECTION_NODE"; break; case DTM.COMMENT_NODE : typestring = "COMMENT_NODE"; break; case DTM.DOCUMENT_FRAGMENT_NODE : typestring = "DOCUMENT_FRAGMENT_NODE"; break; case DTM.DOCUMENT_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.DOCUMENT_TYPE_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.ELEMENT_NODE : typestring = "ELEMENT_NODE"; break; case DTM.ENTITY_NODE : typestring = "ENTITY_NODE"; break; case DTM.ENTITY_REFERENCE_NODE : typestring = "ENTITY_REFERENCE_NODE"; break; case DTM.NAMESPACE_NODE : typestring = "NAMESPACE_NODE"; break; case DTM.NOTATION_NODE : typestring = "NOTATION_NODE"; break; case DTM.NULL : typestring = "NULL"; break; case DTM.PROCESSING_INSTRUCTION_NODE : typestring = "PROCESSING_INSTRUCTION_NODE"; break; case DTM.TEXT_NODE : typestring = "TEXT_NODE"; break; default : typestring = "Unknown!"; break; } ps.println("Type: " + typestring); int firstChild = _firstch(i); if (DTM.NULL == firstChild) ps.println("First child: DTM.NULL"); else if (NOTPROCESSED == firstChild) ps.println("First child: NOTPROCESSED"); else ps.println("First child: " + firstChild); int prevSibling = _prevsib(i); if (DTM.NULL == prevSibling) ps.println("Prev sibling: DTM.NULL"); else if (NOTPROCESSED == prevSibling) ps.println("Prev sibling: NOTPROCESSED"); else ps.println("Prev sibling: " + prevSibling); int nextSibling = _nextsib(i); if (DTM.NULL == nextSibling) ps.println("Next sibling: DTM.NULL"); else if (NOTPROCESSED == nextSibling) ps.println("Next sibling: NOTPROCESSED"); else ps.println("Next sibling: " + nextSibling); int parent = _parent(i); if (DTM.NULL == parent) ps.println("Parent: DTM.NULL"); else if (NOTPROCESSED == parent) ps.println("Parent: NOTPROCESSED"); else ps.println("Parent: " + parent); int level = _level(i); ps.println("Level: " + level); ps.println("Node Value: " + getNodeValue(i)); ps.println("String Value: " + getStringValue(i)); ps.println("First Attribute Node: " + m_attribute.elementAt(i)); } } catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); } }
// in src/org/apache/xpath/XPath.java
public void assertion(boolean b, String msg) { if (!b) { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/Compiler.java
public void assertion(boolean b, java.lang.String msg) { if (!b) { java.lang.String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private void assertion(boolean b, String msg) { if (!b) { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/OpMap.java
public int getNextStepPos(int opPos) { int stepType = getOp(opPos); if ((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES)) { return getNextOpPos(opPos); } else if ((stepType >= OpCodes.FIRST_NODESET_OP) && (stepType <= OpCodes.LAST_NODESET_OP)) { int newOpPos = getNextOpPos(opPos); while (OpCodes.OP_PREDICATE == getOp(newOpPos)) { newOpPos = getNextOpPos(newOpPos); } stepType = getOp(newOpPos); if (!((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES))) { return OpCodes.ENDOP; } return newOpPos; } else { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{String.valueOf(stepType)})); //"Programmer's assertion in getNextStepPos: unknown stepType: " + stepType); } }
// in src/org/apache/xpath/NodeSetDTM.java
public int previousNode() { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return DTM.NULL; }
// in src/org/apache/xpath/NodeSetDTM.java
public void runTo(int index) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!"); if ((index >= 0) && (m_next < m_firstFree)) m_next = index; else m_next = m_firstFree - 1; }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNode(int n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); this.addElement(n); }
// in src/org/apache/xpath/NodeSetDTM.java
public void insertNode(int n, int pos) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); insertElementAt(n, pos); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeNode(int n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); this.removeElement(n); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNodes(DTMIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { int obj; while (DTM.NULL != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNodesInDocOrder(DTMIterator iterator, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); int node; while (DTM.NULL != (node = iterator.nextNode())) { addNodeInDocOrder(node, support); } }
// in src/org/apache/xpath/NodeSetDTM.java
public int addNodeInDocOrder(int node, boolean test, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); int insertIndex = -1; if (test) { // This needs to do a binary search, but a binary search // is somewhat tough because the sequence test involves // two nodes. int size = size(), i; for (i = size - 1; i >= 0; i--) { int child = elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } DTM dtm = support.getDTM(node); if (!dtm.isNodeAfter(node, child)) { break; } } if (i != -2) { insertIndex = i + 1; insertElementAt(node, insertIndex); } } else { insertIndex = this.size(); boolean foundit = false; for (int i = 0; i < insertIndex; i++) { if (i == node) { foundit = true; break; } } if (!foundit) addElement(node); } // checkDups(); return insertIndex; }
// in src/org/apache/xpath/NodeSetDTM.java
public int addNodeInDocOrder(int node, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); return addNodeInDocOrder(node, true, support); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addElement(int value) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.addElement(value); }
// in src/org/apache/xpath/NodeSetDTM.java
public void insertElementAt(int value, int at) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.insertElementAt(value, at); }
// in src/org/apache/xpath/NodeSetDTM.java
public void appendNodes(NodeVector nodes) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.appendNodes(nodes); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeAllElements() { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.removeAllElements(); }
// in src/org/apache/xpath/NodeSetDTM.java
public boolean removeElement(int s) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); return super.removeElement(s); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeElementAt(int i) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.removeElementAt(i); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setElementAt(int node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.setElementAt(node, index); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setItem(int node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.setElementAt(node, index); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setCurrentPos(int i) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!"); m_next = i; }
// in src/org/apache/xpath/NodeSetDTM.java
public int getCurrentNode() { if (!m_cacheNodes) throw new RuntimeException( "This NodeSetDTM can not do indexing or counting functions!"); int saved = m_next; // because nextNode always increments // But watch out for copy29, where the root iterator didn't // have nextNode called on it. int current = (m_next > 0) ? m_next-1 : m_next; int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL; m_next = saved; // HACK: I think this is a bit of a hack. -sb return n; }
// in src/org/apache/xpath/NodeSetDTM.java
public void setShouldCacheNodes(boolean b) { if (!isFresh()) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!"); m_cacheNodes = b; m_mutable = true; }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public void detach() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"detach() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public double num() throws javax.xml.transform.TransformerException { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public XMLString xstr() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"xstr() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public String str() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"str() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public int rtf() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"rtf() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public DTMIterator asNodeIterator() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XStringForChars.java
public FastStringBuffer fsb() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS, null)); //"fsb() not supported for XStringForChars!"); }
// in src/org/apache/xpath/objects/XNodeSet.java
public DTMIterator iter() { try { if(hasCache()) return cloneWithReset(); else return this; // don't bother to clone... won't do any good! } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); } }
// in src/org/apache/xpath/objects/XNodeSet.java
public XObject getFresh() { try { if(hasCache()) return (XObject)cloneWithReset(); else return this; // don't bother to clone... won't do any good! } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); } }
// in src/org/apache/xpath/NodeSet.java
public Node previousNode() throws DOMException { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return null; }
// in src/org/apache/xpath/NodeSet.java
public void runTo(int index) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); if ((index >= 0) && (m_next < m_firstFree)) m_next = index; else m_next = m_firstFree - 1; }
// in src/org/apache/xpath/NodeSet.java
public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
// in src/org/apache/xpath/NodeSet.java
public void insertNode(Node n, int pos) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); insertElementAt(n, pos); }
// in src/org/apache/xpath/NodeSet.java
public void removeNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.removeElement(n); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeList nodelist) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != nodelist) // defensive to fix a bug that Sanjiva reported. { int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node obj = nodelist.item(i); if (null != obj) { addElement(obj); } } } // checkDups(); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeSet ns) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); addNodes((NodeIterator) ns); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { Node obj; while (null != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
// in src/org/apache/xpath/NodeSet.java
public void addNodesInDocOrder(NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node node = nodelist.item(i); if (null != node) { addNodeInDocOrder(node, support); } } }
// in src/org/apache/xpath/NodeSet.java
public void addNodesInDocOrder(NodeIterator iterator, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); Node node; while (null != (node = iterator.nextNode())) { addNodeInDocOrder(node, support); } }
// in src/org/apache/xpath/NodeSet.java
private boolean addNodesInDocOrder(int start, int end, int testIndex, NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); boolean foundit = false; int i; Node node = nodelist.item(testIndex); for (i = end; i >= start; i--) { Node child = (Node) elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } if (!DOM2Helper.isNodeAfter(node, child)) { insertElementAt(node, i + 1); testIndex--; if (testIndex > 0) { boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist, support); if (!foundPrev) { addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support); } } break; } } if (i == -1) { insertElementAt(node, 0); } return foundit; }
// in src/org/apache/xpath/NodeSet.java
public int addNodeInDocOrder(Node node, boolean test, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int insertIndex = -1; if (test) { // This needs to do a binary search, but a binary search // is somewhat tough because the sequence test involves // two nodes. int size = size(), i; for (i = size - 1; i >= 0; i--) { Node child = (Node) elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } if (!DOM2Helper.isNodeAfter(node, child)) { break; } } if (i != -2) { insertIndex = i + 1; insertElementAt(node, insertIndex); } } else { insertIndex = this.size(); boolean foundit = false; for (int i = 0; i < insertIndex; i++) { if (this.item(i).equals(node)) { foundit = true; break; } } if (!foundit) addElement(node); } // checkDups(); return insertIndex; }
// in src/org/apache/xpath/NodeSet.java
public int addNodeInDocOrder(Node node, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); return addNodeInDocOrder(node, true, support); }
// in src/org/apache/xpath/NodeSet.java
public void setCurrentPos(int i) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); m_next = i; }
// in src/org/apache/xpath/NodeSet.java
public Node getCurrentNode() { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); int saved = m_next; Node n = (m_next < m_firstFree) ? elementAt(m_next) : null; m_next = saved; // HACK: I think this is a bit of a hack. -sb return n; }
// in src/org/apache/xpath/NodeSet.java
public void setShouldCacheNodes(boolean b) { if (!isFresh()) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!"); m_cacheNodes = b; m_mutable = true; }
// in src/org/apache/xpath/NodeSet.java
public void addElement(Node value) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if ((m_firstFree + 1) >= m_mapSize) { if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } else { m_mapSize += m_blocksize; Node newMap[] = new Node[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } } m_map[m_firstFree] = value; m_firstFree++; }
// in src/org/apache/xpath/NodeSet.java
public void insertElementAt(Node value, int at) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } else if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; Node newMap[] = new Node[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } if (at <= (m_firstFree - 1)) { System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at); } m_map[at] = value; m_firstFree++; }
// in src/org/apache/xpath/NodeSet.java
public boolean removeElement(Node s) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { Node node = m_map[i]; if ((null != node) && node.equals(s)) { if (i < m_firstFree - 1) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1); m_firstFree--; m_map[m_firstFree] = null; return true; } } return false; }
// in src/org/apache/xpath/NodeSet.java
public void setElementAt(Node node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } m_map[index] = node; }
// in src/org/apache/xpath/functions/FuncCurrent.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/res/XPATHMessages.java
public static final String createXPATHMsg(ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); if (msg == null) { msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE); throwex = true; } if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); } catch (Exception e) { fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); fmsg += " " + msg; } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xpath/SourceTreeManager.java
public void putDocumentInCache(int n, Source source) { int cachedNode = getNode(source); if (DTM.NULL != cachedNode) { if (!(cachedNode == n)) throw new RuntimeException( "Programmer's Error! " + "putDocumentInCache found reparse of doc: " + source.getSystemId()); return; } if (null != source.getSystemId()) { m_sourceTree.addElement(new SourceTree(n, source.getSystemId())); } }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
public short acceptNode(int n, XPathContext xctxt) { try { xctxt.pushCurrentNode(n); xctxt.pushIteratorRoot(m_context); if(DEBUG) { System.out.println("traverser: "+m_traverser); System.out.print("node: "+n); System.out.println(", "+m_cdtm.getNodeName(n)); // if(m_cdtm.getNodeName(n).equals("near-east")) System.out.println("pattern: "+m_pattern.toString()); m_pattern.debugWhatToShow(m_pattern.getWhatToShow()); } XObject score = m_pattern.execute(xctxt); if(DEBUG) { // System.out.println("analysis: "+Integer.toBinaryString(m_analysis)); System.out.println("score: "+score); System.out.println("skip: "+(score == NodeTest.SCORE_NONE)); } // System.out.println("\n::acceptNode - score: "+score.num()+"::"); return (score == NodeTest.SCORE_NONE) ? DTMIterator.FILTER_SKIP : DTMIterator.FILTER_ACCEPT; } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); xctxt.popIteratorRoot(); } }
// in src/org/apache/xpath/axes/FilterExprWalker.java
public short acceptNode(int n) { try { if (getPredicateCount() > 0) { countProximityPosition(0); if (!executePredicates(n, m_lpi.getXPathContext())) return DTMIterator.FILTER_SKIP; } return DTMIterator.FILTER_ACCEPT; } catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); } }
// in src/org/apache/xpath/axes/AxesWalker.java
public void setRoot(int root) { // %OPT% Get this directly from the lpi. XPathContext xctxt = wi().getXPathContext(); m_dtm = xctxt.getDTM(root); m_traverser = m_dtm.getAxisTraverser(m_axis); m_isFresh = true; m_foundLast = false; m_root = root; m_currentNode = root; if (DTM.NULL == root) { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!"); } resetProximityPositions(); }
// in src/org/apache/xpath/axes/LocPathIterator.java
public int previousNode() { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!"); }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static int getAxisFromStep( Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(stepOpCodePos); switch (stepType) { case OpCodes.FROM_FOLLOWING : return Axis.FOLLOWING; case OpCodes.FROM_FOLLOWING_SIBLINGS : return Axis.FOLLOWINGSIBLING; case OpCodes.FROM_PRECEDING : return Axis.PRECEDING; case OpCodes.FROM_PRECEDING_SIBLINGS : return Axis.PRECEDINGSIBLING; case OpCodes.FROM_PARENT : return Axis.PARENT; case OpCodes.FROM_NAMESPACE : return Axis.NAMESPACE; case OpCodes.FROM_ANCESTORS : return Axis.ANCESTOR; case OpCodes.FROM_ANCESTORS_OR_SELF : return Axis.ANCESTORORSELF; case OpCodes.FROM_ATTRIBUTES : return Axis.ATTRIBUTE; case OpCodes.FROM_ROOT : return Axis.ROOT; case OpCodes.FROM_CHILDREN : return Axis.CHILD; case OpCodes.FROM_DESCENDANTS_OR_SELF : return Axis.DESCENDANTORSELF; case OpCodes.FROM_DESCENDANTS : return Axis.DESCENDANT; case OpCodes.FROM_SELF : return Axis.SELF; case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : return Axis.FILTEREDLIST; } throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isOptimizableForDescendantIterator( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; boolean foundDorDS = false; boolean foundSelf = false; boolean foundDS = false; int nodeTestType = OpCodes.NODETYPE_NODE; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { // The DescendantIterator can only do one node test. If there's more // than one, use another iterator. if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT) return false; stepCount++; if(stepCount > 3) return false; boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType); if(mightBeProximate) return false; switch (stepType) { case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : return false; case OpCodes.FROM_ROOT : if(1 != stepCount) return false; break; case OpCodes.FROM_CHILDREN : if(!foundDS && !(foundDorDS && foundSelf)) return false; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : foundDS = true; case OpCodes.FROM_DESCENDANTS : if(3 == stepCount) return false; foundDorDS = true; break; case OpCodes.FROM_SELF : if(1 != stepCount) return false; foundSelf = true; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } nodeTestType = compiler.getStepTestType(stepOpCodePos); int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; if(OpCodes.ENDOP != compiler.getOp(nextStepOpCodePos)) { if(compiler.countPredicates(stepOpCodePos) > 0) { return false; } } stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static int analyze( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; int analysisResult = 0x00000000; // 32 bits of analysis while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; // String namespace = compiler.getStepNS(stepOpCodePos); // boolean isNSWild = (null != namespace) // ? namespace.equals(NodeTest.WILD) : false; // String localname = compiler.getStepLocalName(stepOpCodePos); // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false; boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos, stepType); if (predAnalysis) analysisResult |= BIT_PREDICATE; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : analysisResult |= BIT_FILTER; break; case OpCodes.FROM_ROOT : analysisResult |= BIT_ROOT; break; case OpCodes.FROM_ANCESTORS : analysisResult |= BIT_ANCESTOR; break; case OpCodes.FROM_ANCESTORS_OR_SELF : analysisResult |= BIT_ANCESTOR_OR_SELF; break; case OpCodes.FROM_ATTRIBUTES : analysisResult |= BIT_ATTRIBUTE; break; case OpCodes.FROM_NAMESPACE : analysisResult |= BIT_NAMESPACE; break; case OpCodes.FROM_CHILDREN : analysisResult |= BIT_CHILD; break; case OpCodes.FROM_DESCENDANTS : analysisResult |= BIT_DESCENDANT; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : // Use a special bit to to make sure we get the right analysis of "//foo". if (2 == stepCount && BIT_ROOT == analysisResult) { analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT; } analysisResult |= BIT_DESCENDANT_OR_SELF; break; case OpCodes.FROM_FOLLOWING : analysisResult |= BIT_FOLLOWING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : analysisResult |= BIT_FOLLOWING_SIBLING; break; case OpCodes.FROM_PRECEDING : analysisResult |= BIT_PRECEDING; break; case OpCodes.FROM_PRECEDING_SIBLINGS : analysisResult |= BIT_PRECEDING_SIBLING; break; case OpCodes.FROM_PARENT : analysisResult |= BIT_PARENT; break; case OpCodes.FROM_SELF : analysisResult |= BIT_SELF; break; case OpCodes.MATCH_ATTRIBUTE : analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node() { analysisResult |= BIT_NODETEST_ANY; } stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } analysisResult |= (stepCount & BITS_COUNT); return analysisResult; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static StepPattern createDefaultStepPattern( Compiler compiler, int opPos, MatchPatternIterator mpi, int analysis, StepPattern tail, StepPattern head) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(opPos); boolean simpleInit = false; boolean prevIsOneStepDown = true; int whatToShow = compiler.getWhatToShow(opPos); StepPattern ai = null; int axis, predicateAxis; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; Expression expr; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : expr = compiler.compile(opPos); break; default : expr = compiler.compile(opPos + 2); } axis = Axis.FILTEREDLIST; predicateAxis = Axis.FILTEREDLIST; ai = new FunctionPattern(expr, axis, predicateAxis); simpleInit = true; break; case OpCodes.FROM_ROOT : whatToShow = DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT; axis = Axis.ROOT; predicateAxis = Axis.ROOT; ai = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, axis, predicateAxis); break; case OpCodes.FROM_ATTRIBUTES : whatToShow = DTMFilter.SHOW_ATTRIBUTE; axis = Axis.PARENT; predicateAxis = Axis.ATTRIBUTE; // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF); break; case OpCodes.FROM_NAMESPACE : whatToShow = DTMFilter.SHOW_NAMESPACE; axis = Axis.PARENT; predicateAxis = Axis.NAMESPACE; // ai = new StepPattern(whatToShow, axis, predicateAxis); break; case OpCodes.FROM_ANCESTORS : axis = Axis.DESCENDANT; predicateAxis = Axis.ANCESTOR; break; case OpCodes.FROM_CHILDREN : axis = Axis.PARENT; predicateAxis = Axis.CHILD; break; case OpCodes.FROM_ANCESTORS_OR_SELF : axis = Axis.DESCENDANTORSELF; predicateAxis = Axis.ANCESTORORSELF; break; case OpCodes.FROM_SELF : axis = Axis.SELF; predicateAxis = Axis.SELF; break; case OpCodes.FROM_PARENT : axis = Axis.CHILD; predicateAxis = Axis.PARENT; break; case OpCodes.FROM_PRECEDING_SIBLINGS : axis = Axis.FOLLOWINGSIBLING; predicateAxis = Axis.PRECEDINGSIBLING; break; case OpCodes.FROM_PRECEDING : axis = Axis.FOLLOWING; predicateAxis = Axis.PRECEDING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : axis = Axis.PRECEDINGSIBLING; predicateAxis = Axis.FOLLOWINGSIBLING; break; case OpCodes.FROM_FOLLOWING : axis = Axis.PRECEDING; predicateAxis = Axis.FOLLOWING; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : axis = Axis.ANCESTORORSELF; predicateAxis = Axis.DESCENDANTORSELF; break; case OpCodes.FROM_DESCENDANTS : axis = Axis.ANCESTOR; predicateAxis = Axis.DESCENDANT; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if(null == ai) { whatToShow = compiler.getWhatToShow(opPos); // %REVIEW% ai = new StepPattern(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos), axis, predicateAxis); } if (false || DEBUG_PATTERN_CREATION) { System.out.print("new step: "+ ai); System.out.print(", axis: " + Axis.getNames(ai.getAxis())); System.out.print(", predAxis: " + Axis.getNames(ai.getAxis())); System.out.print(", what: "); System.out.print(" "); ai.debugWhatToShow(ai.getWhatToShow()); } int argLen = compiler.getFirstPredicateOpPos(opPos); ai.setPredicates(compiler.getCompiledPredicates(argLen)); return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static AxesWalker createDefaultWalker(Compiler compiler, int opPos, WalkingIterator lpi, int analysis) { AxesWalker ai = null; int stepType = compiler.getOp(opPos); /* System.out.println("0: "+compiler.getOp(opPos)); System.out.println("1: "+compiler.getOp(opPos+1)); System.out.println("2: "+compiler.getOp(opPos+2)); System.out.println("3: "+compiler.getOp(opPos+3)); System.out.println("4: "+compiler.getOp(opPos+4)); System.out.println("5: "+compiler.getOp(opPos+5)); */ boolean simpleInit = false; int totalNumberWalkers = (analysis & BITS_COUNT); boolean prevIsOneStepDown = true; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; if (DEBUG_WALKER_CREATION) System.out.println("new walker: FilterExprWalker: " + analysis + ", " + compiler.toString()); ai = new FilterExprWalker(lpi); simpleInit = true; break; case OpCodes.FROM_ROOT : ai = new AxesWalker(lpi, Axis.ROOT); break; case OpCodes.FROM_ANCESTORS : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.ANCESTOR); break; case OpCodes.FROM_ANCESTORS_OR_SELF : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.ANCESTORORSELF); break; case OpCodes.FROM_ATTRIBUTES : ai = new AxesWalker(lpi, Axis.ATTRIBUTE); break; case OpCodes.FROM_NAMESPACE : ai = new AxesWalker(lpi, Axis.NAMESPACE); break; case OpCodes.FROM_CHILDREN : ai = new AxesWalker(lpi, Axis.CHILD); break; case OpCodes.FROM_DESCENDANTS : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.DESCENDANT); break; case OpCodes.FROM_DESCENDANTS_OR_SELF : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.DESCENDANTORSELF); break; case OpCodes.FROM_FOLLOWING : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.FOLLOWING); break; case OpCodes.FROM_FOLLOWING_SIBLINGS : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.FOLLOWINGSIBLING); break; case OpCodes.FROM_PRECEDING : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PRECEDING); break; case OpCodes.FROM_PRECEDING_SIBLINGS : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PRECEDINGSIBLING); break; case OpCodes.FROM_PARENT : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PARENT); break; case OpCodes.FROM_SELF : ai = new AxesWalker(lpi, Axis.SELF); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (simpleInit) { ai.initNodeTest(DTMFilter.SHOW_ALL); } else { int whatToShow = compiler.getWhatToShow(opPos); /* System.out.print("construct: "); NodeTest.debugWhatToShow(whatToShow); System.out.println("or stuff: "+(whatToShow & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_ELEMENT | DTMFilter.SHOW_PROCESSING_INSTRUCTION))); */ if ((0 == (whatToShow & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_NAMESPACE | DTMFilter.SHOW_ELEMENT | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) || (whatToShow == DTMFilter.SHOW_ALL)) ai.initNodeTest(whatToShow); else { ai.initNodeTest(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos)); } } return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isNaturalDocOrder( Compiler compiler, int stepOpCodePos, int stepIndex, int analysis) throws javax.xml.transform.TransformerException { if(canCrissCross(analysis)) return false; // Namespaces can present some problems, so just punt if we're looking for // these. if(isSet(analysis, BIT_NAMESPACE)) return false; // The following, preceding, following-sibling, and preceding sibling can // be found in doc order if we get to this point, but if they occur // together, they produce // duplicates, so it's better for us to eliminate this case so we don't // have to check for duplicates during runtime if we're using a // WalkingIterator. if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) && isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING)) return false; // OK, now we have to check for select="@*/axis::*" patterns, which // can also cause duplicates to happen. But select="axis*/@::*" patterns // are OK, as are select="@foo/axis::*" patterns. // Unfortunately, we can't do this just via the analysis bits. int stepType; int stepCount = 0; boolean foundWildAttribute = false; // Steps that can traverse anything other than down a // subtree or that can produce duplicates when used in // combonation are counted with this variable. int potentialDuplicateMakingStepCount = 0; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; switch (stepType) { case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : if(foundWildAttribute) // Maybe not needed, but be safe. return false; // This doesn't seem to work as a test for wild card. Hmph. // int nodeTestType = compiler.getStepTestType(stepOpCodePos); String localName = compiler.getStepLocalName(stepOpCodePos); // System.err.println("localName: "+localName); if(localName.equals("*")) { foundWildAttribute = true; } break; case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : case OpCodes.FROM_DESCENDANTS_OR_SELF : case OpCodes.FROM_DESCENDANTS : if(potentialDuplicateMakingStepCount > 0) return false; potentialDuplicateMakingStepCount++; case OpCodes.FROM_ROOT : case OpCodes.FROM_CHILDREN : case OpCodes.FROM_SELF : if(foundWildAttribute) return false; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public short acceptNode(int n) { XPathContext xctxt = m_lpi.getXPathContext(); try { xctxt.pushCurrentNode(n); XObject score = execute(xctxt, n); // System.out.println("\n::acceptNode - score: "+score.num()+"::"); if (score != NodeTest.SCORE_NONE) { if (getPredicateCount() > 0) { countProximityPosition(0); if (!executePredicates(n, xctxt)) return DTMIterator.FILTER_SKIP; } return DTMIterator.FILTER_ACCEPT; } } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); } return DTMIterator.FILTER_SKIP; }
// in src/org/apache/xpath/axes/UnionChildIterator.java
public short acceptNode(int n) { XPathContext xctxt = getXPathContext(); try { xctxt.pushCurrentNode(n); for (int i = 0; i < m_nodeTests.length; i++) { PredicatedNodeTest pnt = m_nodeTests[i]; XObject score = pnt.execute(xctxt, n); if (score != NodeTest.SCORE_NONE) { // Note that we are assuming there are no positional predicates! if (pnt.getPredicateCount() > 0) { if (pnt.executePredicates(n, xctxt)) return DTMIterator.FILTER_ACCEPT; } else return DTMIterator.FILTER_ACCEPT; } } } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); } return DTMIterator.FILTER_SKIP; }
// in src/org/apache/xpath/patterns/StepPattern.java
private final boolean checkProximityPosition(XPathContext xctxt, int predPos, DTM dtm, int context, int pos) { try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.PRECEDINGSIBLING); for (int child = traverser.first(context); DTM.NULL != child; child = traverser.next(context, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { throw new Error("Why: Should never have been called"); } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos--; if (pos < 1) return false; } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return (pos == 1); }
// in src/org/apache/xpath/patterns/StepPattern.java
private final int getProximityPosition(XPathContext xctxt, int predPos, boolean findLast) { int pos = 0; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int parent = dtm.getParent(context); try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.CHILD); for (int child = traverser.first(parent); DTM.NULL != child; child = traverser.next(parent, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { if ((pos + 1) != (int) pred.numWithSideEffects()) { pass = false; break; } } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos++; if (!findLast && child == context) { return pos; } } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return pos; }
// in src/org/apache/xpath/Expression.java
public void assertion(boolean b, java.lang.String msg) { if (!b) { java.lang.String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
25
              
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
4
              
// in src/org/apache/xml/utils/DOMHelper.java
public static Node getParentOfNode(Node node) throws RuntimeException { Node parent; short nodeType = node.getNodeType(); if (Node.ATTRIBUTE_NODE == nodeType) { Document doc = node.getOwnerDocument(); /* TBD: if(null == doc) { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!"); } */ // Given how expensive the tree walk may be, we should first ask // whether this DOM can answer the question for us. The additional // test does slow down Level 1 DOMs slightly. DOMHelper2, which // is currently specialized for Xerces, assumes it can use the // Level 2 solution. We might want to have an intermediate stage, // which would assume DOM Level 2 but not assume Xerces. // // (Shouldn't have to check whether impl is null in a compliant DOM, // but let's be paranoid for a moment...) DOMImplementation impl=doc.getImplementation(); if(impl!=null && impl.hasFeature("Core","2.0")) { parent=((Attr)node).getOwnerElement(); return parent; } // DOM Level 1 solution, as fallback. Hugely expensive. Element rootElem = doc.getDocumentElement(); if (null == rootElem) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT, null)); //"Attribute child does not have an owner document element!"); } parent = locateAttrParent(rootElem, node); } else { parent = node.getParentNode(); // if((Node.DOCUMENT_NODE != nodeType) && (null == parent)) // { // throw new RuntimeException("Child does not have parent!"); // } } return parent; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void assertion(boolean condition, String msg) throws RuntimeException { if (!condition) throw new RuntimeException(msg); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private final void assertIsLocPathIterator(Expression expr1, ExpressionOwner eo) throws RuntimeException { if(!(expr1 instanceof LocPathIterator)) { String errMsg; if(expr1 instanceof Variable) { errMsg = "Programmer's assertion: expr1 not an iterator: "+ ((Variable)expr1).getQName(); } else { errMsg = "Programmer's assertion: expr1 not an iterator: "+ expr1.getClass().getName(); } throw new RuntimeException(errMsg + ", "+ eo.getClass().getName()+" "+ expr1.exprGetParent()); } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private static void validateNewAddition(Vector paths, ExpressionOwner owner, LocPathIterator path) throws RuntimeException { assertion(owner.getExpression() == path, "owner.getExpression() != path!!!"); int n = paths.size(); // There should never be any duplicates in the list! for(int i = 0; i < n; i++) { ExpressionOwner ew = (ExpressionOwner)paths.elementAt(i); assertion(ew != owner, "duplicate owner on the list!!!"); assertion(ew.getExpression() != path, "duplicate expression on the list!!!"); } }
(Domain) ConfigurationError 90
              
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
75
              
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
105
              
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
(Domain) IllegalArgumentException 72
              
// in src/org/apache/xml/dtm/DTMException.java
public synchronized Throwable initCause(Throwable cause) { if ((this.containedException == null) && (cause != null)) { throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause"); } if (cause == this) { throw new IllegalArgumentException( XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted"); } this.containedException = cause; return this; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node) { if(null == node) throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!"); if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy) return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber(); else { // Find the DOM2DTMs wrapped around this Document (if any) // and check whether they contain the Node in question. // // NOTE that since a DOM2DTM may represent a subtree rather // than a full document, we have to be prepared to check more // than one -- and there is no guarantee that we will find // one that contains ancestors or siblings of the node we're // seeking. // // %REVIEW% We could search for the one which contains this // node at the deepest level, and thus covers the widest // subtree, but that's going to entail additional work // checking more DTMs... and getHandleOfNode is not a // cheap operation in most implementations. // // TODO: %REVIEW% If overflow addressing, we may recheck a DTM // already examined. Ouch. But with the increased number of DTMs, // scanning back to check this is painful. // POSSIBLE SOLUTIONS: // Generate a list of _unique_ DTM objects? // Have each DTM cache last DOM node search? int max = m_dtms.length; for(int i = 0; i < max; i++) { DTM thisDTM=m_dtms[i]; if((null != thisDTM) && thisDTM instanceof DOM2DTM) { int handle=((DOM2DTM)thisDTM).getHandleOfNode(node); if(handle!=DTM.NULL) return handle; } } // Not found; generate a new DTM. // // %REVIEW% Is this really desirable, or should we return null // and make folks explicitly instantiate from a DOMSource? The // latter is more work but gives the caller the opportunity to // explicitly add the DTM to a DTMManager... and thus to know when // it can be discarded again, which is something we need to pay much // more attention to. (Especially since only DTMs which are assigned // to a manager can use the overflow addressing scheme.) // // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode // and the DTM wasn't registered with this DTMManager, we will create // a new DTM and _still_ not be able to find the node (since it will // be resynthesized). Another reason to push hard on making all DTMs // be managed DTMs. // Since the real root of our tree may be a DocumentFragment, we need to // use getParent to find the root, instead of getOwnerDocument. Otherwise // DOM2DTM#getHandleOfNode will be very unhappy. Node root = node; Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode(); for (; p != null; p = p.getParentNode()) { root = p; } DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root), false, null, true, true); int handle; if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode) { // Can't return the same node since it's unique to a specific DTM, // but can return the equivalent node -- find the corresponding // Document Element, then ask it for the xml: namespace decl. handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement()); handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName()); } else handle = ((DOM2DTM)dtm).getHandleOfNode(node); if(DTM.NULL == handle) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!"); return handle; } }
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { _result = result; if (null == result) { ErrorMsg err = new ErrorMsg(ErrorMsg.ER_RESULT_NULL); throw new IllegalArgumentException(err.toString()); //"result should not be null"); } if (_isIdentity) { try { // Connect this object with output system directly SerializationHandler outputHandler = _transformer.getOutputHandler(result); _transformer.transferOutputProperties(outputHandler); _handler = outputHandler; _lexHandler = outputHandler; } catch (TransformerException e) { _result = null; } } else if (_done) { // Run the transformation now, if not already done try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "TransformerFactory"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // Return value for attribute 'translet-name' if (name.equals(TRANSLET_NAME)) { return _transletName; } else if (name.equals(GENERATE_TRANSLET)) { return _generateTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(AUTO_TRANSLET)) { return _autoTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(ENABLE_INLINING)) { if (_enableInlining) return Boolean.TRUE; else return Boolean.FALSE; } // Throw an exception for all other attributes ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // Set the default translet name (ie. class name), which will be used // for translets that cannot be given a name from their system-id. if (name.equals(TRANSLET_NAME) && value instanceof String) { _transletName = (String) value; return; } else if (name.equals(DESTINATION_DIRECTORY) && value instanceof String) { _destinationDirectory = (String) value; return; } else if (name.equals(PACKAGE_NAME) && value instanceof String) { _packageName = (String) value; return; } else if (name.equals(JAR_NAME) && value instanceof String) { _jarFileName = (String) value; return; } else if (name.equals(GENERATE_TRANSLET)) { if (value instanceof Boolean) { _generateTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _generateTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(AUTO_TRANSLET)) { if (value instanceof Boolean) { _autoTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _autoTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(USE_CLASSPATH)) { if (value instanceof Boolean) { _useClasspath = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _useClasspath = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(DEBUG)) { if (value instanceof Boolean) { _debug = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _debug = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(ENABLE_INLINING)) { if (value instanceof Boolean) { _enableInlining = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _enableInlining = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(INDENT_NUMBER)) { if (value instanceof String) { try { _indentNumber = Integer.parseInt((String) value); return; } catch (NumberFormatException e) { // Falls through } } else if (value instanceof Integer) { _indentNumber = ((Integer) value).intValue(); return; } } // Throw an exception for all other attributes final ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "Transformer"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; // Register a message handler to report xsl:messages if (_translet != null) _translet.setMessageHandler(new MessageHandler(_errorListener)); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } return _properties.getProperty(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperties(Properties properties) throws IllegalArgumentException { if (properties != null) { final Enumeration names = properties.propertyNames(); while (names.hasMoreElements()) { final String name = (String) names.nextElement(); // Ignore lower layer properties if (isDefaultProperty(name, properties)) continue; if (validOutputProperty(name)) { _properties.setProperty(name, properties.getProperty(name)); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } } } else { _properties = _propertiesClone; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } _properties.setProperty(name, value); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setParameter(String name, Object value) { if (value == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE, name); throw new IllegalArgumentException(err.toString()); } if (_isIdentity) { if (_parameters == null) { _parameters = new Hashtable(); } _parameters.put(name, value); } else { _translet.addParameter(name, value); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return m_incremental ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_OPTIMIZE)) { return m_optimize ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return m_source_location ? Boolean.TRUE : Boolean.FALSE; } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
// in src/org/apache/xalan/templates/ElemAttribute.java
public void setName(AVT v) { if (v.isSimple()) { if (v.getSimpleString().equals("xmlns")) { throw new IllegalArgumentException(); } } super.setName(v); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void copyFrom(Properties src, boolean shouldResetDefaults) { Enumeration keys = src.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (!isLegalPropertyKey(key)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{key})); //"output property not recognized: " Object oldValue = m_properties.get(key); if (null == oldValue) { String val = (String) src.get(key); if(shouldResetDefaults && key.equals(OutputKeys.METHOD)) { setMethodDefaults(val); } m_properties.put(key, val); } else if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) { m_properties.put(key, (String) oldValue + " " + (String) src.get(key)); } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { if (null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null"); try { // ContentHandler handler = // m_transformer.createResultContentHandler(result); // m_transformer.setContentHandler(handler); SerializationHandler xoh = m_transformer.createSerializationHandler(result); m_transformer.setSerializationHandler(xoh); } catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); } m_result = result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputProperty(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = props.getProperty(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " //+ qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputPropertyNoDefault(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = (String) props.getProperties().get(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " // + qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { synchronized (m_reentryGuard) { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. if (null == m_outputFormat) { m_outputFormat = (OutputProperties) getStylesheet().getOutputComposed().clone(); } if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == m_userParams) m_userParams = new Vector(); if (null == s2) { replaceOrPushUserParam(new QName(s1), XObject.create(value, getXPathContext())); setParameter(s1, null, value); } else { replaceOrPushUserParam(new QName(s1, s2), XObject.create(value, getXPathContext())); setParameter(s2, s1, value); } } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setResult(Result result) throws IllegalArgumentException { if(null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null"); m_result = result; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } if (null == m_params) { m_params = new Hashtable(); } m_params.put(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { String value = null; OutputProperties props = m_outputFormat; value = props.getProperty(name); if (null == value) { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " // + name); } return value; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); else m_errorListener = listener; }
// in src/org/apache/xalan/lib/sql/ConnectionPoolManager.java
public synchronized void registerPool( String name, ConnectionPool pool ) { if ( m_poolTable.containsKey(name) ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOL_EXISTS, null)); //"Pool already exists"); } m_poolTable.put(name, pool); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xalan/lib/sql/XConnection.java
public XBooleanStatic connect( ExpressionContext exprContext, String name ) { try { m_ConnectionPool = m_PoolMgr.getPool(name); if (m_ConnectionPool == null) { //Try to create a jndi source with the passed name ConnectionPool pool = new JNDIConnectionPool(name); if (pool.testConnection()) { //JNDIConnectionPool seems good, so register it with the pool manager. //Once registered, it will show up like other named ConnectionPool's, //so the m_PoolMgr.getPool(name) method (above) will find it. m_PoolMgr.registerPool(name, pool); m_ConnectionPool = pool; m_IsDefaultPool = false; return new XBooleanStatic(true); } else { throw new IllegalArgumentException( "Invalid ConnectionPool name or JNDI Datasource path: " + name); } } else { m_IsDefaultPool = false; return new XBooleanStatic(true); } } catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); } }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
public XPathFunction resolveFunction(QName qname, int arity) { if (qname == null) throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NULL_QNAME, null)); if (arity < 0) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NEGATIVE_ARITY, null)); String uri = qname.getNamespaceURI(); if (uri == null || uri.length() == 0) return null; String className = null; String methodName = null; if (uri.startsWith("http://exslt.org")) { className = getEXSLTClassName(uri); methodName = qname.getLocalPart(); } else if (!uri.equals(ExtensionNamespaceContext.JAVA_EXT_URI)) { int lastSlash = className.lastIndexOf('/'); if (-1 != lastSlash) className = className.substring(lastSlash + 1); } String localPart = qname.getLocalPart(); int lastDotIndex = localPart.lastIndexOf('.'); if (lastDotIndex > 0) { if (className != null) className = className + "." + localPart.substring(0, lastDotIndex); else className = localPart.substring(0, lastDotIndex); methodName = localPart.substring(lastDotIndex + 1); } else methodName = localPart; if(null == className || className.trim().length() == 0 || null == methodName || methodName.trim().length() == 0) return null; ExtensionHandler handler = null; try { ExtensionHandler.getClassForName(className); handler = new ExtensionHandlerJavaClass(uri, "javaclass", className); } catch (ClassNotFoundException e) { return null; } return new XPathFunctionImpl(handler, methodName); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public String getNamespaceURI(String prefix) { if (prefix == null) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_NAMESPACE_CONTEXT_NULL_PREFIX, null)); if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) return XMLConstants.NULL_NS_URI; else if (prefix.equals(XMLConstants.XML_NS_PREFIX)) return XMLConstants.XML_NS_URI; else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) return XMLConstants.XMLNS_ATTRIBUTE_NS_URI; else if (prefix.equals(EXSLT_PREFIX)) return EXSLT_URI; else if (prefix.equals(EXSLT_MATH_PREFIX)) return EXSLT_MATH_URI; else if (prefix.equals(EXSLT_SET_PREFIX)) return EXSLT_SET_URI; else if (prefix.equals(EXSLT_STRING_PREFIX)) return EXSLT_STRING_URI; else if (prefix.equals(EXSLT_DATETIME_PREFIX)) return EXSLT_DATETIME_URI; else if (prefix.equals(EXSLT_DYNAMIC_PREFIX)) return EXSLT_DYNAMIC_URI; else if (prefix.equals(JAVA_EXT_PREFIX)) return JAVA_EXT_URI; else return XMLConstants.NULL_NS_URI; }
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public String getPrefix(String namespace) { if (namespace == null) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_NAMESPACE_CONTEXT_NULL_NAMESPACE, null)); if (namespace.equals(XMLConstants.XML_NS_URI)) return XMLConstants.XML_NS_PREFIX; else if (namespace.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) return XMLConstants.XMLNS_ATTRIBUTE; else if (namespace.equals(EXSLT_URI)) return EXSLT_PREFIX; else if (namespace.equals(EXSLT_MATH_URI)) return EXSLT_MATH_PREFIX; else if (namespace.equals(EXSLT_SET_URI)) return EXSLT_SET_PREFIX; else if (namespace.equals(EXSLT_STRING_URI)) return EXSLT_STRING_PREFIX; else if (namespace.equals(EXSLT_DATETIME_URI)) return EXSLT_DATETIME_PREFIX; else if (namespace.equals(EXSLT_DYNAMIC_URI)) return EXSLT_DYNAMIC_PREFIX; else if (namespace.equals(JAVA_EXT_URI)) return JAVA_EXT_PREFIX; else return null; }
// in src/org/apache/xpath/XPathContext.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorListener = listener; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } // If isSupported check is already done then the execution path // shouldn't come here. Being defensive String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException ( fmsg ); }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean isObjectModelSupported(String objectModel) { if (objectModel == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_NULL, new Object[] { this.getClass().getName() } ); throw new NullPointerException( fmsg ); } if (objectModel.length() == 0) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_EMPTY, new Object[] { this.getClass().getName() } ); throw new IllegalArgumentException( fmsg ); } // know how to support default object model, W3C DOM if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) { return true; } // don't know how to support anything else return false; }
4
              
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
31
              
// in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
public int getNextOption() throws IllegalArgumentException, MissingOptArgException { int retval = -1; if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR, new Character(c)); throw (new IllegalArgumentException(msg.toString())); } else if(shouldHaveArg && (arg == null)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR, new Character(c)); throw (new MissingOptArgException(msg.toString())); } retval = c; } return retval; }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { _result = result; if (null == result) { ErrorMsg err = new ErrorMsg(ErrorMsg.ER_RESULT_NULL); throw new IllegalArgumentException(err.toString()); //"result should not be null"); } if (_isIdentity) { try { // Connect this object with output system directly SerializationHandler outputHandler = _transformer.getOutputHandler(result); _transformer.transferOutputProperties(outputHandler); _handler = outputHandler; _lexHandler = outputHandler; } catch (TransformerException e) { _result = null; } } else if (_done) { // Run the transformation now, if not already done try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "TransformerFactory"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // Return value for attribute 'translet-name' if (name.equals(TRANSLET_NAME)) { return _transletName; } else if (name.equals(GENERATE_TRANSLET)) { return _generateTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(AUTO_TRANSLET)) { return _autoTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(ENABLE_INLINING)) { if (_enableInlining) return Boolean.TRUE; else return Boolean.FALSE; } // Throw an exception for all other attributes ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // Set the default translet name (ie. class name), which will be used // for translets that cannot be given a name from their system-id. if (name.equals(TRANSLET_NAME) && value instanceof String) { _transletName = (String) value; return; } else if (name.equals(DESTINATION_DIRECTORY) && value instanceof String) { _destinationDirectory = (String) value; return; } else if (name.equals(PACKAGE_NAME) && value instanceof String) { _packageName = (String) value; return; } else if (name.equals(JAR_NAME) && value instanceof String) { _jarFileName = (String) value; return; } else if (name.equals(GENERATE_TRANSLET)) { if (value instanceof Boolean) { _generateTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _generateTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(AUTO_TRANSLET)) { if (value instanceof Boolean) { _autoTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _autoTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(USE_CLASSPATH)) { if (value instanceof Boolean) { _useClasspath = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _useClasspath = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(DEBUG)) { if (value instanceof Boolean) { _debug = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _debug = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(ENABLE_INLINING)) { if (value instanceof Boolean) { _enableInlining = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _enableInlining = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(INDENT_NUMBER)) { if (value instanceof String) { try { _indentNumber = Integer.parseInt((String) value); return; } catch (NumberFormatException e) { // Falls through } } else if (value instanceof Integer) { _indentNumber = ((Integer) value).intValue(); return; } } // Throw an exception for all other attributes final ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "Transformer"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; // Register a message handler to report xsl:messages if (_translet != null) _translet.setMessageHandler(new MessageHandler(_errorListener)); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } return _properties.getProperty(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperties(Properties properties) throws IllegalArgumentException { if (properties != null) { final Enumeration names = properties.propertyNames(); while (names.hasMoreElements()) { final String name = (String) names.nextElement(); // Ignore lower layer properties if (isDefaultProperty(name, properties)) continue; if (validOutputProperty(name)) { _properties.setProperty(name, properties.getProperty(name)); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } } } else { _properties = _propertiesClone; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } _properties.setProperty(name, value); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { _errorlistener = listener; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // GTM: NB: 'debug' should change to something more unique... if ((name.equals("translet-name")) || (name.equals("debug"))) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } return _xsltcFactory.getAttribute(name); } else { if (_xalanFactory == null) { createXalanTransformerFactory(); } return _xalanFactory.getAttribute(name); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // GTM: NB: 'debug' should change to something more unique... if ((name.equals("translet-name")) || (name.equals("debug"))) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } _xsltcFactory.setAttribute(name, value); } else { if (_xalanFactory == null) { createXalanTransformerFactory(); } _xalanFactory.setAttribute(name, value); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return m_incremental ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_OPTIMIZE)) { return m_optimize ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return m_source_location ? Boolean.TRUE : Boolean.FALSE; } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
private static String getOutputPropertyNoDefault(String qnameString, Properties props) throws IllegalArgumentException { String value = (String)props.get(qnameString); return value; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { if (null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null"); try { // ContentHandler handler = // m_transformer.createResultContentHandler(result); // m_transformer.setContentHandler(handler); SerializationHandler xoh = m_transformer.createSerializationHandler(result); m_transformer.setSerializationHandler(xoh); } catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); } m_result = result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputProperty(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = props.getProperty(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " //+ qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputPropertyNoDefault(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = (String) props.getProperties().get(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " // + qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { synchronized (m_reentryGuard) { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. if (null == m_outputFormat) { m_outputFormat = (OutputProperties) getStylesheet().getOutputComposed().clone(); } if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperties(Properties oformat) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (null != oformat) { // See if an *explicit* method was set. String method = (String) oformat.get(OutputKeys.METHOD); if (null != method) m_outputFormat = new OutputProperties(method); else if(m_outputFormat==null) m_outputFormat = new OutputProperties(); m_outputFormat.copyFrom(oformat); // copyFrom does not set properties that have been already set, so // this must be called after, which is a bit in the reverse from // what one might think. m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties()); } else { // if oformat is null JAXP says that any props previously set are removed // and we are to revert back to those in the templates object (i.e. Stylesheet). m_outputFormat = null; } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setResult(Result result) throws IllegalArgumentException { if(null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null"); m_result = result; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperties(Properties oformat) throws IllegalArgumentException { if (null != oformat) { // See if an *explicit* method was set. String method = (String) oformat.get(OutputKeys.METHOD); if (null != method) m_outputFormat = new OutputProperties(method); else m_outputFormat = new OutputProperties(); m_outputFormat.copyFrom(oformat); } else { // if oformat is null JAXP says that any props previously set are removed // and we are to revert back to those in the templates object (i.e. Stylesheet). m_outputFormat = null; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { String value = null; OutputProperties props = m_outputFormat; value = props.getProperty(name); if (null == value) { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " // + name); } return value; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); else m_errorListener = listener; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized Connection getConnection( )throws IllegalArgumentException, SQLException { PooledConnection pcon = null; // We will fill up the pool any time it is less than the // Minimum. THis could be cause by the enableing and disabling // or the pool. // if ( m_pool.size() < m_PoolMinSize ) { initializePool(); } // find a connection not in use for ( int x = 0; x < m_pool.size(); x++ ) { pcon = (PooledConnection) m_pool.elementAt(x); // Check to see if the Connection is in use if ( pcon.inUse() == false ) { // Mark it as in use pcon.setInUse(true); // return the JDBC Connection stored in the // PooledConnection object return pcon.getConnection(); } } // Could not find a free connection, // create and add a new one // Create a new JDBC Connection Connection con = createConnection(); // Create a new PooledConnection, passing it the JDBC // Connection pcon = new PooledConnection(con); // Mark the connection as in use pcon.setInUse(true); // Add the new PooledConnection object to the pool m_pool.addElement(pcon); // return the new Connection return pcon.getConnection(); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xpath/XPathContext.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorListener = listener; }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
(Domain) MalformedURIException 66
              
// in src/org/apache/xml/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); // This is a fix for XALANJ-2059. if(m_scheme != null && p_base != null) { // a) If <uriSpec> starts with a slash (/), it means <uriSpec> is absolute // and p_base can be ignored. // For example, // uriSpec = file:/myDIR/myXSLFile.xsl // p_base = file:/myWork/ // // Here, uriSpec has absolute path after scheme file and : // Hence p_base can be ignored. // // b) Similarily, according to RFC 2396, uri is resolved for <uriSpec> relative to <p_base> // if scheme in <uriSpec> is same as scheme in <p_base>, else p_base can be ignored. // // c) if <p_base> is not hierarchical, it can be ignored. // if(uriSpec.startsWith("/") || !m_scheme.equals(p_base.m_scheme) || !p_base.getSchemeSpecificPart().startsWith("/")) { p_base = null; } } // Fix for XALANJ-2059 uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/serializer/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/serializer/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
0 34
              
// in src/org/apache/xml/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); // This is a fix for XALANJ-2059. if(m_scheme != null && p_base != null) { // a) If <uriSpec> starts with a slash (/), it means <uriSpec> is absolute // and p_base can be ignored. // For example, // uriSpec = file:/myDIR/myXSLFile.xsl // p_base = file:/myWork/ // // Here, uriSpec has absolute path after scheme file and : // Hence p_base can be ignored. // // b) Similarily, according to RFC 2396, uri is resolved for <uriSpec> relative to <p_base> // if scheme in <uriSpec> is same as scheme in <p_base>, else p_base can be ignored. // // c) if <p_base> is not hierarchical, it can be ignored. // if(uriSpec.startsWith("/") || !m_scheme.equals(p_base.m_scheme) || !p_base.getSchemeSpecificPart().startsWith("/")) { p_base = null; } } // Fix for XALANJ-2059 uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/utils/URI.java
public void setPath(String p_path) throws MalformedURIException { if (p_path == null) { m_path = null; m_queryString = null; m_fragment = null; } else { initializePath(p_path); } }
// in src/org/apache/xml/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/serializer/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPath(String p_path) throws MalformedURIException { if (p_path == null) { m_path = null; m_queryString = null; m_fragment = null; } else { initializePath(p_path); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
(Lib) MissingResourceException 57
              
// in src/org/apache/xml/utils/res/XResourceBundle.java
public static final XResourceBundle loadResourceBundle( String className, Locale locale) throws MissingResourceException { String suffix = getResourceSuffix(locale); //System.out.println("resource " + className + suffix); try { // first try with the given locale String resourceName = className + suffix; return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLMessages.java
public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); try { return (ListResourceBundle)ResourceBundle.getBundle(className, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/serializer/utils/Messages.java
private ListResourceBundle loadResourceBundle(String resourceBundle) throws MissingResourceException { m_resourceBundleName = resourceBundle; Locale locale = getLocale(); ListResourceBundle lrb; try { ResourceBundle rb = ResourceBundle.getBundle(m_resourceBundleName, locale); lrb = (ListResourceBundle) rb; } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } } m_resourceBundle = lrb; return lrb; }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
57
              
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
57
              
// in src/org/apache/xml/utils/res/XResourceBundle.java
public static final XResourceBundle loadResourceBundle( String className, Locale locale) throws MissingResourceException { String suffix = getResourceSuffix(locale); //System.out.println("resource " + className + suffix); try { // first try with the given locale String resourceName = className + suffix; return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLMessages.java
public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); try { return (ListResourceBundle)ResourceBundle.getBundle(className, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/serializer/utils/Messages.java
private ListResourceBundle loadResourceBundle(String resourceBundle) throws MissingResourceException { m_resourceBundleName = resourceBundle; Locale locale = getLocale(); ListResourceBundle lrb; try { ResourceBundle rb = ResourceBundle.getBundle(m_resourceBundleName, locale); lrb = (ListResourceBundle) rb; } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } } m_resourceBundle = lrb; return lrb; }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
(Lib) SAXException 112
              
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (target.equals("xml-stylesheet")) { String href = null; // CDATA #REQUIRED String type = null; // CDATA #REQUIRED String title = null; // CDATA #IMPLIED String media = null; // CDATA #IMPLIED String charset = null; // CDATA #IMPLIED boolean alternate = false; // (yes|no) "no" StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true); boolean lookedAhead = false; Source source = null; String token = ""; while (tokenizer.hasMoreTokens()) { if (!lookedAhead) token = tokenizer.nextToken(); else lookedAhead = false; if (tokenizer.hasMoreTokens() && (token.equals(" ") || token.equals("\t") || token.equals("="))) continue; String name = token; if (name.equals("type")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); type = token.substring(1, token.length() - 1); } else if (name.equals("href")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); href = token; if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); // If the href value has parameters to be passed to a // servlet(something like "foobar?id=12..."), // we want to make sure we get them added to // the href value. Without this check, we would move on // to try to process another attribute and that would be // wrong. // We need to set lookedAhead here to flag that we // already have the next token. while ( token.equals("=") && tokenizer.hasMoreTokens()) { href = href + token + tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); lookedAhead = true; } else { break; } } } href = href.substring(1, href.length() - 1); try { // Add code to use a URIResolver. Patch from Dmitri Ilyin. if (m_uriResolver != null) { source = m_uriResolver.resolve(href, m_baseID); } else { href = SystemIDResolver.getAbsoluteURI(href, m_baseID); source = new SAXSource(new InputSource(href)); } } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } } else if (name.equals("title")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); title = token.substring(1, token.length() - 1); } else if (name.equals("media")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); media = token.substring(1, token.length() - 1); } else if (name.equals("charset")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); charset = token.substring(1, token.length() - 1); } else if (name.equals("alternate")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); alternate = token.substring(1, token.length() - 1).equals("yes"); } } if ((null != type) && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt")) && (null != href)) { if (null != m_media) { if (null != media) { if (!media.equals(m_media)) return; } else return; } if (null != m_charset) { if (null != charset) { if (!charset.equals(m_charset)) return; } else return; } if (null != m_title) { if (null != title) { if (!title.equals(m_title)) return; } else return; } m_stylesheets.addElement(source); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
protected void append(Node newNode) throws org.xml.sax.SAXException { Node currentNode = m_currentNode; if (null != currentNode) { if (currentNode == m_root && m_nextSibling != null) currentNode.insertBefore(newNode, m_nextSibling); else currentNode.appendChild(newNode); // System.out.println(newNode.getNodeName()); } else if (null != m_docFrag) { if (m_nextSibling != null) m_docFrag.insertBefore(newNode, m_nextSibling); else m_docFrag.appendChild(newNode); } else { boolean ok = true; short type = newNode.getNodeType(); if (type == Node.TEXT_NODE) { String data = newNode.getNodeValue(); if ((null != data) && (data.trim().length() > 0)) { throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null)); //"Warning: can't output text before document element! Ignoring..."); } ok = false; } else if (type == Node.ELEMENT_NODE) { if (m_doc.getDocumentElement() != null) { ok = false; throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null)); //"Can't have more than one root on a DOM!"); } } if (ok) { if (m_nextSibling != null) m_doc.insertBefore(newNode, m_nextSibling); else m_doc.appendChild(newNode); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startElement( String ns, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { Element elem; // Note that the namespace-aware call must be used to correctly // construct a Level 2 DOM, even for non-namespaced nodes. if ((null == ns) || (ns.length() == 0)) elem = m_doc.createElementNS(null,name); else elem = m_doc.createElementNS(ns, name); append(elem); try { int nAtts = atts.getLength(); if (0 != nAtts) { for (int i = 0; i < nAtts; i++) { //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) ); // First handle a possible ID attribute if (atts.getType(i).equalsIgnoreCase("ID")) setIDAttribute(atts.getValue(i), elem); String attrNS = atts.getURI(i); if("".equals(attrNS)) attrNS = null; // DOM represents no-namespace as null // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i) // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i)); // Crimson won't let us set an xmlns: attribute on the DOM. String attrQName = atts.getQName(i); // In SAX, xmlns[:] attributes have an empty namespace, while in DOM they // should have the xmlns namespace if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) { attrNS = "http://www.w3.org/2000/xmlns/"; } // ALWAYS use the DOM Level 2 call! elem.setAttributeNS(attrNS,attrQName, atts.getValue(i)); } } /* * Adding namespace nodes to the DOM tree; */ int nDecls = m_prefixMappings.size(); String prefix, declURL; for (int i = 0; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; declURL = (String) m_prefixMappings.elementAt(i + 1); elem.setAttributeNS("http://www.w3.org/2000/xmlns/", prefix, declURL); } m_prefixMappings.clear(); // append(elem); m_elemStack.push(elem); m_currentNode = elem; // append(elem); } catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); } }
// in src/org/apache/xml/utils/XMLReaderManager.java
public synchronized XMLReader getXMLReader() throws SAXException { XMLReader reader; boolean readerInUse; if (m_readers == null) { // When the m_readers.get() method is called for the first time // on a thread, a new XMLReader will automatically be created. m_readers = new ThreadLocal(); } if (m_inUse == null) { m_inUse = new Hashtable(); } // If the cached reader for this thread is in use, construct a new // one; otherwise, return the cached reader. reader = (XMLReader) m_readers.get(); boolean threadHasReader = (reader != null); if (!threadHasReader || m_inUse.get(reader) == Boolean.TRUE) { try { try { // According to JAXP 1.2 specification, if a SAXSource // is created using a SAX InputSource the Transformer or // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); } catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } } try { reader.setFeature(NAMESPACES_FEATURE, true); reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false); } catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. } } catch (ParserConfigurationException ex) { throw new SAXException(ex); } catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); } catch (NoSuchMethodError ex2) { } catch (AbstractMethodError ame) { } // Cache the XMLReader if this is the first time we've created // a reader for this thread. if (!threadHasReader) { m_readers.set(reader); m_inUse.put(reader, Boolean.TRUE); } } else { m_inUse.put(reader, Boolean.TRUE); } return reader; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_entry_pause() throws SAXException { if(fCoroutineManager==null) { // Nobody called init()? Do it now... init(null,-1,-1); } try { Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID); if(arg==Boolean.FALSE) co_yield(false); } catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public void startParse(InputSource source) throws SAXException { if (fIncrementalParser==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser."); if (fParseInProgress) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing."); boolean ok=false; try { ok = parseSomeSetup(source); } catch(Exception ex) { throw new SAXException(ex); } if(!ok) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with"); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null == m_entities) { m_entities = new Vector(); } try { systemId = SystemIDResolver.getAbsoluteURI(systemId, getDocumentBaseURI()); } catch (Exception e) { throw new org.xml.sax.SAXException(e); } // private static final int ENTITY_FIELD_PUBLICID = 0; m_entities.addElement(publicId); // private static final int ENTITY_FIELD_SYSTEMID = 1; m_entities.addElement(systemId); // private static final int ENTITY_FIELD_NOTATIONNAME = 2; m_entities.addElement(notationName); // private static final int ENTITY_FIELD_NAME = 3; m_entities.addElement(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startDocumentInternal() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_needToCallStartDocument = false; if (m_inEntityRef) return; m_needToOutputDocTypeDecl = true; m_startNewLine = false; /* The call to getXMLVersion() might emit an error message * and we should emit this message regardless of if we are * writing out an XML header or not. */ final String version = getXMLVersion(); if (getOmitXMLDeclaration() == false) { String encoding = Encodings.getMimeEncoding(getEncoding()); String standalone; if (m_standaloneWasSpecified) { standalone = " standalone=\"" + getStandalone() + "\""; } else { standalone = ""; } try { final java.io.Writer writer = m_writer; writer.write("<?xml version=\""); writer.write(version); writer.write("\" encoding=\""); writer.write(encoding); writer.write('\"'); writer.write(standalone); writer.write("?>"); if (m_doIndent) { if (m_standaloneWasSpecified || getDoctypePublic() != null || getDoctypeSystem() != null) { // We almost never put a newline after the XML // header because this XML could be used as // an extenal general parsed entity // and we don't know the context into which it // will be used in the future. Only when // standalone, or a doctype system or public is // specified are we free to insert a new line // after the header. Is it even worth bothering // in these rare cases? writer.write(m_lineSep, 0, m_lineSepLen); } } } catch(IOException e) { throw new SAXException(e); } } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (m_inEntityRef) return; flushPending(); if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) startDocumentInternal(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); int indexOfQLT = data.indexOf("?>"); if (indexOfQLT >= 0) { // See XSLT spec on error recovery of "?>" in PIs. if (indexOfQLT > 0) { writer.write(data.substring(0, indexOfQLT)); } writer.write("? >"); // add space between. if ((indexOfQLT + 2) < data.length()) { writer.write(data.substring(indexOfQLT + 2)); } } else { writer.write(data); } writer.write('?'); writer.write('>'); /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { if (m_elemContext.m_startTagOpen) { try { final String patchedName = patchName(name); final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_xmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 32 to 127 so we write out the // value directly writer.write(' '); writer.write(patchedName); writer.write("=\""); writer.write(value); writer.write('"'); } else { writer.write(' '); writer.write(patchedName); writer.write("=\""); writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); try { if (inTemporaryOutputState()) { /* leave characters un-processed as we are * creating temporary output, the output generated by * this serializer will be input to a final serializer * later on and it will do the processing in final * output state (not temporary output state). * * A "temporary" ToTextStream serializer is used to * evaluate attribute value templates (for example), * and the result of evaluating such a thing * is fed into a final serializer later on. */ m_writer.write(ch, start, length); } else { // In final output state we do process the characters! writeNormalizedChars(ch, start, length, m_lineSepUse); } if (m_tracer != null) super.fireCharEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); if (m_tracer != null) super.fireCDATAEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
private void outputDocTypeDecl(String name) throws SAXException { if (true == m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((null != doctypeSystem) || (null != doctypePublic)) { final java.io.Writer writer = m_writer; try { writer.write("<!DOCTYPE "); writer.write(name); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('"'); } if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); writer.write('"'); } writer.write('>'); outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } } m_needToOutputDocTypeDecl = false; }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { ElemContext elemContext = m_elemContext; // clean up any pending things first if (elemContext.m_startTagOpen) { closeStartTag(); elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_needToOutputDocTypeDecl) { String n = name; if (n == null || n.length() == 0) { // If the lexical QName is not given // use the localName in the DOCTYPE n = localName; } outputDocTypeDecl(n); } // if this element has a namespace then treat it like XML if (null != namespaceURI && namespaceURI.length() > 0) { super.startElement(namespaceURI, localName, name, atts); return; } try { // getElemDesc2(name) is faster than getElemDesc(name) ElemDesc elemDesc = getElemDesc2(name); int elemFlags = elemDesc.getFlags(); // deal with indentation issues first if (m_doIndent) { boolean isBlockElement = (elemFlags & ElemDesc.BLOCK) != 0; if (m_ispreserve) m_ispreserve = false; else if ( (null != elemContext.m_elementName) && (!m_inBlockElem || isBlockElement) /* && !isWhiteSpaceSensitive */ ) { m_startNewLine = true; indent(); } m_inBlockElem = !isBlockElement; } // save any attributes for later processing if (atts != null) addAttributes(atts); m_isprevtext = false; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); if (m_tracer != null) firePseudoAttributes(); if ((elemFlags & ElemDesc.EMPTY) != 0) { // an optimization for elements which are expected // to be empty. m_elemContext = elemContext.push(); /* XSLTC sometimes calls namespaceAfterStartElement() * so we need to remember the name */ m_elemContext.m_elementName = name; m_elemContext.m_elementDesc = elemDesc; return; } else { elemContext = elemContext.push(namespaceURI,localName,name); m_elemContext = elemContext; elemContext.m_elementDesc = elemDesc; elemContext.m_isRaw = (elemFlags & ElemDesc.RAW) != 0; } if ((elemFlags & ElemDesc.HEADELEM) != 0) { // This is the <HEAD> element, do some special processing closeStartTag(); elemContext.m_startTagOpen = false; if (!m_omitMetaTag) { if (m_doIndent) indent(); writer.write( "<META http-equiv=\"Content-Type\" content=\"text/html; charset="); String encoding = getEncoding(); String encode = Encodings.getMimeEncoding(encoding); writer.write(encode); writer.write("\">"); } } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement( final String namespaceURI, final String localName, final String name) throws org.xml.sax.SAXException { // deal with any pending issues if (m_cdataTagOpen) closeCDATA(); // if the element has a namespace, treat it like XML, not HTML if (null != namespaceURI && namespaceURI.length() > 0) { super.endElement(namespaceURI, localName, name); return; } try { ElemContext elemContext = m_elemContext; final ElemDesc elemDesc = elemContext.m_elementDesc; final int elemFlags = elemDesc.getFlags(); final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0; // deal with any indentation issues if (m_doIndent) { final boolean isBlockElement = (elemFlags&ElemDesc.BLOCK) != 0; boolean shouldIndent = false; if (m_ispreserve) { m_ispreserve = false; } else if (m_doIndent && (!m_inBlockElem || isBlockElement)) { m_startNewLine = true; shouldIndent = true; } if (!elemContext.m_startTagOpen && shouldIndent) indent(elemContext.m_currentElemDepth - 1); m_inBlockElem = !isBlockElement; } final java.io.Writer writer = m_writer; if (!elemContext.m_startTagOpen) { writer.write("</"); writer.write(name); writer.write('>'); } else { // the start-tag open when this method was called, // so we need to process it now. if (m_tracer != null) super.fireStartElem(name); // the starting tag was still open when we received this endElement() call // so we need to process any gathered attributes NOW, before they go away. int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (!elemEmpty) { // As per Dave/Paul recommendation 12/06/2000 // if (shouldIndent) // writer.write('>'); // indent(m_currentIndent); writer.write("></"); writer.write(name); writer.write('>'); } else { writer.write('>'); } } // clean up because the element has ended if ((elemFlags & ElemDesc.WHITESPACESENSITIVE) != 0) m_ispreserve = true; m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); // OPTIMIZE-EMPTY if (elemEmpty) { // a quick exit if the HTML element had no children. // This block of code can be removed if the corresponding block of code // in startElement() also labeled with "OPTIMIZE-EMPTY" is also removed m_elemContext = elemContext.m_prev; return; } // some more clean because the element has ended. if (!elemContext.m_startTagOpen) { if (m_doIndent && !m_preserves.isEmpty()) m_preserves.pop(); } m_elemContext = elemContext.m_prev; // m_isRawStack.pop(); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void characters(char chars[], int start, int length) throws org.xml.sax.SAXException { if (m_elemContext.m_isRaw) { try { // Clean up some pending issues. if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; writeNormalizedChars(chars, start, length, false, m_lineSepUse); // time to generate characters event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); } } else { super.characters(chars, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if ((null != m_elemContext.m_elementName) && (m_elemContext.m_elementName.equalsIgnoreCase("SCRIPT") || m_elemContext.m_elementName.equalsIgnoreCase("STYLE"))) { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); // writer.write(ch, start, length); writeNormalizedChars(ch, start, length, true, m_lineSepUse); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } } else { super.cdata(ch, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // Process any pending starDocument and startElement first. flushPending(); // Use a fairly nasty hack to tell if the next node is supposed to be // unescaped text. if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { // clean up any pending things first if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps processing instructions can be written out in HTML before * the DOCTYPE, in which case this could be emitted with the * startElement call, that knows the name of the document element * doing it right. */ if (true == m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; //writer.write("<?" + target); writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); //writer.write(data + ">"); // different from XML writer.write(data); // different from XML writer.write('>'); // different from XML // Always output a newline char if not inside of an // element. The whitespace is not significant in that // case. if (m_elemContext.m_currentElemDepth <= 0) outputLineSep(); m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } // now generate the PI event if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void entityReference(String name) throws org.xml.sax.SAXException { try { final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void closeStartTag() throws SAXException { try { // finish processing attributes, time to fire off the start element event if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs>0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); /* At this point we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) // if there are any cdata sections m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { try { final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_htmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 0 to 127 so we write out the // value directly writer.write(' '); writer.write(name); writer.write("=\""); writer.write(value); writer.write('"'); } else if ( (flags & HTML_ATTREMPTY) > 0 && (value.length() == 0 || value.equalsIgnoreCase(name))) { writer.write(' '); writer.write(name); } else { writer.write(' '); writer.write(name); writer.write("=\""); if ((flags & HTML_ATTRURL) > 0) { writeAttrURI(writer, value, m_specialEscapeURLs); } else { writeAttrString(writer, value, this.getEncoding()); } writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeCDATA() throws org.xml.sax.SAXException { try { m_writer.write(CDATA_DELIMITER_CLOSE); // write out a CDATA section closing "]]>" m_cdataTagOpen = false; // Remember that we have done so. } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected final void flushWriter() throws org.xml.sax.SAXException { final java.io.Writer writer = m_writer; if (null != writer) { try { if (writer instanceof WriterToUTF8Buffered) { if (m_shouldFlush) ((WriterToUTF8Buffered) writer).flush(); else ((WriterToUTF8Buffered) writer).flushBuffer(); } if (writer instanceof WriterToASCI) { if (m_shouldFlush) writer.flush(); } else { // Flush always. // Not a great thing if the writer was created // by this class, but don't have a choice. writer.flush(); } } catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void elementDecl(String name, String model) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ELEMENT "); writer.write(name); writer.write(' '); writer.write(model); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { DTDprolog(); outputEntityDecl(name, value); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ATTLIST "); writer.write(eName); writer.write(' '); writer.write(aName); writer.write(' '); writer.write(type); if (valueDefault != null) { writer.write(' '); writer.write(valueDefault); } //writer.write(" "); //writer.write(value); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void cdata(char ch[], int start, final int length) throws org.xml.sax.SAXException { try { final int old_start = start; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); boolean writeCDataBrackets = (((length >= 1) && escapingNotNeeded(ch[start]))); /* Write out the CDATA opening delimiter only if * we are supposed to, and if we are not already in * the middle of a CDATA section */ if (writeCDataBrackets && !m_cdataTagOpen) { m_writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } // writer.write(ch, start, length); if (isEscapingDisabled()) { charactersRaw(ch, start, length); } else writeNormalizedChars(ch, start, length, true, m_lineSepUse); /* used to always write out CDATA closing delimiter here, * but now we delay, so that we can merge CDATA sections on output. * need to write closing delimiter later */ if (writeCDataBrackets) { /* if the CDATA section ends with ] don't leave it open * as there is a chance that an adjacent CDATA sections * starts with ]>. * We don't want to merge ]] with > , or ] with ]> */ if (ch[start + length - 1] == ']') closeCDATA(); } // time to fire off CDATA event if (m_tracer != null) super.fireCDATAEvent(ch, old_start, length); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_inEntityRef) return; try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; m_writer.write(ch, start, length); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(final char chars[], final int start, final int length) throws org.xml.sax.SAXException { // It does not make sense to continue with rest of the method if the number of // characters to read from array is 0. // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node // is created if string is empty. if (length == 0 || (m_inEntityRef && !m_expandDTDEntities)) return; m_docIsEmpty = false; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); } if (m_cdataStartCalled || m_elemContext.m_isCdataSection) { /* either due to startCDATA() being called or due to * cdata-section-elements atribute, we need this as cdata */ cdata(chars, start, length); return; } if (m_cdataTagOpen) closeCDATA(); if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping)) { charactersRaw(chars, start, length); // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { int i; int startClean; // skip any leading whitspace // don't go off the end and use a hand inlined version // of isWhitespace(ch) final int end = start + length; int lastDirtyCharProcessed = start - 1; // last non-clean character that was processed // that was processed final Writer writer = m_writer; boolean isAllWhitespace = true; // process any leading whitspace i = start; while (i < end && isAllWhitespace) { char ch1 = chars[i]; if (m_charInfo.shouldMapTextChar(ch1)) { // The character is supposed to be replaced by a String // so write out the clean whitespace characters accumulated // so far // then the String. writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo .getOutputStringForChar(ch1); writer.write(outputStringForChar); // We can't say that everything we are writing out is // all whitespace, we just wrote out a String. isAllWhitespace = false; lastDirtyCharProcessed = i; // mark the last non-clean // character processed i++; } else { // The character is clean, but is it a whitespace ? switch (ch1) { // TODO: Any other whitespace to consider? case CharInfo.S_SPACE: // Just accumulate the clean whitespace i++; break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); i++; break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; i++; break; case CharInfo.S_HORIZONAL_TAB: // Just accumulate the clean whitespace i++; break; default: // The character was clean, but not a whitespace // so break the loop to continue with this character // (we don't increment index i !!) isAllWhitespace = false; break; } } } /* If there is some non-whitespace, mark that we may need * to preserve this. This is only important if we have indentation on. */ if (i < end || !isAllWhitespace) m_ispreserve = true; for (; i < end; i++) { char ch = chars[i]; if (m_charInfo.shouldMapTextChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo.getOutputStringForChar(ch); writer.write(outputStringForChar); lastDirtyCharProcessed = i; } else { if (ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: // Leave whitespace TAB as a real character break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; // Leave whitespace carriage return as a real character break; default: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars, do nothing, just add it to // the clean characters } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters, including NEL (0x85) writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#8232;"); lastDirtyCharProcessed = i; } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just leave it get added on to the clean characters } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out an entity writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } } } // we've reached the end. Any clean characters at the // end of the array than need to be written out? startClean = lastDirtyCharProcessed + 1; if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // For indentation purposes, mark that we've just writen text out m_isprevtext = true; } catch (IOException e) { throw new SAXException(e); } // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { if (m_inEntityRef) return; if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; m_docIsEmpty = false; } else if (m_cdataTagOpen) closeCDATA(); try { if (m_needToOutputDocTypeDecl) { if(null != getDoctypeSystem()) { outputDocTypeDecl(name, true); } m_needToOutputDocTypeDecl = false; } /* before we over-write the current elementLocalName etc. * lets close out the old one (if we still need to) */ if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); m_ispreserve = false; if (shouldIndent() && m_startNewLine) { indent(); } m_startNewLine = true; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); } catch (IOException e) { throw new SAXException(e); } // process the attributes now, because after this SAX call they might be gone if (atts != null) addAttributes(atts); m_elemContext = m_elemContext.push(namespaceURI,localName,name); m_isprevtext = false; if (m_tracer != null) firePseudoAttributes(); }
// in src/org/apache/xml/serializer/ToStream.java
void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException { if (m_cdataTagOpen) closeCDATA(); try { final java.io.Writer writer = m_writer; writer.write("<!DOCTYPE "); writer.write(name); String doctypePublic = getDoctypePublic(); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('\"'); } String doctypeSystem = getDoctypeSystem(); if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); if (closeDecl) { writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); closeDecl = false; // done closing } else writer.write('\"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_inEntityRef) return; // namespaces declared at the current depth are no longer valid // so get rid of them m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null); try { final java.io.Writer writer = m_writer; if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (m_spaceBeforeClose) writer.write(" />"); else writer.write("/>"); /* don't need to pop cdataSectionState because * this element ended so quickly that we didn't get * to push the state. */ } else { if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(m_elemContext.m_currentElemDepth - 1); writer.write('<'); writer.write('/'); writer.write(name); writer.write('>'); } } catch (IOException e) { throw new SAXException(e); } if (!m_elemContext.m_startTagOpen && m_doIndent) { m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); } m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { int start_old = start; if (m_inEntityRef) return; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } try { final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary. for (int i = start; i < limit; i++) { if (wasDash && ch[i] == '-') { writer.write(ch, start, i - start); writer.write(" -"); start = i + 1; } wasDash = (ch[i] == '-'); } // if we have some chars in the comment if (length > 0) { // Output the remaining characters (if any) final int remainingChars = (limit - start); if (remainingChars > 0) writer.write(ch, start, remainingChars); // Protect comment end from a single trailing dash if (ch[limit - 1] == '-') writer.write(' '); } writer.write(COMMENT_END); } catch (IOException e) { throw new SAXException(e); } /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; // time to generate comment event if (m_tracer != null) super.fireCommentEvent(ch, start_old,length); }
// in src/org/apache/xml/serializer/ToStream.java
public void endDTD() throws org.xml.sax.SAXException { try { if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } final java.io.Writer writer = m_writer; if (!m_inDoctype) writer.write("]>"); else { writer.write('>'); } writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeStartTag() throws SAXException { if (m_elemContext.m_startTagOpen) { try { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); } catch (IOException e) { throw new SAXException(e); } /* whether Xalan or XSLTC, we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeDocType(DocumentType node, boolean bStart) throws SAXException { // The DocType and internalSubset can not be modified in DOM and is // considered to be well-formed as the outcome of successful parsing. String docTypeName = node.getNodeName(); String publicId = node.getPublicId(); String systemId = node.getSystemId(); String internalSubset = node.getInternalSubset(); //DocumentType nodes are never passed to the filter if (internalSubset != null && !"".equals(internalSubset)) { if (bStart) { try { // The Serializer does not provide a way to write out the // DOCTYPE internal subset via an event call, so we write it // out here. Writer writer = fSerializer.getWriter(); StringBuffer dtd = new StringBuffer(); dtd.append("<!DOCTYPE "); dtd.append(docTypeName); if (null != publicId) { dtd.append(" PUBLIC \""); dtd.append(publicId); dtd.append('\"'); } if (null != systemId) { if (null == publicId) { dtd.append(" SYSTEM \""); } else { dtd.append(" \""); } dtd.append(systemId); dtd.append('\"'); } dtd.append(" [ "); dtd.append(fNewLine); dtd.append(internalSubset); dtd.append("]>"); dtd.append(fNewLine); writer.write(dtd.toString()); writer.flush(); } catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); } } // else if !bStart do nothing } else { if (bStart) { if (fLexicalHandler != null) { fLexicalHandler.startDTD(docTypeName, publicId, systemId); } } else { if (fLexicalHandler != null) { fLexicalHandler.endDTD(); } } } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { final int col = qname.lastIndexOf(':'); final String prefix = (col == -1) ? null : qname.substring(0, col); SyntaxTreeNode element = makeInstance(uri, prefix, localname, attributes); if (element == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ELEMENT_PARSE_ERR, prefix+':'+localname); throw new SAXException(err.toString()); } // If this is the root element of the XML document we need to make sure // that it contains a definition of the XSL namespace URI if (_root == null) { if ((_prefixMapping == null) || (_prefixMapping.containsValue(Constants.XSLT_URI) == false)) _rootNamespaceDef = false; else _rootNamespaceDef = true; _root = element; } else { SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek(); parent.addElement(element); element.setParent(parent); } element.setAttributes(new AttributeList(attributes)); element.setPrefixMapping(_prefixMapping); if (element instanceof Stylesheet) { // Extension elements and excluded elements have to be // handled at this point in order to correctly generate // Fallback elements from <xsl:fallback>s. getSymbolTable().setCurrentNode(element); ((Stylesheet)element).declareExtensionPrefixes(this); } _prefixMapping = null; _parentStack.push(element); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void endDocument() throws SAXException { _parser.endDocument(); // create the templates try { XSLTC xsltc = _parser.getXSLTC(); // Set the translet class name if not already set String transletName; if (_systemId != null) { transletName = Util.baseName(_systemId); } else { transletName = (String)_tfactory.getAttribute("translet-name"); } xsltc.setClassName(transletName); // Get java-legal class name from XSLTC module transletName = xsltc.getClassName(); Stylesheet stylesheet = null; SyntaxTreeNode root = _parser.getDocumentRoot(); // Compile the translet - this is where the work is done! if (!_parser.errorsFound() && root != null) { // Create a Stylesheet element from the root node stylesheet = _parser.makeStylesheet(root); stylesheet.setSystemId(_systemId); stylesheet.setParentStylesheet(null); if (xsltc.getTemplateInlining()) stylesheet.setTemplateInlining(true); else stylesheet.setTemplateInlining(false); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { stylesheet.setSourceLoader(this); } _parser.setCurrentStylesheet(stylesheet); // Set it as top-level in the XSLTC object xsltc.setStylesheet(stylesheet); // Create AST under the Stylesheet element _parser.createAST(stylesheet); } // Generate the bytecodes and output the translet class(es) if (!_parser.errorsFound() && stylesheet != null) { stylesheet.setMultiDocument(xsltc.isMultiDocument()); stylesheet.setHasIdCall(xsltc.hasIdCall()); // Class synchronization is needed for BCEL synchronized (xsltc.getClass()) { stylesheet.translate(); } } if (!_parser.errorsFound()) { // Check that the transformation went well before returning final byte[][] bytecodes = xsltc.getBytecodes(); if (bytecodes != null) { _templates = new TemplatesImpl(xsltc.getBytecodes(), transletName, _parser.getOutputProperties(), _indentNumber, _tfactory); // Set URIResolver on templates object if (_uriResolver != null) { _templates.setURIResolver(_uriResolver); } } } else { StringBuffer errorMessage = new StringBuffer(); Vector errors = _parser.getErrors(); final int count = errors.size(); for (int i = 0; i < count; i++) { if (errorMessage.length() > 0) errorMessage.append('\n'); errorMessage.append(errors.elementAt(i).toString()); } throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString())); } }
// in src/org/apache/xalan/xsltc/trax/XSLTCSource.java
protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet) throws SAXException { SAXImpl idom = (SAXImpl)_dom.get(); if (idom != null) { if (dtmManager != null) { idom.migrateTo(dtmManager); } } else { Source source = _source; if (source == null) { if (_systemId != null && _systemId.length() > 0) { source = new StreamSource(_systemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR); throw new SAXException(err.toString()); } } DOMWSFilter wsfilter = null; if (translet != null && translet instanceof StripFilter) { wsfilter = new DOMWSFilter(translet); } boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false; if (dtmManager == null) { dtmManager = XSLTCDTMManager.newInstance(); } idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall); String systemId = getSystemId(); if (systemId != null) { idom.setDocumentURI(systemId); } _dom.set(idom); } return idom; }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDocument() throws SAXException { // Make sure setResult() was called before the first SAX event if (_result == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR); throw new SAXException(err.toString()); } if (!_isIdentity) { boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; XSLTCDTMManager dtmManager = null; // Create an internal DOM (not W3C) and get SAX2 input handler try { dtmManager = (XSLTCDTMManager)_transformer.getTransformerFactory() .getDTMManagerClass() .newInstance(); } catch (Exception e) { throw new SAXException(e); } DTMWSFilter wsFilter; if (_translet != null && _translet instanceof StripFilter) { wsFilter = new DOMWSFilter(_translet); } else { wsFilter = null; } // Construct the DTM using the SAX events that come through _dom = (SAXImpl)dtmManager.getDTM(null, false, wsFilter, true, false, hasIdCall); _handler = _dom.getBuilder(); _lexHandler = (LexicalHandler) _handler; _dtdHandler = (DTDHandler) _handler; _declHandler = (DeclHandler) _handler; // Set document URI _dom.setDocumentURI(_systemId); if (_locator != null) { _handler.setDocumentLocator(_locator); } } // Proxy call _handler.startDocument(); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDocument() throws SAXException { // Signal to the DOMBuilder that the document is complete _handler.endDocument(); if (!_isIdentity) { // Run the transformation now if we have a reference to a Result object if (_result != null) { try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { throw new SAXException(e); } } // Signal that the internal DOM is built (see 'setResult()'). _done = true; // Set this DOM as the transformer's DOM _transformer.setDOM(_dom); } if (_isIdentity && _result instanceof DOMResult) { ((DOMResult)_result).setNode(_transformer.getTransletOutputHandlerFactory().getNode()); } }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { if (this == handler.getCurrentProcessor()) { handler.popProcessor(); } int nChars = m_accumulator.length(); if ((nChars > 0) && ((null != m_xslTextElement) ||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator)) || handler.isSpacePreserve()) { ElemTextLiteral elem = new ElemTextLiteral(); elem.setDOMBackPointer(m_firstBackPointer); elem.setLocaterInfo(handler.getLocator()); try { elem.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } boolean doe = (null != m_xslTextElement) ? m_xslTextElement.getDisableOutputEscaping() : false; elem.setDisableOutputEscaping(doe); elem.setPreserveSpace(true); char[] chars = new char[nChars]; m_accumulator.getChars(0, nChars, chars, 0); elem.setChars(chars); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); } m_accumulator.setLength(0); m_firstBackPointer = null; }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { // ElemTemplateElement parent = handler.getElemTemplateElement(); XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); ElemTemplateElement elem = null; try { elem = (ElemTemplateElement) classObject.newInstance(); elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { ElemAttributeSet eat = new ElemAttributeSet(); eat.setLocaterInfo(handler.getLocator()); try { eat.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } eat.setDOMBackPointer(handler.getOriginatingNode()); setPropertiesFromAttributes(handler, rawName, attributes, eat); handler.getStylesheet().setAttributeSet(eat); // handler.pushElemTemplateElement(eat); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(eat); handler.pushElemTemplateElement(eat); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
AVT processAVT( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCDATA(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCHAR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (value.length() != 1)) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (value.length() != 1) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return new Character(value.charAt(0)); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; if (getSupportsAVT()) { try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (!avt.isSimple()) return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } int retVal = this.getEnum(value); if (retVal == StringToIntTable.INVALID_KEY) { StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } if (getSupportsAVT()) return avt; else return new Integer(retVal); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM_OR_PQNAME(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { Object objToReturn = null; if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); if (!avt.isSimple()) return avt; else objToReturn = avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } // An avt wasn't used. int key = this.getEnum(value); if (key != StringToIntTable.INVALID_KEY) { if (objToReturn == null) objToReturn = new Integer(key); } // enum not used. Validate qname-but-not-ncname. else { try { QName qname = new QName(value, handler, true); if (objToReturn == null) objToReturn = qname; if (qname.getPrefix() == null) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } } catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; } catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; } } return objToReturn; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processEXPR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath expr = handler.createXPath(value, owner); return expr; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNMTOKEN(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNmtoken(value))) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNmtoken(value)) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } } return value; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processPATTERN( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath pattern = handler.createMatchPatternXPath(value, owner); return pattern; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNUMBER( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { Double val; AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (avt.isSimple()) { val = Double.valueOf(value); } } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } return avt; } else { try { return Double.valueOf(value); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processAVT_QNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if (avt.isSimple()) { int indexOfNSSep = value.indexOf(':'); if (indexOfNSSep >= 0) { String prefix = value.substring(0, indexOfNSSep); if (!XML11Char.isXML11ValidNCName(prefix)) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null); return null; } } String localName = (indexOfNSSep < 0) ? value : value.substring(indexOfNSSep + 1); if ((localName == null) || (localName.length() == 0) || (!XML11Char.isXML11ValidNCName(localName))) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null ); return null; } } } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } return avt; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNCNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNCName(value))) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNCName(value)) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processSIMPLEPATTERNLIST( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nPatterns = tokenizer.countTokens(); Vector patterns = new Vector(nPatterns); for (int i = 0; i < nPatterns; i++) { XPath pattern = handler.createMatchPatternXPath(tokenizer.nextToken(), owner); patterns.addElement(pattern); } return patterns; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_URLLIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (url != null) strings.addElement(url); else throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_LIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (prefix.equals(Constants.ATTRVAL_DEFAULT_PREFIX) || url != null) strings.addElement(prefix); else throw new org.xml.sax.SAXException( XSLMessages.createMessage( XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processURL( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value // if (avt.getSimpleString() != null) { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); //} return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); return value; } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, this); try { // Get the Source from the user's URIResolver (if any). Source sourceFromURIResolver = getSourceFromUriResolver(handler); // Get the system ID of the included/imported stylesheet module String hrefUrl = getBaseURIOfIncludedStylesheet(handler, sourceFromURIResolver); if (handler.importStackContains(hrefUrl)) { throw new org.xml.sax.SAXException( XSLMessages.createMessage( getStylesheetInclErr(), new Object[]{ hrefUrl })); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!"); } // Push the system ID and corresponding Source // on some stacks for later retrieval during parse() time. handler.pushImportURL(hrefUrl); handler.pushImportSource(sourceFromURIResolver); int savedStylesheetType = handler.getStylesheetType(); handler.setStylesheetType(this.getStylesheetType()); handler.pushNewNamespaceSupport(); try { parse(handler, uri, localName, rawName, attributes); } finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); } } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warn(String msg, Object args[]) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createWarning(msg, args); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { if (null != handler) handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Exception e) throws org.xml.sax.SAXException { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); TransformerException pe; if (!(e instanceof TransformerException)) { pe = (null == e) ? new TransformerException(msg, locator) : new TransformerException(msg, locator, e); } else pe = (TransformerException) e; if (null != handler) { try { handler.error(pe); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else throw new org.xml.sax.SAXException(pe); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.fatalError(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void startNode(int node) throws org.xml.sax.SAXException { XPathContext xcntxt = m_transformer.getXPathContext(); try { if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { xcntxt.pushCurrentNode(node); if(m_startNode != node) { super.startNode(node); } else { String elemName = m_dtm.getNodeName(node); String localName = m_dtm.getLocalName(node); String namespace = m_dtm.getNamespaceURI(node); //xcntxt.pushCurrentNode(node); // SAX-like call to allow adding attributes afterwards m_handler.startElement(namespace, localName, elemName); boolean hasNSDecls = false; DTM dtm = m_dtm; for (int ns = dtm.getFirstNamespaceNode(node, true); DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true)) { SerializerUtils.ensureNamespaceDeclDeclared(m_handler,dtm, ns); } for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr)) { SerializerUtils.addAttribute(m_handler, attr); } } } else { xcntxt.pushCurrentNode(node); super.startNode(node); xcntxt.popCurrentNode(); } } catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (!m_foundFirstElement && null != m_serializer) { m_foundFirstElement = true; Serializer newSerializer; try { newSerializer = SerializerSwitcher.switchSerializerIfHTML(uri, localName, m_outputFormat.getProperties(), m_serializer); } catch (TransformerException te) { throw new SAXException(te); } if (newSerializer != m_serializer) { try { m_resultContentHandler = newSerializer.asContentHandler(); } catch (IOException ioe) // why? { throw new SAXException(ioe); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; m_serializer = newSerializer; } } flushStartDoc(); m_resultContentHandler.startElement(uri, localName, qName, attributes); }
// in src/org/apache/xalan/xslt/Process.java
public static void main(String argv[]) { // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off boolean doStackDumpOnError = false; boolean setQuietMode = false; boolean doDiag = false; String msg = null; boolean isSecureProcessing = false; // Runtime.getRuntime().traceMethodCalls(false); // Runtime.getRuntime().traceInstructions(false); /** * The default diagnostic writer... */ java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true); java.io.PrintWriter dumpWriter = diagnosticsWriter; ResourceBundle resbundle = (XSLMessages.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES)); String flavor = "s2s"; if (argv.length < 1) { printArgOptions(resbundle); } else { boolean useXSLTC = false; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { useXSLTC = true; } } TransformerFactory tfactory; if (useXSLTC) { String key = "javax.xml.transform.TransformerFactory"; String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"; Properties props = System.getProperties(); props.put(key, value); System.setProperties(props); } try { tfactory = TransformerFactory.newInstance(); tfactory.setErrorListener(new DefaultErrorHandler(false)); } catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); } boolean formatOutput = false; boolean useSourceLocation = false; String inFileName = null; String outFileName = null; String dumpFileName = null; String xslFileName = null; String treedumpFileName = null; PrintTraceListener tracer = null; String outputType = null; String media = null; Vector params = new Vector(); boolean quietConflictWarnings = false; URIResolver uriResolver = null; EntityResolver entityResolver = null; ContentHandler contentHandler = null; int recursionLimit=-1; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { // The -XSLTC option has been processed. } else if ("-TT".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceTemplates = true; } else printInvalidXSLTCOption("-TT"); // tfactory.setTraceTemplates(true); } else if ("-TG".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceGeneration = true; } else printInvalidXSLTCOption("-TG"); // tfactory.setTraceSelect(true); } else if ("-TS".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceSelection = true; } else printInvalidXSLTCOption("-TS"); // tfactory.setTraceTemplates(true); } else if ("-TTC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceElements = true; } else printInvalidXSLTCOption("-TTC"); // tfactory.setTraceTemplateChildren(true); } else if ("-INDENT".equalsIgnoreCase(argv[i])) { int indentAmount; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { indentAmount = Integer.parseInt(argv[++i]); } else { indentAmount = 0; } // TBD: // xmlProcessorLiaison.setIndent(indentAmount); } else if ("-IN".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') inFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-IN" })); //"Missing argument for); } else if ("-MEDIA".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) media = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-MEDIA" })); //"Missing argument for); } else if ("-OUT".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') outFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-OUT" })); //"Missing argument for); } else if ("-XSL".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') xslFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XSL" })); //"Missing argument for); } else if ("-FLAVOR".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { flavor = argv[++i]; } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-FLAVOR" })); //"Missing argument for); } else if ("-PARAM".equalsIgnoreCase(argv[i])) { if (i + 2 < argv.length) { String name = argv[++i]; params.addElement(name); String expression = argv[++i]; params.addElement(expression); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-PARAM" })); //"Missing argument for); } else if ("-E".equalsIgnoreCase(argv[i])) { // TBD: // xmlProcessorLiaison.setShouldExpandEntityRefs(false); } else if ("-V".equalsIgnoreCase(argv[i])) { diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version " + Version.getVersion() + ", " + /* xmlProcessorLiaison.getParserDescription()+ */ resbundle.getString("version2")); // "<<<<<<<"); } else if ("-QC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) quietConflictWarnings = true; else printInvalidXSLTCOption("-QC"); } else if ("-Q".equalsIgnoreCase(argv[i])) { setQuietMode = true; } else if ("-DIAG".equalsIgnoreCase(argv[i])) { doDiag = true; } else if ("-XML".equalsIgnoreCase(argv[i])) { outputType = "xml"; } else if ("-TEXT".equalsIgnoreCase(argv[i])) { outputType = "text"; } else if ("-HTML".equalsIgnoreCase(argv[i])) { outputType = "html"; } else if ("-EDUMP".equalsIgnoreCase(argv[i])) { doStackDumpOnError = true; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { dumpFileName = argv[++i]; } } else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { uriResolver = (URIResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); tfactory.setURIResolver(uriResolver); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); } } else { msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-URIResolver" }); //"Missing argument for); System.err.println(msg); doExit(msg); } } else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { entityResolver = (EntityResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { contentHandler = (ContentHandler) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else if ("-L".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); else printInvalidXSLTCOption("-L"); } else if ("-INCREMENTAL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/incremental", java.lang.Boolean.TRUE); else printInvalidXSLTCOption("-INCREMENTAL"); } else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i])) { // Default is true. // // %REVIEW% We should have a generalized syntax for negative // switches... and probably should accept the inverse even // if it is the default. if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/optimize", java.lang.Boolean.FALSE); else printInvalidXSLTCOption("-NOOPTIMIZE"); } else if ("-RL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (i + 1 < argv.length) recursionLimit = Integer.parseInt(argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-rl" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXSLTCOption("-RL"); } } // Generate the translet class and optionally specify the name // of the translet class. else if ("-XO".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("translet-name", argv[++i]); } else tfactory.setAttribute("generate-translet", "true"); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XO"); } } // Specify the destination directory for the translet classes. else if ("-XD".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("destination-directory", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XD" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XD"); } } // Specify the jar file name which the translet classes are packaged into. else if ("-XJ".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("jar-name", argv[++i]); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XJ" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XJ"); } } // Specify the package name prefix for the generated translet classes. else if ("-XP".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("package-name", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XP" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XP"); } } // Enable template inlining. else if ("-XN".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("enable-inlining", "true"); } else printInvalidXalanOption("-XN"); } // Turns on additional debugging message output else if ("-XX".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("debug", "true"); } else printInvalidXalanOption("-XX"); } // Create the Transformer from the translet if the translet class is newer // than the stylesheet. else if ("-XT".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("auto-translet", "true"); } else printInvalidXalanOption("-XT"); } else if ("-SECURE".equalsIgnoreCase(argv[i])) { isSecureProcessing = true; try { tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (TransformerConfigurationException e) {} } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] })); //"Invalid argument:); } // Print usage instructions if no xml and xsl file is specified in the command line if (inFileName == null && xslFileName == null) { msg = resbundle.getString("xslProc_no_input"); System.err.println(msg); doExit(msg); } // Note that there are usage cases for calling us without a -IN arg // The main XSL transformation occurs here! try { long start = System.currentTimeMillis(); if (null != dumpFileName) { dumpWriter = new PrintWriter(new FileWriter(dumpFileName)); } Templates stylesheet = null; if (null != xslFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Node xslDOM = docBuilder.parse(new InputSource(xslFileName)); stylesheet = tfactory.newTemplates(new DOMSource(xslDOM, xslFileName)); } else { // System.out.println("Calling newTemplates: "+xslFileName); stylesheet = tfactory.newTemplates(new StreamSource(xslFileName)); // System.out.println("Done calling newTemplates: "+xslFileName); } } PrintWriter resultWriter; StreamResult strResult; if (null != outFileName) { strResult = new StreamResult(new FileOutputStream(outFileName)); // One possible improvement might be to ensure this is // a valid URI before setting the systemId, but that // might have subtle changes that pre-existing users // might notice; we can think about that later -sc r1.46 strResult.setSystemId(outFileName); } else { strResult = new StreamResult(System.out); // We used to default to incremental mode in this case. // We've since decided that since the -INCREMENTAL switch is // available, that default is probably not necessary nor // necessarily a good idea. } SAXTransformerFactory stf = (SAXTransformerFactory) tfactory; // This is currently controlled via TransformerFactoryImpl. if (!useXSLTC && useSourceLocation) stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); // Did they pass in a stylesheet, or should we get it from the // document? if (null == stylesheet) { Source source = stf.getAssociatedStylesheet(new StreamSource(inFileName), media, null, null); if (null != source) stylesheet = tfactory.newTemplates(source); else { if (null != media) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: " // + inFileName + ", media=" // + media); else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: " //+ inFileName); } } if (null != stylesheet) { Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer(); transformer.setErrorListener(new DefaultErrorHandler(false)); // Override the output format? if (null != outputType) { transformer.setOutputProperty(OutputKeys.METHOD, outputType); } if (transformer instanceof org.apache.xalan.transformer.TransformerImpl) { org.apache.xalan.transformer.TransformerImpl impl = (org.apache.xalan.transformer.TransformerImpl)transformer; TraceManager tm = impl.getTraceManager(); if (null != tracer) tm.addTraceListener(tracer); impl.setQuietConflictWarnings(quietConflictWarnings); // This is currently controlled via TransformerFactoryImpl. if (useSourceLocation) impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); if(recursionLimit>0) impl.setRecursionLimit(recursionLimit); // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter ); } int nParams = params.size(); for (int i = 0; i < nParams; i += 2) { transformer.setParameter((String) params.elementAt(i), (String) params.elementAt(i + 1)); } if (uriResolver != null) transformer.setURIResolver(uriResolver); if (null != inFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setCoalescing(true); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); if (entityResolver != null) docBuilder.setEntityResolver(entityResolver); Node xmlDoc = docBuilder.parse(new InputSource(inFileName)); Document doc = docBuilder.newDocument(); org.w3c.dom.DocumentFragment outNode = doc.createDocumentFragment(); transformer.transform(new DOMSource(xmlDoc, inFileName), new DOMResult(outNode)); // Now serialize output to disk with identity transformer Transformer serializer = stf.newTransformer(); serializer.setErrorListener(new DefaultErrorHandler(false)); Properties serializationProps = stylesheet.getOutputProperties(); serializer.setOutputProperties(serializationProps); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); serializer.transform(new DOMSource(outNode), result); } else serializer.transform(new DOMSource(outNode), strResult); } else if (flavor.equals("th")) { for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior { // System.out.println("Testing the TransformerHandler..."); // =============== XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } if (!useXSLTC) stf.setAttribute(org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL, Boolean.TRUE); TransformerHandler th = stf.newTransformerHandler(stylesheet); reader.setContentHandler(th); reader.setDTDHandler(th); if(th instanceof org.xml.sax.ErrorHandler) reader.setErrorHandler((org.xml.sax.ErrorHandler)th); try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", th); } catch (org.xml.sax.SAXNotRecognizedException e){} catch (org.xml.sax.SAXNotSupportedException e){} try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) {} th.setResult(strResult); reader.parse(new InputSource(inFileName)); } } else { if (entityResolver != null) { XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } reader.setEntityResolver(entityResolver); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform( new SAXSource(reader, new InputSource(inFileName)), result); } else { transformer.transform( new SAXSource(reader, new InputSource(inFileName)), strResult); } } else if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform(new StreamSource(inFileName), result); } else { // System.out.println("Starting transform"); transformer.transform(new StreamSource(inFileName), strResult); // System.out.println("Done with transform"); } } } else { StringReader reader = new StringReader("<?xml version=\"1.0\"?> <doc/>"); transformer.transform(new StreamSource(reader), strResult); } } else { // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); doExit(msg); } // close output streams if (null != outFileName && strResult!=null) { java.io.OutputStream out = strResult.getOutputStream(); java.io.Writer writer = strResult.getWriter(); try { if (out != null) out.close(); if (writer != null) writer.close(); } catch(java.io.IOException ie) {} } long stop = System.currentTimeMillis(); long millisecondsDuration = stop - start; if (doDiag) { Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) }; msg = XSLMessages.createMessage("diagTiming", msgArgs); diagnosticsWriter.println('\n'); diagnosticsWriter.println(msg); } } catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); } if (null != dumpFileName) { dumpWriter.close(); } if (null != diagnosticsWriter) { // diagnosticsWriter.close(); } // if(!setQuietMode) // diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done"); // else // diagnosticsWriter.println(""); //"Xalan: done"); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
94
              
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
702
              
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void warning (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); // Note: should we really call .toString() below, since // sometimes the message is not properly set? m_pw.println("warning: " + exception.getMessage()); m_pw.flush(); if (getThrowOnWarning()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void error (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void fatalError (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); m_pw.println("fatalError: " + exception.getMessage()); m_pw.flush(); if (getThrowOnFatalError()) throw exception; }
// in src/org/apache/xml/utils/FastStringBuffer.java
public void sendSAXcharacters( org.xml.sax.ContentHandler ch, int start, int length) throws org.xml.sax.SAXException { int startChunk = start >>> m_chunkBits; int startColumn = start & m_chunkMask; if (startColumn + length < m_chunkMask && m_innerFSB == null) { ch.characters(m_array[startChunk], startColumn, length); return; } int stop = start + length; int stopChunk = stop >>> m_chunkBits; int stopColumn = stop & m_chunkMask; for (int i = startChunk; i < stopChunk; ++i) { if (i == 0 && m_innerFSB != null) m_innerFSB.sendSAXcharacters(ch, startColumn, m_chunkSize - startColumn); else ch.characters(m_array[i], startColumn, m_chunkSize - startColumn); startColumn = 0; // after first chunk } // Last, or only, chunk if (stopChunk == 0 && m_innerFSB != null) m_innerFSB.sendSAXcharacters(ch, startColumn, stopColumn - startColumn); else if (stopColumn > startColumn) { ch.characters(m_array[stopChunk], startColumn, stopColumn - startColumn); } }
// in src/org/apache/xml/utils/FastStringBuffer.java
public int sendNormalizedSAXcharacters( org.xml.sax.ContentHandler ch, int start, int length) throws org.xml.sax.SAXException { // This call always starts at the beginning of the // string being written out, either because it was called directly or // because it was an m_innerFSB recursion. This is important since // it gives us a well-known initial state for this flag: int stateForNextChunk=SUPPRESS_LEADING_WS; int stop = start + length; int startChunk = start >>> m_chunkBits; int startColumn = start & m_chunkMask; int stopChunk = stop >>> m_chunkBits; int stopColumn = stop & m_chunkMask; for (int i = startChunk; i < stopChunk; ++i) { if (i == 0 && m_innerFSB != null) stateForNextChunk= m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, m_chunkSize - startColumn); else stateForNextChunk= sendNormalizedSAXcharacters(m_array[i], startColumn, m_chunkSize - startColumn, ch,stateForNextChunk); startColumn = 0; // after first chunk } // Last, or only, chunk if (stopChunk == 0 && m_innerFSB != null) stateForNextChunk= // %REVIEW% Is this update really needed? m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, stopColumn - startColumn); else if (stopColumn > startColumn) { stateForNextChunk= // %REVIEW% Is this update really needed? sendNormalizedSAXcharacters(m_array[stopChunk], startColumn, stopColumn - startColumn, ch, stateForNextChunk | SUPPRESS_TRAILING_WS); } return stateForNextChunk; }
// in src/org/apache/xml/utils/FastStringBuffer.java
static int sendNormalizedSAXcharacters(char ch[], int start, int length, org.xml.sax.ContentHandler handler, int edgeTreatmentFlags) throws org.xml.sax.SAXException { boolean processingLeadingWhitespace = ((edgeTreatmentFlags & SUPPRESS_LEADING_WS) != 0); boolean seenWhitespace = ((edgeTreatmentFlags & CARRY_WS) != 0); int currPos = start; int limit = start+length; // Strip any leading spaces first, if required if (processingLeadingWhitespace) { for (; currPos < limit && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } // If we've only encountered leading spaces, the // current state remains unchanged if (currPos == limit) { return edgeTreatmentFlags; } } // If we get here, there are no more leading spaces to strip while (currPos < limit) { int startNonWhitespace = currPos; // Grab a chunk of non-whitespace characters for (; currPos < limit && !XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } // Non-whitespace seen - emit them, along with a single // space for any preceding whitespace characters if (startNonWhitespace != currPos) { if (seenWhitespace) { handler.characters(SINGLE_SPACE, 0, 1); seenWhitespace = false; } handler.characters(ch, startNonWhitespace, currPos - startNonWhitespace); } int startWhitespace = currPos; // Consume any whitespace characters for (; currPos < limit && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } if (startWhitespace != currPos) { seenWhitespace = true; } } return (seenWhitespace ? CARRY_WS : 0) | (edgeTreatmentFlags & SUPPRESS_TRAILING_WS); }
// in src/org/apache/xml/utils/FastStringBuffer.java
public static void sendNormalizedSAXcharacters(char ch[], int start, int length, org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException { sendNormalizedSAXcharacters(ch, start, length, handler, SUPPRESS_BOTH); }
// in src/org/apache/xml/utils/FastStringBuffer.java
public void sendSAXComment( org.xml.sax.ext.LexicalHandler ch, int start, int length) throws org.xml.sax.SAXException { // %OPT% Do it this way for now... String comment = getString(start, length); ch.comment(comment.toCharArray(), 0, length); }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); traverseFragment(pos); this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverseFragment(Node pos) throws org.xml.sax.SAXException { Node top = pos; while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/utils/TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if(m_contentHandler instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler) { ((org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)m_contentHandler).characters(node); } else { String data = ((Text) node).getData(); this.m_contentHandler.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/utils/TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { if (m_contentHandler instanceof NodeConsumer) { ((NodeConsumer) m_contentHandler).setOriginatingNode(node); } if (node instanceof Locator) { Locator loc = (Locator)node; m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId()); } else { m_locator.setColumnNumber(0); m_locator.setLineNumber(0); } switch (node.getNodeType()) { case Node.COMMENT_NODE : { String data = ((Comment) node).getData(); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.comment(data.toCharArray(), 0, data.length()); } } break; case Node.DOCUMENT_FRAGMENT_NODE : // ??; break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : NamedNodeMap atts = ((Element) node).getAttributes(); int nAttrs = atts.getLength(); // System.out.println("TreeWalker#startNode: "+node.getNodeName()); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); this.m_contentHandler.startPrefixMapping(prefix, attr.getNodeValue()); } } // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node)); // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node)); String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.startElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName(), new AttList(atts, m_dh)); break; case Node.PROCESSING_INSTRUCTION_NODE : { ProcessingInstruction pi = (ProcessingInstruction) node; String name = pi.getNodeName(); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(pi.getNodeName(), pi.getData()); } } break; case Node.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case Node.TEXT_NODE : { //String data = ((Text) node).getData(); if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( eref.getNodeName()); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/utils/TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); NamedNodeMap atts = ((Element) node).getAttributes(); int nAttrs = atts.getLength(); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); this.m_contentHandler.endPrefixMapping(prefix); } } break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(eref.getNodeName()); } } break; default : } }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void warning(SAXParseException exception) throws SAXException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println("Parser warning: " + exception.getMessage()); }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void error(SAXParseException exception) throws SAXException { //printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void fatalError(SAXParseException exception) throws SAXException { // printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (target.equals("xml-stylesheet")) { String href = null; // CDATA #REQUIRED String type = null; // CDATA #REQUIRED String title = null; // CDATA #IMPLIED String media = null; // CDATA #IMPLIED String charset = null; // CDATA #IMPLIED boolean alternate = false; // (yes|no) "no" StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true); boolean lookedAhead = false; Source source = null; String token = ""; while (tokenizer.hasMoreTokens()) { if (!lookedAhead) token = tokenizer.nextToken(); else lookedAhead = false; if (tokenizer.hasMoreTokens() && (token.equals(" ") || token.equals("\t") || token.equals("="))) continue; String name = token; if (name.equals("type")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); type = token.substring(1, token.length() - 1); } else if (name.equals("href")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); href = token; if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); // If the href value has parameters to be passed to a // servlet(something like "foobar?id=12..."), // we want to make sure we get them added to // the href value. Without this check, we would move on // to try to process another attribute and that would be // wrong. // We need to set lookedAhead here to flag that we // already have the next token. while ( token.equals("=") && tokenizer.hasMoreTokens()) { href = href + token + tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); lookedAhead = true; } else { break; } } } href = href.substring(1, href.length() - 1); try { // Add code to use a URIResolver. Patch from Dmitri Ilyin. if (m_uriResolver != null) { source = m_uriResolver.resolve(href, m_baseID); } else { href = SystemIDResolver.getAbsoluteURI(href, m_baseID); source = new SAXSource(new InputSource(href)); } } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } } else if (name.equals("title")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); title = token.substring(1, token.length() - 1); } else if (name.equals("media")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); media = token.substring(1, token.length() - 1); } else if (name.equals("charset")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); charset = token.substring(1, token.length() - 1); } else if (name.equals("alternate")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); alternate = token.substring(1, token.length() - 1).equals("yes"); } } if ((null != type) && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt")) && (null != href)) { if (null != m_media) { if (null != media) { if (!media.equals(m_media)) return; } else return; } if (null != m_charset) { if (null != charset) { if (!charset.equals(m_charset)) return; } else return; } if (null != m_title) { if (null != title) { if (!title.equals(m_title)) return; } else return; } m_stylesheets.addElement(source); } } }
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws org.xml.sax.SAXException { throw new StopParseException(); }
// in src/org/apache/xml/utils/DOMBuilder.java
protected void append(Node newNode) throws org.xml.sax.SAXException { Node currentNode = m_currentNode; if (null != currentNode) { if (currentNode == m_root && m_nextSibling != null) currentNode.insertBefore(newNode, m_nextSibling); else currentNode.appendChild(newNode); // System.out.println(newNode.getNodeName()); } else if (null != m_docFrag) { if (m_nextSibling != null) m_docFrag.insertBefore(newNode, m_nextSibling); else m_docFrag.appendChild(newNode); } else { boolean ok = true; short type = newNode.getNodeType(); if (type == Node.TEXT_NODE) { String data = newNode.getNodeValue(); if ((null != data) && (data.trim().length() > 0)) { throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null)); //"Warning: can't output text before document element! Ignoring..."); } ok = false; } else if (type == Node.ELEMENT_NODE) { if (m_doc.getDocumentElement() != null) { ok = false; throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null)); //"Can't have more than one root on a DOM!"); } } if (ok) { if (m_nextSibling != null) m_doc.insertBefore(newNode, m_nextSibling); else m_doc.appendChild(newNode); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startDocument() throws org.xml.sax.SAXException { // No action for the moment. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endDocument() throws org.xml.sax.SAXException { // No action for the moment. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startElement( String ns, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { Element elem; // Note that the namespace-aware call must be used to correctly // construct a Level 2 DOM, even for non-namespaced nodes. if ((null == ns) || (ns.length() == 0)) elem = m_doc.createElementNS(null,name); else elem = m_doc.createElementNS(ns, name); append(elem); try { int nAtts = atts.getLength(); if (0 != nAtts) { for (int i = 0; i < nAtts; i++) { //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) ); // First handle a possible ID attribute if (atts.getType(i).equalsIgnoreCase("ID")) setIDAttribute(atts.getValue(i), elem); String attrNS = atts.getURI(i); if("".equals(attrNS)) attrNS = null; // DOM represents no-namespace as null // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i) // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i)); // Crimson won't let us set an xmlns: attribute on the DOM. String attrQName = atts.getQName(i); // In SAX, xmlns[:] attributes have an empty namespace, while in DOM they // should have the xmlns namespace if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) { attrNS = "http://www.w3.org/2000/xmlns/"; } // ALWAYS use the DOM Level 2 call! elem.setAttributeNS(attrNS,attrQName, atts.getValue(i)); } } /* * Adding namespace nodes to the DOM tree; */ int nDecls = m_prefixMappings.size(); String prefix, declURL; for (int i = 0; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; declURL = (String) m_prefixMappings.elementAt(i + 1); elem.setAttributeNS("http://www.w3.org/2000/xmlns/", prefix, declURL); } m_prefixMappings.clear(); // append(elem); m_elemStack.push(elem); m_currentNode = elem; // append(elem); } catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endElement(String ns, String localName, String name) throws org.xml.sax.SAXException { m_elemStack.pop(); m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek(); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error if (m_inCData) { cdata(ch, start, length); return; } String s = new String(ch, start, length); Node childNode; childNode = m_currentNode != null ? m_currentNode.getLastChild(): null; if( childNode != null && childNode.getNodeType() == Node.TEXT_NODE ){ ((Text)childNode).appendData(s); } else{ Text text = m_doc.createTextNode(s); append(text); } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); append(m_doc.createProcessingInstruction("xslt-next-is-raw", "formatter-to-dom")); append(m_doc.createTextNode(s)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startEntity(String name) throws org.xml.sax.SAXException { // Almost certainly the wrong behavior... // entityReference(name); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endEntity(String name) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/DOMBuilder.java
public void entityReference(String name) throws org.xml.sax.SAXException { append(m_doc.createEntityReference(name)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem()) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); append(m_doc.createTextNode(s)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { append(m_doc.createProcessingInstruction(target, data)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { append(m_doc.createComment(new String(ch, start, length))); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startCDATA() throws org.xml.sax.SAXException { m_inCData = true; append(m_doc.createCDATASection("")); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endCDATA() throws org.xml.sax.SAXException { m_inCData = false; }
// in src/org/apache/xml/utils/DOMBuilder.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); CDATASection section =(CDATASection) m_currentNode.getLastChild(); section.appendData(s); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException { // Do nothing for now. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endDTD() throws org.xml.sax.SAXException { // Do nothing for now. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { if(null == prefix || prefix.length() == 0) prefix = "xmlns"; else prefix = "xmlns:"+prefix; m_prefixMappings.addElement(prefix); m_prefixMappings.addElement(uri); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/DOMBuilder.java
public void skippedEntity(String name) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/XMLStringDefault.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { }
// in src/org/apache/xml/utils/XMLStringDefault.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { }
// in src/org/apache/xml/utils/XMLReaderManager.java
public synchronized XMLReader getXMLReader() throws SAXException { XMLReader reader; boolean readerInUse; if (m_readers == null) { // When the m_readers.get() method is called for the first time // on a thread, a new XMLReader will automatically be created. m_readers = new ThreadLocal(); } if (m_inUse == null) { m_inUse = new Hashtable(); } // If the cached reader for this thread is in use, construct a new // one; otherwise, return the cached reader. reader = (XMLReader) m_readers.get(); boolean threadHasReader = (reader != null); if (!threadHasReader || m_inUse.get(reader) == Boolean.TRUE) { try { try { // According to JAXP 1.2 specification, if a SAXSource // is created using a SAX InputSource the Transformer or // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); } catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } } try { reader.setFeature(NAMESPACES_FEATURE, true); reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false); } catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. } } catch (ParserConfigurationException ex) { throw new SAXException(ex); } catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); } catch (NoSuchMethodError ex2) { } catch (AbstractMethodError ame) { } // Cache the XMLReader if this is the first time we've created // a reader for this thread. if (!threadHasReader) { m_readers.set(reader); m_inUse.put(reader, Boolean.TRUE); } } else { m_inUse.put(reader, Boolean.TRUE); } return reader; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.characters(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endDocument() throws org.xml.sax.SAXException { // EXCEPTION: In this case we need to run the event BEFORE we yield. if(clientContentHandler!=null) clientContentHandler.endDocument(); eventcounter=0; co_yield(false); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.endElement(namespaceURI,localName,qName); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.endPrefixMapping(prefix); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.ignorableWhitespace(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.processingInstruction(target,data); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.skippedEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startDocument() throws org.xml.sax.SAXException { co_entry_pause(); // Otherwise, begin normal event delivery if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startDocument(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startElement(namespaceURI, localName, qName, atts); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startPrefixMapping(prefix,uri); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.comment(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endCDATA() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endCDATA(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endDTD() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endDTD(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startCDATA() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.startCDATA(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler. startDTD(name, publicId, systemId); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.startEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void notationDecl(String a, String b, String c) throws SAXException { if(null!=clientDTDHandler) clientDTDHandler.notationDecl(a,b,c); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void unparsedEntityDecl(String a, String b, String c, String d) throws SAXException { if(null!=clientDTDHandler) clientDTDHandler.unparsedEntityDecl(a,b,c,d); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void error(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void fatalError(SAXParseException exception) throws SAXException { // EXCEPTION: In this case we need to run the event BEFORE we yield -- // just as with endDocument, this terminates the event stream. if(null!=clientErrorHandler) clientErrorHandler.error(exception); eventcounter=0; co_yield(false); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void warning(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
protected void count_and_yield(boolean moreExpected) throws SAXException { if(!moreExpected) eventcounter=0; if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_entry_pause() throws SAXException { if(fCoroutineManager==null) { // Nobody called init()? Do it now... init(null,-1,-1); } try { Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID); if(arg==Boolean.FALSE) co_yield(false); } catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException { // Actually creating the text node is handled by // processAccumulatedText(); here we just accumulate the // characters into the buffer. m_char.append(ch,start,length); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endDocument() throws org.xml.sax.SAXException { // May need to tell the low-level builder code to pop up a level. // There _should't_ be any significant pending text at this point. appendEndDocument(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException { processAccumulatedText(); // No args but we do need to tell the low-level builder code to // pop up a level. appendEndElement(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { // No-op }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { // %TBD% I believe ignorable text isn't part of the DTM model...? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { processAccumulatedText(); // %TBD% Which pools do target and data go into? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { processAccumulatedText(); //%TBD% }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startDocument() throws org.xml.sax.SAXException { appendStartDocument(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws org.xml.sax.SAXException { processAccumulatedText(); // %TBD% Split prefix off qname String prefix=null; int colon=qName.indexOf(':'); if(colon>0) prefix=qName.substring(0,colon); // %TBD% Where do we pool expandedName, or is it just the union, or... /**/System.out.println("Prefix="+prefix+" index="+m_prefixNames.stringToIndex(prefix)); appendStartElement(m_nsNames.stringToIndex(namespaceURI), m_localNames.stringToIndex(localName), m_prefixNames.stringToIndex(prefix)); /////// %TBD% // %TBD% I'm assuming that DTM will require resequencing of // NS decls before other attrs, hence two passes are taken. // %TBD% Is there an easier way to test for NSDecl? int nAtts=(atts==null) ? 0 : atts.getLength(); // %TBD% Countdown is more efficient if nobody cares about sequence. for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(qName.startsWith("xmlns:") || "xmlns".equals(qName)) { prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); } else { // %REVEIW% Null or ""? prefix=null; // Default prefix } appendNSDeclaration( m_prefixNames.stringToIndex(prefix), m_nsNames.stringToIndex(atts.getValue(i)), atts.getType(i).equalsIgnoreCase("ID")); } } for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(!(qName.startsWith("xmlns:") || "xmlns".equals(qName))) { // %TBD% I hate having to extract the prefix into a new // string when we may never use it. Consider pooling whole // qNames, which are already strings? prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); localName=qName.substring(colon+1); } else { prefix=""; // Default prefix localName=qName; } m_char.append(atts.getValue(i)); // Single-string value int contentEnd=m_char.length(); if(!("xmlns".equals(prefix) || "xmlns".equals(qName))) appendAttribute(m_nsNames.stringToIndex(atts.getURI(i)), m_localNames.stringToIndex(localName), m_prefixNames.stringToIndex(prefix), atts.getType(i).equalsIgnoreCase("ID"), m_char_current_start, contentEnd-m_char_current_start); m_char_current_start=contentEnd; } } }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { // No-op in DTM, handled during element/attr processing? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { processAccumulatedText(); m_char.append(ch,start,length); // Single-string value appendComment(m_char_current_start,length); m_char_current_start+=length; }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endCDATA() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endDTD() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startCDATA() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException {}
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException {}
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
public void traverse(int pos) throws org.xml.sax.SAXException { // %REVIEW% Why isn't this just traverse(pos,pos)? int top = pos; // Remember the root of this subtree while (DTM.NULL != pos) { startNode(pos); int nextNode = m_dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { endNode(pos); if (top == pos) break; nextNode = m_dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = m_dtm.getParent(pos); if ((DTM.NULL == pos) || (top == pos)) { // %REVIEW% This condition isn't tested in traverse(pos,top) // -- bug? if (DTM.NULL != pos) endNode(pos); nextNode = DTM.NULL; break; } } } pos = nextNode; } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
public void traverse(int pos, int top) throws org.xml.sax.SAXException { // %OPT% Can we simplify the loop conditionals by adding: // if(top==DTM.NULL) top=0 // -- or by simply ignoring this case and relying on the fact that // pos will never equal DTM.NULL until we're ready to exit? while (DTM.NULL != pos) { startNode(pos); int nextNode = m_dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { endNode(pos); if ((DTM.NULL != top) && top == pos) break; nextNode = m_dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = m_dtm.getParent(pos); if ((DTM.NULL == pos) || ((DTM.NULL != top) && (top == pos))) { nextNode = DTM.NULL; break; } } } pos = nextNode; } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
private final void dispatachChars(int node) throws org.xml.sax.SAXException { m_dtm.dispatchCharactersEvents(node, m_contentHandler, false); }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
protected void startNode(int node) throws org.xml.sax.SAXException { if (m_contentHandler instanceof NodeConsumer) { // %TBD% // ((NodeConsumer) m_contentHandler).setOriginatingNode(node); } switch (m_dtm.getNodeType(node)) { case DTM.COMMENT_NODE : { XMLString data = m_dtm.getStringValue(node); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); data.dispatchAsComment(lh); } } break; case DTM.DOCUMENT_FRAGMENT_NODE : // ??; break; case DTM.DOCUMENT_NODE : this.m_contentHandler.startDocument(); break; case DTM.ELEMENT_NODE : DTM dtm = m_dtm; for (int nsn = dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn; nsn = dtm.getNextNamespaceNode(node, nsn, true)) { // String prefix = dtm.getPrefix(nsn); String prefix = dtm.getNodeNameX(nsn); this.m_contentHandler.startPrefixMapping(prefix, dtm.getNodeValue(nsn)); } // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node)); // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node)); String ns = dtm.getNamespaceURI(node); if(null == ns) ns = ""; // %OPT% !! org.xml.sax.helpers.AttributesImpl attrs = new org.xml.sax.helpers.AttributesImpl(); for (int i = dtm.getFirstAttribute(node); i != DTM.NULL; i = dtm.getNextAttribute(i)) { attrs.addAttribute(dtm.getNamespaceURI(i), dtm.getLocalName(i), dtm.getNodeName(i), "CDATA", dtm.getNodeValue(i)); } this.m_contentHandler.startElement(ns, m_dtm.getLocalName(node), m_dtm.getNodeName(node), attrs); break; case DTM.PROCESSING_INSTRUCTION_NODE : { String name = m_dtm.getNodeName(node); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(name, m_dtm.getNodeValue(node)); } } break; case DTM.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case DTM.TEXT_NODE : { if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case DTM.ENTITY_REFERENCE_NODE : { if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( m_dtm.getNodeName(node)); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
protected void endNode(int node) throws org.xml.sax.SAXException { switch (m_dtm.getNodeType(node)) { case DTM.DOCUMENT_NODE : this.m_contentHandler.endDocument(); break; case DTM.ELEMENT_NODE : String ns = m_dtm.getNamespaceURI(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dtm.getLocalName(node), m_dtm.getNodeName(node)); for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn; nsn = m_dtm.getNextNamespaceNode(node, nsn, true)) { // String prefix = m_dtm.getPrefix(nsn); String prefix = m_dtm.getNodeNameX(nsn); this.m_contentHandler.endPrefixMapping(prefix); } break; case DTM.CDATA_SECTION_NODE : break; case DTM.ENTITY_REFERENCE_NODE : { if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(m_dtm.getNodeName(node)); } } break; default : } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public void startParse(InputSource source) throws SAXException { if (fIncrementalParser==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser."); if (fParseInProgress) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing."); boolean ok=false; try { ok = parseSomeSetup(source); } catch(Exception ex) { throw new SAXException(ex); } if(!ok) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with"); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { if(normalize) { XMLString str = getStringValue(nodeHandle); str = str.fixWhiteSpace(true, true, false); str.dispatchCharactersEvents(ch); } else { int type = getNodeType(nodeHandle); Node node = getNode(nodeHandle); dispatchNodeData(node, ch, 0); // Text coalition -- a DTM text node may represent multiple // DOM nodes. if(TEXT_NODE == type || CDATA_SECTION_NODE == type) { while( null != (node=logicalNextDOMTextNode(node)) ) { dispatchNodeData(node, ch, 0); } } } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
protected static void dispatchNodeData(Node node, org.xml.sax.ContentHandler ch, int depth) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_FRAGMENT_NODE : case Node.DOCUMENT_NODE : case Node.ELEMENT_NODE : { for (Node child = node.getFirstChild(); null != child; child = child.getNextSibling()) { dispatchNodeData(child, ch, depth+1); } } break; case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW% case Node.COMMENT_NODE : if(0 != depth) break; // NOTE: Because this operation works in the DOM space, it does _not_ attempt // to perform Text Coalition. That should only be done in DTM space. case Node.TEXT_NODE : case Node.CDATA_SECTION_NODE : case Node.ATTRIBUTE_NODE : String str = node.getNodeValue(); if(ch instanceof CharacterNodeHandler) { ((CharacterNodeHandler)ch).characters(node); } else { ch.characters(str.toCharArray(), 0, str.length()); } break; // /* case Node.PROCESSING_INSTRUCTION_NODE : // // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING); // break; */ default : // ignore break; } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { TreeWalker treeWalker = m_walker; ContentHandler prevCH = treeWalker.getContentHandler(); if(null != prevCH) { treeWalker = new TreeWalker(null); } treeWalker.setContentHandler(ch); try { Node node = getNode(nodeHandle); treeWalker.traverseFragment(node); } finally { treeWalker.setContentHandler(null); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void startDocument() throws SAXException { // Re-initialize the tree append process m_endDocumentOccured = false; m_prefixMappings = new java.util.Vector(); m_contextIndexes = new IntStack(); m_parents = new IntStack(); m_currentDocumentNode=m_size; super.startDocument(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void endDocument() throws SAXException { charactersFlush(); m_nextsib.setElementAt(NULL,m_currentDocumentNode); if (m_firstch.elementAt(m_currentDocumentNode) == NOTPROCESSED) m_firstch.setElementAt(NULL,m_currentDocumentNode); if (DTM.NULL != m_previous) m_nextsib.setElementAt(DTM.NULL,m_previous); m_parents = null; m_prefixMappings = null; m_contextIndexes = null; m_currentDocumentNode= NULL; // no longer open m_endDocumentOccured = true; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return; int type = _type(identity); if (isTextType(type)) { int dataIndex = m_dataOrQName.elementAt(identity); int offset = m_data.elementAt(dataIndex); int length = m_data.elementAt(dataIndex + 1); if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } else { int firstChild = _firstch(identity); if (DTM.NULL != firstChild) { int offset = -1; int length = 0; int startNode = identity; identity = firstChild; do { type = _type(identity); if (isTextType(type)) { int dataIndex = _dataOrQName(identity); if (-1 == offset) { offset = m_data.elementAt(dataIndex); } length += m_data.elementAt(dataIndex + 1); } identity = getNextNodeIdentity(identity); } while (DTM.NULL != identity && (_parent(identity) >= startNode)); if (length > 0) { if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } } else if(type != DTM.ELEMENT_NODE) { int dataIndex = _dataOrQName(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String str = m_valuesOrPrefixes.indexToString(dataIndex); if(normalize) FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 0, str.length(), ch); else ch.characters(str.toCharArray(), 0, str.length()); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { DTMTreeWalker treeWalker = m_walker; ContentHandler prevCH = treeWalker.getcontentHandler(); if (null != prevCH) { treeWalker = new DTMTreeWalker(); } treeWalker.setcontentHandler(ch); treeWalker.setDTM(this); try { treeWalker.traverse(nodeHandle); } finally { treeWalker.setcontentHandler(null); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException { return null; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null == m_entities) { m_entities = new Vector(); } try { systemId = SystemIDResolver.getAbsoluteURI(systemId, getDocumentBaseURI()); } catch (Exception e) { throw new org.xml.sax.SAXException(e); } // private static final int ENTITY_FIELD_PUBLICID = 0; m_entities.addElement(publicId); // private static final int ENTITY_FIELD_SYSTEMID = 1; m_entities.addElement(systemId); // private static final int ENTITY_FIELD_NOTATIONNAME = 2; m_entities.addElement(notationName); // private static final int ENTITY_FIELD_NAME = 3; m_entities.addElement(name); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startDocument() throws SAXException { if (DEBUG) System.out.println("startDocument"); int doc = addNode(DTM.DOCUMENT_NODE, m_expandedNameTable.getExpandedTypeID(DTM.DOCUMENT_NODE), DTM.NULL, DTM.NULL, 0, true); m_parents.push(doc); m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the next element. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endDocument() throws SAXException { if (DEBUG) System.out.println("endDocument"); charactersFlush(); m_nextsib.setElementAt(NULL,0); if (m_firstch.elementAt(0) == NOTPROCESSED) m_firstch.setElementAt(NULL,0); if (DTM.NULL != m_previous) m_nextsib.setElementAt(DTM.NULL,m_previous); m_parents = null; m_prefixMappings = null; m_contextIndexes = null; m_endDocumentOccured = true; // Bugzilla 4858: throw away m_locator. we cache m_systemId m_locator = null; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (DEBUG) System.out.println("startPrefixMapping: prefix: " + prefix + ", uri: " + uri); if(null == prefix) prefix = ""; m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endPrefixMapping(String prefix) throws SAXException { if (DEBUG) System.out.println("endPrefixMapping: prefix: " + prefix); if(null == prefix) prefix = ""; int index = m_contextIndexes.peek() - 1; do { index = m_prefixMappings.indexOf(prefix, ++index); } while ( (index >= 0) && ((index & 0x01) == 0x01) ); if (index > -1) { m_prefixMappings.setElementAt("%@$#^@#", index); m_prefixMappings.setElementAt("%@$#^@#", index + 1); } // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (DEBUG) { System.out.println("startElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName+", atts: " + attributes); boolean DEBUG_ATTRS=true; if(DEBUG_ATTRS & attributes!=null) { int n = attributes.getLength(); if(n==0) System.out.println("\tempty attribute list"); else for (int i = 0; i < n; i++) System.out.println("\t attr: uri: " + attributes.getURI(i) + ", localname: " + attributes.getLocalName(i) + ", qname: " + attributes.getQName(i) + ", type: " + attributes.getType(i) + ", value: " + attributes.getValue(i) ); } } charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); String prefix = getPrefix(qName, uri); int prefixIndex = (null != prefix) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); int prev = DTM.NULL; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); prefix = getPrefix(attrQName, attrUri); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; int val = m_valuesOrPrefixes.stringToIndex(valString); //String attrLocalName = attributes.getLocalName(i); if (null != prefix) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); prev = addNode(nodeType, exName, elemNode, prev, val, false); } if (DTM.NULL != prev) m_nextsib.setElementAt(DTM.NULL,prev); if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endElement(String uri, String localName, String qName) throws SAXException { if (DEBUG) System.out.println("endElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName); charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } int lastNode = m_previous; m_previous = m_parents.pop(); // If lastNode is still DTM.NULL, this element had no children if (DTM.NULL == lastNode) m_firstch.setElementAt(DTM.NULL,m_previous); else m_nextsib.setElementAt(DTM.NULL,lastNode); popShouldStripWhitespace(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void characters(char ch[], int start, int length) throws SAXException { if (m_textPendingStart == -1) // First one in this block { m_textPendingStart = m_chars.size(); m_coalescedTextType = m_textType; } // Type logic: If all adjacent text is CDATASections, the // concatentated text is treated as a single CDATASection (see // initialization above). If any were ordinary Text, the whole // thing is treated as Text. This may be worth %REVIEW%ing. else if (m_textType == DTM.TEXT_NODE) { m_coalescedTextType = DTM.TEXT_NODE; } m_chars.append(ch, start, length); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { // %OPT% We can probably take advantage of the fact that we know this // is whitespace. characters(ch, start, length); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void processingInstruction(String target, String data) throws SAXException { if (DEBUG) System.out.println("processingInstruction: target: " + target +", data: "+data); charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(null, target, DTM.PROCESSING_INSTRUCTION_NODE); int dataIndex = m_valuesOrPrefixes.stringToIndex(data); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void skippedEntity(String name) throws SAXException { // %REVIEW% What should be done here? // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void warning(SAXParseException e) throws SAXException { // %REVIEW% Is there anyway to get the JAXP error listener here? System.err.println(e.getMessage()); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void error(SAXParseException e) throws SAXException { throw e; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void fatalError(SAXParseException e) throws SAXException { throw e; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void elementDecl(String name, String model) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void internalEntityDecl(String name, String value) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_insideDTD = true; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endDTD() throws SAXException { m_insideDTD = false; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startEntity(String name) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endEntity(String name) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startCDATA() throws SAXException { m_textType = DTM.CDATA_SECTION_NODE; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endCDATA() throws SAXException { m_textType = DTM.TEXT_NODE; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(DTM.COMMENT_NODE); // For now, treat comments as strings... I guess we should do a // seperate FSB buffer instead. int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start, length)); m_previous = addNode(DTM.COMMENT_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); int prefixIndex = (qName.length() != localName.length()) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); String prefix; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { prefix = getPrefix(attrQName, attrUri); if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (m_buildIdIndex && attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; m_values.addElement(valString); int val = m_valueIndex++; if (attrLocalName.length() != attrQName.length()) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); addNode(nodeType, exName, elemNode, DTM.NULL, val, false); } if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void endElement(String uri, String localName, String qName) throws SAXException { charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } m_previous = m_parents.pop(); popShouldStripWhitespace(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); // %OPT% Saving the comment string in a Vector has a lower cost than // saving it in DTMStringPool. m_values.addElement(new String(ch, start, length)); int dataIndex = m_valueIndex++; m_previous = addNode(DTM.COMMENT_NODE, DTM.COMMENT_NODE, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void startDocument() throws SAXException { int doc = addNode(DTM.DOCUMENT_NODE, DTM.DOCUMENT_NODE, DTM.NULL, DTM.NULL, 0, true); m_parents.push(doc); m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the next element. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void endDocument() throws SAXException { super.endDocument(); // Add a NULL entry to the end of the node arrays as // the end indication. m_exptype.addElement(NULL); m_parent.addElement(NULL); m_nextsib.addElement(NULL); m_firstch.addElement(NULL); // Set the cached references after the document is built. m_extendedTypes = m_expandedNameTable.getExtendedTypes(); m_exptype_map = m_exptype.getMap(); m_nextsib_map = m_nextsib.getMap(); m_firstch_map = m_firstch.getMap(); m_parent_map = m_parent.getMap(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void processingInstruction(String target, String data) throws SAXException { charactersFlush(); int dataIndex = m_data.size(); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, DTM.PROCESSING_INSTRUCTION_NODE, m_parents.peek(), m_previous, -dataIndex, false); m_data.addElement(m_valuesOrPrefixes.stringToIndex(target)); m_values.addElement(data); m_data.addElement(m_valueIndex++); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public final void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return; int type = _type2(identity); if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE) { int startNode = identity; identity = _firstch2(identity); if (DTM.NULL != identity) { int offset = -1; int length = 0; do { type = _exptype2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (-1 == offset) { offset = dataIndex >>> TEXT_LENGTH_BITS; } length += dataIndex & TEXT_LENGTH_MAX; } else { if (-1 == offset) { offset = m_data.elementAt(-dataIndex); } length += m_data.elementAt(-dataIndex + 1); } } identity++; } while (_parent2(identity) >= startNode); if (length > 0) { if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } } } else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); else m_chars.sendSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); else m_chars.sendSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String str = (String)m_values.elementAt(dataIndex); if(normalize) FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 0, str.length(), ch); else ch.characters(str.toCharArray(), 0, str.length()); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyTextNode(final int nodeID, SerializationHandler handler) throws SAXException { if (nodeID != DTM.NULL) { int dataIndex = m_dataOrQName.elementAt(nodeID); if (dataIndex >= 0) { m_chars.sendSAXcharacters(handler, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { m_chars.sendSAXcharacters(handler, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final String copyElement(int nodeID, int exptype, SerializationHandler handler) throws SAXException { final ExtendedType extType = m_extendedTypes[exptype]; String uri = extType.getNamespace(); String name = extType.getLocalName(); if (uri.length() == 0) { handler.startElement(name); return name; } else { int qnameIndex = m_dataOrQName.elementAt(nodeID); if (qnameIndex == 0) { handler.startElement(name); handler.namespaceAfterStartElement(EMPTY_STR, uri); return name; } if (qnameIndex < 0) { qnameIndex = -qnameIndex; qnameIndex = m_data.elementAt(qnameIndex); } String qName = m_valuesOrPrefixes.indexToString(qnameIndex); handler.startElement(qName); int prefixIndex = qName.indexOf(':'); String prefix; if (prefixIndex > 0) { prefix = qName.substring(0, prefixIndex); } else { prefix = null; } handler.namespaceAfterStartElement(prefix, uri); return qName; } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyNS(final int nodeID, SerializationHandler handler, boolean inScope) throws SAXException { // %OPT% Optimization for documents which does not have any explicit // namespace nodes. For these documents, there is an implicit // namespace node (xmlns:xml="http://www.w3.org/XML/1998/namespace") // declared on the root element node. In this case, there is no // need to do namespace copying. We can safely return without // doing anything. if (m_namespaceDeclSetElements != null && m_namespaceDeclSetElements.size() == 1 && m_namespaceDeclSets != null && ((SuballocatedIntVector)m_namespaceDeclSets.elementAt(0)) .size() == 1) return; SuballocatedIntVector nsContext = null; int nextNSNode; // Find the first namespace node if (inScope) { nsContext = findNamespaceContext(nodeID); if (nsContext == null || nsContext.size() < 1) return; else nextNSNode = makeNodeIdentity(nsContext.elementAt(0)); } else nextNSNode = getNextNamespaceNode2(nodeID); int nsIndex = 1; while (nextNSNode != DTM.NULL) { // Retrieve the name of the namespace node int eType = _exptype2(nextNSNode); String nodeName = m_extendedTypes[eType].getLocalName(); // Retrieve the node value of the namespace node int dataIndex = m_dataOrQName.elementAt(nextNSNode); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String nodeValue = (String)m_values.elementAt(dataIndex); handler.namespaceAfterStartElement(nodeName, nodeValue); if (inScope) { if (nsIndex < nsContext.size()) { nextNSNode = makeNodeIdentity(nsContext.elementAt(nsIndex)); nsIndex++; } else return; } else nextNSNode = getNextNamespaceNode2(nextNSNode); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyAttributes(final int nodeID, SerializationHandler handler) throws SAXException{ for(int current = getFirstAttributeIdentity(nodeID); current != DTM.NULL; current = getNextAttributeIdentity(current)){ int eType = _exptype2(current); copyAttribute(current, eType, handler); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyAttribute(int nodeID, int exptype, SerializationHandler handler) throws SAXException { /* final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); */ final ExtendedType extType = m_extendedTypes[exptype]; final String uri = extType.getNamespace(); final String localName = extType.getLocalName(); String prefix = null; String qname = null; int dataIndex = _dataOrQName(nodeID); int valueIndex = dataIndex; if (dataIndex <= 0) { int prefixIndex = m_data.elementAt(-dataIndex); valueIndex = m_data.elementAt(-dataIndex+1); qname = m_valuesOrPrefixes.indexToString(prefixIndex); int colonIndex = qname.indexOf(':'); if (colonIndex > 0) { prefix = qname.substring(0, colonIndex); } } if (uri.length() != 0) { handler.namespaceAfterStartElement(prefix, uri); } String nodeName = (prefix != null) ? qname : localName; String nodeValue = (String)m_values.elementAt(valueIndex); handler.addAttribute(nodeName, nodeValue); }
// in src/org/apache/xml/serializer/TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); Node top = pos; while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/serializer/TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/serializer/TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if(m_Serializer != null) { this.m_Serializer.characters(node); } else { String data = ((Text) node).getData(); this.m_contentHandler.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/serializer/TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { // TODO: <REVIEW> // A Serializer implements ContentHandler, but not NodeConsumer // so drop this reference to NodeConsumer which would otherwise // pull in all sorts of things // if (m_contentHandler instanceof NodeConsumer) // { // ((NodeConsumer) m_contentHandler).setOriginatingNode(node); // } // TODO: </REVIEW> if (node instanceof Locator) { Locator loc = (Locator)node; m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId()); } else { m_locator.setColumnNumber(0); m_locator.setLineNumber(0); } switch (node.getNodeType()) { case Node.COMMENT_NODE : { String data = ((Comment) node).getData(); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.comment(data.toCharArray(), 0, data.length()); } } break; case Node.DOCUMENT_FRAGMENT_NODE : // ??; break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : Element elem_node = (Element) node; { // Make sure the namespace node // for the element itself is declared // to the ContentHandler String uri = elem_node.getNamespaceURI(); if (uri != null) { String prefix = elem_node.getPrefix(); if (prefix==null) prefix=""; this.m_contentHandler.startPrefixMapping(prefix,uri); } } NamedNodeMap atts = elem_node.getAttributes(); int nAttrs = atts.getLength(); // System.out.println("TreeWalker#startNode: "+node.getNodeName()); // Make sure the namespace node of // each attribute is declared to the ContentHandler for (int i = 0; i < nAttrs; i++) { final Node attr = atts.item(i); final String attrName = attr.getNodeName(); final int colon = attrName.indexOf(':'); final String prefix; // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. if (colon < 0) prefix = ""; else prefix = attrName.substring(colon + 1); this.m_contentHandler.startPrefixMapping(prefix, attr.getNodeValue()); } else if (colon > 0) { prefix = attrName.substring(0,colon); String uri = attr.getNamespaceURI(); if (uri != null) this.m_contentHandler.startPrefixMapping(prefix,uri); } } String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.startElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName(), new AttList(atts, m_dh)); break; case Node.PROCESSING_INSTRUCTION_NODE : { ProcessingInstruction pi = (ProcessingInstruction) node; String name = pi.getNodeName(); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(pi.getNodeName(), pi.getData()); } } break; case Node.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case Node.TEXT_NODE : { //String data = ((Text) node).getData(); if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( eref.getNodeName()); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/serializer/TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); if (m_Serializer == null) { // Don't bother with endPrefixMapping calls if the ContentHandler is a // SerializationHandler because SerializationHandler's ignore the // endPrefixMapping() calls anyways. . . . This is an optimization. Element elem_node = (Element) node; NamedNodeMap atts = elem_node.getAttributes(); int nAttrs = atts.getLength(); // do the endPrefixMapping calls in reverse order // of the startPrefixMapping calls for (int i = (nAttrs-1); 0 <= i; i--) { final Node attr = atts.item(i); final String attrName = attr.getNodeName(); final int colon = attrName.indexOf(':'); final String prefix; if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. if (colon < 0) prefix = ""; else prefix = attrName.substring(colon + 1); this.m_contentHandler.endPrefixMapping(prefix); } else if (colon > 0) { prefix = attrName.substring(0, colon); this.m_contentHandler.endPrefixMapping(prefix); } } { String uri = elem_node.getNamespaceURI(); if (uri != null) { String prefix = elem_node.getPrefix(); if (prefix==null) prefix=""; this.m_contentHandler.endPrefixMapping(prefix); } } } break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(eref.getNodeName()); } } break; default : } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public boolean setEscaping(boolean escape) throws SAXException { boolean oldEscapeSetting = m_escapeSetting; m_escapeSetting = escape; if (escape) { processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } return oldEscapeSetting; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void elementDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endDocument() throws SAXException { flushPending(); // Close output document m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
protected void closeStartTag() throws SAXException { m_elemContext.m_startTagOpen = false; final String localName = getLocalName(m_elemContext.m_elementName); final String uri = getNamespaceURI(m_elemContext.m_elementName, true); // Now is time to send the startElement event if (m_needToCallStartDocument) { startDocumentInternal(); } m_saxHandler.startElement(uri, localName, m_elemContext.m_elementName, m_attributes); // we've sent the official SAX attributes on their way, // now we don't need them anymore. m_attributes.clear(); if(m_state != null) m_state.setCurrentNode(null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void closeCDATA() throws SAXException { // Output closing bracket - "]]>" if (m_lexHandler != null && m_cdataTagOpen) { m_lexHandler.endCDATA(); } // There are no longer any calls made to // m_lexHandler.startCDATA() without a balancing call to // m_lexHandler.endCDATA() // so we set m_cdataTagOpen to false to remember this. m_cdataTagOpen = false; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endElement(String namespaceURI, String localName, String qName) throws SAXException { // Close any open elements etc. flushPending(); if (namespaceURI == null) { if (m_elemContext.m_elementURI != null) namespaceURI = m_elemContext.m_elementURI; else namespaceURI = getNamespaceURI(qName, true); } if (localName == null) { if (m_elemContext.m_elementLocalName != null) localName = m_elemContext.m_elementLocalName; else localName = getLocalName(qName); } m_saxHandler.endElement(namespaceURI, localName, qName); if (m_tracer != null) super.fireEndElem(qName); /* Pop all namespaces at the current element depth. * We are not waiting for official endPrefixMapping() calls. */ m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, m_saxHandler); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endPrefixMapping(String prefix) throws SAXException { /* poping all prefix mappings should have been done * in endElement() already */ return; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { m_saxHandler.ignorableWhitespace(arg0,arg1,arg2); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { m_saxHandler.skippedEntity(arg0); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { startPrefixMapping(prefix, uri, true); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException { /* Remember the mapping, and at what depth it was declared * This is one greater than the current depth because these * mappings will apply to the next depth. This is in * consideration that startElement() will soon be called */ boolean pushed; int pushDepth; if (shouldFlush) { flushPending(); // the prefix mapping applies to the child element (one deeper) pushDepth = m_elemContext.m_currentElemDepth + 1; } else { // the prefix mapping applies to the current element pushDepth = m_elemContext.m_currentElemDepth; } pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth); if (pushed) { m_saxHandler.startPrefixMapping(prefix,uri); if (getShouldOutputNSAttr()) { /* I don't know if we really needto do this. The * callers of this object should have injected both * startPrefixMapping and the attributes. We are * just covering our butt here. */ String name; if (EMPTYSTRING.equals(prefix)) { name = "xmlns"; addAttributeAlways(XMLNS_URI, name, name,"CDATA",uri, false); } else { if (!EMPTYSTRING.equals(uri)) // hack for attribset16 test { // that maps ns1 prefix to "" URI name = "xmlns:" + prefix; /* for something like xmlns:abc="w3.pretend.org" * the uri is the value, that is why we pass it in the * value, or 5th slot of addAttributeAlways() */ addAttributeAlways(XMLNS_URI, prefix, name,"CDATA",uri, false ); } } } } return pushed; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void comment(char[] arg0, int arg1, int arg2) throws SAXException { flushPending(); if (m_lexHandler != null) m_lexHandler.comment(arg0, arg1, arg2); if (m_tracer != null) super.fireCommentEvent(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endCDATA() throws SAXException { /* Normally we would do somthing with this but we ignore it. * The neccessary call to m_lexHandler.endCDATA() will be made * in flushPending(). * * This is so that if we get calls like these: * this.startCDATA(); * this.characters(chars1, off1, len1); * this.endCDATA(); * this.startCDATA(); * this.characters(chars2, off2, len2); * this.endCDATA(); * * that we will only make these calls to the wrapped handlers: * * m_lexHandler.startCDATA(); * m_saxHandler.characters(chars1, off1, len1); * m_saxHandler.characters(chars1, off2, len2); * m_lexHandler.endCDATA(); * * We will merge adjacent CDATA blocks. */ }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endDTD() throws SAXException { if (m_lexHandler != null) m_lexHandler.endDTD(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startEntity(String arg0) throws SAXException { if (m_lexHandler != null) m_lexHandler.startEntity(arg0); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void characters(String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { startElement( elementNamespaceURI,elementLocalName,elementName, null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement(String elementName) throws SAXException { startElement(null, null, elementName, null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { // We do the first two things in flushPending() but we don't // close any open CDATA calls. if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_elemContext.m_isCdataSection && !m_cdataTagOpen && m_lexHandler != null) { m_lexHandler.startCDATA(); // We have made a call to m_lexHandler.startCDATA() with // no balancing call to m_lexHandler.endCDATA() // so we set m_cdataTagOpen true to remember this. m_cdataTagOpen = true; } /* If there are any occurances of "]]>" in the character data * let m_saxHandler worry about it, we've already warned them with * the previous call of m_lexHandler.startCDATA(); */ m_saxHandler.characters(ch, off, len); // time to generate characters event if (m_tracer != null) fireCharEvent(ch, off, len); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { flushPending(); // Pass the processing instruction to the SAX handler m_saxHandler.processingInstruction(target, data); // we don't want to leave serializer to fire off this event, // so do it here. if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startCDATA() throws SAXException { /* m_cdataTagOpen can only be true here if we have ignored the * previous call to this.endCDATA() and the previous call * this.startCDATA() before that is still "open". In this way * we merge adjacent CDATA. If anything else happened after the * ignored call to this.endCDATA() and this call then a call to * flushPending() would have been made which would have * closed the CDATA and set m_cdataTagOpen to false. */ if (!m_cdataTagOpen ) { flushPending(); if (m_lexHandler != null) { m_lexHandler.startCDATA(); // We have made a call to m_lexHandler.startCDATA() with // no balancing call to m_lexHandler.endCDATA() // so we set m_cdataTagOpen true to remember this. m_cdataTagOpen = true; } } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws SAXException { flushPending(); super.startElement(namespaceURI, localName, name, atts); // Handle document type declaration (for first element only) if (m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); if (doctypeSystem != null && m_lexHandler != null) { String doctypePublic = getDoctypePublic(); if (doctypeSystem != null) m_lexHandler.startDTD( name, doctypePublic, doctypeSystem); } m_needToOutputDocTypeDecl = false; } m_elemContext = m_elemContext.push(namespaceURI, localName, name); // ensurePrefixIsDeclared depends on the current depth, so // the previous increment is necessary where it is. if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); // add the attributes to the collected ones if (atts != null) addAttributes(atts); // do we really need this CDATA section state? m_elemContext.m_isCdataSection = isCdataSection(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
private void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { int index; final boolean no_prefix = ((index = rawName.indexOf(":")) < 0); String prefix = (no_prefix) ? "" : rawName.substring(0, index); if (null != prefix) { String foundURI = m_prefixMap.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(ns)) { this.startPrefixMapping(prefix, ns, false); if (getShouldOutputNSAttr()) { // Bugzilla1133: Generate attribute as well as namespace event. // SAX does expect both. this.addAttributeAlways( "http://www.w3.org/2000/xmlns/", no_prefix ? "xmlns" : prefix, // local name no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname "CDATA", ns, false); } } } } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { ensurePrefixIsDeclared(uri, rawName); addAttributeAlways(uri, localName, rawName, type, value, false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEndElem(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void comment(String data) throws SAXException { m_docIsEmpty = false; final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { addAttributeAlways(uri, localName, rawName, type, value, XSLAttribute); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttributes(Attributes atts) throws SAXException { int nAtts = atts.getLength(); for (int i = 0; i < nAtts; i++) { String uri = atts.getURI(i); if (null == uri) uri = ""; addAttributeAlways( uri, atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i), false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; m_inEntityRef = false; if (m_tracer != null) this.fireEndEntity(name); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void namespaceAfterStartElement(String uri, String prefix) throws SAXException { // default behavior is to do nothing }
// in src/org/apache/xml/serializer/SerializerBase.java
public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void error(SAXParseException exc) throws SAXException { }
// in src/org/apache/xml/serializer/SerializerBase.java
public void fatalError(SAXParseException exc) throws SAXException { m_elemContext.m_startTagOpen = false; }
// in src/org/apache/xml/serializer/SerializerBase.java
public void warning(SAXParseException exc) throws SAXException { }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length)); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void fireEndEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) flushMyWriter(); // we do not need to handle this. }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTDOCUMENT); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEndDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDDOCUMENT); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartElem(String elemName) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTELEMENT, elemName, m_attributes); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEscapingEvent(String name, String data) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_PI,name, data); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEntityReference(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF,name, (Attributes)null); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void startDocument() throws org.xml.sax.SAXException { // if we do get called with startDocument(), handle it right away startDocumentInternal(); m_needToCallStartDocument = false; return; }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { if (m_tracer != null) this.fireStartDoc(); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException { if (m_elemContext.m_startTagOpen) { addAttributeAlways(uri, localName, rawName, type, value, false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void notationDecl(String arg0, String arg1, String arg2) throws SAXException { // This method just provides a definition to satisfy the interface // A particular sub-class of SerializerBase provides the implementation (if desired) }
// in src/org/apache/xml/serializer/SerializerBase.java
public void unparsedEntityDecl( String arg0, String arg1, String arg2, String arg3) throws SAXException { // This method just provides a definition to satisfy the interface // A particular sub-class of SerializerBase provides the implementation (if desired) }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startDocumentInternal() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_needToCallStartDocument = false; if (m_inEntityRef) return; m_needToOutputDocTypeDecl = true; m_startNewLine = false; /* The call to getXMLVersion() might emit an error message * and we should emit this message regardless of if we are * writing out an XML header or not. */ final String version = getXMLVersion(); if (getOmitXMLDeclaration() == false) { String encoding = Encodings.getMimeEncoding(getEncoding()); String standalone; if (m_standaloneWasSpecified) { standalone = " standalone=\"" + getStandalone() + "\""; } else { standalone = ""; } try { final java.io.Writer writer = m_writer; writer.write("<?xml version=\""); writer.write(version); writer.write("\" encoding=\""); writer.write(encoding); writer.write('\"'); writer.write(standalone); writer.write("?>"); if (m_doIndent) { if (m_standaloneWasSpecified || getDoctypePublic() != null || getDoctypeSystem() != null) { // We almost never put a newline after the XML // header because this XML could be used as // an extenal general parsed entity // and we don't know the context into which it // will be used in the future. Only when // standalone, or a doctype system or public is // specified are we free to insert a new line // after the header. Is it even worth bothering // in these rare cases? writer.write(m_lineSep, 0, m_lineSepLen); } } } catch(IOException e) { throw new SAXException(e); } } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startPreserving() throws org.xml.sax.SAXException { // Not sure this is really what we want. -sb m_preserves.push(true); m_ispreserve = true; }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endPreserving() throws org.xml.sax.SAXException { // Not sure this is really what we want. -sb m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (m_inEntityRef) return; flushPending(); if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) startDocumentInternal(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); int indexOfQLT = data.indexOf("?>"); if (indexOfQLT >= 0) { // See XSLT spec on error recovery of "?>" in PIs. if (indexOfQLT > 0) { writer.write(data.substring(0, indexOfQLT)); } writer.write("? >"); // add space between. if ((indexOfQLT + 2) < data.length()) { writer.write(data.substring(indexOfQLT + 2)); } } else { writer.write(data); } writer.write('?'); writer.write('>'); /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { if (m_elemContext.m_startTagOpen) { try { final String patchedName = patchName(name); final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_xmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 32 to 127 so we write out the // value directly writer.write(' '); writer.write(patchedName); writer.write("=\""); writer.write(value); writer.write('"'); } else { writer.write(' '); writer.write(patchedName); writer.write("=\""); writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean xslAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { boolean was_added = addAttributeAlways(uri, localName, rawName, type, value, xslAttribute); /* * We don't run this block of code if: * 1. The attribute value was only replaced (was_added is false). * 2. The attribute is from an xsl:attribute element (that is handled * in the addAttributeAlways() call just above. * 3. The name starts with "xmlns", i.e. it is a namespace declaration. */ if (was_added && !xslAttribute && !rawName.startsWith("xmlns")) { String prefixUsed = ensureAttributesNamespaceIsDeclared( uri, localName, rawName); if (prefixUsed != null && rawName != null && !rawName.startsWith(prefixUsed)) { // use a different raw name, with the prefix used in the // generated namespace declaration rawName = prefixUsed + ":" + localName; } } addAttributeAlways(uri, localName, rawName, type, value, xslAttribute); } else { /* * The startTag is closed, yet we are adding an attribute? * * Section: 7.1.3 Creating Attributes Adding an attribute to an * element after a PI (for example) has been added to it is an * error. The attributes can be ignored. The spec doesn't explicitly * say this is disallowed, as it does for child elements, but it * makes sense to have the same treatment. * * We choose to ignore the attribute which is added too late. */ // Generate a warning of the ignored attributes // Create the warning message String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,new Object[]{ localName }); try { // Prepare to issue the warning message Transformer tran = super.getTransformer(); ErrorListener errHandler = tran.getErrorListener(); // Issue the warning message if (null != errHandler && m_sourceLocator != null) errHandler.warning(new TransformerException(msg, m_sourceLocator)); else System.out.println(msg); } catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); return; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public boolean setEscaping(boolean escape) throws SAXException { return m_handler.setEscaping(escape); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.addAttribute(uri, localName, rawName, type, value, XSLAttribute); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addUniqueAttribute(String rawName, String value, int flags) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.addUniqueAttribute(rawName, value, flags); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void characters(String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endElement(String elementName) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endElement(elementName); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { this.startPrefixMapping(prefix,uri, true); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null) { String prefix1 = getPrefixPart(m_firstElementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_firstElementURI = uri; } } startPrefixMapping(prefix,uri, false); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException { boolean pushed = false; if (m_firstTagNotEmitted) { if (m_firstElementName != null && shouldFlush) { /* we've already seen a startElement, and this is a prefix mapping * for the up coming element, so flush the old element * then send this event on its way. */ flush(); pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush); } else { if (m_namespacePrefix == null) { m_namespacePrefix = new Vector(); m_namespaceURI = new Vector(); } m_namespacePrefix.addElement(prefix); m_namespaceURI.addElement(uri); if (m_firstElementURI == null) { if (prefix.equals(m_firstElementPrefix)) m_firstElementURI = uri; } } } else { pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush); } return pushed; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startDocument() throws SAXException { m_needToCallStartDocument = true; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement(String qName) throws SAXException { this.startElement(null, null, qName, null); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement(String namespaceURI, String localName, String qName) throws SAXException { this.startElement(namespaceURI, localName, qName, null); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement( String namespaceURI, String localName, String elementName, Attributes atts) throws SAXException { /* we are notified of the start of an element */ if (m_firstTagNotEmitted) { /* we have not yet sent the first element on its way */ if (m_firstElementName != null) { /* this is not the first element, but a later one. * But we have the old element pending, so flush it out, * then send this one on its way. */ flush(); m_handler.startElement(namespaceURI, localName, elementName, atts); } else { /* this is the very first element that we have seen, * so save it for flushing later. We may yet get to know its * URI due to added attributes. */ m_wrapped_handler_not_initialized = true; m_firstElementName = elementName; // null if not known m_firstElementPrefix = getPrefixPartUnknown(elementName); // null if not known m_firstElementURI = namespaceURI; // null if not known m_firstElementLocalName = localName; if (m_tracer != null) firePseudoElement(elementName); /* we don't want to call our own addAttributes, which * merely delegates to the wrapped handler, but we want to * add these attributes to m_attributes. So me must call super. * addAttributes() In this case m_attributes is only used for the * first element, after that this class totally delegates to the * wrapped handler which is either XML or HTML. */ if (atts != null) super.addAttributes(atts); // if there are attributes, then lets make the flush() // call the startElement on the handler and send the // attributes on their way. if (atts != null) flush(); } } else { // this is not the first element, but a later one, so just // send it on its way. m_handler.startElement(namespaceURI, localName, elementName, atts); } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void comment(String comment) throws SAXException { if (m_firstTagNotEmitted && m_firstElementName != null) { emitFirstTag(); } else if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } m_handler.comment(comment); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { m_handler.attributeDecl(arg0, arg1, arg2, arg3, arg4); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void elementDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.elementDecl(arg0, arg1); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.externalEntityDecl(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.internalEntityDecl(arg0, arg1); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void characters(char[] characters, int offset, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.characters(characters, offset, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endDocument() throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endDocument(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endElement(String namespaceURI, String localName, String qName) throws SAXException { if (m_firstTagNotEmitted) { flush(); if (namespaceURI == null && m_firstElementURI != null) namespaceURI = m_firstElementURI; if (localName == null && m_firstElementLocalName != null) localName = m_firstElementLocalName; } m_handler.endElement(namespaceURI, localName, qName); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endPrefixMapping(String prefix) throws SAXException { m_handler.endPrefixMapping(prefix); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void processingInstruction(String target, String data) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.processingInstruction(target, data); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void skippedEntity(String name) throws SAXException { m_handler.skippedEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void comment(char[] ch, int start, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.comment(ch, start, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endCDATA() throws SAXException { m_handler.endCDATA(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endDTD() throws SAXException { m_handler.endDTD(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endEntity(String name) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.endEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startCDATA() throws SAXException { m_handler.startCDATA(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_handler.startDTD(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startEntity(String name) throws SAXException { m_handler.startEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void initStreamOutput() throws SAXException { // Try to rule out if this is an not to be an HTML document based on prefix boolean firstElementIsHTML = isFirstElemHTML(); if (firstElementIsHTML) { // create an HTML output handler, and initialize it // keep a reference to the old handler, ... it will soon be gone SerializationHandler oldHandler = m_handler; /* We have to make sure we get an output properties with the proper * defaults for the HTML method. The easiest way to do this is to * have the OutputProperties class do it. */ Properties htmlProperties = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML); Serializer serializer = SerializerFactory.getSerializer(htmlProperties); // The factory should be returning a ToStream // Don't know what to do if it doesn't // i.e. the user has over-ridden the content-handler property // for html m_handler = (SerializationHandler) serializer; //m_handler = new ToHTMLStream(); Writer writer = oldHandler.getWriter(); if (null != writer) m_handler.setWriter(writer); else { OutputStream os = oldHandler.getOutputStream(); if (null != os) m_handler.setOutputStream(os); } // need to copy things from the old handler to the new one here // if (_setVersion_called) // { m_handler.setVersion(oldHandler.getVersion()); // } // if (_setDoctypeSystem_called) // { m_handler.setDoctypeSystem(oldHandler.getDoctypeSystem()); // } // if (_setDoctypePublic_called) // { m_handler.setDoctypePublic(oldHandler.getDoctypePublic()); // } // if (_setMediaType_called) // { m_handler.setMediaType(oldHandler.getMediaType()); // } m_handler.setTransformer(oldHandler.getTransformer()); } /* Now that we have a real wrapped handler (XML or HTML) lets * pass any cached calls to it */ // Call startDocument() if necessary if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } // the wrapped handler is now fully initialized m_wrapped_handler_not_initialized = false; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void emitFirstTag() throws SAXException { if (m_firstElementName != null) { if (m_wrapped_handler_not_initialized) { initStreamOutput(); m_wrapped_handler_not_initialized = false; } // Output first tag m_handler.startElement(m_firstElementURI, null, m_firstElementName, m_attributes); // don't need the collected attributes of the first element anymore. m_attributes = null; // Output namespaces of first tag if (m_namespacePrefix != null) { final int n = m_namespacePrefix.size(); for (int i = 0; i < n; i++) { final String prefix = (String) m_namespacePrefix.elementAt(i); final String uri = (String) m_namespaceURI.elementAt(i); m_handler.startPrefixMapping(prefix, uri, false); } m_namespacePrefix = null; m_namespaceURI = null; } m_firstTagNotEmitted = false; } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addAttributes(Attributes atts) throws SAXException { m_handler.addAttributes(atts); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void flushPending() throws SAXException { flush(); m_handler.flushPending(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void entityReference(String entityName) throws SAXException { m_handler.entityReference(entityName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endElement(String elemName) throws SAXException { if (m_tracer != null) super.fireEndElem(elemName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endElement(String arg0, String arg1, String arg2) throws SAXException { if (m_tracer != null) super.fireEndElem(arg2); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireCommentEvent(ch, start, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void comment(String data) throws org.xml.sax.SAXException { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void elementDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endPrefixMapping(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void processingInstruction(String arg0, String arg1) throws SAXException { if (m_tracer != null) super.fireEscapingEvent(arg0, arg1); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { flushPending(); super.startElement(arg0, arg1, arg2, arg3); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endDTD() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { super.startElement(elementNamespaceURI, elementLocalName, elementName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String elementName) throws SAXException { super.startElement(elementName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endDocument() throws SAXException { flushPending(); m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void characters(String characters) throws SAXException { final int length = characters.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } characters.getChars(0, length, m_charsBuff, 0); m_saxHandler.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void characters(char[] characters, int offset, int length) throws SAXException { m_saxHandler.characters(characters, offset, length); // time to fire off characters event if (m_tracer != null) super.fireCharEvent(characters, offset, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML return false; }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { super.startDocumentInternal(); m_needToCallStartDocument = false; // No action for the moment. }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { // time to fire off startElement event if (m_tracer != null) { super.fireStartElem(name); this.firePseudoAttributes(); } return; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireEndElem(name); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); try { if (inTemporaryOutputState()) { /* leave characters un-processed as we are * creating temporary output, the output generated by * this serializer will be input to a final serializer * later on and it will do the processing in final * output state (not temporary output state). * * A "temporary" ToTextStream serializer is used to * evaluate attribute value templates (for example), * and the result of evaluating such a thing * is fed into a final serializer later on. */ m_writer.write(ch, start, length); } else { // In final output state we do process the characters! writeNormalizedChars(ch, start, length, m_lineSepUse); } if (m_tracer != null) super.fireCharEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
void writeNormalizedChars( final char ch[], final int start, final int length, final boolean useLineSep) throws IOException, org.xml.sax.SAXException { final String encoding = getEncoding(); final java.io.Writer writer = m_writer; final int end = start + length; /* copy a few "constants" before the loop for performance */ final char S_LINEFEED = CharInfo.S_LINEFEED; // This for() loop always increments i by one at the end // of the loop. Additional increments of i adjust for when // two input characters (a high/low UTF16 surrogate pair) // are processed. for (int i = start; i < end; i++) { final char c = ch[i]; if (S_LINEFEED == c && useLineSep) { writer.write(m_lineSep, 0, m_lineSepLen); // one input char processed } else if (m_encodingInfo.isInEncoding(c)) { writer.write(c); // one input char processed } else if (Encodings.isHighUTF16Surrogate(c)) { final int codePoint = writeUTF16Surrogate(c, ch, i, end); if (codePoint != 0) { // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(codePoint); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } i++; // two input chars processed } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(c)); writer.write(';'); // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(c); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(c); } // one input char was processed } } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); if (m_tracer != null) super.fireCDATAEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // flush anything pending first flushPending(); if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void comment(String data) throws org.xml.sax.SAXException { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); if (m_tracer != null) super.fireCommentEvent(ch, start, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endCDATA() throws SAXException { // do nothing }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endElement(String elemName) throws SAXException { if (m_tracer != null) super.fireEndElem(elemName); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { if (m_needToCallStartDocument) startDocumentInternal(); // time to fire off startlement event. if (m_tracer != null) { super.fireStartElem(elementName); this.firePseudoAttributes(); } return; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(String characters) throws SAXException { final int length = characters.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } characters.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { // do nothing, forget about the attribute }
// in src/org/apache/xml/serializer/ToTextStream.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML return false; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
public void flushPending() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { super.startDocumentInternal(); m_needToCallStartDocument = false; m_needToOutputDocTypeDecl = true; m_startNewLine = false; setOmitXMLDeclaration(true); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
private void outputDocTypeDecl(String name) throws SAXException { if (true == m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((null != doctypeSystem) || (null != doctypePublic)) { final java.io.Writer writer = m_writer; try { writer.write("<!DOCTYPE "); writer.write(name); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('"'); } if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); writer.write('"'); } writer.write('>'); outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } } m_needToOutputDocTypeDecl = false; }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { ElemContext elemContext = m_elemContext; // clean up any pending things first if (elemContext.m_startTagOpen) { closeStartTag(); elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_needToOutputDocTypeDecl) { String n = name; if (n == null || n.length() == 0) { // If the lexical QName is not given // use the localName in the DOCTYPE n = localName; } outputDocTypeDecl(n); } // if this element has a namespace then treat it like XML if (null != namespaceURI && namespaceURI.length() > 0) { super.startElement(namespaceURI, localName, name, atts); return; } try { // getElemDesc2(name) is faster than getElemDesc(name) ElemDesc elemDesc = getElemDesc2(name); int elemFlags = elemDesc.getFlags(); // deal with indentation issues first if (m_doIndent) { boolean isBlockElement = (elemFlags & ElemDesc.BLOCK) != 0; if (m_ispreserve) m_ispreserve = false; else if ( (null != elemContext.m_elementName) && (!m_inBlockElem || isBlockElement) /* && !isWhiteSpaceSensitive */ ) { m_startNewLine = true; indent(); } m_inBlockElem = !isBlockElement; } // save any attributes for later processing if (atts != null) addAttributes(atts); m_isprevtext = false; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); if (m_tracer != null) firePseudoAttributes(); if ((elemFlags & ElemDesc.EMPTY) != 0) { // an optimization for elements which are expected // to be empty. m_elemContext = elemContext.push(); /* XSLTC sometimes calls namespaceAfterStartElement() * so we need to remember the name */ m_elemContext.m_elementName = name; m_elemContext.m_elementDesc = elemDesc; return; } else { elemContext = elemContext.push(namespaceURI,localName,name); m_elemContext = elemContext; elemContext.m_elementDesc = elemDesc; elemContext.m_isRaw = (elemFlags & ElemDesc.RAW) != 0; } if ((elemFlags & ElemDesc.HEADELEM) != 0) { // This is the <HEAD> element, do some special processing closeStartTag(); elemContext.m_startTagOpen = false; if (!m_omitMetaTag) { if (m_doIndent) indent(); writer.write( "<META http-equiv=\"Content-Type\" content=\"text/html; charset="); String encoding = getEncoding(); String encode = Encodings.getMimeEncoding(encoding); writer.write(encode); writer.write("\">"); } } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement( final String namespaceURI, final String localName, final String name) throws org.xml.sax.SAXException { // deal with any pending issues if (m_cdataTagOpen) closeCDATA(); // if the element has a namespace, treat it like XML, not HTML if (null != namespaceURI && namespaceURI.length() > 0) { super.endElement(namespaceURI, localName, name); return; } try { ElemContext elemContext = m_elemContext; final ElemDesc elemDesc = elemContext.m_elementDesc; final int elemFlags = elemDesc.getFlags(); final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0; // deal with any indentation issues if (m_doIndent) { final boolean isBlockElement = (elemFlags&ElemDesc.BLOCK) != 0; boolean shouldIndent = false; if (m_ispreserve) { m_ispreserve = false; } else if (m_doIndent && (!m_inBlockElem || isBlockElement)) { m_startNewLine = true; shouldIndent = true; } if (!elemContext.m_startTagOpen && shouldIndent) indent(elemContext.m_currentElemDepth - 1); m_inBlockElem = !isBlockElement; } final java.io.Writer writer = m_writer; if (!elemContext.m_startTagOpen) { writer.write("</"); writer.write(name); writer.write('>'); } else { // the start-tag open when this method was called, // so we need to process it now. if (m_tracer != null) super.fireStartElem(name); // the starting tag was still open when we received this endElement() call // so we need to process any gathered attributes NOW, before they go away. int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (!elemEmpty) { // As per Dave/Paul recommendation 12/06/2000 // if (shouldIndent) // writer.write('>'); // indent(m_currentIndent); writer.write("></"); writer.write(name); writer.write('>'); } else { writer.write('>'); } } // clean up because the element has ended if ((elemFlags & ElemDesc.WHITESPACESENSITIVE) != 0) m_ispreserve = true; m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); // OPTIMIZE-EMPTY if (elemEmpty) { // a quick exit if the HTML element had no children. // This block of code can be removed if the corresponding block of code // in startElement() also labeled with "OPTIMIZE-EMPTY" is also removed m_elemContext = elemContext.m_prev; return; } // some more clean because the element has ended. if (!elemContext.m_startTagOpen) { if (m_doIndent && !m_preserves.isEmpty()) m_preserves.pop(); } m_elemContext = elemContext.m_prev; // m_isRawStack.pop(); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void characters(char chars[], int start, int length) throws org.xml.sax.SAXException { if (m_elemContext.m_isRaw) { try { // Clean up some pending issues. if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; writeNormalizedChars(chars, start, length, false, m_lineSepUse); // time to generate characters event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); } } else { super.characters(chars, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if ((null != m_elemContext.m_elementName) && (m_elemContext.m_elementName.equalsIgnoreCase("SCRIPT") || m_elemContext.m_elementName.equalsIgnoreCase("STYLE"))) { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); // writer.write(ch, start, length); writeNormalizedChars(ch, start, length, true, m_lineSepUse); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } } else { super.cdata(ch, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // Process any pending starDocument and startElement first. flushPending(); // Use a fairly nasty hack to tell if the next node is supposed to be // unescaped text. if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { // clean up any pending things first if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps processing instructions can be written out in HTML before * the DOCTYPE, in which case this could be emitted with the * startElement call, that knows the name of the document element * doing it right. */ if (true == m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; //writer.write("<?" + target); writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); //writer.write(data + ">"); // different from XML writer.write(data); // different from XML writer.write('>'); // different from XML // Always output a newline char if not inside of an // element. The whitespace is not significant in that // case. if (m_elemContext.m_currentElemDepth <= 0) outputLineSep(); m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } // now generate the PI event if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void entityReference(String name) throws org.xml.sax.SAXException { try { final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException,SAXException { /* * process the collected attributes */ for (int i = 0; i < nAttrs; i++) { processAttribute( writer, m_attributes.getQName(i), m_attributes.getValue(i), m_elemContext.m_elementDesc); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void closeStartTag() throws SAXException { try { // finish processing attributes, time to fire off the start element event if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs>0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); /* At this point we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) // if there are any cdata sections m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_inDTD = true; super.startDTD(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void endDTD() throws org.xml.sax.SAXException { m_inDTD = false; /* for ToHTMLStream the DOCTYPE is entirely output in the * startDocumentInternal() method, so don't do anything here */ }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void elementDecl(String name, String model) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { try { final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_htmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 0 to 127 so we write out the // value directly writer.write(' '); writer.write(name); writer.write("=\""); writer.write(value); writer.write('"'); } else if ( (flags & HTML_ATTREMPTY) > 0 && (value.length() == 0 || value.equalsIgnoreCase(name))) { writer.write(' '); writer.write(name); } else { writer.write(' '); writer.write(name); writer.write("=\""); if ((flags & HTML_ATTRURL) > 0) { writeAttrURI(writer, value, m_specialEscapeURLs); } else { writeAttrString(writer, value, this.getEncoding()); } writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void comment(char ch[], int start, int length) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer if (m_inDTD) return; // Clean up some pending issues, just in case // this call is coming right after a startElement() // or we are in the middle of writing out CDATA // or if a startDocument() call was not received if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps comments can be written out in HTML before the DOCTYPE. * In this case we might delete this call to writeOutDOCTYPE, and * it would be handled within the startElement() call. */ if (m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element super.comment(ch, start, length); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public boolean setEscaping(boolean escape) throws SAXException { boolean oldEscapeSetting = m_escapeSetting; m_escapeSetting = escape; if (escape) { processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } return oldEscapeSetting; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void elementDecl(String name, String model) throws SAXException { return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void internalEntityDecl(String name, String value) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endElement(String uri, String localName, String qName) throws SAXException { flushPending(); m_saxHandler.endElement(uri, localName, qName); // time to fire off endElement event if (m_tracer != null) super.fireEndElem(qName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endPrefixMapping(String prefix) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { flushPending(); m_saxHandler.processingInstruction(target,data); // time to fire off processing instruction event if (m_tracer != null) super.fireEscapingEvent(target,data); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { flushPending(); super.startElement(namespaceURI, localName, qName, atts); m_saxHandler.startElement(namespaceURI, localName, qName, atts); m_elemContext.m_startTagOpen = false; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void comment(char[] ch, int start, int length) throws SAXException { flushPending(); if (m_lexHandler != null) m_lexHandler.comment(ch, start, length); // time to fire off comment event if (m_tracer != null) super.fireCommentEvent(ch, start, length); return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endCDATA() throws SAXException { return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endDTD() throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endDocument() throws SAXException { flushPending(); // Close output document m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
protected void closeStartTag() throws SAXException { m_elemContext.m_startTagOpen = false; // Now is time to send the startElement event m_saxHandler.startElement( EMPTYSTRING, m_elemContext.m_elementName, m_elemContext.m_elementName, m_attributes); m_attributes.clear(); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void characters(final String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { super.startElement(elementNamespaceURI, elementLocalName, elementName); flushPending(); // Handle document type declaration (for first element only) if (!m_dtdHandled) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((doctypeSystem != null) || (doctypePublic != null)) { if (m_lexHandler != null) m_lexHandler.startDTD( elementName, doctypePublic, doctypeSystem); } m_dtdHandled = true; } m_elemContext = m_elemContext.push(elementNamespaceURI, elementLocalName, elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement(String elementName) throws SAXException { this.startElement(null,null, elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endElement(String elementName) throws SAXException { flushPending(); m_saxHandler.endElement(EMPTYSTRING, elementName, elementName); // time to fire off endElement event if (m_tracer != null) super.fireEndElem(elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { flushPending(); m_saxHandler.characters(ch, off, len); // time to fire off characters event if (m_tracer != null) super.fireCharEvent(ch, off, len); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } // Close any open element if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML if (shouldFlush) flushPending(); m_saxHandler.startPrefixMapping(prefix,uri); return false; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { startPrefixMapping(prefix,uri,true); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeCDATA() throws org.xml.sax.SAXException { try { m_writer.write(CDATA_DELIMITER_CLOSE); // write out a CDATA section closing "]]>" m_cdataTagOpen = false; // Remember that we have done so. } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected final void flushWriter() throws org.xml.sax.SAXException { final java.io.Writer writer = m_writer; if (null != writer) { try { if (writer instanceof WriterToUTF8Buffered) { if (m_shouldFlush) ((WriterToUTF8Buffered) writer).flush(); else ((WriterToUTF8Buffered) writer).flushBuffer(); } if (writer instanceof WriterToASCI) { if (m_shouldFlush) writer.flush(); } else { // Flush always. // Not a great thing if the writer was created // by this class, but don't have a choice. writer.flush(); } } catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void elementDecl(String name, String model) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ELEMENT "); writer.write(name); writer.write(' '); writer.write(model); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { DTDprolog(); outputEntityDecl(name, value); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ATTLIST "); writer.write(eName); writer.write(' '); writer.write(aName); writer.write(' '); writer.write(type); if (valueDefault != null) { writer.write(' '); writer.write(valueDefault); } //writer.write(" "); //writer.write(value); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { try { DTDprolog(); m_writer.write("<!ENTITY "); m_writer.write(name); if (publicId != null) { m_writer.write(" PUBLIC \""); m_writer.write(publicId); } else { m_writer.write(" SYSTEM \""); m_writer.write(systemId); } m_writer.write("\" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
void writeNormalizedChars( char ch[], int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException { final java.io.Writer writer = m_writer; int end = start + length; for (int i = start; i < end; i++) { char c = ch[i]; if (CharInfo.S_LINEFEED == c && useSystemLineSeparator) { writer.write(m_lineSep, 0, m_lineSepLen); } else if (isCData && (!escapingNotNeeded(c))) { // if (i != 0) if (m_cdataTagOpen) closeCDATA(); // This needs to go into a function... if (Encodings.isHighUTF16Surrogate(c)) { writeUTF16Surrogate(c, ch, i, end); i++ ; // process two input characters } else { writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } // if ((i != 0) && (i < (end - 1))) // if (!m_cdataTagOpen && (i < (end - 1))) // { // writer.write(CDATA_DELIMITER_OPEN); // m_cdataTagOpen = true; // } } else if ( isCData && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1]) && ('>' == ch[i + 2]))) { writer.write(CDATA_CONTINUE); i += 2; } else { if (escapingNotNeeded(c)) { if (isCData && !m_cdataTagOpen) { writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } writer.write(c); } // This needs to go into a function... else if (Encodings.isHighUTF16Surrogate(c)) { if (m_cdataTagOpen) closeCDATA(); writeUTF16Surrogate(c, ch, i, end); i++; // process two input characters } else { if (m_cdataTagOpen) closeCDATA(); writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void endNonEscaping() throws org.xml.sax.SAXException { m_disableOutputEscapingStates.pop(); }
// in src/org/apache/xml/serializer/ToStream.java
public void startNonEscaping() throws org.xml.sax.SAXException { m_disableOutputEscapingStates.push(true); }
// in src/org/apache/xml/serializer/ToStream.java
protected void cdata(char ch[], int start, final int length) throws org.xml.sax.SAXException { try { final int old_start = start; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); boolean writeCDataBrackets = (((length >= 1) && escapingNotNeeded(ch[start]))); /* Write out the CDATA opening delimiter only if * we are supposed to, and if we are not already in * the middle of a CDATA section */ if (writeCDataBrackets && !m_cdataTagOpen) { m_writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } // writer.write(ch, start, length); if (isEscapingDisabled()) { charactersRaw(ch, start, length); } else writeNormalizedChars(ch, start, length, true, m_lineSepUse); /* used to always write out CDATA closing delimiter here, * but now we delay, so that we can merge CDATA sections on output. * need to write closing delimiter later */ if (writeCDataBrackets) { /* if the CDATA section ends with ] don't leave it open * as there is a chance that an adjacent CDATA sections * starts with ]>. * We don't want to merge ]] with > , or ] with ]> */ if (ch[start + length - 1] == ']') closeCDATA(); } // time to fire off CDATA event if (m_tracer != null) super.fireCDATAEvent(ch, old_start, length); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_inEntityRef) return; try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; m_writer.write(ch, start, length); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(final char chars[], final int start, final int length) throws org.xml.sax.SAXException { // It does not make sense to continue with rest of the method if the number of // characters to read from array is 0. // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node // is created if string is empty. if (length == 0 || (m_inEntityRef && !m_expandDTDEntities)) return; m_docIsEmpty = false; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); } if (m_cdataStartCalled || m_elemContext.m_isCdataSection) { /* either due to startCDATA() being called or due to * cdata-section-elements atribute, we need this as cdata */ cdata(chars, start, length); return; } if (m_cdataTagOpen) closeCDATA(); if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping)) { charactersRaw(chars, start, length); // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { int i; int startClean; // skip any leading whitspace // don't go off the end and use a hand inlined version // of isWhitespace(ch) final int end = start + length; int lastDirtyCharProcessed = start - 1; // last non-clean character that was processed // that was processed final Writer writer = m_writer; boolean isAllWhitespace = true; // process any leading whitspace i = start; while (i < end && isAllWhitespace) { char ch1 = chars[i]; if (m_charInfo.shouldMapTextChar(ch1)) { // The character is supposed to be replaced by a String // so write out the clean whitespace characters accumulated // so far // then the String. writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo .getOutputStringForChar(ch1); writer.write(outputStringForChar); // We can't say that everything we are writing out is // all whitespace, we just wrote out a String. isAllWhitespace = false; lastDirtyCharProcessed = i; // mark the last non-clean // character processed i++; } else { // The character is clean, but is it a whitespace ? switch (ch1) { // TODO: Any other whitespace to consider? case CharInfo.S_SPACE: // Just accumulate the clean whitespace i++; break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); i++; break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; i++; break; case CharInfo.S_HORIZONAL_TAB: // Just accumulate the clean whitespace i++; break; default: // The character was clean, but not a whitespace // so break the loop to continue with this character // (we don't increment index i !!) isAllWhitespace = false; break; } } } /* If there is some non-whitespace, mark that we may need * to preserve this. This is only important if we have indentation on. */ if (i < end || !isAllWhitespace) m_ispreserve = true; for (; i < end; i++) { char ch = chars[i]; if (m_charInfo.shouldMapTextChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo.getOutputStringForChar(ch); writer.write(outputStringForChar); lastDirtyCharProcessed = i; } else { if (ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: // Leave whitespace TAB as a real character break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; // Leave whitespace carriage return as a real character break; default: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars, do nothing, just add it to // the clean characters } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters, including NEL (0x85) writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#8232;"); lastDirtyCharProcessed = i; } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just leave it get added on to the clean characters } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out an entity writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } } } // we've reached the end. Any clean characters at the // end of the array than need to be written out? startClean = lastDirtyCharProcessed + 1; if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // For indentation purposes, mark that we've just writen text out m_isprevtext = true; } catch (IOException e) { throw new SAXException(e); } // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(String s) throws org.xml.sax.SAXException { if (m_inEntityRef && !m_expandDTDEntities) return; final int length = s.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } s.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { if (m_inEntityRef) return; if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; m_docIsEmpty = false; } else if (m_cdataTagOpen) closeCDATA(); try { if (m_needToOutputDocTypeDecl) { if(null != getDoctypeSystem()) { outputDocTypeDecl(name, true); } m_needToOutputDocTypeDecl = false; } /* before we over-write the current elementLocalName etc. * lets close out the old one (if we still need to) */ if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); m_ispreserve = false; if (shouldIndent() && m_startNewLine) { indent(); } m_startNewLine = true; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); } catch (IOException e) { throw new SAXException(e); } // process the attributes now, because after this SAX call they might be gone if (atts != null) addAttributes(atts); m_elemContext = m_elemContext.push(namespaceURI,localName,name); m_isprevtext = false; if (m_tracer != null) firePseudoAttributes(); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { startElement(elementNamespaceURI, elementLocalName, elementName, null); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement(String elementName) throws SAXException { startElement(null, null, elementName, null); }
// in src/org/apache/xml/serializer/ToStream.java
void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException { if (m_cdataTagOpen) closeCDATA(); try { final java.io.Writer writer = m_writer; writer.write("<!DOCTYPE "); writer.write(name); String doctypePublic = getDoctypePublic(); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('\"'); } String doctypeSystem = getDoctypeSystem(); if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); if (closeDecl) { writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); closeDecl = false; // done closing } else writer.write('\"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException { /* real SAX attributes are not passed in, so process the * attributes that were collected after the startElement call. * _attribVector is a "cheap" list for Stream serializer output * accumulated over a series of calls to attribute(name,value) */ String encoding = getEncoding(); for (int i = 0; i < nAttrs; i++) { // elementAt is JDK 1.1.8 final String name = m_attributes.getQName(i); final String value = m_attributes.getValue(i); writer.write(' '); writer.write(name); writer.write("=\""); writeAttrString(writer, value, encoding); writer.write('\"'); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_inEntityRef) return; // namespaces declared at the current depth are no longer valid // so get rid of them m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null); try { final java.io.Writer writer = m_writer; if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (m_spaceBeforeClose) writer.write(" />"); else writer.write("/>"); /* don't need to pop cdataSectionState because * this element ended so quickly that we didn't get * to push the state. */ } else { if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(m_elemContext.m_currentElemDepth - 1); writer.write('<'); writer.write('/'); writer.write(name); writer.write('>'); } } catch (IOException e) { throw new SAXException(e); } if (!m_elemContext.m_startTagOpen && m_doIndent) { m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); } m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String name) throws org.xml.sax.SAXException { endElement(null, null, name); }
// in src/org/apache/xml/serializer/ToStream.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // the "true" causes the flush of any open tags startPrefixMapping(prefix, uri, true); }
// in src/org/apache/xml/serializer/ToStream.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException { /* Remember the mapping, and at what depth it was declared * This is one greater than the current depth because these * mappings will apply to the next depth. This is in * consideration that startElement() will soon be called */ boolean pushed; int pushDepth; if (shouldFlush) { flushPending(); // the prefix mapping applies to the child element (one deeper) pushDepth = m_elemContext.m_currentElemDepth + 1; } else { // the prefix mapping applies to the current element pushDepth = m_elemContext.m_currentElemDepth; } pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth); if (pushed) { /* Brian M.: don't know if we really needto do this. The * callers of this object should have injected both * startPrefixMapping and the attributes. We are * just covering our butt here. */ String name; if (EMPTYSTRING.equals(prefix)) { name = "xmlns"; addAttributeAlways(XMLNS_URI, name, name, "CDATA", uri, false); } else { if (!EMPTYSTRING.equals(uri)) // hack for XSLTC attribset16 test { // that maps ns1 prefix to "" URI name = "xmlns:" + prefix; /* for something like xmlns:abc="w3.pretend.org" * the uri is the value, that is why we pass it in the * value, or 5th slot of addAttributeAlways() */ addAttributeAlways(XMLNS_URI, prefix, name, "CDATA", uri, false); } } } return pushed; }
// in src/org/apache/xml/serializer/ToStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { int start_old = start; if (m_inEntityRef) return; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } try { final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary. for (int i = start; i < limit; i++) { if (wasDash && ch[i] == '-') { writer.write(ch, start, i - start); writer.write(" -"); start = i + 1; } wasDash = (ch[i] == '-'); } // if we have some chars in the comment if (length > 0) { // Output the remaining characters (if any) final int remainingChars = (limit - start); if (remainingChars > 0) writer.write(ch, start, remainingChars); // Protect comment end from a single trailing dash if (ch[limit - 1] == '-') writer.write(' '); } writer.write(COMMENT_END); } catch (IOException e) { throw new SAXException(e); } /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; // time to generate comment event if (m_tracer != null) super.fireCommentEvent(ch, start_old,length); }
// in src/org/apache/xml/serializer/ToStream.java
public void endCDATA() throws org.xml.sax.SAXException { if (m_cdataTagOpen) closeCDATA(); m_cdataStartCalled = false; }
// in src/org/apache/xml/serializer/ToStream.java
public void endDTD() throws org.xml.sax.SAXException { try { if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } final java.io.Writer writer = m_writer; if (!m_inDoctype) writer.write("]>"); else { writer.write('>'); } writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException { // do nothing }
// in src/org/apache/xml/serializer/ToStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (0 == length) return; characters(ch, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void skippedEntity(String name) throws org.xml.sax.SAXException { // TODO: Should handle }
// in src/org/apache/xml/serializer/ToStream.java
public void startCDATA() throws org.xml.sax.SAXException { m_cdataStartCalled = true; }
// in src/org/apache/xml/serializer/ToStream.java
public void startEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = true; if (!m_expandDTDEntities && !m_inExternalDTD) { /* Only leave the entity as-is if * we've been told not to expand them * and this is not the magic [dtd] name. */ startNonEscaping(); characters("&" + name + ';'); endNonEscaping(); } m_inEntityRef = true; }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeStartTag() throws SAXException { if (m_elemContext.m_startTagOpen) { try { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); } catch (IOException e) { throw new SAXException(e); } /* whether Xalan or XSLTC, we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException { setDoctypeSystem(systemId); setDoctypePublic(publicId); m_elemContext.m_elementName = name; m_inDoctype = true; }
// in src/org/apache/xml/serializer/ToStream.java
protected String ensureAttributesNamespaceIsDeclared( String ns, String localName, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { // extract the prefix in front of the raw name int index = 0; String prefixFromRawName = (index = rawName.indexOf(":")) < 0 ? "" : rawName.substring(0, index); if (index > 0) { // we have a prefix, lets see if it maps to a namespace String uri = m_prefixMap.lookupNamespace(prefixFromRawName); if (uri != null && uri.equals(ns)) { // the prefix in the raw name is already maps to the given namespace uri // so we don't need to do anything return null; } else { // The uri does not map to the prefix in the raw name, // so lets make the mapping. this.startPrefixMapping(prefixFromRawName, ns, false); this.addAttribute( "http://www.w3.org/2000/xmlns/", prefixFromRawName, "xmlns:" + prefixFromRawName, "CDATA", ns, false); return prefixFromRawName; } } else { // we don't have a prefix in the raw name. // Does the URI map to a prefix already? String prefix = m_prefixMap.lookupPrefix(ns); if (prefix == null) { // uri is not associated with a prefix, // so lets generate a new prefix to use prefix = m_prefixMap.generateNextPrefix(); this.startPrefixMapping(prefix, ns, false); this.addAttribute( "http://www.w3.org/2000/xmlns/", prefix, "xmlns:" + prefix, "CDATA", ns, false); } return prefix; } } return null; }
// in src/org/apache/xml/serializer/ToStream.java
void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { int index; final boolean no_prefix = ((index = rawName.indexOf(":")) < 0); String prefix = (no_prefix) ? "" : rawName.substring(0, index); if (null != prefix) { String foundURI = m_prefixMap.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(ns)) { this.startPrefixMapping(prefix, ns); // Bugzilla1133: Generate attribute as well as namespace event. // SAX does expect both. this.addAttributeAlways( "http://www.w3.org/2000/xmlns/", no_prefix ? "xmlns" : prefix, // local name no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname "CDATA", ns, false); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } if (m_writer != null) { try { m_writer.flush(); } catch(IOException e) { // what? me worry? } } }
// in src/org/apache/xml/serializer/ToStream.java
public void notationDecl(String name, String pubID, String sysID) throws SAXException { // TODO Auto-generated method stub try { DTDprolog(); m_writer.write("<!NOTATION "); m_writer.write(name); if (pubID != null) { m_writer.write(" PUBLIC \""); m_writer.write(pubID); } else { m_writer.write(" SYSTEM \""); m_writer.write(sysID); } m_writer.write("\" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
public void unparsedEntityDecl(String name, String pubID, String sysID, String notationName) throws SAXException { // TODO Auto-generated method stub try { DTDprolog(); m_writer.write("<!ENTITY "); m_writer.write(name); if (pubID != null) { m_writer.write(" PUBLIC \""); m_writer.write(pubID); } else { m_writer.write(" SYSTEM \""); m_writer.write(sysID); } m_writer.write("\" NDATA "); m_writer.write(notationName); m_writer.write(" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
private void DTDprolog() throws SAXException, IOException { final java.io.Writer writer = m_writer; if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } if (m_inDoctype) { writer.write(" ["); writer.write(m_lineSep, 0, m_lineSepLen); m_inDoctype = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void startDocumentInternal() throws SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_saxHandler.startDocument(); m_needToCallStartDocument = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startDTD(String arg0, String arg1, String arg2) throws SAXException { // do nothing for now }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void characters(String characters) throws SAXException { final int len = characters.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } characters.getChars(0,len, m_charsBuff, 0); characters(m_charsBuff, 0, len); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void comment(String comment) throws SAXException { flushPending(); // Ignore if a lexical handler has not been set if (m_lexHandler != null) { final int len = comment.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } comment.getChars(0,len, m_charsBuff, 0); m_lexHandler.comment(m_charsBuff, 0, len); // time to fire off comment event if (m_tracer != null) super.fireCommentEvent(m_charsBuff, 0, len); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { // Redefined in SAXXMLOutput }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void closeStartTag() throws SAXException { }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void closeCDATA() throws SAXException { // Redefined in SAXXMLOutput }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(arg2); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement(String uri, String localName, String qName) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(qName); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement(String qName) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(qName); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { // remember the current node if (m_state != null) { m_state.setCurrentNode(node); } // Get the node's value as a String and use that String as if // it were an input character notification. String data = node.getNodeValue(); if (data != null) { this.characters(data); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void fatalError(SAXParseException exc) throws SAXException { super.fatalError(exc); m_needToCallStartDocument = false; if (m_saxHandler instanceof ErrorHandler) { ((ErrorHandler)m_saxHandler).fatalError(exc); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void error(SAXParseException exc) throws SAXException { super.error(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).error(exc); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void warning(SAXParseException exc) throws SAXException { super.warning(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).warning(exc); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.fSerializer.startDocument(); // Determine if the Node is a DOM Level 3 Core Node. if (pos.getNodeType() != Node.DOCUMENT_NODE) { Document ownerDoc = pos.getOwnerDocument(); if (ownerDoc != null && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } else { if (((Document) pos) .getImplementation() .hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } if (fSerializer instanceof LexicalHandler) { fLexicalHandler = ((LexicalHandler) this.fSerializer); } if (fFilter != null) fWhatToShowFilter = fFilter.getWhatToShow(); Node top = pos; while (null != pos) { startNode(pos); Node nextNode = null; nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } this.fSerializer.endDocument(); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.fSerializer.startDocument(); // Determine if the Node is a DOM Level 3 Core Node. if (pos.getNodeType() != Node.DOCUMENT_NODE) { Document ownerDoc = pos.getOwnerDocument(); if (ownerDoc != null && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } else { if (((Document) pos) .getImplementation() .hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } if (fSerializer instanceof LexicalHandler) { fLexicalHandler = ((LexicalHandler) this.fSerializer); } if (fFilter != null) fWhatToShowFilter = fFilter.getWhatToShow(); while (null != pos) { startNode(pos); Node nextNode = null; nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.fSerializer.endDocument(); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if (fSerializer != null) { this.fSerializer.characters(node); } else { String data = ((Text) node).getData(); this.fSerializer.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { if (node instanceof Locator) { Locator loc = (Locator) node; fLocator.setColumnNumber(loc.getColumnNumber()); fLocator.setLineNumber(loc.getLineNumber()); fLocator.setPublicId(loc.getPublicId()); fLocator.setSystemId(loc.getSystemId()); } else { fLocator.setColumnNumber(0); fLocator.setLineNumber(0); } switch (node.getNodeType()) { case Node.DOCUMENT_TYPE_NODE : serializeDocType((DocumentType) node, true); break; case Node.COMMENT_NODE : serializeComment((Comment) node); break; case Node.DOCUMENT_FRAGMENT_NODE : // Children are traversed break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : serializeElement((Element) node, true); break; case Node.PROCESSING_INSTRUCTION_NODE : serializePI((ProcessingInstruction) node); break; case Node.CDATA_SECTION_NODE : serializeCDATASection((CDATASection) node); break; case Node.TEXT_NODE : serializeText((Text) node); break; case Node.ENTITY_REFERENCE_NODE : serializeEntityReference((EntityReference) node, true); break; default : } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.DOCUMENT_TYPE_NODE : serializeDocType((DocumentType) node, false); break; case Node.ELEMENT_NODE : serializeElement((Element) node, false); break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : serializeEntityReference((EntityReference) node, false); break; default : } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeDocType(DocumentType node, boolean bStart) throws SAXException { // The DocType and internalSubset can not be modified in DOM and is // considered to be well-formed as the outcome of successful parsing. String docTypeName = node.getNodeName(); String publicId = node.getPublicId(); String systemId = node.getSystemId(); String internalSubset = node.getInternalSubset(); //DocumentType nodes are never passed to the filter if (internalSubset != null && !"".equals(internalSubset)) { if (bStart) { try { // The Serializer does not provide a way to write out the // DOCTYPE internal subset via an event call, so we write it // out here. Writer writer = fSerializer.getWriter(); StringBuffer dtd = new StringBuffer(); dtd.append("<!DOCTYPE "); dtd.append(docTypeName); if (null != publicId) { dtd.append(" PUBLIC \""); dtd.append(publicId); dtd.append('\"'); } if (null != systemId) { if (null == publicId) { dtd.append(" SYSTEM \""); } else { dtd.append(" \""); } dtd.append(systemId); dtd.append('\"'); } dtd.append(" [ "); dtd.append(fNewLine); dtd.append(internalSubset); dtd.append("]>"); dtd.append(fNewLine); writer.write(dtd.toString()); writer.flush(); } catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); } } // else if !bStart do nothing } else { if (bStart) { if (fLexicalHandler != null) { fLexicalHandler.startDTD(docTypeName, publicId, systemId); } } else { if (fLexicalHandler != null) { fLexicalHandler.endDTD(); } } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeComment(Comment node) throws SAXException { // comments=true if ((fFeatures & COMMENTS) != 0) { String data = node.getData(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCommentWellFormed(data); } if (fLexicalHandler != null) { // apply the LSSerializer filter after the operations requested by the // DOMConfiguration parameters have been applied if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { return; } fLexicalHandler.comment(data.toCharArray(), 0, data.length()); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeElement(Element node, boolean bStart) throws SAXException { if (bStart) { fElementDepth++; // We use the Xalan specific startElement and starPrefixMapping calls // (and addAttribute and namespaceAfterStartElement) as opposed to // SAX specific, for performance reasons as they reduce the overhead // of creating an AttList object upfront. // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isElementWellFormed(node); } // REVISIT: We apply the LSSerializer filter for elements before // namesapce fixup if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { return; } // namespaces=true, record and fixup namspaced element if ((fFeatures & NAMESPACES) != 0) { fNSBinder.pushContext(); fLocalNSBinder.reset(); recordLocalNSDecl(node); fixupElementNS(node); } // Namespace normalization fSerializer.startElement( node.getNamespaceURI(), node.getLocalName(), node.getNodeName()); serializeAttList(node); } else { fElementDepth--; // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { return; } this.fSerializer.endElement( node.getNamespaceURI(), node.getLocalName(), node.getNodeName()); // since endPrefixMapping was not used by SerializationHandler it was removed // for performance reasons. if ((fFeatures & NAMESPACES) != 0 ) { fNSBinder.popContext(); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeAttList(Element node) throws SAXException { NamedNodeMap atts = node.getAttributes(); int nAttrs = atts.getLength(); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String localName = attr.getLocalName(); String attrName = attr.getNodeName(); String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix(); String attrValue = attr.getNodeValue(); // Determine the Attr's type. String type = null; if (fIsLevel3DOM) { type = ((Attr) attr).getSchemaTypeInfo().getTypeName(); } type = type == null ? "CDATA" : type; String attrNS = attr.getNamespaceURI(); if (attrNS !=null && attrNS.length() == 0) { attrNS=null; // we must remove prefix for this attribute attrName=attr.getLocalName(); } boolean isSpecified = ((Attr) attr).getSpecified(); boolean addAttr = true; boolean applyFilter = false; boolean xmlnsAttr = attrName.equals("xmlns") || attrName.startsWith("xmlns:"); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isAttributeWellFormed(attr); } //----------------------------------------------------------------- // start Attribute namespace fixup //----------------------------------------------------------------- // namespaces=true, normalize all non-namespace attributes // Step 3. Attribute if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) { // If the Attr has a namespace URI if (attrNS != null) { attrPrefix = attrPrefix == null ? "" : attrPrefix; String declAttrPrefix = fNSBinder.getPrefix(attrNS); String declAttrNS = fNSBinder.getURI(attrPrefix); // attribute has no prefix (default namespace decl does not apply to // attributes) // OR // attribute prefix is not declared // OR // conflict: attribute has a prefix that conflicts with a binding if ("".equals(attrPrefix) || "".equals(declAttrPrefix) || !attrPrefix.equals(declAttrPrefix)) { // namespaceURI matches an in scope declaration of one or // more prefixes if (declAttrPrefix != null && !"".equals(declAttrPrefix)) { // pick the prefix that was found and change attribute's // prefix and nodeName. attrPrefix = declAttrPrefix; if (declAttrPrefix.length() > 0 ) { attrName = declAttrPrefix + ":" + localName; } else { attrName = localName; } } else { // The current prefix is not null and it has no in scope // declaration if (attrPrefix != null && !"".equals(attrPrefix) && declAttrNS == null) { // declare this prefix if ((fFeatures & NAMESPACEDECLS) != 0) { fSerializer.addAttribute(XMLNS_URI, attrPrefix, XMLNS_PREFIX + ":" + attrPrefix, "CDATA", attrNS); fNSBinder.declarePrefix(attrPrefix, attrNS); fLocalNSBinder.declarePrefix(attrPrefix, attrNS); } } else { // find a prefix following the pattern "NS" +index // (starting at 1) // make sure this prefix is not declared in the current // scope. int counter = 1; attrPrefix = "NS" + counter++; while (fLocalNSBinder.getURI(attrPrefix) != null) { attrPrefix = "NS" + counter++; } // change attribute's prefix and Name attrName = attrPrefix + ":" + localName; // create a local namespace declaration attribute // Add the xmlns declaration attribute if ((fFeatures & NAMESPACEDECLS) != 0) { fSerializer.addAttribute(XMLNS_URI, attrPrefix, XMLNS_PREFIX + ":" + attrPrefix, "CDATA", attrNS); fNSBinder.declarePrefix(attrPrefix, attrNS); fLocalNSBinder.declarePrefix(attrPrefix, attrNS); } } } } } else { // if the Attr has no namespace URI // Attr has no localName if (localName == null) { // DOM Level 1 node! String msg = Utils.messages.createMessage( MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, new Object[] { attrName }); if (fErrorHandler != null) { fErrorHandler .handleError(new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, null, null)); } } else { // uri=null and no colon // attr has no namespace URI and no prefix // no action is required, since attrs don't use default } } } // discard-default-content=true // Default attr's are not passed to the filter and this contraint // is applied only when discard-default-content=true // What about default xmlns attributes???? check for xmlnsAttr if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified) || ((fFeatures & DISCARDDEFAULT) == 0)) { applyFilter = true; } else { addAttr = false; } if (applyFilter) { // apply the filter for Attributes that are not default attributes // or namespace decl attributes if (fFilter != null && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE) != 0) { if (!xmlnsAttr) { short code = fFilter.acceptNode(attr); switch (code) { case NodeFilter.FILTER_REJECT : case NodeFilter.FILTER_SKIP : addAttr = false; break; default : //fall through.. } } } } // if the node is a namespace node if (addAttr && xmlnsAttr) { // If namespace-declarations=true, add the node , else don't add it if ((fFeatures & NAMESPACEDECLS) != 0) { // The namespace may have been fixed up, in that case don't add it. if (localName != null && !"".equals(localName)) { fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue); } } } else if ( addAttr && !xmlnsAttr) { // if the node is not a namespace node // If namespace-declarations=true, add the node with the Attr nodes namespaceURI // else add the node setting it's namespace to null or else the serializer will later // attempt to add a xmlns attr for the prefixed attribute if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) { fSerializer.addAttribute( attrNS, localName, attrName, type, attrValue); } else { fSerializer.addAttribute( "", localName, attrName, type, attrValue); } } // if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) { int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); if (!"".equals(prefix)) { fSerializer.namespaceAfterStartElement(prefix, attrValue); } } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializePI(ProcessingInstruction node) throws SAXException { ProcessingInstruction pi = node; String name = pi.getNodeName(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isPIWellFormed(node); } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { return; } // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { fNextIsRaw = true; } else { this.fSerializer.processingInstruction(name, pi.getData()); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeCDATASection(CDATASection node) throws SAXException { // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCDATASectionWellFormed(node); } // cdata-sections = true if ((fFeatures & CDATA) != 0) { // split-cdata-sections = true // Assumption: This parameter has an effect only when // cdata-sections=true // ToStream, by default splits cdata-sections. Hence the check // below. String nodeValue = node.getNodeValue(); int endIndex = nodeValue.indexOf("]]>"); if ((fFeatures & SPLITCDATA) != 0) { if (endIndex >= 0) { // The first node split will contain the ]] markers String relatedData = nodeValue.substring(0, endIndex + 2); String msg = Utils.messages.createMessage( MsgKey.ER_CDATA_SECTIONS_SPLIT, null); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_WARNING, msg, MsgKey.ER_CDATA_SECTIONS_SPLIT, null, relatedData, null)); } } } else { if (endIndex >= 0) { // The first node split will contain the ]] markers String relatedData = nodeValue.substring(0, endIndex + 2); String msg = Utils.messages.createMessage( MsgKey.ER_CDATA_SECTIONS_SPLIT, null); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_CDATA_SECTIONS_SPLIT)); } // Report an error and return. What error??? return; } } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) { return; } // splits the cdata-section if (fLexicalHandler != null) { fLexicalHandler.startCDATA(); } dispatachChars(node); if (fLexicalHandler != null) { fLexicalHandler.endCDATA(); } } else { dispatachChars(node); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeText(Text node) throws SAXException { if (fNextIsRaw) { fNextIsRaw = false; fSerializer.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); fSerializer.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { // keep track of dispatch or not to avoid duplicaiton of filter code boolean bDispatch = false; // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isTextWellFormed(node); } // if the node is whitespace // Determine the Attr's type. boolean isElementContentWhitespace = false; if (fIsLevel3DOM) { isElementContentWhitespace = node.isElementContentWhitespace(); } if (isElementContentWhitespace) { // element-content-whitespace=true if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) { bDispatch = true; } } else { bDispatch = true; } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_TEXT)) { return; } if (bDispatch) { dispatachChars(node); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeEntityReference( EntityReference node, boolean bStart) throws SAXException { if (bStart) { EntityReference eref = node; // entities=true if ((fFeatures & ENTITIES) != 0) { // perform well-formedness and other checking only if // entities = true // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isEntityReferneceWellFormed(node); } // check "unbound-prefix-in-entity-reference" [fatal] // Raised if the configuration parameter "namespaces" is set to true if ((fFeatures & NAMESPACES) != 0) { checkUnboundPrefixInEntRef(node); } // The filter should not apply in this case, since the // EntityReference is not being expanded. // should we pass entity reference nodes to the filter??? } if (fLexicalHandler != null) { // startEntity outputs only Text but not Element, Attr, Comment // and PI child nodes. It does so by setting the m_inEntityRef // in ToStream and using this to decide if a node is to be // serialized or not. fLexicalHandler.startEntity(eref.getNodeName()); } } else { EntityReference eref = node; // entities=true or false, if (fLexicalHandler != null) { fLexicalHandler.endEntity(eref.getNodeName()); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void fixupElementNS(Node node) throws SAXException { String namespaceURI = ((Element) node).getNamespaceURI(); String prefix = ((Element) node).getPrefix(); String localName = ((Element) node).getLocalName(); if (namespaceURI != null) { //if ( Element's prefix/namespace pair (or default namespace, // if no prefix) are within the scope of a binding ) prefix = prefix == null ? "" : prefix; String inScopeNamespaceURI = fNSBinder.getURI(prefix); if ((inScopeNamespaceURI != null && inScopeNamespaceURI.equals(namespaceURI))) { // do nothing, declaration in scope is inherited } else { // Create a local namespace declaration attr for this namespace, // with Element's current prefix (or a default namespace, if // no prefix). If there's a conflicting local declaration // already present, change its value to use this namespace. // Add the xmlns declaration attribute //fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth); if ((fFeatures & NAMESPACEDECLS) != 0) { if ("".equals(prefix) || "".equals(namespaceURI)) { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI); } else { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI); } } fLocalNSBinder.declarePrefix(prefix, namespaceURI); fNSBinder.declarePrefix(prefix, namespaceURI); } } else { // Element has no namespace // DOM Level 1 if (localName == null || "".equals(localName)) { // DOM Level 1 node! String msg = Utils.messages.createMessage( MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, new Object[] { node.getNodeName()}); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, null, null)); } } else { namespaceURI = fNSBinder.getURI(""); if (namespaceURI !=null && namespaceURI.length() > 0) { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, ""); fLocalNSBinder.declarePrefix("", ""); fNSBinder.declarePrefix("", ""); } } } }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException() throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException(char[] chars, int off, int len) throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException(String elemQName) throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public boolean setEscaping(boolean escape) throws SAXException { couldThrowSAXException(); return false; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void flushPending() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttributes(Attributes atts) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(String chars) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endElement(String elemName) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startDocument() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement(String uri, String localName, String qName) throws SAXException { couldThrowSAXException(qName); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement(String qName) throws SAXException { couldThrowSAXException(qName); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void namespaceAfterStartElement(String uri, String prefix) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { couldThrowSAXException(); return false; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void entityReference(String entityName) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endDocument() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startPrefixMapping(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endPrefixMapping(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endElement(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void processingInstruction(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void skippedEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void comment(String comment) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startDTD(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endDTD() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startCDATA() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endCDATA() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void comment(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void elementDecl(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void warning(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void error(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void fatalError(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(Node node) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void notationDecl(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void unparsedEntityDecl( String arg0, String arg1, String arg2, String arg3) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { if (_nestedLevel > 0) return; if (_str != null) { _buffer.append(_str); _str = null; } _buffer.append(ch, off, len); }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void characters(String characters) throws SAXException { if (_nestedLevel > 0) return; if (_str == null && _buffer.length() == 0) { _str = characters; } else { if (_str != null) { _buffer.append(_str); _str = null; } _buffer.append(characters); } }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void startElement(String qname) throws SAXException { _nestedLevel++; }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void endElement(String qname) throws SAXException { _nestedLevel--; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { final int col = qname.lastIndexOf(':'); final String prefix = (col == -1) ? null : qname.substring(0, col); SyntaxTreeNode element = makeInstance(uri, prefix, localname, attributes); if (element == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ELEMENT_PARSE_ERR, prefix+':'+localname); throw new SAXException(err.toString()); } // If this is the root element of the XML document we need to make sure // that it contains a definition of the XSL namespace URI if (_root == null) { if ((_prefixMapping == null) || (_prefixMapping.containsValue(Constants.XSLT_URI) == false)) _rootNamespaceDef = false; else _rootNamespaceDef = true; _root = element; } else { SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek(); parent.addElement(element); element.setParent(parent); } element.setAttributes(new AttributeList(attributes)); element.setPrefixMapping(_prefixMapping); if (element instanceof Stylesheet) { // Extension elements and excluded elements have to be // handled at this point in order to correctly generate // Fallback elements from <xsl:fallback>s. getSymbolTable().setCurrentNode(element); ((Stylesheet)element).declareExtensionPrefixes(this); } _prefixMapping = null; _parentStack.push(element); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void startDocument() throws SAXException { }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void endDocument() throws SAXException { // Set the String value when the document is built. if (_size == 1) _text = _textArray[0]; else { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < _size; i++) { buffer.append(_textArray[i]); } _text = buffer.toString(); } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(String str) throws SAXException { // Resize the text array if necessary if (_size >= _textArray.length) { String[] newTextArray = new String[_textArray.length * 2]; System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length); _textArray = newTextArray; } // If the escape setting is false, set the corresponding bit in // the _dontEscape BitArray. if (!_escaping) { // The _dontEscape array is only created when needed. if (_dontEscape == null) { _dontEscape = new BitArray(8); } // Resize the _dontEscape array if necessary if (_size >= _dontEscape.size()) _dontEscape.resize(_dontEscape.size() * 2); _dontEscape.setBit(_size); } _textArray[_size++] = str; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(char[] ch, int offset, int length) throws SAXException { if (_size >= _textArray.length) { String[] newTextArray = new String[_textArray.length * 2]; System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length); _textArray = newTextArray; } if (!_escaping) { if (_dontEscape == null) { _dontEscape = new BitArray(8); } if (_size >= _dontEscape.size()) _dontEscape.resize(_dontEscape.size() * 2); _dontEscape.setBit(_size); } _textArray[_size++] = new String(ch, offset, length); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public boolean setEscaping(boolean escape) throws SAXException { final boolean temp = _escaping; _escaping = escape; return temp; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
private void maybeEmitStartElement() throws SAXException { if (_openElementName != null) { int index; if ((index =_openElementName.indexOf(":")) < 0) _dom.startElement(null, _openElementName, _openElementName, _attributes); else _dom.startElement(null, _openElementName.substring(index+1), _openElementName, _attributes); _openElementName = null; } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
private void prepareNewDOM() throws SAXException { _dom = (SAXImpl)_dtmManager.getDTM(null, true, _wsfilter, true, false, false, _initSize, _buildIdIndex); _dom.startDocument(); // Flush pending Text nodes to SAXImpl for (int i = 0; i < _size; i++) { String str = _textArray[i]; _dom.characters(str.toCharArray(), 0, str.length()); } _size = 0; }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startDocument() throws SAXException { }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endDocument() throws SAXException { if (_dom != null) { _dom.endDocument(); } else { super.endDocument(); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(String str) throws SAXException { if (_dom != null) { characters(str.toCharArray(), 0, str.length()); } else { super.characters(str); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(char[] ch, int offset, int length) throws SAXException { if (_dom != null) { maybeEmitStartElement(); _dom.characters(ch, offset, length); } else { super.characters(ch, offset, length); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public boolean setEscaping(boolean escape) throws SAXException { if (_dom != null) { return _dom.setEscaping(escape); } else { return super.setEscaping(escape); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String elementName) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _openElementName = elementName; _attributes.clear(); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String uri, String localName, String qName) throws SAXException { startElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { startElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endElement(String elementName) throws SAXException { maybeEmitStartElement(); _dom.endElement(null, null, elementName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { endElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { if (_dom == null) { prepareNewDOM(); } _dom.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void comment(String comment) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); char[] chars = comment.toCharArray(); _dom.comment(chars, 0, chars.length); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void comment(char[] chars, int offset, int length) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.comment(chars, offset, length); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void processingInstruction(String target, String data) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.processingInstruction(target, data); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void dispatchCharactersEvents(int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { if (_dom != null) { _dom.dispatchCharactersEvents(nodeHandle, ch, normalize); } else { super.dispatchCharactersEvents(nodeHandle, ch, normalize); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { if (_dom != null) { _dom.dispatchToEvents(nodeHandle, ch); } else { super.dispatchToEvents(nodeHandle, ch); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); _disableEscaping = !_escaping; _textNodeToProcess = getNumberOfNodes(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startDocument() throws SAXException { super.startDocument(); _nsIndex.put(new Integer(0), new Integer(_uriCount++)); definePrefixAndUri(XML_PREFIX, XML_URI); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void endDocument() throws SAXException { super.endDocument(); handleTextEscaping(); _namesSize = m_expandedNameTable.getSize(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes, Node node) throws SAXException { this.startElement(uri, localName, qname, attributes); if (m_buildIdIndex) { _node2Ids.put(node, new Integer(m_parents.peek())); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException { super.startElement(uri, localName, qname, attributes); handleTextEscaping(); if (m_wsfilter != null) { // Look for any xml:space attributes // Depending on the implementation of attributes, this // might be faster than looping through all attributes. ILENE final int index = attributes.getIndex(XMLSPACE_STRING); if (index >= 0) { xmlSpaceDefine(attributes.getValue(index), m_parents.peek()); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void endElement(String namespaceURI, String localName, String qname) throws SAXException { super.endElement(namespaceURI, localName, qname); handleTextEscaping(); // Revert to strip/preserve-space setting from before this element if (m_wsfilter != null) { xmlSpaceRevert(m_previous); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void processingInstruction(String target, String data) throws SAXException { super.processingInstruction(target, data); handleTextEscaping(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); _textNodeToProcess = getNumberOfNodes(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { super.startPrefixMapping(prefix, uri); handleTextEscaping(); definePrefixAndUri(prefix, uri); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void definePrefixAndUri(String prefix, String uri) throws SAXException { // Check if the URI already exists before pushing on stack Integer eType = new Integer(getIdForNamespace(uri)); if ((Integer)_nsIndex.get(eType) == null) { _nsIndex.put(eType, new Integer(_uriCount++)); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void comment(char[] ch, int start, int length) throws SAXException { super.comment(ch, start, length); handleTextEscaping(); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _handler.startDocument(); parse(_dom); _handler.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
private void parse(Node node) throws IOException, SAXException { if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: _handler.startCDATA(); _handler.characters(node.getNodeValue()); _handler.endCDATA(); break; case Node.COMMENT_NODE: // should be handled!!! _handler.comment(node.getNodeValue()); break; case Node.DOCUMENT_NODE: _handler.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _handler.endDocument(); break; case Node.DOCUMENT_FRAGMENT_NODE: next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } break; case Node.ELEMENT_NODE: // Generate SAX event to start element final String qname = node.getNodeName(); _handler.startElement(null, null, qname); int colon; String prefix; final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace attributes first for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a namespace declaration? if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uriAttr); } } // Process all non-namespace attributes next NamespaceMappings nm = new NamespaceMappings(); for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a regular attribute? if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); // Uri may be implicitly declared if (uriAttr != null && !uriAttr.equals(EMPTYSTRING) ) { colon = qnameAttr.lastIndexOf(':'); // Fix for bug 26319 // For attributes not given an prefix explictly // but having a namespace uri we need // to explicitly generate the prefix String newPrefix = nm.lookupPrefix(uriAttr); if (newPrefix == null) newPrefix = nm.generateNextPrefix(); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : newPrefix; _handler.namespaceAfterStartElement(prefix, uriAttr); _handler.addAttribute((prefix + ":" + qnameAttr), attr.getNodeValue()); } else { _handler.addAttribute(qnameAttr, attr.getNodeValue()); } } } // Now element namespace and children final String uri = node.getNamespaceURI(); final String localName = node.getLocalName(); // Uri may be implicitly declared if (uri != null) { colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uri); }else { // Fix for bug 26319 // If an element foo is created using // createElementNS(null,locName) // then the element should be serialized // <foo xmlns=" "/> if (uri == null && localName != null) { prefix = EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, EMPTYSTRING); } } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _handler.endElement(qname); break; case Node.PROCESSING_INSTRUCTION_NODE: _handler.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: _handler.characters(node.getNodeValue()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private boolean startPrefixMapping(String prefix, String uri) throws SAXException { boolean pushed = true; Stack uriStack = (Stack) _nsPrefixes.get(prefix); if (uriStack != null) { if (uriStack.isEmpty()) { _sax.startPrefixMapping(prefix, uri); uriStack.push(uri); } else { final String lastUri = (String) uriStack.peek(); if (!lastUri.equals(uri)) { _sax.startPrefixMapping(prefix, uri); uriStack.push(uri); } else { pushed = false; } } } else { _sax.startPrefixMapping(prefix, uri); _nsPrefixes.put(prefix, uriStack = new Stack()); uriStack.push(uri); } return pushed; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void endPrefixMapping(String prefix) throws SAXException { final Stack uriStack = (Stack) _nsPrefixes.get(prefix); if (uriStack != null) { _sax.endPrefixMapping(prefix); uriStack.pop(); } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _sax.startDocument(); parse(_dom); _sax.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void parse(Node node) throws IOException, SAXException { Node first = null; if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_FRAGMENT_NODE: case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: final String cdata = node.getNodeValue(); if (_lex != null) { _lex.startCDATA(); _sax.characters(cdata.toCharArray(), 0, cdata.length()); _lex.endCDATA(); } else { // in the case where there is no lex handler, we still // want the text of the cdate to make its way through. _sax.characters(cdata.toCharArray(), 0, cdata.length()); } break; case Node.COMMENT_NODE: // should be handled!!! if (_lex != null) { final String value = node.getNodeValue(); _lex.comment(value.toCharArray(), 0, value.length()); } break; case Node.DOCUMENT_NODE: _sax.setDocumentLocator(this); _sax.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _sax.endDocument(); break; case Node.ELEMENT_NODE: String prefix; List pushedPrefixes = new ArrayList(); final AttributesImpl attrs = new AttributesImpl(); final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace declarations for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore everything but NS declarations here if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } } // Process all other attributes for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore NS declarations here if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); final String localNameAttr = getLocalName(attr); // Uri may be implicitly declared if (uriAttr != null) { final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } // Add attribute to list attrs.addAttribute(attr.getNamespaceURI(), getLocalName(attr), qnameAttr, "CDATA", attr.getNodeValue()); } } // Now process the element itself final String qname = node.getNodeName(); final String uri = node.getNamespaceURI(); final String localName = getLocalName(node); // Uri may be implicitly declared if (uri != null) { final int colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uri)) { pushedPrefixes.add(prefix); } } // Generate SAX event to start element if (_saxImpl != null) { _saxImpl.startElement(uri, localName, qname, attrs, node); } else { _sax.startElement(uri, localName, qname, attrs); } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _sax.endElement(uri, localName, qname); // Generate endPrefixMapping() for all pushed prefixes final int nPushedPrefixes = pushedPrefixes.size(); for (int i = 0; i < nPushedPrefixes; i++) { endPrefixMapping((String) pushedPrefixes.get(i)); } break; case Node.PROCESSING_INSTRUCTION_NODE: _sax.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: final String data = node.getNodeValue(); _sax.characters(data.toCharArray(), 0, data.length()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void endDocument() throws SAXException { _parser.endDocument(); // create the templates try { XSLTC xsltc = _parser.getXSLTC(); // Set the translet class name if not already set String transletName; if (_systemId != null) { transletName = Util.baseName(_systemId); } else { transletName = (String)_tfactory.getAttribute("translet-name"); } xsltc.setClassName(transletName); // Get java-legal class name from XSLTC module transletName = xsltc.getClassName(); Stylesheet stylesheet = null; SyntaxTreeNode root = _parser.getDocumentRoot(); // Compile the translet - this is where the work is done! if (!_parser.errorsFound() && root != null) { // Create a Stylesheet element from the root node stylesheet = _parser.makeStylesheet(root); stylesheet.setSystemId(_systemId); stylesheet.setParentStylesheet(null); if (xsltc.getTemplateInlining()) stylesheet.setTemplateInlining(true); else stylesheet.setTemplateInlining(false); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { stylesheet.setSourceLoader(this); } _parser.setCurrentStylesheet(stylesheet); // Set it as top-level in the XSLTC object xsltc.setStylesheet(stylesheet); // Create AST under the Stylesheet element _parser.createAST(stylesheet); } // Generate the bytecodes and output the translet class(es) if (!_parser.errorsFound() && stylesheet != null) { stylesheet.setMultiDocument(xsltc.isMultiDocument()); stylesheet.setHasIdCall(xsltc.hasIdCall()); // Class synchronization is needed for BCEL synchronized (xsltc.getClass()) { stylesheet.translate(); } } if (!_parser.errorsFound()) { // Check that the transformation went well before returning final byte[][] bytecodes = xsltc.getBytecodes(); if (bytecodes != null) { _templates = new TemplatesImpl(xsltc.getBytecodes(), transletName, _parser.getOutputProperties(), _indentNumber, _tfactory); // Set URIResolver on templates object if (_uriResolver != null) { _templates.setURIResolver(_uriResolver); } } } else { StringBuffer errorMessage = new StringBuffer(); Vector errors = _parser.getErrors(); final int count = errors.size(); for (int i = 0; i < count; i++) { if (errorMessage.length() > 0) errorMessage.append('\n'); errorMessage.append(errors.elementAt(i).toString()); } throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString())); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { _parser.startElement(uri, localname, qname, attributes); }
// in src/org/apache/xalan/xsltc/trax/XSLTCSource.java
protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet) throws SAXException { SAXImpl idom = (SAXImpl)_dom.get(); if (idom != null) { if (dtmManager != null) { idom.migrateTo(dtmManager); } } else { Source source = _source; if (source == null) { if (_systemId != null && _systemId.length() > 0) { source = new StreamSource(_systemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR); throw new SAXException(err.toString()); } } DOMWSFilter wsfilter = null; if (translet != null && translet instanceof StripFilter) { wsfilter = new DOMWSFilter(translet); } boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false; if (dtmManager == null) { dtmManager = XSLTCDTMManager.newInstance(); } idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall); String systemId = getSystemId(); if (systemId != null) { idom.setDocumentURI(systemId); } _dom.set(idom); } return idom; }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void characters(char[] ch, int start, int length) throws SAXException { _handler.characters(ch, start, length); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDocument() throws SAXException { // Make sure setResult() was called before the first SAX event if (_result == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR); throw new SAXException(err.toString()); } if (!_isIdentity) { boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; XSLTCDTMManager dtmManager = null; // Create an internal DOM (not W3C) and get SAX2 input handler try { dtmManager = (XSLTCDTMManager)_transformer.getTransformerFactory() .getDTMManagerClass() .newInstance(); } catch (Exception e) { throw new SAXException(e); } DTMWSFilter wsFilter; if (_translet != null && _translet instanceof StripFilter) { wsFilter = new DOMWSFilter(_translet); } else { wsFilter = null; } // Construct the DTM using the SAX events that come through _dom = (SAXImpl)dtmManager.getDTM(null, false, wsFilter, true, false, hasIdCall); _handler = _dom.getBuilder(); _lexHandler = (LexicalHandler) _handler; _dtdHandler = (DTDHandler) _handler; _declHandler = (DeclHandler) _handler; // Set document URI _dom.setDocumentURI(_systemId); if (_locator != null) { _handler.setDocumentLocator(_locator); } } // Proxy call _handler.startDocument(); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDocument() throws SAXException { // Signal to the DOMBuilder that the document is complete _handler.endDocument(); if (!_isIdentity) { // Run the transformation now if we have a reference to a Result object if (_result != null) { try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { throw new SAXException(e); } } // Signal that the internal DOM is built (see 'setResult()'). _done = true; // Set this DOM as the transformer's DOM _transformer.setDOM(_dom); } if (_isIdentity && _result instanceof DOMResult) { ((DOMResult)_result).setNode(_transformer.getTransletOutputHandlerFactory().getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException { _handler.startElement(uri, localName, qname, attributes); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endElement(String namespaceURI, String localName, String qname) throws SAXException { _handler.endElement(namespaceURI, localName, qname); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void processingInstruction(String target, String data) throws SAXException { _handler.processingInstruction(target, data); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.startCDATA(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.endCDATA(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void comment(char[] ch, int start, int length) throws SAXException { if (_lexHandler != null) { _lexHandler.comment(ch, start, length); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { _handler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void skippedEntity(String name) throws SAXException { _handler.skippedEntity(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { _handler.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endPrefixMapping(String prefix) throws SAXException { _handler.endPrefixMapping(prefix); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { if (_lexHandler != null) { _lexHandler.startDTD(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDTD() throws SAXException { if (_lexHandler != null) { _lexHandler.endDTD(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.startEntity(name); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.endEntity(name); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException { if (_dtdHandler != null) { _dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (_dtdHandler != null) { _dtdHandler.notationDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (_declHandler != null) { _declHandler.attributeDecl(eName, aName, type, valueDefault, value); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void elementDecl(String name, String model) throws SAXException { if (_declHandler != null) { _declHandler.elementDecl(name, model); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException { if (_declHandler != null) { _declHandler.externalEntityDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void internalEntityDecl(String name, String value) throws SAXException { if (_declHandler != null) { _declHandler.internalEntityDecl(name, value); } }
// in src/org/apache/xalan/xsltc/trax/SAX2DOM.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { // Hmmm... for the moment I don't think I'll have default properties set for this. -sb m_outputProperties = new OutputProperties(); m_outputProperties.setDOMBackPointer(handler.getOriginatingNode()); m_outputProperties.setLocaterInfo(handler.getLocator()); m_outputProperties.setUid(handler.nextUid()); setPropertiesFromAttributes(handler, rawName, attributes, this); // Access this only from the Hashtable level... we don't want to // get default properties. String entitiesFileName = (String) m_outputProperties.getProperties().get(OutputPropertiesFactory.S_KEY_ENTITIES); if (null != entitiesFileName) { try { String absURL = SystemIDResolver.getAbsoluteURI(entitiesFileName, handler.getBaseIdentifier()); m_outputProperties.getProperties().put(OutputPropertiesFactory.S_KEY_ENTITIES, absURL); } catch(TransformerException te) { handler.error(te.getMessage(), te); } } handler.getStylesheet().setOutput(m_outputProperties); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(m_outputProperties); m_outputProperties = null; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { if (this == handler.getCurrentProcessor()) { handler.popProcessor(); } int nChars = m_accumulator.length(); if ((nChars > 0) && ((null != m_xslTextElement) ||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator)) || handler.isSpacePreserve()) { ElemTextLiteral elem = new ElemTextLiteral(); elem.setDOMBackPointer(m_firstBackPointer); elem.setLocaterInfo(handler.getLocator()); try { elem.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } boolean doe = (null != m_xslTextElement) ? m_xslTextElement.getDisableOutputEscaping() : false; elem.setDisableOutputEscaping(doe); elem.setPreserveSpace(true); char[] chars = new char[nChars]; m_accumulator.getChars(0, nChars, chars, 0); elem.setChars(chars); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); } m_accumulator.setLength(0); m_firstBackPointer = null; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void characters( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { m_accumulator.append(ch, start, length); if(null == m_firstBackPointer) m_firstBackPointer = handler.getOriginatingNode(); // Catch all events until a non-character event. if (this != handler.getCurrentProcessor()) handler.pushProcessor(this); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { // Since this has been installed as the current processor, we // may get and end element event, in which case, we pop and clear // and then call the real element processor. startNonText(handler); handler.getCurrentProcessor().endElement(handler, uri, localName, rawName); handler.popProcessor(); }
// in src/org/apache/xalan/processor/ProcessorExsltFuncResult.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws SAXException { String msg = ""; super.startElement(handler, uri, localName, rawName, attributes); ElemTemplateElement ancestor = handler.getElemTemplateElement().getParentElem(); while (ancestor != null && !(ancestor instanceof ElemExsltFunction)) { if (ancestor instanceof ElemVariable || ancestor instanceof ElemParam || ancestor instanceof ElemExsltFuncResult) { msg = "func:result cannot appear within a variable, parameter, or another func:result."; handler.error(msg, new SAXException(msg)); } ancestor = ancestor.getParentElem(); } if (ancestor == null) { msg = "func:result must appear in a func:function element"; handler.error(msg, new SAXException(msg)); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { // ElemTemplateElement parent = handler.getElemTemplateElement(); XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); ElemTemplateElement elem = null; try { elem = (ElemTemplateElement) classObject.newInstance(); elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { ElemTemplateElement parent = handler.getElemTemplateElement(); if(null != parent) // defensive, for better multiple error reporting. -sb { parent.appendChild(elem); handler.pushElemTemplateElement(elem); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { super.endElement(handler, uri, localName, rawName); handler.popElemTemplateElement().setEndLocaterInfo(handler.getLocator()); }
// in src/org/apache/xalan/processor/ProcessorPreserveSpace.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { Stylesheet thisSheet = handler.getStylesheet(); WhitespaceInfoPaths paths = new WhitespaceInfoPaths(thisSheet); setPropertiesFromAttributes(handler, rawName, attributes, paths); Vector xpaths = paths.getElements(); for (int i = 0; i < xpaths.size(); i++) { WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), false, thisSheet); wsi.setUid(handler.nextUid()); thisSheet.setPreserveSpaces(wsi); } paths.clearElements(); }
// in src/org/apache/xalan/processor/ProcessorDecimalFormat.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { DecimalFormatProperties dfp = new DecimalFormatProperties(handler.nextUid()); dfp.setDOMBackPointer(handler.getOriginatingNode()); dfp.setLocaterInfo(handler.getLocator()); setPropertiesFromAttributes(handler, rawName, attributes, dfp); handler.getStylesheet().setDecimalFormat(dfp); handler.getStylesheet().appendChild(dfp); }
// in src/org/apache/xalan/processor/ProcessorNamespaceAlias.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { final String resultNS; NamespaceAlias na = new NamespaceAlias(handler.nextUid()); setPropertiesFromAttributes(handler, rawName, attributes, na); String prefix = na.getStylesheetPrefix(); if(prefix.equals("#default")) { prefix = ""; na.setStylesheetPrefix(prefix); } String stylesheetNS = handler.getNamespaceForPrefix(prefix); na.setStylesheetNamespace(stylesheetNS); prefix = na.getResultPrefix(); if(prefix.equals("#default")) { prefix = ""; na.setResultPrefix(prefix); resultNS = handler.getNamespaceForPrefix(prefix); if(null == resultNS) handler.error(XSLTErrorResources.ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT, null, null); } else { resultNS = handler.getNamespaceForPrefix(prefix); if(null == resultNS) handler.error(XSLTErrorResources.ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX, new Object[] {prefix}, null); } na.setResultNamespace(resultNS); handler.getStylesheet().setNamespaceAlias(na); handler.getStylesheet().appendChild(na); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemTemplateElement elem = handler.getElemTemplateElement(); if (elem instanceof ElemLiteralResult) { if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet()) { handler.popStylesheet(); } } super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorTemplate.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { super.appendAndPush(handler, elem); elem.setDOMBackPointer(handler.getOriginatingNode()); handler.getStylesheet().setTemplate((ElemTemplate) elem); }
// in src/org/apache/xalan/processor/ProcessorStripSpace.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { Stylesheet thisSheet = handler.getStylesheet(); WhitespaceInfoPaths paths = new WhitespaceInfoPaths(thisSheet); setPropertiesFromAttributes(handler, rawName, attributes, paths); Vector xpaths = paths.getElements(); for (int i = 0; i < xpaths.size(); i++) { WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), true, thisSheet); wsi.setUid(handler.nextUid()); thisSheet.setStripSpaces(wsi); } paths.clearElements(); }
// in src/org/apache/xalan/processor/ProcessorText.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Don't push this element onto the element stack. ProcessorCharacters charProcessor = (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text"); charProcessor.setXslTextElement((ElemText) elem); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); elem.setDOMBackPointer(handler.getOriginatingNode()); }
// in src/org/apache/xalan/processor/ProcessorText.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ProcessorCharacters charProcessor = (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text"); charProcessor.setXslTextElement(null); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { ElemAttributeSet eat = new ElemAttributeSet(); eat.setLocaterInfo(handler.getLocator()); try { eat.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } eat.setDOMBackPointer(handler.getOriginatingNode()); setPropertiesFromAttributes(handler, rawName, attributes, eat); handler.getStylesheet().setAttributeSet(eat); // handler.pushElemTemplateElement(eat); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(eat); handler.pushElemTemplateElement(eat); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { handler.popElemTemplateElement(); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
AVT processAVT( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCDATA(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCHAR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (value.length() != 1)) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (value.length() != 1) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return new Character(value.charAt(0)); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; if (getSupportsAVT()) { try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (!avt.isSimple()) return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } int retVal = this.getEnum(value); if (retVal == StringToIntTable.INVALID_KEY) { StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } if (getSupportsAVT()) return avt; else return new Integer(retVal); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM_OR_PQNAME(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { Object objToReturn = null; if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); if (!avt.isSimple()) return avt; else objToReturn = avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } // An avt wasn't used. int key = this.getEnum(value); if (key != StringToIntTable.INVALID_KEY) { if (objToReturn == null) objToReturn = new Integer(key); } // enum not used. Validate qname-but-not-ncname. else { try { QName qname = new QName(value, handler, true); if (objToReturn == null) objToReturn = qname; if (qname.getPrefix() == null) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } } catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; } catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; } } return objToReturn; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processEXPR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath expr = handler.createXPath(value, owner); return expr; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNMTOKEN(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNmtoken(value))) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNmtoken(value)) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } } return value; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processPATTERN( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath pattern = handler.createMatchPatternXPath(value, owner); return pattern; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNUMBER( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { Double val; AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (avt.isSimple()) { val = Double.valueOf(value); } } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } return avt; } else { try { return Double.valueOf(value); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processQNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { QName qname = new QName(value, handler, true); return qname; } catch (IllegalArgumentException ie) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie); return null; } catch (RuntimeException re) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re); return null; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processAVT_QNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if (avt.isSimple()) { int indexOfNSSep = value.indexOf(':'); if (indexOfNSSep >= 0) { String prefix = value.substring(0, indexOfNSSep); if (!XML11Char.isXML11ValidNCName(prefix)) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null); return null; } } String localName = (indexOfNSSep < 0) ? value : value.substring(indexOfNSSep + 1); if ((localName == null) || (localName.length() == 0) || (!XML11Char.isXML11ValidNCName(localName))) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null ); return null; } } } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } return avt; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNCNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNCName(value))) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNCName(value)) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processQNAMES( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nQNames = tokenizer.countTokens(); Vector qnames = new Vector(nQNames); for (int i = 0; i < nQNames; i++) { // Fix from Alexander Rudnev qnames.addElement(new QName(tokenizer.nextToken(), handler)); } return qnames; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
final Vector processQNAMESRNU(StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nQNames = tokenizer.countTokens(); Vector qnames = new Vector(nQNames); String defaultURI = handler.getNamespaceForPrefix(""); for (int i = 0; i < nQNames; i++) { String tok = tokenizer.nextToken(); if (tok.indexOf(':') == -1) { qnames.addElement(new QName(defaultURI,tok)); } else { qnames.addElement(new QName(tok, handler)); } } return qnames; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processSIMPLEPATTERNLIST( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nPatterns = tokenizer.countTokens(); Vector patterns = new Vector(nPatterns); for (int i = 0; i < nPatterns; i++) { XPath pattern = handler.createMatchPatternXPath(tokenizer.nextToken(), owner); patterns.addElement(pattern); } return patterns; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_URLLIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (url != null) strings.addElement(url); else throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_LIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (prefix.equals(Constants.ATTRVAL_DEFAULT_PREFIX) || url != null) strings.addElement(prefix); else throw new org.xml.sax.SAXException( XSLMessages.createMessage( XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processURL( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value // if (avt.getSimpleString() != null) { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); //} return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
private Boolean processYESNO( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { // Is this already checked somewhere else? -sb if (!(value.equals("yes") || value.equals("no"))) { handleError(handler, XSLTErrorResources.INVALID_BOOLEAN, new Object[] {name,value}, null); return null; } return new Boolean(value.equals("yes") ? true : false); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processValue( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { int type = getType(); Object processedValue = null; switch (type) { case T_AVT : processedValue = processAVT(handler, uri, name, rawName, value, owner); break; case T_CDATA : processedValue = processCDATA(handler, uri, name, rawName, value, owner); break; case T_CHAR : processedValue = processCHAR(handler, uri, name, rawName, value, owner); break; case T_ENUM : processedValue = processENUM(handler, uri, name, rawName, value, owner); break; case T_EXPR : processedValue = processEXPR(handler, uri, name, rawName, value, owner); break; case T_NMTOKEN : processedValue = processNMTOKEN(handler, uri, name, rawName, value, owner); break; case T_PATTERN : processedValue = processPATTERN(handler, uri, name, rawName, value, owner); break; case T_NUMBER : processedValue = processNUMBER(handler, uri, name, rawName, value, owner); break; case T_QNAME : processedValue = processQNAME(handler, uri, name, rawName, value, owner); break; case T_QNAMES : processedValue = processQNAMES(handler, uri, name, rawName, value); break; case T_QNAMES_RESOLVE_NULL: processedValue = processQNAMESRNU(handler, uri, name, rawName, value); break; case T_SIMPLEPATTERNLIST : processedValue = processSIMPLEPATTERNLIST(handler, uri, name, rawName, value, owner); break; case T_URL : processedValue = processURL(handler, uri, name, rawName, value, owner); break; case T_YESNO : processedValue = processYESNO(handler, uri, name, rawName, value); break; case T_STRINGLIST : processedValue = processSTRINGLIST(handler, uri, name, rawName, value); break; case T_PREFIX_URLLIST : processedValue = processPREFIX_URLLIST(handler, uri, name, rawName, value); break; case T_ENUM_OR_PQNAME : processedValue = processENUM_OR_PQNAME(handler, uri, name, rawName, value, owner); break; case T_NCNAME : processedValue = processNCNAME(handler, uri, name, rawName, value, owner); break; case T_AVT_QNAME : processedValue = processAVT_QNAME(handler, uri, name, rawName, value, owner); break; case T_PREFIXLIST : processedValue = processPREFIX_LIST(handler, uri, name, rawName, value); break; default : } return processedValue; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { setAttrValue(handler, this.getNamespace(), this.getName(), this.getName(), this.getDefault(), elem); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
boolean setAttrValue( StylesheetHandler handler, String attrUri, String attrLocalName, String attrRawName, String attrValue, ElemTemplateElement elem) throws org.xml.sax.SAXException { if(attrRawName.equals("xmlns") || attrRawName.startsWith("xmlns:")) return true; String setterString = getSetterMethodName(); // If this is null, then it is a foreign namespace and we // do not process it. if (null != setterString) { try { Method meth; Object[] args; if(setterString.equals(S_FOREIGNATTR_SETTER)) { // workaround for possible crimson bug if( attrUri==null) attrUri=""; // First try to match with the primative value. Class sclass = attrUri.getClass(); Class[] argTypes = new Class[]{ sclass, sclass, sclass, sclass }; meth = elem.getClass().getMethod(setterString, argTypes); args = new Object[]{ attrUri, attrLocalName, attrRawName, attrValue }; } else { Object value = processValue(handler, attrUri, attrLocalName, attrRawName, attrValue, elem); // If a warning was issued because the value for this attribute was // invalid, then the value will be null. Just return if (null == value) return false; // First try to match with the primative value. Class[] argTypes = new Class[]{ getPrimativeClass(value) }; try { meth = elem.getClass().getMethod(setterString, argTypes); } catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); } args = new Object[]{ value }; } meth.invoke(elem, args); } catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae); return false; } catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; } } return true; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
private void handleError(StylesheetHandler handler, String msg, Object [] args, Exception exc) throws org.xml.sax.SAXException { switch (getErrorType()) { case (FATAL): case (ERROR): handler.error(msg, args, exc); break; case (WARNING): handler.warn(msg, args); default: break; } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, this); try { // Get the Source from the user's URIResolver (if any). Source sourceFromURIResolver = getSourceFromUriResolver(handler); // Get the system ID of the included/imported stylesheet module String hrefUrl = getBaseURIOfIncludedStylesheet(handler, sourceFromURIResolver); if (handler.importStackContains(hrefUrl)) { throw new org.xml.sax.SAXException( XSLMessages.createMessage( getStylesheetInclErr(), new Object[]{ hrefUrl })); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!"); } // Push the system ID and corresponding Source // on some stacks for later retrieval during parse() time. handler.pushImportURL(hrefUrl); handler.pushImportSource(sourceFromURIResolver); int savedStylesheetType = handler.getStylesheetType(); handler.setStylesheetType(this.getStylesheetType()); handler.pushNewNamespaceSupport(); try { parse(handler, uri, localName, rawName, attributes); } finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); } } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public InputSource resolveEntity( StylesheetHandler handler, String publicId, String systemId) throws org.xml.sax.SAXException { return null; }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { if (m_savedLastOrder == null) m_savedLastOrder = new IntStack(); m_savedLastOrder.push(getElemDef().getLastOrder()); getElemDef().setLastOrder(-1); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { if (m_savedLastOrder != null && !m_savedLastOrder.empty()) getElemDef().setLastOrder(m_savedLastOrder.pop()); if (!getElemDef().getRequiredFound()) handler.error(XSLTErrorResources.ER_REQUIRED_ELEM_NOT_FOUND, new Object[]{getElemDef().getRequiredElem()}, null); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void characters( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { handler.error(XSLTErrorResources.ER_CHARS_NOT_ALLOWED, null, null);//"Characters are not allowed at this point in the document!", //null); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void ignorableWhitespace( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void processingInstruction( StylesheetHandler handler, String target, String data) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void skippedEntity(StylesheetHandler handler, String name) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
void setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, ElemTemplateElement target) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, target, true); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
Attributes setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, ElemTemplateElement target, boolean throwError) throws org.xml.sax.SAXException { XSLTElementDef def = getElemDef(); AttributesImpl undefines = null; boolean isCompatibleMode = ((null != handler.getStylesheet() && handler.getStylesheet().getCompatibleMode()) || !throwError); if (isCompatibleMode) undefines = new AttributesImpl(); // Keep track of which XSLTAttributeDefs have been processed, so // I can see which default values need to be set. List processedDefs = new ArrayList(); // Keep track of XSLTAttributeDefs that were invalid List errorDefs = new ArrayList(); int nAttrs = attributes.getLength(); for (int i = 0; i < nAttrs; i++) { String attrUri = attributes.getURI(i); // Hack for Crimson. -sb if((null != attrUri) && (attrUri.length() == 0) && (attributes.getQName(i).startsWith("xmlns:") || attributes.getQName(i).equals("xmlns"))) { attrUri = org.apache.xalan.templates.Constants.S_XMLNAMESPACEURI; } String attrLocalName = attributes.getLocalName(i); XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName); if (null == attrDef) { if (!isCompatibleMode) { // Then barf, because this element does not allow this attribute. handler.error(XSLTErrorResources.ER_ATTR_NOT_ALLOWED, new Object[]{attributes.getQName(i), rawName}, null);//"\""+attributes.getQName(i)+"\"" //+ " attribute is not allowed on the " + rawName // + " element!", null); } else { undefines.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } else { // Can we switch the order here: boolean success = attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); // Now we only add the element if it passed a validation check if (success) processedDefs.add(attrDef); else errorDefs.add(attrDef); } } XSLTAttributeDef[] attrDefs = def.getAttributes(); int nAttrDefs = attrDefs.length; for (int i = 0; i < nAttrDefs; i++) { XSLTAttributeDef attrDef = attrDefs[i]; String defVal = attrDef.getDefault(); if (null != defVal) { if (!processedDefs.contains(attrDef)) { attrDef.setDefAttrValue(handler, target); } } if (attrDef.getRequired()) { if ((!processedDefs.contains(attrDef)) && (!errorDefs.contains(attrDef))) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null); } } return undefines; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException { return getCurrentProcessor().resolveEntity(this, publicId, systemId); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
XSLTElementProcessor getProcessorFor( String uri, String localName, String rawName) throws org.xml.sax.SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor(); XSLTElementDef def = currentProcessor.getElemDef(); XSLTElementProcessor elemProcessor = def.getProcessorFor(uri, localName); if (null == elemProcessor && !(currentProcessor instanceof ProcessorStylesheetDoc) && ((null == getStylesheet() || Double.valueOf(getStylesheet().getVersion()).doubleValue() > Constants.XSLTVERSUPPORTED) ||(!uri.equals(Constants.S_XSLNAMESPACEURL) && currentProcessor instanceof ProcessorStylesheetElement) || getElemVersion() > Constants.XSLTVERSUPPORTED )) { elemProcessor = def.getProcessorForUnknown(uri, localName); } if (null == elemProcessor) error(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_ALLOWED_IN_POSITION, new Object[]{rawName}),null);//rawName + " is not allowed in this position in the stylesheet!", return elemProcessor; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startDocument() throws org.xml.sax.SAXException { m_stylesheetLevel++; pushSpaceHandling(false); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // m_nsSupport.pushContext(); // this.getNamespaceSupport().declarePrefix(prefix, uri); //m_prefixMappings.add(prefix); // JDK 1.2+ only -sc //m_prefixMappings.add(uri); // JDK 1.2+ only -sc m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException { // m_nsSupport.popContext(); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void flushCharacters() throws org.xml.sax.SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startElement( String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { NamespaceSupport nssupport = this.getNamespaceSupport(); nssupport.pushContext(); int n = m_prefixMappings.size(); for (int i = 0; i < n; i++) { String prefix = (String)m_prefixMappings.elementAt(i++); String nsURI = (String)m_prefixMappings.elementAt(i); nssupport.declarePrefix(prefix, nsURI); } //m_prefixMappings.clear(); // JDK 1.2+ only -sc m_prefixMappings.removeAllElements(); // JDK 1.1.x compat -sc m_elementID++; // This check is currently done for all elements. We should possibly consider // limiting this check to xsl:stylesheet elements only since that is all it really // applies to. Also, it could be bypassed if m_shouldProcess is already true. // In other words, the next two statements could instead look something like this: // if (!m_shouldProcess) // { // if (localName.equals(Constants.ELEMNAME_STYLESHEET_STRING) && // url.equals(Constants.S_XSLNAMESPACEURL)) // { // checkForFragmentID(attributes); // if (!m_shouldProcess) // return; // } // else // return; // } // I didn't include this code statement at this time because in practice // it is a small performance hit and I was waiting to see if its absence // caused a problem. - GLP checkForFragmentID(attributes); if (!m_shouldProcess) return; flushCharacters(); pushSpaceHandling(attributes); XSLTElementProcessor elemProcessor = getProcessorFor(uri, localName, rawName); if(null != elemProcessor) // defensive, for better multiple error reporting. -sb { this.pushProcessor(elemProcessor); elemProcessor.startElement(this, uri, localName, rawName, attributes); } else { m_shouldProcess = false; popSpaceHandling(); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endElement(String uri, String localName, String rawName) throws org.xml.sax.SAXException { m_elementID--; if (!m_shouldProcess) return; if ((m_elementID + 1) == m_fragmentID) m_shouldProcess = false; flushCharacters(); popSpaceHandling(); XSLTElementProcessor p = getCurrentProcessor(); p.endElement(this, uri, localName, rawName); this.popProcessor(); this.getNamespaceSupport().popContext(); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; XSLTElementProcessor elemProcessor = getCurrentProcessor(); XSLTElementDef def = elemProcessor.getElemDef(); if (def.getType() != XSLTElementDef.T_PCDATA) elemProcessor = def.getProcessorFor(null, "text()"); if (null == elemProcessor) { // If it's whitespace, just ignore it, otherwise flag an error. if (!XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) error( XSLMessages.createMessage(XSLTErrorResources.ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION, null),null);//"Non-whitespace text is not allowed in this position in the stylesheet!", } else elemProcessor.characters(this, ch, start, length); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().ignorableWhitespace(this, ch, start, length); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; // Recreating Scott's kluge: // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced. // String localName = getLocalName(target); // String ns = m_stylesheet.getNamespaceFromStack(target); // // %REVIEW%: We need a better PI architecture String prefix="",ns="", localName=target; int colon=target.indexOf(':'); if(colon>=0) { ns=getNamespaceForPrefix(prefix=target.substring(0,colon)); localName=target.substring(colon+1); } try { // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced... but since the XML Namespaces // spec never defined namespaces as applying to PI's, and since // the testcase we're trying to support is inconsistant in whether // it binds the prefix, I'm going to make this sloppy for // testing purposes. if( "xalan-doc-cache-off".equals(target) || "xalan:doc-cache-off".equals(target) || ("doc-cache-off".equals(localName) && ns.equals("org.apache.xalan.xslt.extensions.Redirect") ) ) { if(!(m_elems.peek() instanceof ElemForEach)) throw new TransformerException ("xalan:doc-cache-off not allowed here!", getLocator()); ElemForEach elem = (ElemForEach)m_elems.peek(); elem.m_doc_cache_off = true; //System.out.println("JJK***** Recognized <? {"+ns+"}"+prefix+":"+localName+" "+data+"?>"); } } catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? } flushCharacters(); getCurrentProcessor().processingInstruction(this, target, data); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void skippedEntity(String name) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().skippedEntity(this, name); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warn(String msg, Object args[]) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createWarning(msg, args); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { if (null != handler) handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Exception e) throws org.xml.sax.SAXException { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); TransformerException pe; if (!(e instanceof TransformerException)) { pe = (null == e) ? new TransformerException(msg, locator) : new TransformerException(msg, locator, e); } else pe = (TransformerException) e; if (null != handler) { try { handler.error(pe); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else throw new org.xml.sax.SAXException(pe); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Object args[], Exception e) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createMessage(msg, args); error(formattedMsg, e); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.fatalError(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Just push, but don't append. handler.pushElemTemplateElement(elem); }
// in src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemParam v = (ElemParam) handler.getElemTemplateElement(); handler.getStylesheet().appendChild(v); handler.getStylesheet().setParam(v); super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Just push, but don't append. handler.pushElemTemplateElement(elem); }
// in src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemVariable v = (ElemVariable) handler.getElemTemplateElement(); handler.getStylesheet().appendChild(v); handler.getStylesheet().setVariable(v); super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { super.endElement(handler, uri, localName, rawName); handler.popElemTemplateElement(); handler.popStylesheet(); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws SAXException { //System.out.println("ProcessorFunction.startElement()"); String msg = ""; if (!(handler.getElemTemplateElement() instanceof Stylesheet)) { msg = "func:function element must be top level."; handler.error(msg, new SAXException(msg)); } super.startElement(handler, uri, localName, rawName, attributes); String val = attributes.getValue("name"); int indexOfColon = val.indexOf(":"); if (indexOfColon > 0) { //String prefix = val.substring(0, indexOfColon); //String localVal = val.substring(indexOfColon + 1); //String ns = handler.getNamespaceSupport().getURI(prefix); //if (ns.length() > 0) // System.out.println("fullfuncname " + ns + localVal); } else { msg = "func:function name must have namespace"; handler.error(msg, new SAXException(msg)); } }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws SAXException { //System.out.println("ProcessorFunction appendAndPush()" + elem); super.appendAndPush(handler, elem); //System.out.println("originating node " + handler.getOriginatingNode()); elem.setDOMBackPointer(handler.getOriginatingNode()); handler.getStylesheet().setTemplate((ElemTemplate) elem); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws SAXException { ElemTemplateElement function = handler.getElemTemplateElement(); validate(function, handler); // may throw exception super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void validate(ElemTemplateElement elem, StylesheetHandler handler) throws SAXException { String msg = ""; while (elem != null) { //System.out.println("elem " + elem); if (elem instanceof ElemExsltFuncResult && elem.getNextSiblingElem() != null && !(elem.getNextSiblingElem() instanceof ElemFallback)) { msg = "func:result has an illegal following sibling (only xsl:fallback allowed)"; handler.error(msg, new SAXException(msg)); } if((elem instanceof ElemApplyImport || elem instanceof ElemApplyTemplates || elem instanceof ElemAttribute || elem instanceof ElemCallTemplate || elem instanceof ElemComment || elem instanceof ElemCopy || elem instanceof ElemCopyOf || elem instanceof ElemElement || elem instanceof ElemLiteralResult || elem instanceof ElemNumber || elem instanceof ElemPI || elem instanceof ElemText || elem instanceof ElemTextLiteral || elem instanceof ElemValueOf) && !(ancestorIsOk(elem))) { msg ="misplaced literal result in a func:function container."; handler.error(msg, new SAXException(msg)); } ElemTemplateElement nextElem = elem.getFirstChildElem(); while (nextElem == null) { nextElem = elem.getNextSiblingElem(); if (nextElem == null) elem = elem.getParentElem(); if (elem == null || elem instanceof ElemExsltFunction) return; // ok } elem = nextElem; } }
// in src/org/apache/xalan/processor/ProcessorKey.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { KeyDeclaration kd = new KeyDeclaration(handler.getStylesheet(), handler.nextUid()); kd.setDOMBackPointer(handler.getOriginatingNode()); kd.setLocaterInfo(handler.getLocator()); setPropertiesFromAttributes(handler, rawName, attributes, kd); handler.getStylesheet().setKey(kd); }
// in src/org/apache/xalan/processor/ProcessorKey.java
void setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, org.apache.xalan.templates.ElemTemplateElement target) throws org.xml.sax.SAXException { XSLTElementDef def = getElemDef(); // Keep track of which XSLTAttributeDefs have been processed, so // I can see which default values need to be set. List processedDefs = new ArrayList(); int nAttrs = attributes.getLength(); for (int i = 0; i < nAttrs; i++) { String attrUri = attributes.getURI(i); String attrLocalName = attributes.getLocalName(i); XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName); if (null == attrDef) { // Then barf, because this element does not allow this attribute. handler.error(attributes.getQName(i) + "attribute is not allowed on the " + rawName + " element!", null); } else { String valueString = attributes.getValue(i); if (valueString.indexOf(org.apache.xpath.compiler.Keywords.FUNC_KEY_STRING + "(") >= 0) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_KEY_CALL, null), null); processedDefs.add(attrDef); attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); } } XSLTAttributeDef[] attrDefs = def.getAttributes(); int nAttrDefs = attrDefs.length; for (int i = 0; i < nAttrDefs; i++) { XSLTAttributeDef attrDef = attrDefs[i]; String defVal = attrDef.getDefault(); if (null != defVal) { if (!processedDefs.contains(attrDef)) { attrDef.setDefAttrValue(handler, target); } } if (attrDef.getRequired()) { if (!processedDefs.contains(attrDef)) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null); } } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (String systemId) throws org.xml.sax.SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (m_entityResolver != null) { return m_entityResolver.resolveEntity(publicId, systemId); } else { return null; } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (m_dtdHandler != null) { m_dtdHandler.notationDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (m_dtdHandler != null) { m_dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startDocument() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startDocument"); m_insideParse = true; // Thread listener = new Thread(m_transformer); if (m_contentHandler != null) { //m_transformer.setTransformThread(listener); if(m_incremental) { m_transformer.setSourceTreeDocForThread(m_dtm.getDocument()); int cpriority = Thread.currentThread().getPriority(); // runTransformThread is equivalent with the 2.0.1 code, // except that the Thread may come from a pool. m_transformer.runTransformThread( cpriority ); } // This is now done _last_, because IncrementalSAXSource_Filter // will immediately go into a "wait until events are requested" // pause. I believe that will close our timing window. // %REVIEW% m_contentHandler.startDocument(); } //listener.setDaemon(false); //listener.start(); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endDocument() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endDocument"); m_insideParse = false; if (m_contentHandler != null) { m_contentHandler.endDocument(); } if(m_incremental) { m_transformer.waitTransformThread(); } else { m_transformer.setSourceTreeDocForThread(m_dtm.getDocument()); m_transformer.run(); } /* Thread transformThread = m_transformer.getTransformThread(); if (null != transformThread) { try { // This should wait until the transformThread is considered not alive. transformThread.join(); if (!m_transformer.hasTransformThreadErrorCatcher()) { Exception e = m_transformer.getExceptionThrown(); if (null != e) throw new org.xml.sax.SAXException(e); } m_transformer.setTransformThread(null); } catch (InterruptedException ie){} }*/ }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startPrefixMapping: " + prefix + ", " + uri); if (m_contentHandler != null) { m_contentHandler.startPrefixMapping(prefix, uri); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endPrefixMapping(String prefix) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endPrefixMapping: " + prefix); if (m_contentHandler != null) { m_contentHandler.endPrefixMapping(prefix); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startElement( String uri, String localName, String qName, Attributes atts) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startElement: " + qName); if (m_contentHandler != null) { m_contentHandler.startElement(uri, localName, qName, atts); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endElement: " + qName); if (m_contentHandler != null) { m_contentHandler.endElement(uri, localName, qName); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void characters(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#characters: " + start + ", " + length); if (m_contentHandler != null) { m_contentHandler.characters(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#ignorableWhitespace: " + start + ", " + length); if (m_contentHandler != null) { m_contentHandler.ignorableWhitespace(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void processingInstruction(String target, String data) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#processingInstruction: " + target + ", " + data); if (m_contentHandler != null) { m_contentHandler.processingInstruction(target, data); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void skippedEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#skippedEntity: " + name); if (m_contentHandler != null) { m_contentHandler.skippedEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void warning(SAXParseException e) throws SAXException { // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).warning(e); } else { try { errorListener.warning(new javax.xml.transform.TransformerException(e)); } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void error(SAXParseException e) throws SAXException { // %REVIEW% I don't think this should be called. -sb // clearCoRoutine(e); // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).error(e); if(null != m_errorHandler) m_errorHandler.error(e); // may not be called. } else { try { errorListener.error(new javax.xml.transform.TransformerException(e)); if(null != m_errorHandler) m_errorHandler.error(e); // may not be called. } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void fatalError(SAXParseException e) throws SAXException { if(null != m_errorHandler) { try { m_errorHandler.fatalError(e); } catch(SAXParseException se) { // ignore } // clearCoRoutine(e); } // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).fatalError(e); if(null != m_errorHandler) m_errorHandler.fatalError(e); // may not be called. } else { try { errorListener.fatalError(new javax.xml.transform.TransformerException(e)); if(null != m_errorHandler) m_errorHandler.fatalError(e); // may not be called. } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startDTD: " + name + ", " + publicId + ", " + systemId); if (null != m_lexicalHandler) { m_lexicalHandler.startDTD(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endDTD() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endDTD"); if (null != m_lexicalHandler) { m_lexicalHandler.endDTD(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startEntity: " + name); if (null != m_lexicalHandler) { m_lexicalHandler.startEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endEntity: " + name); if (null != m_lexicalHandler) { m_lexicalHandler.endEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startCDATA() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startCDATA"); if (null != m_lexicalHandler) { m_lexicalHandler.startCDATA(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endCDATA() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endCDATA"); if (null != m_lexicalHandler) { m_lexicalHandler.endCDATA(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void comment(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#comment: " + start + ", " + length); if (null != m_lexicalHandler) { m_lexicalHandler.comment(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void elementDecl(String name, String model) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", " + model); if (null != m_declHandler) { m_declHandler.elementDecl(name, model); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#attributeDecl: " + eName + ", " + aName + ", etc..."); if (null != m_declHandler) { m_declHandler.attributeDecl(eName, aName, type, valueDefault, value); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void internalEntityDecl(String name, String value) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#internalEntityDecl: " + name + ", " + value); if (null != m_declHandler) { m_declHandler.internalEntityDecl(name, value); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#externalEntityDecl: " + name + ", " + publicId + ", " + systemId); if (null != m_declHandler) { m_declHandler.externalEntityDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
public void traverse(int pos) throws org.xml.sax.SAXException { m_dtm = m_transformer.getXPathContext().getDTM(pos); m_startNode = pos; super.traverse(pos); }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void endNode(int node) throws org.xml.sax.SAXException { super.endNode(node); if(DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { m_transformer.getXPathContext().popCurrentNode(); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void startNode(int node) throws org.xml.sax.SAXException { XPathContext xcntxt = m_transformer.getXPathContext(); try { if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { xcntxt.pushCurrentNode(node); if(m_startNode != node) { super.startNode(node); } else { String elemName = m_dtm.getNodeName(node); String localName = m_dtm.getLocalName(node); String namespace = m_dtm.getNamespaceURI(node); //xcntxt.pushCurrentNode(node); // SAX-like call to allow adding attributes afterwards m_handler.startElement(namespace, localName, elemName); boolean hasNSDecls = false; DTM dtm = m_dtm; for (int ns = dtm.getFirstNamespaceNode(node, true); DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true)) { SerializerUtils.ensureNamespaceDeclDeclared(m_handler,dtm, ns); } for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr)) { SerializerUtils.addAttribute(m_handler, attr); } } } else { xcntxt.pushCurrentNode(node); super.startNode(node); xcntxt.popCurrentNode(); } } catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (null != m_resultDTDHandler) m_resultDTDHandler.notationDecl(name, publicId, systemId); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null != m_resultDTDHandler) m_resultDTDHandler.unparsedEntityDecl(name, publicId, systemId, notationName); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endDocument() throws SAXException { flushStartDoc(); m_resultContentHandler.endDocument(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { flushStartDoc(); m_resultContentHandler.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endPrefixMapping(String prefix) throws SAXException { flushStartDoc(); m_resultContentHandler.endPrefixMapping(prefix); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (!m_foundFirstElement && null != m_serializer) { m_foundFirstElement = true; Serializer newSerializer; try { newSerializer = SerializerSwitcher.switchSerializerIfHTML(uri, localName, m_outputFormat.getProperties(), m_serializer); } catch (TransformerException te) { throw new SAXException(te); } if (newSerializer != m_serializer) { try { m_resultContentHandler = newSerializer.asContentHandler(); } catch (IOException ioe) // why? { throw new SAXException(ioe); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; m_serializer = newSerializer; } } flushStartDoc(); m_resultContentHandler.startElement(uri, localName, qName, attributes); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { m_resultContentHandler.endElement(uri, localName, qName); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void characters(char ch[], int start, int length) throws SAXException { flushStartDoc(); m_resultContentHandler.characters(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { m_resultContentHandler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void processingInstruction(String target, String data) throws SAXException { flushStartDoc(); m_resultContentHandler.processingInstruction(target, data); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void skippedEntity(String name) throws SAXException { flushStartDoc(); m_resultContentHandler.skippedEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { flushStartDoc(); if (null != m_resultLexicalHandler) m_resultLexicalHandler.startDTD(name, publicId, systemId); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endDTD() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endDTD(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startEntity(String name) throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.startEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endEntity(String name) throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startCDATA() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.startCDATA(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endCDATA() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endCDATA(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void comment(char ch[], int start, int length) throws SAXException { flushStartDoc(); if (null != m_resultLexicalHandler) m_resultLexicalHandler.comment(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void elementDecl (String name, String model) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.elementDecl(name, model); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void attributeDecl (String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.attributeDecl(eName, aName, type, valueDefault, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void internalEntityDecl (String name, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.internalEntityDecl(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void externalEntityDecl (String name, String publicId, String systemId) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.externalEntityDecl(name, publicId, systemId); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void outputResultTreeFragment( SerializationHandler handler, XObject obj, XPathContext support) throws org.xml.sax.SAXException { int doc = obj.rtf(); DTM dtm = support.getDTM(doc); if (null != dtm) { for (int n = dtm.getFirstChild(doc); DTM.NULL != n; n = dtm.getNextSibling(n)) { handler.flushPending(); // I think. . . . This used to have a (true) arg // to flush prefixes, will that cause problems ??? if (dtm.getNodeType(n) == DTM.ELEMENT_NODE && dtm.getNamespaceURI(n) == null) handler.startPrefixMapping("", ""); dtm.dispatchToEvents(n, handler); } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void ensureNamespaceDeclDeclared( SerializationHandler handler, DTM dtm, int namespace) throws org.xml.sax.SAXException { String uri = dtm.getNodeValue(namespace); String prefix = dtm.getNodeNameX(namespace); if ((uri != null && uri.length() > 0) && (null != prefix)) { String foundURI; NamespaceMappings ns = handler.getNamespaceMappings(); if (ns != null) { foundURI = ns.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(uri)) { handler.startPrefixMapping(prefix, uri, false); } } } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
protected static void dispatchNodeData( Node node, ContentHandler ch, int depth )throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_FRAGMENT_NODE : case Node.DOCUMENT_NODE : case Node.ELEMENT_NODE : { for (Node child = node.getFirstChild(); null != child; child = child.getNextSibling()) { dispatchNodeData(child, ch, depth+1); } } break; case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW% case Node.COMMENT_NODE : if(0 != depth) break; // NOTE: Because this operation works in the DOM space, it does _not_ attempt // to perform Text Coalition. That should only be done in DTM space. case Node.TEXT_NODE : case Node.CDATA_SECTION_NODE : case Node.ATTRIBUTE_NODE : String str = node.getNodeValue(); if(ch instanceof CharacterNodeHandler) { ((CharacterNodeHandler)ch).characters(node); } else { ch.characters(str.toCharArray(), 0, str.length()); } break; // /* case Node.PROCESSING_INSTRUCTION_NODE : // // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING); // break; */ default : // ignore break; } }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dispatchToEvents( int parm1, ContentHandler parm2 )throws org.xml.sax.SAXException { if (DEBUG) { System.out.println( "dispathcToEvents(" + parm1 + "," + parm2 + ")"); } return; }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dispatchCharactersEvents( int nodeHandle, ContentHandler ch, boolean normalize )throws org.xml.sax.SAXException { if (DEBUG) { System.out.println("dispatchCharacterEvents(" + nodeHandle + "," + ch + "," + normalize + ")"); } if(normalize) { XMLString str = getStringValue(nodeHandle); str = str.fixWhiteSpace(true, true, false); str.dispatchCharactersEvents(ch); } else { Node node = getNode(nodeHandle); dispatchNodeData(node, ch, 0); } }
// in src/org/apache/xpath/objects/XObject.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { xstr().dispatchCharactersEvents(ch); }
// in src/org/apache/xpath/objects/XStringForFSB.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { fsb().sendSAXcharacters(ch, m_start, m_length); }
// in src/org/apache/xpath/objects/XStringForFSB.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { fsb().sendSAXComment(lh, m_start, m_length); }
// in src/org/apache/xpath/objects/XString.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { String str = str(); ch.characters(str.toCharArray(), 0, str.length()); }
// in src/org/apache/xpath/objects/XString.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { String str = str(); lh.comment(str.toCharArray(), 0, str.length()); }
// in src/org/apache/xpath/objects/XStringForChars.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { ch.characters((char[])m_obj, m_start, m_length); }
// in src/org/apache/xpath/objects/XStringForChars.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { lh.comment((char[])m_obj, m_start, m_length); }
// in src/org/apache/xpath/objects/XNodeSet.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { int node = item(0); if(node != DTM.NULL) { m_dtmMgr.getDTM(node).dispatchCharactersEvents(node, ch, false); } }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { if(Arg0IsNodesetExpr()) { int node = getArg0AsNode(xctxt); if(DTM.NULL != node) { DTM dtm = xctxt.getDTM(node); dtm.dispatchCharactersEvents(node, handler, true); } } else { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public void executeCharsToContentHandler( XPathContext xctxt, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { LocPathIterator clone = (LocPathIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); clone.setRoot(current, xctxt); int node = clone.nextNode(); DTM dtm = clone.getDTM(node); clone.detach(); if(node != DTM.NULL) { dtm.dispatchCharactersEvents(node, handler, false); } }
// in src/org/apache/xpath/Expression.java
public void executeCharsToContentHandler( XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); obj.detach(); }
(Domain) DTMDOMException 43
              
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node cloneNode(boolean deep) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element getDocumentElement() { int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle)) { switch(dtm.getNodeType(kidhandle)) { case Node.ELEMENT_NODE: if(elementhandle!=DTM.NULL) { elementhandle=DTM.NULL; // More than one; ill-formed. kidhandle=dtm.getLastChild(dochandle); // End loop } else elementhandle=kidhandle; break; // These are harmless; document is still wellformed case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: case Node.DOCUMENT_TYPE_NODE: break; default: elementhandle=DTM.NULL; // ill-formed kidhandle=dtm.getLastChild(dochandle); // End loop break; } } if(elementhandle==DTM.NULL) throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); else return (Element)(dtm.getNode(elementhandle)); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final DocumentFragment createDocumentFragment() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text createTextNode(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Comment createComment(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void normalize() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setValue(String value) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public String getInputEncoding() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public boolean getStrictErrorChecking() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setStrictErrorChecking(boolean strictErrorChecking) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public DocumentType createDocumentType(String qualifiedName,String publicId, String systemId) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Document createDocument(String namespaceURI,String qualfiedName,DocumentType doctype) { // Could create a DTM... but why, when it'd have to be permanantly empty? throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public NodeFilter getFilter() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node nextNode() throws DOMException { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.nextNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node previousNode() { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.previousNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
0 0
(Lib) TransformerConfigurationException 36
              
// in src/org/apache/xalan/xsltc/trax/Util.java
public static InputSource getInputSource(XSLTC xsltc, Source source) throws TransformerConfigurationException { InputSource input = null; String systemId = source.getSystemId(); try { // Try to get InputSource from SAXSource input if (source instanceof SAXSource) { final SAXSource sax = (SAXSource)source; input = sax.getInputSource(); // Pass the SAX parser to the compiler try { XMLReader reader = sax.getXMLReader(); /* * Fix for bug 24695 * According to JAXP 1.2 specification if a SAXSource * is created using a SAX InputSource the Transformer or * TransformerFactory creates a reader via the * XMLReaderFactory if setXMLReader is not used */ if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); } catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } } } reader.setFeature ("http://xml.org/sax/features/namespaces",true); reader.setFeature ("http://xml.org/sax/features/namespace-prefixes",false); xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); } } // handle DOMSource else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource)source; final Document dom = (Document)domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(dom); xsltc.setXMLReader(dom2sax); // Try to get SAX InputSource from DOM Source. input = SAXSource.sourceToInputSource(source); if (input == null){ input = new InputSource(domsrc.getSystemId()); } } // Try to get InputStream or Reader from StreamSource else if (source instanceof StreamSource) { final StreamSource stream = (StreamSource)source; final InputStream istream = stream.getInputStream(); final Reader reader = stream.getReader(); xsltc.setXMLReader(null); // Clear old XML reader // Create InputSource from Reader or InputStream in Source if (istream != null) { input = new InputSource(istream); } else if (reader != null) { input = new InputSource(reader); } else { input = new InputSource(systemId); } } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR); throw new TransformerConfigurationException(err.toString()); } input.setSystemId(systemId); } catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); } catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); } return input; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void defineTransletClasses() throws TransformerConfigurationException { if (_bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR); throw new TransformerConfigurationException(err.toString()); } TransletClassLoader loader = (TransletClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new TransletClassLoader(ObjectFactory.findClassLoader()); } }); try { final int classCount = _bytecodes.length; _class = new Class[classCount]; if (classCount > 1) { _auxClasses = new Hashtable(); } for (int i = 0; i < classCount; i++) { _class[i] = loader.defineClass(_bytecodes[i]); final Class superClass = _class[i].getSuperclass(); // Check if this is the main class if (superClass.getName().equals(ABSTRACT_TRANSLET)) { _transletIndex = i; } else { _auxClasses.put(_class[i].getName(), _class[i]); } } if (_transletIndex < 0) { ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name); throw new TransformerConfigurationException(err.toString()); } } catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private Translet getTransletInstance() throws TransformerConfigurationException { try { if (_name == null) return null; if (_class == null) defineTransletClasses(); // The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance(); translet.postInitialization(); translet.setTemplates(this); if (_auxClasses != null) { translet.setAuxiliaryClasses(_auxClasses); } return translet; } catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseId; XMLReader reader = null; InputSource isource = null; /** * Fix for bugzilla bug 24187 */ StylesheetPIHandler _stylesheetPIHandler = new StylesheetPIHandler(null,media,title,charset); try { if (source instanceof DOMSource ) { final DOMSource domsrc = (DOMSource) source; baseId = domsrc.getSystemId(); final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); _stylesheetPIHandler.setBaseId(baseId); dom2sax.setContentHandler( _stylesheetPIHandler); dom2sax.parse(); } else { isource = SAXSource.sourceToInputSource(source); baseId = isource.getSystemId(); SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); if (reader == null) { reader = XMLReaderFactory.createXMLReader(); } _stylesheetPIHandler.setBaseId(baseId); reader.setContentHandler(_stylesheetPIHandler); reader.parse(isource); } if (_uriResolver != null ) { _stylesheetPIHandler.setURIResolver(_uriResolver); } } catch (StopParseException e ) { // startElement encountered so do not parse further } catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return _stylesheetPIHandler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { // If the _useClasspath attribute is true, try to load the translet from // the CLASSPATH and create a template object using the loaded // translet. if (_useClasspath) { String transletName = getTransletBaseName(source); if (_packageName != null) transletName = _packageName + "." + transletName; try { final Class clazz = ObjectFactory.findProviderClass( transletName, ObjectFactory.findClassLoader(), true); resetTransientAttributes(); return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this); } catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); } catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); } } // If _autoTranslet is true, we will try to load the bytecodes // from the translet classes without compiling the stylesheet. if (_autoTranslet) { byte[][] bytecodes = null; String transletClassName = getTransletBaseName(source); if (_packageName != null) transletClassName = _packageName + "." + transletClassName; if (_jarFileName != null) bytecodes = getBytecodesFromJar(source, transletClassName); else bytecodes = getBytecodesFromClasses(source, transletClassName); if (bytecodes != null) { if (_debug) { if (_jarFileName != null) System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName)); else System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName)); } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this); } } // Create and initialize a stylesheet compiler final XSLTC xsltc = new XSLTC(); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); else xsltc.setTemplateInlining(false); if (_isSecureProcessing) xsltc.setSecureProcessing(true); xsltc.init(); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { xsltc.setSourceLoader(this); } // Pass parameters to the Parser to make sure it locates the correct // <?xml-stylesheet ...?> PI in an XML input document if ((_piParams != null) && (_piParams.get(source) != null)) { // Get the parameters for this Source object PIParamWrapper p = (PIParamWrapper)_piParams.get(source); // Pass them on to the compiler (which will pass then to the parser) if (p != null) { xsltc.setPIParameters(p._media, p._title, p._charset); } } // Set the attributes for translet generation int outputType = XSLTC.BYTEARRAY_OUTPUT; if (_generateTranslet || _autoTranslet) { // Set the translet name xsltc.setClassName(getTransletBaseName(source)); if (_destinationDirectory != null) xsltc.setDestDirectory(_destinationDirectory); else { String xslName = getStylesheetFileName(source); if (xslName != null) { File xslFile = new File(xslName); String xslDir = xslFile.getParent(); if (xslDir != null) xsltc.setDestDirectory(xslDir); } } if (_packageName != null) xsltc.setPackageName(_packageName); if (_jarFileName != null) { xsltc.setJarFileName(_jarFileName); outputType = XSLTC.BYTEARRAY_AND_JAR_OUTPUT; } else outputType = XSLTC.BYTEARRAY_AND_FILE_OUTPUT; } // Compile the stylesheet final InputSource input = Util.getInputSource(xsltc, source); byte[][] bytecodes = xsltc.compile(null, input, outputType); final String transletName = xsltc.getClassName(); // Output to the jar file if the jar file name is set. if ((_generateTranslet || _autoTranslet) && bytecodes != null && _jarFileName != null) { try { xsltc.outputToJar(); } catch (java.io.IOException e) { } } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); // Pass compiler warnings to the error listener if (_errorListener != this) { try { passWarningsToListener(xsltc.getWarnings()); } catch (TransformerException e) { throw new TransformerConfigurationException(e); } } else { xsltc.printWarnings(); } // Check that the transformation went well before returning if (bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); TransformerConfigurationException exc = new TransformerConfigurationException(err.toString()); // Pass compiler errors to the error listener if (_errorListener != null) { passErrorsToListener(xsltc.getErrors()); // As required by TCK 1.2, send a fatalError to the // error listener because compilation of the stylesheet // failed and no further processing will be possible. try { _errorListener.fatalError(exc); } catch (TransformerException te) { // well, we tried. } } else { xsltc.printErrors(); } throw exc; } return new TemplatesImpl(bytecodes, transletName, xsltc.getOutputProperties(), _indentNumber, this); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public javax.xml.transform.Templates processFromNode(Node node) throws TransformerConfigurationException { try { TemplatesHandler builder = newTemplatesHandler(); TreeWalker walker = new TreeWalker(builder, new org.apache.xml.utils.DOM2Helper(), builder.getSystemId()); walker.traverse(node); return builder.getTemplates(); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } } catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; } /* catch (TransformerException tce) { // Assume it's already been reported to the error listener. throw new TransformerConfigurationException(tce.getMessage(), tce); }*/ catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new TrAXFilter(templates); } catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
30
              
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
48
              
// in src/org/apache/xalan/xsltc/trax/Util.java
public static InputSource getInputSource(XSLTC xsltc, Source source) throws TransformerConfigurationException { InputSource input = null; String systemId = source.getSystemId(); try { // Try to get InputSource from SAXSource input if (source instanceof SAXSource) { final SAXSource sax = (SAXSource)source; input = sax.getInputSource(); // Pass the SAX parser to the compiler try { XMLReader reader = sax.getXMLReader(); /* * Fix for bug 24695 * According to JAXP 1.2 specification if a SAXSource * is created using a SAX InputSource the Transformer or * TransformerFactory creates a reader via the * XMLReaderFactory if setXMLReader is not used */ if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); } catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } } } reader.setFeature ("http://xml.org/sax/features/namespaces",true); reader.setFeature ("http://xml.org/sax/features/namespace-prefixes",false); xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); } } // handle DOMSource else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource)source; final Document dom = (Document)domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(dom); xsltc.setXMLReader(dom2sax); // Try to get SAX InputSource from DOM Source. input = SAXSource.sourceToInputSource(source); if (input == null){ input = new InputSource(domsrc.getSystemId()); } } // Try to get InputStream or Reader from StreamSource else if (source instanceof StreamSource) { final StreamSource stream = (StreamSource)source; final InputStream istream = stream.getInputStream(); final Reader reader = stream.getReader(); xsltc.setXMLReader(null); // Clear old XML reader // Create InputSource from Reader or InputStream in Source if (istream != null) { input = new InputSource(istream); } else if (reader != null) { input = new InputSource(reader); } else { input = new InputSource(systemId); } } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR); throw new TransformerConfigurationException(err.toString()); } input.setSystemId(systemId); } catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); } catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); } return input; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void defineTransletClasses() throws TransformerConfigurationException { if (_bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR); throw new TransformerConfigurationException(err.toString()); } TransletClassLoader loader = (TransletClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new TransletClassLoader(ObjectFactory.findClassLoader()); } }); try { final int classCount = _bytecodes.length; _class = new Class[classCount]; if (classCount > 1) { _auxClasses = new Hashtable(); } for (int i = 0; i < classCount; i++) { _class[i] = loader.defineClass(_bytecodes[i]); final Class superClass = _class[i].getSuperclass(); // Check if this is the main class if (superClass.getName().equals(ABSTRACT_TRANSLET)) { _transletIndex = i; } else { _auxClasses.put(_class[i].getName(), _class[i]); } } if (_transletIndex < 0) { ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name); throw new TransformerConfigurationException(err.toString()); } } catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private Translet getTransletInstance() throws TransformerConfigurationException { try { if (_name == null) return null; if (_class == null) defineTransletClasses(); // The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance(); translet.postInitialization(); translet.setTemplates(this); if (_auxClasses != null) { translet.setAuxiliaryClasses(_auxClasses); } return translet; } catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
public synchronized Transformer newTransformer() throws TransformerConfigurationException { TransformerImpl transformer; transformer = new TransformerImpl(getTransletInstance(), _outputProperties, _indentNumber, _tfactory); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } if (_tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) { transformer.setSecureProcessing(true); } return transformer; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseId; XMLReader reader = null; InputSource isource = null; /** * Fix for bugzilla bug 24187 */ StylesheetPIHandler _stylesheetPIHandler = new StylesheetPIHandler(null,media,title,charset); try { if (source instanceof DOMSource ) { final DOMSource domsrc = (DOMSource) source; baseId = domsrc.getSystemId(); final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); _stylesheetPIHandler.setBaseId(baseId); dom2sax.setContentHandler( _stylesheetPIHandler); dom2sax.parse(); } else { isource = SAXSource.sourceToInputSource(source); baseId = isource.getSystemId(); SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); if (reader == null) { reader = XMLReaderFactory.createXMLReader(); } _stylesheetPIHandler.setBaseId(baseId); reader.setContentHandler(_stylesheetPIHandler); reader.parse(isource); } if (_uriResolver != null ) { _stylesheetPIHandler.setURIResolver(_uriResolver); } } catch (StopParseException e ) { // startElement encountered so do not parse further } catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return _stylesheetPIHandler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { TransformerImpl result = new TransformerImpl(new Properties(), _indentNumber, this); if (_uriResolver != null) { result.setURIResolver(_uriResolver); } if (_isSecureProcessing) { result.setSecureProcessing(true); } return result; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { final Templates templates = newTemplates(source); final Transformer transformer = templates.newTransformer(); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return(transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { // If the _useClasspath attribute is true, try to load the translet from // the CLASSPATH and create a template object using the loaded // translet. if (_useClasspath) { String transletName = getTransletBaseName(source); if (_packageName != null) transletName = _packageName + "." + transletName; try { final Class clazz = ObjectFactory.findProviderClass( transletName, ObjectFactory.findClassLoader(), true); resetTransientAttributes(); return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this); } catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); } catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); } } // If _autoTranslet is true, we will try to load the bytecodes // from the translet classes without compiling the stylesheet. if (_autoTranslet) { byte[][] bytecodes = null; String transletClassName = getTransletBaseName(source); if (_packageName != null) transletClassName = _packageName + "." + transletClassName; if (_jarFileName != null) bytecodes = getBytecodesFromJar(source, transletClassName); else bytecodes = getBytecodesFromClasses(source, transletClassName); if (bytecodes != null) { if (_debug) { if (_jarFileName != null) System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName)); else System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName)); } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this); } } // Create and initialize a stylesheet compiler final XSLTC xsltc = new XSLTC(); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); else xsltc.setTemplateInlining(false); if (_isSecureProcessing) xsltc.setSecureProcessing(true); xsltc.init(); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { xsltc.setSourceLoader(this); } // Pass parameters to the Parser to make sure it locates the correct // <?xml-stylesheet ...?> PI in an XML input document if ((_piParams != null) && (_piParams.get(source) != null)) { // Get the parameters for this Source object PIParamWrapper p = (PIParamWrapper)_piParams.get(source); // Pass them on to the compiler (which will pass then to the parser) if (p != null) { xsltc.setPIParameters(p._media, p._title, p._charset); } } // Set the attributes for translet generation int outputType = XSLTC.BYTEARRAY_OUTPUT; if (_generateTranslet || _autoTranslet) { // Set the translet name xsltc.setClassName(getTransletBaseName(source)); if (_destinationDirectory != null) xsltc.setDestDirectory(_destinationDirectory); else { String xslName = getStylesheetFileName(source); if (xslName != null) { File xslFile = new File(xslName); String xslDir = xslFile.getParent(); if (xslDir != null) xsltc.setDestDirectory(xslDir); } } if (_packageName != null) xsltc.setPackageName(_packageName); if (_jarFileName != null) { xsltc.setJarFileName(_jarFileName); outputType = XSLTC.BYTEARRAY_AND_JAR_OUTPUT; } else outputType = XSLTC.BYTEARRAY_AND_FILE_OUTPUT; } // Compile the stylesheet final InputSource input = Util.getInputSource(xsltc, source); byte[][] bytecodes = xsltc.compile(null, input, outputType); final String transletName = xsltc.getClassName(); // Output to the jar file if the jar file name is set. if ((_generateTranslet || _autoTranslet) && bytecodes != null && _jarFileName != null) { try { xsltc.outputToJar(); } catch (java.io.IOException e) { } } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); // Pass compiler warnings to the error listener if (_errorListener != this) { try { passWarningsToListener(xsltc.getWarnings()); } catch (TransformerException e) { throw new TransformerConfigurationException(e); } } else { xsltc.printWarnings(); } // Check that the transformation went well before returning if (bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); TransformerConfigurationException exc = new TransformerConfigurationException(err.toString()); // Pass compiler errors to the error listener if (_errorListener != null) { passErrorsToListener(xsltc.getErrors()); // As required by TCK 1.2, send a fatalError to the // error listener because compilation of the stylesheet // failed and no further processing will be possible. try { _errorListener.fatalError(exc); } catch (TransformerException te) { // well, we tried. } } else { xsltc.printErrors(); } throw exc; } return new TemplatesImpl(bytecodes, transletName, xsltc.getOutputProperties(), _indentNumber, this); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { final TemplatesHandlerImpl handler = new TemplatesHandlerImpl(_indentNumber, this); if (_uriResolver != null) { handler.setURIResolver(_uriResolver); } return handler; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { final Transformer transformer = newTransformer(); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { final Transformer transformer = newTransformer(src); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { final Transformer transformer = templates.newTransformer(); final TransformerImpl internal = (TransformerImpl)transformer; return new TransformerHandlerImpl(internal); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if (templates == null) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new org.apache.xalan.xsltc.trax.TrAXFilter(templates); } catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { if (_currFactory == null) { createXSLTCTransformerFactory(); } return _currFactory.getAssociatedStylesheet(source, media, title, charset); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } _currFactory = _xalanFactory; return _currFactory.newTransformer(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } _currFactory = _xalanFactory; return _currFactory.newTransformer(source); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } _currFactory = _xsltcFactory; return _currFactory.newTemplates(source); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } return _xsltcFactory.newTemplatesHandler(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } return _xalanFactory.newTransformerHandler(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } return _xalanFactory.newTransformerHandler(src); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } return _xsltcFactory.newTransformerHandler(templates); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } Templates templates = _xsltcFactory.newTemplates(src); if (templates == null ) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new org.apache.xalan.xsltc.trax.TrAXFilter(templates); } catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
protected Stylesheet getStylesheetRoot(StylesheetHandler handler) throws TransformerConfigurationException { StylesheetRoot stylesheet; stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener()); if (handler.getStylesheetProcessor().isSecureProcessing()) stylesheet.setSecureProcessing(true); return stylesheet; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public javax.xml.transform.Templates processFromNode(Node node) throws TransformerConfigurationException { try { TemplatesHandler builder = newTemplatesHandler(); TreeWalker walker = new TreeWalker(builder, new org.apache.xml.utils.DOM2Helper(), builder.getSystemId()); walker.traverse(node); return builder.getTemplates(); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } } catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; } /* catch (TransformerException tce) { // Assume it's already been reported to the error listener. throw new TransformerConfigurationException(tce.getMessage(), tce); }*/ catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
javax.xml.transform.Templates processFromNode(Node node, String systemID) throws TransformerConfigurationException { m_DOMsystemID = systemID; return processFromNode(node); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { return new StylesheetHandler(this); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new TrAXFilter(templates); } catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newTransformerHandler(templates); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
protected Stylesheet getStylesheetRoot(StylesheetHandler handler) throws TransformerConfigurationException { StylesheetRoot stylesheet; stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener()); if (handler.getStylesheetProcessor().isSecureProcessing()) stylesheet.setSecureProcessing(true); return stylesheet; }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
(Domain) TypeCheckError 34
              
// in src/org/apache/xalan/xsltc/compiler/DocumentCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // At least one argument - two at most final int ac = argumentCount(); if ((ac < 1) || (ac > 2)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } if (getStylesheet() == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } // Parse the first argument _arg1 = argument(0); if (_arg1 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } _arg1Type = _arg1.typeCheck(stable); if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) { _arg1 = new CastExpr(_arg1, Type.String); } // Parse the second argument if (ac == 2) { _arg2 = argument(1); if (_arg2 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } final Type arg2Type = _arg2.typeCheck(stable); if (arg2Type.identicalTo(Type.Node)) { _arg2 = new CastExpr(_arg2, Type.NodeSet); } else if (arg2Type.identicalTo(Type.NodeSet)) { // falls through } else { ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argument() instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "element-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) { return _type; } if (_arg instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "function-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/NameBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check the argument type (if any) switch(argumentCount()) { case 0: _paramType = Type.Node; break; case 1: _paramType = _param.typeCheck(stable); break; default: throw new TypeCheckError(this); } // The argument has to be a node, a node-set or a node reference if ((_paramType != Type.NodeSet) && (_paramType != Type.Node) && (_paramType != Type.Reference)) { throw new TypeCheckError(this); } return (_type = Type.String); }
// in src/org/apache/xalan/xsltc/compiler/ForEach.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType || _type instanceof NodeType) { _select = new CastExpr(_select, Type.NodeSet); typeCheckContents(stable); return Type.Void; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); return Type.Void; } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ref != null) { final String name = _variableName.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR, name, this); } if ((_ref = resolve(getParser(), stable)) != null) { return (_type = _ref.typeCheck(stable)); } throw new TypeCheckError(reportError()); }
// in src/org/apache/xalan/xsltc/compiler/CastExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.getType(); if (tleft == null) { tleft = _left.typeCheck(stable); } if (tleft instanceof NodeType) { tleft = Type.Node; // multiple instances } else if (tleft instanceof ResultTreeType) { tleft = Type.ResultTree; // multiple instances } if (InternalTypeMap.maps(tleft, _type) != null) { return _type; } // throw new TypeCheckError(this); throw new TypeCheckError(new ErrorMsg( ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString())); }
// in src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); //bug fix # 2838, cast to reals if both are result tree fragments if (tleft instanceof ResultTreeType && tright instanceof ResultTreeType ) { _right = new CastExpr(_right, Type.Real); _left = new CastExpr(_left, Type.Real); return _type = Type.Boolean; } // If one is of reference type, then convert the other too if (hasReferenceArgs()) { Type type = null; Type typeL = null; Type typeR = null; if (tleft instanceof ReferenceType) { if (_left instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_left; VariableBase var = ref.getVariable(); typeL = var.getType(); } } if (tright instanceof ReferenceType) { if (_right instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_right; VariableBase var = ref.getVariable(); typeR = var.getType(); } } // bug fix # 2838 if (typeL == null) type = typeR; else if (typeR == null) type = typeL; else { type = Type.Real; } if (type == null) type = Type.Real; _right = new CastExpr(_right, type); _left = new CastExpr(_left, type); return _type = Type.Boolean; } if (hasNodeSetArgs()) { // Ensure that the node-set is the left argument if (tright instanceof NodeSetType) { final Expression temp = _right; _right = _left; _left = temp; _op = (_op == Operators.GT) ? Operators.LT : (_op == Operators.LT) ? Operators.GT : (_op == Operators.GE) ? Operators.LE : Operators.GE; tright = _right.getType(); } // Promote nodes to node sets if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // Promote integer to doubles to have fewer compares if (tright instanceof IntType) { _right = new CastExpr(_right, Type.Real); } // Promote result-trees to strings if (tright instanceof ResultTreeType) { _right = new CastExpr(_right, Type.String); } return _type = Type.Boolean; } // In the node-boolean case, convert node to boolean first if (hasNodeArgs()) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); tright = Type.Boolean; } if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); tleft = Type.Boolean; } } // Lookup the table of primops to find the best match MethodType ptype = lookupPrimop(stable, Operators.getOpNames(_op), new MethodType(Type.Void, tleft, tright)); if (ptype != null) { Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); throw new TypeCheckError(err); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError { _fname.clearNamespace(); // HACK!!! final int n = _arguments.size(); final Vector argsType = typeCheckArgs(stable); final MethodType args = new MethodType(Type.Void, argsType); final MethodType ptype = lookupPrimop(stable, _fname.getLocalPart(), args); if (ptype != null) { for (int i = 0; i < n; i++) { final Type argType = (Type) ptype.argsType().elementAt(i); final Expression exp = (Expression)_arguments.elementAt(i); if (!argType.identicalTo(exp.getType())) { try { _arguments.setElementAt(new CastExpr(exp, argType), i); } catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion } } } _chosenMethodType = ptype; return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{ final Vector constructors = findConstructors(); if (constructors == null) { // Constructor not found in this class throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND, _className); } final int nConstructors = constructors.size(); final int nArgs = _arguments.size(); final Vector argsType = typeCheckArgs(stable); // Try all constructors int bestConstrDistance = Integer.MAX_VALUE; _type = null; // reset for (int j, i = 0; i < nConstructors; i++) { // Check if all parameters to this constructor can be converted final Constructor constructor = (Constructor)constructors.elementAt(i); final Class[] paramTypes = constructor.getParameterTypes(); Class extType = null; int currConstrDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currConstrDistance += ((JavaType)match).distance; } else if (intType instanceof ObjectType) { ObjectType objectType = (ObjectType)intType; if (objectType.getJavaClass() == extType) continue; else if (extType.isAssignableFrom(objectType.getJavaClass())) currConstrDistance += 1; else { currConstrDistance = Integer.MAX_VALUE; break; } } else { // no mapping available currConstrDistance = Integer.MAX_VALUE; break; } } if (j == nArgs && currConstrDistance < bestConstrDistance ) { _chosenConstructor = constructor; _isExtConstructor = true; bestConstrDistance = currConstrDistance; _type = (_clazz != null) ? Type.newObjectType(_clazz) : Type.newObjectType(_className); } } if (_type != null) { return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError { int nArgs = _arguments.size(); final String name = _fname.getLocalPart(); // check if function is a contructor 'new' if (_fname.getLocalPart().equals("new")) { return typeCheckConstructor(stable); } // check if we are calling an instance method else { boolean hasThisArgument = false; if (nArgs == 0) _isStatic = true; if (!_isStatic) { if (_namespace_format == NAMESPACE_FORMAT_JAVA || _namespace_format == NAMESPACE_FORMAT_PACKAGE) hasThisArgument = true; Expression firstArg = (Expression)_arguments.elementAt(0); Type firstArgType = (Type)firstArg.typeCheck(stable); if (_namespace_format == NAMESPACE_FORMAT_CLASS && firstArgType instanceof ObjectType && _clazz != null && _clazz.isAssignableFrom(((ObjectType)firstArgType).getJavaClass())) hasThisArgument = true; if (hasThisArgument) { _thisArgument = (Expression) _arguments.elementAt(0); _arguments.remove(0); nArgs--; if (firstArgType instanceof ObjectType) { _className = ((ObjectType) firstArgType).getJavaClassName(); } else throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, name); } } else if (_className.length() == 0) { /* * Warn user if external function could not be resolved. * Warning will _NOT_ be issued is the call is properly * wrapped in an <xsl:if> or <xsl:when> element. For details * see If.parserContents() and When.parserContents() */ final Parser parser = getParser(); if (parser != null) { reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR, _fname.toString()); } unresolvedExternal = true; return _type = Type.Int; // use "Int" as "unknown" } } final Vector methods = findMethods(); if (methods == null) { // Method not found in this class throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name); } Class extType = null; final int nMethods = methods.size(); final Vector argsType = typeCheckArgs(stable); // Try all methods to identify the best fit int bestMethodDistance = Integer.MAX_VALUE; _type = null; // reset internal type for (int j, i = 0; i < nMethods; i++) { // Check if all paramteters to this method can be converted final Method method = (Method)methods.elementAt(i); final Class[] paramTypes = method.getParameterTypes(); int currMethodDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currMethodDistance += ((JavaType)match).distance; } else { // no mapping available // // Allow a Reference type to match any external (Java) type at // the moment. The real type checking is performed at runtime. if (intType instanceof ReferenceType) { currMethodDistance += 1; } else if (intType instanceof ObjectType) { ObjectType object = (ObjectType)intType; if (extType.getName().equals(object.getJavaClassName())) currMethodDistance += 0; else if (extType.isAssignableFrom(object.getJavaClass())) currMethodDistance += 1; else { currMethodDistance = Integer.MAX_VALUE; break; } } else { currMethodDistance = Integer.MAX_VALUE; break; } } } if (j == nArgs) { // Check if the return type can be converted extType = method.getReturnType(); _type = (Type) _java2Internal.get(extType); if (_type == null) { _type = Type.newObjectType(extType); } // Use this method if all parameters & return type match if (_type != null && currMethodDistance < bestMethodDistance) { _chosenMethod = method; bestMethodDistance = currMethodDistance; } } } // It is an error if the chosen method is an instance menthod but we don't // have a this argument. if (_chosenMethod != null && _thisArgument == null && !Modifier.isStatic(_chosenMethod.getModifiers())) { throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, getMethodSignature(argsType)); } if (_type != null) { if (_type == Type.NodeSet) { getXSLTC().setMultiDocument(true); } return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type ftype = _filterExpr.typeCheck(stable); if (ftype instanceof NodeSetType == false) { if (ftype instanceof ReferenceType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } /* else if (ftype instanceof ResultTreeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } */ else if (ftype instanceof NodeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Wrap single node path in a node set final Type ptype = _path.typeCheck(stable); if (!(ptype instanceof NodeSetType)) { _path = new CastExpr(_path, Type.NodeSet); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/StringCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int argc = argumentCount(); if (argc > 1) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(err); } if (argc > 0) { argument().typeCheck(stable); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, Ops[_op], new MethodType(Type.Void, tleft, tright)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } final Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/CastCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this)); } // The first argument must be a literal String Expression exp = argument(0); if (exp instanceof LiteralExpr) { _className = ((LiteralExpr) exp).getValue(); _type = Type.newObjectType(_className); } else { throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, getName(), this)); } // Second argument must be of type reference or object _right = argument(1); Type tright = _right.typeCheck(stable); if (tright != Type.Reference && tright instanceof ObjectType == false) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR, tright, _type, this)); } return _type; }
// in src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, "u-", new MethodType(Type.Void, tleft)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/CallTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Template template = stable.lookupTemplate(_name); if (template != null) { typeCheckContents(stable); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this); throw new TypeCheckError(err); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof NodeType || _type instanceof ReferenceType) { _select = new CastExpr(_select, Type.NodeSet); _type = Type.NodeSet; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); // with-params return Type.Void; } throw new TypeCheckError(this); } else { typeCheckContents(stable); // with-params return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/FilterExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ContainsCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Get the left and right operand types Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); // Check if the operator supports the two operand types MethodType wantType = new MethodType(Type.Void, tleft, tright); MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); // Yes, the operation is supported if (haveType != null) { // Check if left-hand side operand must be type casted Type arg1 = (Type)haveType.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) _left = new CastExpr(_left, arg1); // Check if right-hand side operand must be type casted Type arg2 = (Type) haveType.argsType().elementAt(1); if (!arg2.identicalTo(tright)) _right = new CastExpr(_right, arg1); // Return the result type for the operator we will use return _type = haveType.resultType(); } throw new TypeCheckError(this); }
1
              
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
90
              
// in src/org/apache/xalan/xsltc/compiler/DocumentCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // At least one argument - two at most final int ac = argumentCount(); if ((ac < 1) || (ac > 2)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } if (getStylesheet() == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } // Parse the first argument _arg1 = argument(0); if (_arg1 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } _arg1Type = _arg1.typeCheck(stable); if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) { _arg1 = new CastExpr(_arg1, Type.String); } // Parse the second argument if (ac == 2) { _arg2 = argument(1); if (_arg2 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } final Type arg2Type = _arg2.typeCheck(stable); if (arg2Type.identicalTo(Type.Node)) { _arg2 = new CastExpr(_arg2, Type.NodeSet); } else if (arg2Type.identicalTo(Type.NodeSet)) { // falls through } else { ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argument() instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "element-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/Comment.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.String; }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) { return _type; } if (_arg instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "function-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/NameBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check the argument type (if any) switch(argumentCount()) { case 0: _paramType = Type.Node; break; case 1: _paramType = _param.typeCheck(stable); break; default: throw new TypeCheckError(this); } // The argument has to be a node, a node-set or a node reference if ((_paramType != Type.NodeSet) && (_paramType != Type.Node) && (_paramType != Type.Reference)) { throw new TypeCheckError(this); } return (_type = Type.String); }
// in src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/XslAttribute.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (!_ignore) { _name.typeCheck(stable); if (_namespace != null) { _namespace.typeCheck(stable); } typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Variable.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check the 'select' expression if present if (_select != null) { _type = _select.typeCheck(stable); } // Type check the element contents otherwise else if (hasContents()) { typeCheckContents(stable); _type = Type.ResultTree; } else { _type = Type.Reference; } // The return type is void as the variable element does not leave // anything on the JVM's stack. The '_type' global will be returned // by the references to this variable, and not by the variable itself. return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ForEach.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType || _type instanceof NodeType) { _select = new CastExpr(_select, Type.NodeSet); typeCheckContents(stable); return Type.Void; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); return Type.Void; } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/When.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check the test expression if (_test.typeCheck(stable) instanceof BooleanType == false) { _test = new CastExpr(_test, Type.Boolean); } // Type-check the contents (if necessary) if (!_ignore) { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Returned cached type if available if (_type != null) return _type; // Find nearest closure to add a variable reference if (_variable.isLocal()) { SyntaxTreeNode node = getParent(); do { if (node instanceof Closure) { _closure = (Closure) node; break; } if (node instanceof TopLevelElement) { break; // way up in the tree } node = node.getParent(); } while (node != null); if (_closure != null) { _closure.addVariable(this); } } // Attempt to get the cached variable type _type = _variable.getType(); // If that does not work we must force a type-check (this is normally // only needed for globals in included/imported stylesheets if (_type == null) { _variable.typeCheck(stable); _type = _variable.getType(); } // If in a top-level element, create dependency to the referenced var addParentDependency(); // Return the type of the referenced variable return _type; }
// in src/org/apache/xalan/xsltc/compiler/AncestorPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_left != null) { _left.typeCheck(stable); } return _right.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_path != null) { final Type ptype = _path.typeCheck(stable); if (ptype instanceof NodeType) { // promote to node-set _path = new CastExpr(_path, Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ParentPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _left.typeCheck(stable); return _right.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/BooleanCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _arg.typeCheck(stable); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Fallback.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_active) { return(typeCheckContents(stable)); } else { return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/StepPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (hasPredicates()) { // Type check all the predicates (e -> position() = e) final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Predicate pred = (Predicate)_predicates.elementAt(i); pred.typeCheck(stable); } // Analyze context cases _contextCase = analyzeCases(); Step step = null; // Create an instance of Step to do the translation if (_contextCase == SIMPLE_CONTEXT) { Predicate pred = (Predicate)_predicates.elementAt(0); if (pred.isNthPositionFilter()) { _contextCase = GENERAL_CONTEXT; step = new Step(_axis, _nodeType, _predicates); } else { step = new Step(_axis, _nodeType, null); } } else if (_contextCase == GENERAL_CONTEXT) { final int len = _predicates.size(); for (int i = 0; i < len; i++) { ((Predicate)_predicates.elementAt(i)).dontOptimize(); } step = new Step(_axis, _nodeType, _predicates); } if (step != null) { step.setParser(getParser()); step.typeCheck(stable); _step = step; } } return _axis == Axis.CHILD ? Type.Element : Type.Attribute; }
// in src/org/apache/xalan/xsltc/compiler/AlternativePattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _left.typeCheck(stable); _right.typeCheck(stable); return null; }
// in src/org/apache/xalan/xsltc/compiler/LangCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _langType = _lang.typeCheck(stable); if (!(_langType instanceof StringType)) { _lang = new CastExpr(_lang, Type.String); } return Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Param.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType == false && !(_type instanceof ObjectType)) { _select = new CastExpr(_select, Type.Reference); } } else if (hasContents()) { typeCheckContents(stable); } _type = Type.Reference; // This element has no type (the parameter does, but the parameter // element itself does not). return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/XslElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (!_ignore) { _name.typeCheck(stable); if (_namespace != null) { _namespace.typeCheck(stable); } } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ref != null) { final String name = _variableName.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR, name, this); } if ((_ref = resolve(getParser(), stable)) != null) { return (_type = _ref.typeCheck(stable)); } throw new TypeCheckError(reportError()); }
// in src/org/apache/xalan/xsltc/compiler/LiteralExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/CastExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.getType(); if (tleft == null) { tleft = _left.typeCheck(stable); } if (tleft instanceof NodeType) { tleft = Type.Node; // multiple instances } else if (tleft instanceof ResultTreeType) { tleft = Type.ResultTree; // multiple instances } if (InternalTypeMap.maps(tleft, _type) != null) { return _type; } // throw new TypeCheckError(this); throw new TypeCheckError(new ErrorMsg( ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString())); }
// in src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { stype = _step.typeCheck(stable); _path.typeCheck(stable); if (_axisMismatch) enableNodeOrdering(); return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Inform stylesheet to instantiate a DecimalFormat object getStylesheet().numberFormattingUsed(); final Type tvalue = _value.typeCheck(stable); if (tvalue instanceof RealType == false) { _value = new CastExpr(_value, Type.Real); } final Type tformat = _format.typeCheck(stable); if (tformat instanceof StringType == false) { _format = new CastExpr(_format, Type.String); } if (argumentCount() == 3) { final Type tname = _name.typeCheck(stable); if (_name instanceof LiteralExpr) { final LiteralExpr literal = (LiteralExpr) _name; _resolvedQName = getParser().getQNameIgnoreDefaultNs(literal.getValue()); } else if (tname instanceof StringType == false) { _name = new CastExpr(_name, Type.String); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/Import.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int length = _components.length; for (int i = 0; i < length; i++) { if (_components[i].typeCheck(stable) != Type.NodeSet) { _components[i] = new CastExpr(_components[i], Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Whitespace.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; // We don't return anything. }
// in src/org/apache/xalan/xsltc/compiler/AttributeSet.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ignore) return (Type.Void); // _mergeSet Point to any previous definition of this attribute set _mergeSet = stable.addAttributeSet(this); _method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial(); if (_useSets != null) _useSets.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Stylesheet.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int count = _globals.size(); for (int i = 0; i < count; i++) { final VariableBase var = (VariableBase)_globals.elementAt(i); var.typeCheck(stable); } return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/NumberCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argumentCount() > 0) { argument().typeCheck(stable); } return _type = Type.Real; }
// in src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_fallbacks != null) { int count = _fallbacks.size(); for (int i = 0; i < count; i++) { Fallback fallback = (Fallback)_fallbacks.elementAt(i); fallback.typeCheck(stable); } } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Copy.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_useSets != null) { _useSets.typeCheck(stable); } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java
protected Type typeCheckContents(SymbolTable stable) throws TypeCheckError { final int n = elementCount(); for (int i = 0; i < n; i++) { SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i); item.typeCheck(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Key.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check match pattern _match.typeCheck(stable); // Cast node values to string values (except for nodesets) _useType = _use.typeCheck(stable); if (_useType instanceof StringType == false && _useType instanceof NodeSetType == false) { _use = new CastExpr(_use, Type.String); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_path != null) { final Type ptype = _path.typeCheck(stable); if (ptype instanceof NodeType) { // promote to node-set _path = new CastExpr(_path, Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); //bug fix # 2838, cast to reals if both are result tree fragments if (tleft instanceof ResultTreeType && tright instanceof ResultTreeType ) { _right = new CastExpr(_right, Type.Real); _left = new CastExpr(_left, Type.Real); return _type = Type.Boolean; } // If one is of reference type, then convert the other too if (hasReferenceArgs()) { Type type = null; Type typeL = null; Type typeR = null; if (tleft instanceof ReferenceType) { if (_left instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_left; VariableBase var = ref.getVariable(); typeL = var.getType(); } } if (tright instanceof ReferenceType) { if (_right instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_right; VariableBase var = ref.getVariable(); typeR = var.getType(); } } // bug fix # 2838 if (typeL == null) type = typeR; else if (typeR == null) type = typeL; else { type = Type.Real; } if (type == null) type = Type.Real; _right = new CastExpr(_right, type); _left = new CastExpr(_left, type); return _type = Type.Boolean; } if (hasNodeSetArgs()) { // Ensure that the node-set is the left argument if (tright instanceof NodeSetType) { final Expression temp = _right; _right = _left; _left = temp; _op = (_op == Operators.GT) ? Operators.LT : (_op == Operators.LT) ? Operators.GT : (_op == Operators.GE) ? Operators.LE : Operators.GE; tright = _right.getType(); } // Promote nodes to node sets if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // Promote integer to doubles to have fewer compares if (tright instanceof IntType) { _right = new CastExpr(_right, Type.Real); } // Promote result-trees to strings if (tright instanceof ResultTreeType) { _right = new CastExpr(_right, Type.String); } return _type = Type.Boolean; } // In the node-boolean case, convert node to boolean first if (hasNodeArgs()) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); tright = Type.Boolean; } if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); tleft = Type.Boolean; } } // Lookup the table of primops to find the best match MethodType ptype = lookupPrimop(stable, Operators.getOpNames(_op), new MethodType(Type.Void, tleft, tright)); if (ptype != null) { Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/ApplyImports.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); // with-params return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Sort.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tselect = _select.typeCheck(stable); // If the sort data-type is not set we use the natural data-type // of the data we will sort if (!(tselect instanceof StringType)) { _select = new CastExpr(_select, Type.String); } _order.typeCheck(stable); _caseOrder.typeCheck(stable); _dataType.typeCheck(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _left == null ? Type.Root : _left.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/Number.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_value != null) { Type tvalue = _value.typeCheck(stable); if (tvalue instanceof RealType == false) { _value = new CastExpr(_value, Type.Real); } } if (_count != null) { _count.typeCheck(stable); } if (_from != null) { _from.typeCheck(stable); } if (_format != null) { _format.typeCheck(stable); } if (_lang != null) { _lang.typeCheck(stable); } if (_letterValue != null) { _letterValue.typeCheck(stable); } if (_groupingSeparator != null) { _groupingSeparator.typeCheck(stable); } if (_groupingSize != null) { _groupingSize.typeCheck(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Predicate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type texp = _exp.typeCheck(stable); // We need explicit type information for reference types - no good! if (texp instanceof ReferenceType) { _exp = new CastExpr(_exp, texp = Type.Real); } // A result tree fragment should not be cast directly to a number type, // but rather to a boolean value, and then to a numer (0 or 1). // Ref. section 11.2 of the XSLT 1.0 spec if (texp instanceof ResultTreeType) { _exp = new CastExpr(_exp, Type.Boolean); _exp = new CastExpr(_exp, Type.Real); texp = _exp.typeCheck(stable); } // Numerical types will be converted to a position filter if (texp instanceof NumberType) { // Cast any numerical types to an integer if (texp instanceof IntType == false) { _exp = new CastExpr(_exp, Type.Int); } if (_canOptimize) { // Nth position optimization. Expression must not depend on context _nthPositionFilter = !_exp.hasLastCall() && !_exp.hasPositionCall(); // _nthDescendant optimization - only if _nthPositionFilter is on if (_nthPositionFilter) { SyntaxTreeNode parent = getParent(); _nthDescendant = (parent instanceof Step) && (parent.getParent() instanceof AbsoluteLocationPath); return _type = Type.NodeSet; } } // Reset optimization flags _nthPositionFilter = _nthDescendant = false; // Otherwise, expand [e] to [position() = e] final QName position = getParser().getQNameIgnoreDefaultNs("position"); final PositionCall positionCall = new PositionCall(position); positionCall.setParser(getParser()); positionCall.setParent(this); _exp = new EqualityExpr(Operators.EQ, positionCall, _exp); if (_exp.typeCheck(stable) != Type.Boolean) { _exp = new CastExpr(_exp, Type.Boolean); } return _type = Type.Boolean; } else { // All other types will be handled as boolean values if (texp instanceof BooleanType == false) { _exp = new CastExpr(_exp, Type.Boolean); } return _type = Type.Boolean; } }
// in src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); throw new TypeCheckError(err); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Template.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_pattern != null) { _pattern.typeCheck(stable); } return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/BooleanExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = Type.Boolean; return _type; }
// in src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Vector contents = getContents(); final int n = contents.size(); for (int i = 0; i < n; i++) { final Expression exp = (Expression)contents.elementAt(i); if (!exp.typeCheck(stable).identicalTo(Type.String)) { contents.setElementAt(new CastExpr(exp, Type.String), i); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) return _type; final String namespace = _fname.getNamespace(); String local = _fname.getLocalPart(); if (isExtension()) { _fname = new QName(null, null, local); return typeCheckStandard(stable); } else if (isStandard()) { return typeCheckStandard(stable); } // Handle extension functions (they all have a namespace) else { try { _className = getClassNameFromUri(namespace); final int pos = local.lastIndexOf('.'); if (pos > 0) { _isStatic = true; if (_className != null && _className.length() > 0) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; _className = _className + "." + local.substring(0, pos); } else { _namespace_format = NAMESPACE_FORMAT_JAVA; _className = local.substring(0, pos); } _fname = new QName(namespace, null, local.substring(pos + 1)); } else { if (_className != null && _className.length() > 0) { try { _clazz = ObjectFactory.findProviderClass( _className, ObjectFactory.findClassLoader(), true); _namespace_format = NAMESPACE_FORMAT_CLASS; } catch (ClassNotFoundException e) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; } } else _namespace_format = NAMESPACE_FORMAT_JAVA; if (local.indexOf('-') > 0) { local = replaceDash(local); } String extFunction = (String)_extensionFunctionTable.get(namespace + ":" + local); if (extFunction != null) { _fname = new QName(null, null, extFunction); return typeCheckStandard(stable); } else _fname = new QName(namespace, null, local); } return typeCheckExternal(stable); } catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; } } }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError { _fname.clearNamespace(); // HACK!!! final int n = _arguments.size(); final Vector argsType = typeCheckArgs(stable); final MethodType args = new MethodType(Type.Void, argsType); final MethodType ptype = lookupPrimop(stable, _fname.getLocalPart(), args); if (ptype != null) { for (int i = 0; i < n; i++) { final Type argType = (Type) ptype.argsType().elementAt(i); final Expression exp = (Expression)_arguments.elementAt(i); if (!argType.identicalTo(exp.getType())) { try { _arguments.setElementAt(new CastExpr(exp, argType), i); } catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion } } } _chosenMethodType = ptype; return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{ final Vector constructors = findConstructors(); if (constructors == null) { // Constructor not found in this class throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND, _className); } final int nConstructors = constructors.size(); final int nArgs = _arguments.size(); final Vector argsType = typeCheckArgs(stable); // Try all constructors int bestConstrDistance = Integer.MAX_VALUE; _type = null; // reset for (int j, i = 0; i < nConstructors; i++) { // Check if all parameters to this constructor can be converted final Constructor constructor = (Constructor)constructors.elementAt(i); final Class[] paramTypes = constructor.getParameterTypes(); Class extType = null; int currConstrDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currConstrDistance += ((JavaType)match).distance; } else if (intType instanceof ObjectType) { ObjectType objectType = (ObjectType)intType; if (objectType.getJavaClass() == extType) continue; else if (extType.isAssignableFrom(objectType.getJavaClass())) currConstrDistance += 1; else { currConstrDistance = Integer.MAX_VALUE; break; } } else { // no mapping available currConstrDistance = Integer.MAX_VALUE; break; } } if (j == nArgs && currConstrDistance < bestConstrDistance ) { _chosenConstructor = constructor; _isExtConstructor = true; bestConstrDistance = currConstrDistance; _type = (_clazz != null) ? Type.newObjectType(_clazz) : Type.newObjectType(_className); } } if (_type != null) { return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError { int nArgs = _arguments.size(); final String name = _fname.getLocalPart(); // check if function is a contructor 'new' if (_fname.getLocalPart().equals("new")) { return typeCheckConstructor(stable); } // check if we are calling an instance method else { boolean hasThisArgument = false; if (nArgs == 0) _isStatic = true; if (!_isStatic) { if (_namespace_format == NAMESPACE_FORMAT_JAVA || _namespace_format == NAMESPACE_FORMAT_PACKAGE) hasThisArgument = true; Expression firstArg = (Expression)_arguments.elementAt(0); Type firstArgType = (Type)firstArg.typeCheck(stable); if (_namespace_format == NAMESPACE_FORMAT_CLASS && firstArgType instanceof ObjectType && _clazz != null && _clazz.isAssignableFrom(((ObjectType)firstArgType).getJavaClass())) hasThisArgument = true; if (hasThisArgument) { _thisArgument = (Expression) _arguments.elementAt(0); _arguments.remove(0); nArgs--; if (firstArgType instanceof ObjectType) { _className = ((ObjectType) firstArgType).getJavaClassName(); } else throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, name); } } else if (_className.length() == 0) { /* * Warn user if external function could not be resolved. * Warning will _NOT_ be issued is the call is properly * wrapped in an <xsl:if> or <xsl:when> element. For details * see If.parserContents() and When.parserContents() */ final Parser parser = getParser(); if (parser != null) { reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR, _fname.toString()); } unresolvedExternal = true; return _type = Type.Int; // use "Int" as "unknown" } } final Vector methods = findMethods(); if (methods == null) { // Method not found in this class throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name); } Class extType = null; final int nMethods = methods.size(); final Vector argsType = typeCheckArgs(stable); // Try all methods to identify the best fit int bestMethodDistance = Integer.MAX_VALUE; _type = null; // reset internal type for (int j, i = 0; i < nMethods; i++) { // Check if all paramteters to this method can be converted final Method method = (Method)methods.elementAt(i); final Class[] paramTypes = method.getParameterTypes(); int currMethodDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currMethodDistance += ((JavaType)match).distance; } else { // no mapping available // // Allow a Reference type to match any external (Java) type at // the moment. The real type checking is performed at runtime. if (intType instanceof ReferenceType) { currMethodDistance += 1; } else if (intType instanceof ObjectType) { ObjectType object = (ObjectType)intType; if (extType.getName().equals(object.getJavaClassName())) currMethodDistance += 0; else if (extType.isAssignableFrom(object.getJavaClass())) currMethodDistance += 1; else { currMethodDistance = Integer.MAX_VALUE; break; } } else { currMethodDistance = Integer.MAX_VALUE; break; } } } if (j == nArgs) { // Check if the return type can be converted extType = method.getReturnType(); _type = (Type) _java2Internal.get(extType); if (_type == null) { _type = Type.newObjectType(extType); } // Use this method if all parameters & return type match if (_type != null && currMethodDistance < bestMethodDistance) { _chosenMethod = method; bestMethodDistance = currMethodDistance; } } } // It is an error if the chosen method is an instance menthod but we don't // have a this argument. if (_chosenMethod != null && _thisArgument == null && !Modifier.isStatic(_chosenMethod.getModifiers())) { throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, getMethodSignature(argsType)); } if (_type != null) { if (_type == Type.NodeSet) { getXSLTC().setMultiDocument(true); } return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError { final Vector result = new Vector(); final Enumeration e = _arguments.elements(); while (e.hasMoreElements()) { final Expression exp = (Expression)e.nextElement(); result.addElement(exp.typeCheck(stable)); } return result; }
// in src/org/apache/xalan/xsltc/compiler/EqualityExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); if (tleft.isSimple() && tright.isSimple()) { if (tleft != tright) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); } else if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); } else if (tleft instanceof NumberType || tright instanceof NumberType) { _left = new CastExpr(_left, Type.Real); _right = new CastExpr(_right, Type.Real); } else { // both compared as strings _left = new CastExpr(_left, Type.String); _right = new CastExpr(_right, Type.String); } } } else if (tleft instanceof ReferenceType) { _right = new CastExpr(_right, Type.Reference); } else if (tright instanceof ReferenceType) { _left = new CastExpr(_left, Type.Reference); } // the following 2 cases optimize @attr|.|.. = 'string' else if (tleft instanceof NodeType && tright == Type.String) { _left = new CastExpr(_left, Type.String); } else if (tleft == Type.String && tright instanceof NodeType) { _right = new CastExpr(_right, Type.String); } // optimize node/node else if (tleft instanceof NodeType && tright instanceof NodeType) { _left = new CastExpr(_left, Type.String); _right = new CastExpr(_right, Type.String); } else if (tleft instanceof NodeType && tright instanceof NodeSetType) { // compare(Node, NodeSet) will be invoked } else if (tleft instanceof NodeSetType && tright instanceof NodeType) { swapArguments(); // for compare(Node, NodeSet) } else { // At least one argument is of type node, node-set or result-tree // Promote an expression of type node to node-set if (tleft instanceof NodeType) { _left = new CastExpr(_left, Type.NodeSet); } if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // If one arg is a node-set then make it the left one if (tleft.isSimple() || tleft instanceof ResultTreeType && tright instanceof NodeSetType) { swapArguments(); } // Promote integers to doubles to have fewer compares if (_right.getType() instanceof IntType) { _right = new CastExpr(_right, Type.Real); } } return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Message.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type ftype = _filterExpr.typeCheck(stable); if (ftype instanceof NodeSetType == false) { if (ftype instanceof ReferenceType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } /* else if (ftype instanceof ResultTreeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } */ else if (ftype instanceof NodeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Wrap single node path in a node set final Type ptype = _path.typeCheck(stable); if (!(ptype instanceof NodeSetType)) { _path = new CastExpr(_path, Type.NodeSet); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/Instruction.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/If.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check the "test" expression if (_test.typeCheck(stable) instanceof BooleanType == false) { _test = new CastExpr(_test, Type.Boolean); } // Type check the element contents if (!_ignore) { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/TopLevelElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/StringCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int argc = argumentCount(); if (argc > 1) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(err); } if (argc > 0) { argument().typeCheck(stable); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/IntExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.Int; }
// in src/org/apache/xalan/xsltc/compiler/KeyCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type returnType = super.typeCheck(stable); // Run type check on the key name (first argument) - must be a string, // and if it is not it must be converted to one using string() rules. if (_name != null) { final Type nameType = _name.typeCheck(stable); if (_name instanceof LiteralExpr) { final LiteralExpr literal = (LiteralExpr) _name; _resolvedQName = getParser().getQNameIgnoreDefaultNs(literal.getValue()); } else if (nameType instanceof StringType == false) { _name = new CastExpr(_name, Type.String); } } // Run type check on the value for this key. This value can be of // any data type, so this should never cause any type-check errors. // If the value is a reference, then we have to defer the decision // of how to process it until run-time. // If the value is known not to be a node-set, then it should be // converted to a string before the lookup is done. If the value is // known to be a node-set then this process (convert to string, then // do lookup) should be applied to every node in the set, and the // result from all lookups should be added to the resulting node-set. _valueType = _value.typeCheck(stable); if (_valueType != Type.NodeSet && _valueType != Type.Reference && _valueType != Type.String) { _value = new CastExpr(_value, Type.String); _valueType = _value.typeCheck(stable); } // If in a top-level element, create dependency to the referenced key addParentDependency(); return returnType; }
// in src/org/apache/xalan/xsltc/compiler/CopyOf.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tselect = _select.typeCheck(stable); if (tselect instanceof NodeType || tselect instanceof NodeSetType || tselect instanceof ReferenceType || tselect instanceof ResultTreeType) { // falls through } else { _select = new CastExpr(_select, Type.String); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _name.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ConcatCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { for (int i = 0; i < argumentCount(); i++) { final Expression exp = argument(i); if (!exp.typeCheck(stable).identicalTo(Type.String)) { setArgument(i, new CastExpr(exp, Type.String)); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; // TODO }
// in src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, Ops[_op], new MethodType(Type.Void, tleft, tright)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } final Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/Otherwise.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/CastCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this)); } // The first argument must be a literal String Expression exp = argument(0); if (exp instanceof LiteralExpr) { _className = ((LiteralExpr) exp).getValue(); _type = Type.newObjectType(_className); } else { throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, getName(), this)); } // Second argument must be of type reference or object _right = argument(1); Type tright = _right.typeCheck(stable); if (tright != Type.Reference && tright instanceof ObjectType == false) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR, tright, _type, this)); } return _type; }
// in src/org/apache/xalan/xsltc/compiler/LiteralElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check all attributes if (_attributeElements != null) { final int count = _attributeElements.size(); for (int i = 0; i < count; i++) { SyntaxTreeNode node = (SyntaxTreeNode)_attributeElements.elementAt(i); node.typeCheck(stable); } } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Step.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Save this value for later - important for testing for special // combinations of steps and patterns than can be optimised _hadPredicates = hasPredicates(); // Special case for '.' // in the case where '.' has a context such as book/. // or .[false()] we can not optimize the nodeset to a single node. if (isAbbreviatedDot()) { _type = (hasParentPattern() || hasPredicates() ) ? Type.NodeSet : Type.Node; } else { _type = Type.NodeSet; } // Type check all predicates (expressions applied to the step) if (_predicates != null) { final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Expression pred = (Expression)_predicates.elementAt(i); pred.typeCheck(stable); } } // Return either Type.Node or Type.NodeSet return _type; }
// in src/org/apache/xalan/xsltc/compiler/TransletOutput.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type type = _filename.typeCheck(stable); if (type instanceof StringType == false) { _filename = new CastExpr(_filename, Type.String); } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, "u-", new MethodType(Type.Void, tleft)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/ProcessingInstructionPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (hasPredicates()) { // Type check all the predicates (e -> position() = e) final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Predicate pred = (Predicate)_predicates.elementAt(i); pred.typeCheck(stable); } } return Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ValueOf.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type type = _select.typeCheck(stable); // Prefer to handle the value as a node; fall back to String, otherwise if (type != null && !type.identicalTo(Type.Node)) { /*** *** %HZ% Would like to treat result-tree fragments in the same *** %HZ% way as node sets for value-of, but that's running into *** %HZ% some snags. Instead, they'll be converted to String if (type.identicalTo(Type.ResultTree)) { _select = new CastExpr(new CastExpr(_select, Type.NodeSet), Type.Node); } else ***/ if (type.identicalTo(Type.NodeSet)) { _select = new CastExpr(_select, Type.Node); } else { _isString = true; if (!type.identicalTo(Type.String)) { _select = new CastExpr(_select, Type.String); } _isString = true; } } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/RealExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.Real; }
// in src/org/apache/xalan/xsltc/compiler/Include.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/WithParam.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { final Type tselect = _select.typeCheck(stable); if (tselect instanceof ReferenceType == false) { _select = new CastExpr(_select, Type.Reference); } } else { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/CallTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Template template = stable.lookupTemplate(_name); if (template != null) { typeCheckContents(stable); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this); throw new TypeCheckError(err); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof NodeType || _type instanceof ReferenceType) { _select = new CastExpr(_select, Type.NodeSet); _type = Type.NodeSet; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); // with-params return Type.Void; } throw new TypeCheckError(this); } else { typeCheckContents(stable); // with-params return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _value.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilterExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type entity = _entity.typeCheck(stable); if (entity instanceof StringType == false) { _entity = new CastExpr(_entity, Type.String); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/ContainsCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Get the left and right operand types Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); // Check if the operator supports the two operand types MethodType wantType = new MethodType(Type.Void, tleft, tright); MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); // Yes, the operation is supported if (haveType != null) { // Check if left-hand side operand must be type casted Type arg1 = (Type)haveType.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) _left = new CastExpr(_left, arg1); // Check if right-hand side operand must be type casted Type arg2 = (Type) haveType.argsType().elementAt(1); if (!arg2.identicalTo(tright)) _right = new CastExpr(_right, arg1); // Return the result type for the operator we will use return _type = haveType.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/Expression.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
(Lib) NullPointerException 31
              
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void pushRewindMark() { if(m_indexing || m_elemIndexes!=null) throw new java.lang.NullPointerException("Coding error; Don't try to mark/rewind an indexed DTM"); // Values from DTMDefaultBase // %REVIEW% Can the namespace stack sizes ever differ? If not, save space! mark_size.push(m_size); mark_nsdeclset_size.push((m_namespaceDeclSets==null) ? 0 : m_namespaceDeclSets.size()); mark_nsdeclelem_size.push((m_namespaceDeclSetElements==null) ? 0 : m_namespaceDeclSetElements.size()); // Values from SAX2DTM mark_data_size.push(m_data.size()); mark_char_size.push(m_chars.size()); mark_doq_size.push(m_dataOrQName.size()); }
// in src/org/apache/xalan/xsltc/runtime/Hashtable.java
public boolean contains(Object value) { if (value == null) throw new NullPointerException(); int i; HashtableEntry e; HashtableEntry tab[] = table; for (i = tab.length ; i-- > 0 ;) { for (e = tab[i] ; e != null ; e = e.next) { if (e.value.equals(value)) { return true; } } } return false; }
// in src/org/apache/xalan/xsltc/runtime/Hashtable.java
public Object put(Object key, Object value) { // Make sure the value is not null if (value == null) throw new NullPointerException(); // Makes sure the key is not already in the hashtable. HashtableEntry e; HashtableEntry tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (e = tab[index] ; e != null ; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { Object old = e.value; e.value = value; return old; } } // Rehash the table if the threshold is exceeded if (count >= threshold) { rehash(); return put(key, value); } // Creates the new entry. e = new HashtableEntry(); e.hash = hash; e.key = key; e.value = value; e.next = tab[index]; tab[index] = e; count++; return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public boolean getFeature(String name) { // All supported features should be listed here String[] features = { DOMSource.FEATURE, DOMResult.FEATURE, SAXSource.FEATURE, SAXResult.FEATURE, StreamSource.FEATURE, StreamResult.FEATURE, SAXTransformerFactory.FEATURE, SAXTransformerFactory.FEATURE_XMLFILTER }; // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but array is small for (int i =0; i < features.length; i++) { if (name.equals(features[i])) { return true; } } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return _isSecureProcessing; } // Feature not supported return false; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public boolean getFeature(String name) { // All supported features should be listed here String[] features = { DOMSource.FEATURE, DOMResult.FEATURE, SAXSource.FEATURE, SAXResult.FEATURE, StreamSource.FEATURE, StreamResult.FEATURE }; // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but it really does not matter in a function like this for (int i = 0; i < features.length; i++) { if (name.equals(features[i])) return true; } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature return false; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public boolean getFeature(String name) { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_GET_FEATURE_NULL_NAME, null)); } // Try first with identity comparison, which // will be faster. if ((DOMResult.FEATURE == name) || (DOMSource.FEATURE == name) || (SAXResult.FEATURE == name) || (SAXSource.FEATURE == name) || (StreamResult.FEATURE == name) || (StreamSource.FEATURE == name) || (SAXTransformerFactory.FEATURE == name) || (SAXTransformerFactory.FEATURE_XMLFILTER == name)) return true; else if ((DOMResult.FEATURE.equals(name)) || (DOMSource.FEATURE.equals(name)) || (SAXResult.FEATURE.equals(name)) || (SAXSource.FEATURE.equals(name)) || (StreamResult.FEATURE.equals(name)) || (StreamSource.FEATURE.equals(name)) || (SAXTransformerFactory.FEATURE.equals(name)) || (SAXTransformerFactory.FEATURE_XMLFILTER.equals(name))) return true; // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) return m_isSecureProcessing; else // unknown feature return false; }
// in src/org/apache/xalan/transformer/TrAXFilter.java
private void setupParse () { XMLReader p = getParent(); if (p == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_PARENT_FOR_FILTER, null)); //"No parent for filter"); } ContentHandler ch = m_transformer.getInputContentHandler(); // if(ch instanceof SourceTreeHandler) // ((SourceTreeHandler)ch).setUseMultiThreading(true); p.setContentHandler(ch); p.setEntityResolver(this); p.setDTDHandler(this); p.setErrorHandler(this); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serializationHandler) { ToXMLSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(handler); h.setTransformer(this); m_serializationHandler = h; } else m_serializationHandler.setContentHandler(handler); } }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
public XPathFunction resolveFunction(QName qname, int arity) { if (qname == null) throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NULL_QNAME, null)); if (arity < 0) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NEGATIVE_ARITY, null)); String uri = qname.getNamespaceURI(); if (uri == null || uri.length() == 0) return null; String className = null; String methodName = null; if (uri.startsWith("http://exslt.org")) { className = getEXSLTClassName(uri); methodName = qname.getLocalPart(); } else if (!uri.equals(ExtensionNamespaceContext.JAVA_EXT_URI)) { int lastSlash = className.lastIndexOf('/'); if (-1 != lastSlash) className = className.substring(lastSlash + 1); } String localPart = qname.getLocalPart(); int lastDotIndex = localPart.lastIndexOf('.'); if (lastDotIndex > 0) { if (className != null) className = className + "." + localPart.substring(0, lastDotIndex); else className = localPart.substring(0, lastDotIndex); methodName = localPart.substring(lastDotIndex + 1); } else methodName = localPart; if(null == className || className.trim().length() == 0 || null == methodName || methodName.trim().length() == 0) return null; ExtensionHandler handler = null; try { ExtensionHandler.getClassForName(className); handler = new ExtensionHandlerJavaClass(uri, "javaclass", className); } catch (ClassNotFoundException e) { return null; } return new XPathFunctionImpl(handler, methodName); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, 0 ); if ( xpathFunction == null ) { return false; } return true; } catch ( Exception e ) { return false; } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setXPathVariableResolver(XPathVariableResolver resolver) { if ( resolver == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPathVariableResolver"} ); throw new NullPointerException( fmsg ); } this.variableResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setXPathFunctionResolver(XPathFunctionResolver resolver) { if ( resolver == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPathFunctionResolver"} ); throw new NullPointerException( fmsg ); } this.functionResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setNamespaceContext(NamespaceContext nsContext) { if ( nsContext == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"NamespaceContext"} ); throw new NullPointerException( fmsg ); } this.namespaceContext = nsContext; this.prefixResolver = new JAXPPrefixResolver ( nsContext ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean isObjectModelSupported(String objectModel) { if (objectModel == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_NULL, new Object[] { this.getClass().getName() } ); throw new NullPointerException( fmsg ); } if (objectModel.length() == 0) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_EMPTY, new Object[] { this.getClass().getName() } ); throw new IllegalArgumentException( fmsg ); } // know how to support default object model, W3C DOM if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) { return true; } // don't know how to support anything else return false; }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setXPathFunctionResolver(XPathFunctionResolver resolver) { // resolver cannot be null if (resolver == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_NULL_XPATH_FUNCTION_RESOLVER, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } xPathFunctionResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setXPathVariableResolver(XPathVariableResolver resolver) { // resolver cannot be null if (resolver == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_NULL_XPATH_VARIABLE_RESOLVER, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } xPathVariableResolver = resolver; }
0 7
              
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setDTDHandler(DTDHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setEntityResolver(EntityResolver resolver) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setErrorHandler(ErrorHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setContentHandler(ContentHandler handler) throws NullPointerException { _sax = handler; if (handler instanceof LexicalHandler) { _lex = (LexicalHandler) handler; } if (handler instanceof SAXImpl) { _saxImpl = (SAXImpl)handler; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setDTDHandler(DTDHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setEntityResolver(EntityResolver resolver) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setErrorHandler(ErrorHandler handler) throws NullPointerException { }
(Domain) DTMException 26
              
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItem(Node newNode) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItem(String name) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItemNS(Node arg) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
public DTMAxisTraverser getAxisTraverser(final int axis) { DTMAxisTraverser traverser; if (null == m_traversers) // Cache of stateless traversers for this DTM { m_traversers = new DTMAxisTraverser[Axis.getNamesLength()]; traverser = null; } else { traverser = m_traversers[axis]; // Share/reuse existing traverser if (traverser != null) return traverser; } switch (axis) // Generate new traverser { case Axis.ANCESTOR : traverser = new AncestorTraverser(); break; case Axis.ANCESTORORSELF : traverser = new AncestorOrSelfTraverser(); break; case Axis.ATTRIBUTE : traverser = new AttributeTraverser(); break; case Axis.CHILD : traverser = new ChildTraverser(); break; case Axis.DESCENDANT : traverser = new DescendantTraverser(); break; case Axis.DESCENDANTORSELF : traverser = new DescendantOrSelfTraverser(); break; case Axis.FOLLOWING : traverser = new FollowingTraverser(); break; case Axis.FOLLOWINGSIBLING : traverser = new FollowingSiblingTraverser(); break; case Axis.NAMESPACE : traverser = new NamespaceTraverser(); break; case Axis.NAMESPACEDECLS : traverser = new NamespaceDeclsTraverser(); break; case Axis.PARENT : traverser = new ParentTraverser(); break; case Axis.PRECEDING : traverser = new PrecedingTraverser(); break; case Axis.PRECEDINGSIBLING : traverser = new PrecedingSiblingTraverser(); break; case Axis.SELF : traverser = new SelfTraverser(); break; case Axis.ALL : traverser = new AllFromRootTraverser(); break; case Axis.ALLFROMNODE : traverser = new AllFromNodeTraverser(); break; case Axis.PRECEDINGANDANCESTOR : traverser = new PrecedingAndAncestorTraverser(); break; case Axis.DESCENDANTSFROMROOT : traverser = new DescendantFromRootTraverser(); break; case Axis.DESCENDANTSORSELFFROMROOT : traverser = new DescendantOrSelfFromRootTraverser(); break; case Axis.ROOT : traverser = new RootTraverser(); break; case Axis.FILTEREDLIST : return null; // Don't want to throw an exception for this one. default : throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_UNKNOWN_AXIS_TYPE, new Object[]{Integer.toString(axis)})); //"Unknown axis traversal type: "+axis); } if (null == traverser) throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_AXIS_TRAVERSER_NOT_SUPPORTED, new Object[]{Axis.getNames(axis)})); // "Axis traverser not supported: " // + Axis.names[axis]); m_traversers[axis] = traverser; return traverser; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public void addDTM(DTM dtm, int id, int offset) { if(id>=IDENT_MAX_DTMS) { // TODO: %REVIEW% Not really the right error message. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!"); } // We used to just allocate the array size to IDENT_MAX_DTMS. // But we expect to increase that to 16 bits, and I'm not willing // to allocate that much space unless needed. We could use one of our // handy-dandy Fast*Vectors, but this will do for now. // %REVIEW% int oldlen=m_dtms.length; if(oldlen<=id) { // Various growth strategies are possible. I think we don't want // to over-allocate excessively, and I'm willing to reallocate // more often to get that. See also Fast*Vector classes. // // %REVIEW% Should throw a more diagnostic error if we go over the max... int newlen=Math.min((id+256),IDENT_MAX_DTMS); DTM new_m_dtms[] = new DTM[newlen]; System.arraycopy(m_dtms,0,new_m_dtms,0,oldlen); m_dtms=new_m_dtms; int new_m_dtm_offsets[] = new int[newlen]; System.arraycopy(m_dtm_offsets,0,new_m_dtm_offsets,0,oldlen); m_dtm_offsets=new_m_dtm_offsets; } m_dtms[id] = dtm; m_dtm_offsets[id]=offset; dtm.documentRegistration(); // The DTM should have been told who its manager was when we created it. // Do we need to allow for adopting DTMs _not_ created by this manager? }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) { if(DEBUG && null != source) System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId() ); XMLStringFactory xstringFactory = m_xsf; int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); addDTM(dtm, dtmPos, 0); // if (DUMPTREE) // { // dtm.dumpDTM(); // } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader = null; SAX2DTM dtm; try { InputSource xmlSource; if (null == source) { xmlSource = null; } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } if (source==null && unique && !incremental && !doIndexing) { // Special case to support RTF construction into shared DTM. // It should actually still work for other uses, // but may be slightly deoptimized relative to the base // to allow it to deal with carrying multiple documents. // // %REVIEW% This is a sloppy way to request this mode; // we need to consider architectural improvements. dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } /************************************************************** // EXPERIMENTAL 3/22/02 else if(JKESS_XNI_EXPERIMENT && m_incremental) { dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } **************************************************************/ // Create the basic SAX2DTM. else { dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); boolean haveXercesParser = (null != reader) && (reader.getClass() .getName() .equals("org.apache.xerces.parsers.SAXParser") ); if (haveXercesParser) { incremental = true; // No matter what. %REVIEW% } // If the reader is null, but they still requested an incremental // build, then we still want to set up the IncrementalSAXSource stuff. if (m_incremental && incremental /* || ((null == reader) && incremental) */) { IncrementalSAXSource coParser=null; if (haveXercesParser) { // IncrementalSAXSource_Xerces to avoid threading. try { coParser =(IncrementalSAXSource) Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance(); } catch( Exception ex ) { ex.printStackTrace(); coParser=null; } } if (coParser==null ) { // Create a IncrementalSAXSource to run on the secondary thread. if (null == reader) { coParser = new IncrementalSAXSource_Filter(); } else { IncrementalSAXSource_Filter filter = new IncrementalSAXSource_Filter(); filter.setXMLReader(reader); coParser=filter; } } /************************************************************** // EXPERIMENTAL 3/22/02 if (JKESS_XNI_EXPERIMENT && m_incremental && dtm instanceof XNI2DTM && coParser instanceof IncrementalSAXSource_Xerces) { org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc= ((IncrementalSAXSource_Xerces)coParser) .getXNIParserConfiguration(); if (xpc!=null) { // Bypass SAX; listen to the XNI stream ((XNI2DTM)dtm).setIncrementalXNISource(xpc); } else { // Listen to the SAX stream (will fail, diagnostically...) dtm.setIncrementalSAXSource(coParser); } } else ***************************************************************/ // Have the DTM set itself up as IncrementalSAXSource's listener. dtm.setIncrementalSAXSource(coParser); if (null == xmlSource) { // Then the user will construct it themselves. return dtm; } if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } reader.setDTDHandler(dtm); try { // Launch parsing coroutine. Launches a second thread, // if we're using IncrementalSAXSource.filter(). coParser.startParse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } else { if (null == reader) { // Then the user will construct it themselves. return dtm; } // not incremental reader.setContentHandler(dtm); reader.setDTDHandler(dtm); if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); } } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source); } } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public XMLReader getXMLReader(Source inputSource) { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; // If user did not supply a reader, ask for one from the reader manager if (null == reader) { if (m_readerManager == null) { m_readerManager = XMLReaderManager.getInstance(); } reader = m_readerManager.getXMLReader(); } return reader; } catch (SAXException se) { throw new DTMException(se.getMessage(), se); } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM createDocumentFragment() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); Node df = doc.createDocumentFragment(); return getDTM(new DOMSource(df), true, null, false, false); } catch (Exception e) { throw new DTMException(e); } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setNodeValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setPrefix(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node insertBefore(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node replaceChild(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node appendChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node removeChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node cloneNode(boolean deep) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
protected void error(String msg) { throw new DTMException(msg); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator getTypedAxisIterator(int axis, int type) { DTMAxisIterator iterator = null; /* This causes an error when using patterns for elements that do not exist in the DOM (translet types which do not correspond to a DOM type are mapped to the DOM.ELEMENT type). */ // if (type == NO_TYPE) { // return(EMPTYITERATOR); // } // else if (type == ELEMENT) { // iterator = new FilterIterator(getAxisIterator(axis), // getElementFilter()); // } // else { switch (axis) { case Axis.SELF : iterator = new TypedSingletonIterator(type); break; case Axis.CHILD : iterator = new TypedChildrenIterator(type); break; case Axis.PARENT : return (new ParentIterator().setNodeType(type)); case Axis.ANCESTOR : return (new TypedAncestorIterator(type)); case Axis.ANCESTORORSELF : return ((new TypedAncestorIterator(type)).includeSelf()); case Axis.ATTRIBUTE : return (new TypedAttributeIterator(type)); case Axis.DESCENDANT : iterator = new TypedDescendantIterator(type); break; case Axis.DESCENDANTORSELF : iterator = (new TypedDescendantIterator(type)).includeSelf(); break; case Axis.FOLLOWING : iterator = new TypedFollowingIterator(type); break; case Axis.PRECEDING : iterator = new TypedPrecedingIterator(type); break; case Axis.FOLLOWINGSIBLING : iterator = new TypedFollowingSiblingIterator(type); break; case Axis.PRECEDINGSIBLING : iterator = new TypedPrecedingSiblingIterator(type); break; case Axis.NAMESPACE : iterator = new TypedNamespaceIterator(type); break; case Axis.ROOT : iterator = new TypedRootIterator(type); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: typed iterator for axis " //+ Axis.names[axis] + "not implemented"); } } return (iterator); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator getAxisIterator(final int axis) { DTMAxisIterator iterator = null; switch (axis) { case Axis.SELF : iterator = new SingletonIterator(); break; case Axis.CHILD : iterator = new ChildrenIterator(); break; case Axis.PARENT : return (new ParentIterator()); case Axis.ANCESTOR : return (new AncestorIterator()); case Axis.ANCESTORORSELF : return ((new AncestorIterator()).includeSelf()); case Axis.ATTRIBUTE : return (new AttributeIterator()); case Axis.DESCENDANT : iterator = new DescendantIterator(); break; case Axis.DESCENDANTORSELF : iterator = (new DescendantIterator()).includeSelf(); break; case Axis.FOLLOWING : iterator = new FollowingIterator(); break; case Axis.PRECEDING : iterator = new PrecedingIterator(); break; case Axis.FOLLOWINGSIBLING : iterator = new FollowingSiblingIterator(); break; case Axis.PRECEDINGSIBLING : iterator = new PrecedingSiblingIterator(); break; case Axis.NAMESPACE : iterator = new NamespaceIterator(); break; case Axis.ROOT : iterator = new RootIterator(); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: iterator for axis '" + Axis.names[axis] //+ "' not implemented"); } return (iterator); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final PrecedingIterator clone = (PrecedingIterator) super.clone(); final int[] stackCopy = new int[_stack.length]; System.arraycopy(_stack, 0, stackCopy, 0, _stack.length); clone._stack = stackCopy; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; // must set to false for any clone try { final AncestorIterator clone = (AncestorIterator) super.clone(); clone._startNode = _startNode; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final PrecedingIterator clone = (PrecedingIterator) super.clone(); final int[] stackCopy = new int[_stack.length]; System.arraycopy(_stack, 0, stackCopy, 0, _stack.length); clone._stack = stackCopy; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; // must set to false for any clone try { final AncestorIterator clone = (AncestorIterator) super.clone(); clone._startNode = _startNode; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing, boolean hasUserReader, int size, boolean buildIdIndex, boolean newNameTable) { if(DEBUG && null != source) { System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId()); } int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } dtm.setDocumentURI(source.getSystemId()); addDTM(dtm, dtmPos, 0); dom2sax.setContentHandler(dtm); try { dom2sax.parse(); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader; InputSource xmlSource; if (null == source) { xmlSource = null; reader = null; hasUserReader = false; // Make sure the user didn't lie } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } // Create the basic SAX2DTM. SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); if (null == reader) { // Then the user will construct it themselves. return dtm; } reader.setContentHandler(dtm.getBuilder()); if (!hasUserReader || null == reader.getDTDHandler()) { reader.setDTDHandler(dtm); } if(!hasUserReader || null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } finally { if (!hasUserReader) { releaseXMLReader(reader); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); } } }
6
              
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
0
(Lib) ArrayIndexOutOfBoundsException 23
              
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException { /* try { return fastArray[(position*slotsize)+offset]; } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (1)"); if (offset>=slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); return chunk[slotpos + offset]; } }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos + offset] = value; // ATOMIC! } }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getFunction(int i) throws ArrayIndexOutOfBoundsException { if (null == m_functions) throw new ArrayIndexOutOfBoundsException(); return (String) m_functions.elementAt(i); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getElement(int i) throws ArrayIndexOutOfBoundsException { if (null == m_elements) throw new ArrayIndexOutOfBoundsException(); return (String) m_elements.elementAt(i); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExcludeResultPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExcludeResultPrefixs) throw new ArrayIndexOutOfBoundsException(); return m_ExcludeResultPrefixs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public StylesheetComposed getImport(int i) throws ArrayIndexOutOfBoundsException { if (null == m_imports) throw new ArrayIndexOutOfBoundsException(); return (StylesheetComposed) m_imports.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public Stylesheet getInclude(int i) throws ArrayIndexOutOfBoundsException { if (null == m_includes) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includes.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public DecimalFormatProperties getDecimalFormat(int i) throws ArrayIndexOutOfBoundsException { if (null == m_DecimalFormatDeclarations) throw new ArrayIndexOutOfBoundsException(); return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getStripSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespaceStrippingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespaceStrippingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespacePreservingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public OutputProperties getOutput(int i) throws ArrayIndexOutOfBoundsException { if (null == m_output) throw new ArrayIndexOutOfBoundsException(); return (OutputProperties) m_output.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException { if (null == m_keyDeclarations) throw new ArrayIndexOutOfBoundsException(); return (KeyDeclaration) m_keyDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemAttributeSet getAttributeSet(int i) throws ArrayIndexOutOfBoundsException { if (null == m_attributeSets) throw new ArrayIndexOutOfBoundsException(); return (ElemAttributeSet) m_attributeSets.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemVariable getVariableOrParam(int i) throws ArrayIndexOutOfBoundsException { if (null == m_topLevelVariables) throw new ArrayIndexOutOfBoundsException(); return (ElemVariable) m_topLevelVariables.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemTemplate getTemplate(int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); return (ElemTemplate) m_templates.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public NamespaceAlias getNamespaceAlias(int i) throws ArrayIndexOutOfBoundsException { if (null == m_prefix_aliases) throw new ArrayIndexOutOfBoundsException(); return (NamespaceAlias) m_prefix_aliases.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i)); m_templates.setElementAt(v, i); v.setStylesheet(this); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public Stylesheet getIncludeComposed(int i) throws ArrayIndexOutOfBoundsException { if (-1 == i) return this; if (null == m_includesComposed) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includesComposed.elementAt(i); }
// in src/org/apache/xpath/NodeSet.java
public void removeElementAt(int i) { if (null == m_map) return; if (i >= m_firstFree) throw new ArrayIndexOutOfBoundsException(i + " >= " + m_firstFree); else if (i < 0) throw new ArrayIndexOutOfBoundsException(i); if (i < m_firstFree - 1) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1); m_firstFree--; m_map[m_firstFree] = null; }
0 23
              
// in src/org/apache/xml/dtm/ref/CustomStringPool.java
public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { return(String) m_intToString.elementAt(i); }
// in src/org/apache/xml/dtm/ref/DTMSafeStringPool.java
public synchronized String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { return super.indexToString(i); }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException { /* try { return fastArray[(position*slotsize)+offset]; } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (1)"); if (offset>=slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); return chunk[slotpos + offset]; } }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos + offset] = value; // ATOMIC! } }
// in src/org/apache/xml/dtm/ref/DTMStringPool.java
public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { if(i==NULL) return null; return (String) m_intToString.elementAt(i); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ArrayList getAttributeSetComposed(QName name) throws ArrayIndexOutOfBoundsException { return (ArrayList) m_attrSets.get(name); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getFunction(int i) throws ArrayIndexOutOfBoundsException { if (null == m_functions) throw new ArrayIndexOutOfBoundsException(); return (String) m_functions.elementAt(i); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getElement(int i) throws ArrayIndexOutOfBoundsException { if (null == m_elements) throw new ArrayIndexOutOfBoundsException(); return (String) m_elements.elementAt(i); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExcludeResultPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExcludeResultPrefixs) throw new ArrayIndexOutOfBoundsException(); return m_ExcludeResultPrefixs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public StylesheetComposed getImport(int i) throws ArrayIndexOutOfBoundsException { if (null == m_imports) throw new ArrayIndexOutOfBoundsException(); return (StylesheetComposed) m_imports.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public Stylesheet getInclude(int i) throws ArrayIndexOutOfBoundsException { if (null == m_includes) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includes.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public DecimalFormatProperties getDecimalFormat(int i) throws ArrayIndexOutOfBoundsException { if (null == m_DecimalFormatDeclarations) throw new ArrayIndexOutOfBoundsException(); return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getStripSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespaceStrippingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespaceStrippingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespacePreservingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public OutputProperties getOutput(int i) throws ArrayIndexOutOfBoundsException { if (null == m_output) throw new ArrayIndexOutOfBoundsException(); return (OutputProperties) m_output.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException { if (null == m_keyDeclarations) throw new ArrayIndexOutOfBoundsException(); return (KeyDeclaration) m_keyDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemAttributeSet getAttributeSet(int i) throws ArrayIndexOutOfBoundsException { if (null == m_attributeSets) throw new ArrayIndexOutOfBoundsException(); return (ElemAttributeSet) m_attributeSets.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemVariable getVariableOrParam(int i) throws ArrayIndexOutOfBoundsException { if (null == m_topLevelVariables) throw new ArrayIndexOutOfBoundsException(); return (ElemVariable) m_topLevelVariables.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public NamespaceAlias getNamespaceAlias(int i) throws ArrayIndexOutOfBoundsException { if (null == m_prefix_aliases) throw new ArrayIndexOutOfBoundsException(); return (NamespaceAlias) m_prefix_aliases.elementAt(i); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public StylesheetComposed getImportComposed(int i) throws ArrayIndexOutOfBoundsException { StylesheetRoot root = getStylesheetRoot(); // Get the stylesheet that is offset past this stylesheet. // Thus, if the index of this stylesheet is 3, an argument // to getImportComposed of 0 will return the 4th stylesheet // in the global import list. return root.getGlobalImport(1 + m_importNumber + i); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public Stylesheet getIncludeComposed(int i) throws ArrayIndexOutOfBoundsException { if (-1 == i) return this; if (null == m_includesComposed) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includesComposed.elementAt(i); }
(Domain) XPathException 19
              
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public double getNumberValue() throws XPathException { if (getResultType() != NUMBER_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number" } else { try { return m_resultObj.num(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public String getStringValue() throws XPathException { if (getResultType() != STRING_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string." } else { try { return m_resultObj.str(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public boolean getBooleanValue() throws XPathException { if (getResultType() != BOOLEAN_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean." } else { try { return m_resultObj.bool(); } catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node getSingleNodeValue() throws XPathException { if ((m_resultType != ANY_UNORDERED_NODE_TYPE) && (m_resultType != FIRST_ORDERED_NODE_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a single node. // This method applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE." } NodeIterator result = null; try { result = m_resultObj.nodeset(); } catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); } if (null == result) return null; Node node = result.nextNode(); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public int getSnapshotLength() throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. } return m_list.getLength(); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node snapshotItem(int index) throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, } Node node = m_list.item(index); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR, // m_support.ERROR, // null, // null, fmsg, 0, 0); // if(shouldThrow) { throw new XPathException(fmsg, this); } }
8
              
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
10
              
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public double getNumberValue() throws XPathException { if (getResultType() != NUMBER_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number" } else { try { return m_resultObj.num(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public String getStringValue() throws XPathException { if (getResultType() != STRING_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string." } else { try { return m_resultObj.str(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public boolean getBooleanValue() throws XPathException { if (getResultType() != BOOLEAN_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean." } else { try { return m_resultObj.bool(); } catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node getSingleNodeValue() throws XPathException { if ((m_resultType != ANY_UNORDERED_NODE_TYPE) && (m_resultType != FIRST_ORDERED_NODE_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a single node. // This method applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE." } NodeIterator result = null; try { result = m_resultObj.nodeset(); } catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); } if (null == result) return null; Node node = result.nextNode(); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public int getSnapshotLength() throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. } return m_list.getLength(); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node snapshotItem(int index) throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, } Node node = m_list.item(index); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public Object evaluate( String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) throws XPathException, DOMException { XPathExpression xpathExpression = createExpression(expression, resolver); return xpathExpression.evaluate(contextNode, type, result); }
(Lib) DOMException 18
              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public Object getParameter(String name) throws DOMException { if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { return Boolean.TRUE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ if ((fFeatures & ENTITIES) == 0 && (fFeatures & CDATA) == 0 && (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && (fFeatures & NAMESPACES) != 0 && (fFeatures & NAMESPACEDECLS) != 0 && (fFeatures & WELLFORMED) != 0 && (fFeatures & COMMENTS) != 0) { return Boolean.TRUE; } return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { return fDOMErrorHandler; } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { return null; } else { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public void setParameter(String name, Object value) throws DOMException { // If the value is a boolean if (value instanceof Boolean) { boolean state = ((Boolean) value).booleanValue(); if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { fFeatures = state ? fFeatures | COMMENTS : fFeatures & ~COMMENTS; // comments if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { fFeatures = state ? fFeatures | CDATA : fFeatures & ~CDATA; // cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { fFeatures = state ? fFeatures | ENTITIES : fFeatures & ~ENTITIES; // entities if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { fFeatures = state ? fFeatures | NAMESPACES : fFeatures & ~NAMESPACES; // namespaces if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { fFeatures = state ? fFeatures | NAMESPACEDECLS : fFeatures & ~NAMESPACEDECLS; // namespace-declarations if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { fFeatures = state ? fFeatures | SPLITCDATA : fFeatures & ~SPLITCDATA; // split-cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { fFeatures = state ? fFeatures | WELLFORMED : fFeatures & ~WELLFORMED; // well-formed if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { fFeatures = state ? fFeatures | DISCARDDEFAULT : fFeatures & ~DISCARDDEFAULT; // discard-default-content if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures & ~PRETTY_PRINT; // format-pretty-print if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { fFeatures = state ? fFeatures | XMLDECL : fFeatures & ~XMLDECL; if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); } else { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures & ~ELEM_CONTENT_WHITESPACE; // element-content-whitespace if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { // false is not supported if (!state) { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) ) { // true is not supported if (state) { String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); } */ } } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { // infoset if (state) { fFeatures &= ~ENTITIES; fFeatures &= ~CDATA; fFeatures &= ~SCHEMAVALIDATE; fFeatures &= ~DTNORMALIZE; fFeatures |= NAMESPACES; fFeatures |= NAMESPACEDECLS; fFeatures |= WELLFORMED; fFeatures |= ELEM_CONTENT_WHITESPACE; fFeatures |= COMMENTS; fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } } else { // If this is a non-boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } } // If the parameter value is not a boolean else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { if (value == null || value instanceof DOMErrorHandler) { fDOMErrorHandler = (DOMErrorHandler)value; } else { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { if (value != null) { if (!(value instanceof String)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } else { // If this is a boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) || name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL) || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) || name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void throwDOMException(short code, String msg) { String themsg = XSLMessages.createMessage(msg, null); throw new DOMException(code, themsg); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { if(null == refChild) { appendChild(newChild); return newChild; } if(newChild == refChild) { // hmm... return newChild; } Node node = m_firstChild; Node prev = null; boolean foundit = false; while (null != node) { // If the newChild is already in the tree, it is first removed. if(newChild == node) { if(null != prev) ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)node.getNextSibling(); else m_firstChild = (ElemTemplateElement)node.getNextSibling(); node = node.getNextSibling(); continue; // prev remains the same. } if(refChild == node) { if(null != prev) { ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)newChild; } else { m_firstChild = (ElemTemplateElement)newChild; } ((ElemTemplateElement)newChild).m_nextSibling = (ElemTemplateElement)refChild; ((ElemTemplateElement)newChild).setParentElem(this); prev = newChild; node = node.getNextSibling(); foundit = true; continue; } prev = node; node = node.getNextSibling(); } if(!foundit) throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild was not found in insertBefore method!"); else return newChild; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node cloneNode(boolean arg0) { throw new DOMException(DOMException.NOT_SUPPORTED_ERR,null); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public String getNamespaceForPrefix(String prefix, Node context) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_RESOLVER, null); throw new DOMException(DOMException.NAMESPACE_ERR, fmsg); // Unable to resolve prefix with null prefix resolver. }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
1
              
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
127
              
// in src/org/apache/xml/utils/UnImplNode.java
public Node appendChild(Node newChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"appendChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr removeAttributeNode(Attr oldAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNode not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr setAttributeNode(Attr newAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNode not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void removeAttribute(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttribute not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setAttribute(String name, String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttribute not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNodeNS not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNS not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNS not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public String getNodeValue() throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeValue not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setNodeValue(String nodeValue) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setNodeValue not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setValue(String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"insertBefore not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node removeChild(Node oldChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setPrefix(String prefix) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setPrefix not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Element createElement(String tagName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public CDATASection createCDATASection(String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr createAttribute(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public EntityReference createEntityReference(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node importNode(Node importedNode, boolean deep) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setData(String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public String substringData(int offset, int count) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void appendData(String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void insertData(int offset, String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void deleteData(int offset, int count) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void replaceData(int offset, int count, String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public Text splitText(int offset) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node adoptNode(Node source) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/utils/UnImplNode.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xml/utils/UnImplNode.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node renameNode(Node n, String namespaceURI, String name) throws DOMException{ return n; }
// in src/org/apache/xml/utils/UnImplNode.java
public Text replaceWholeText(String content) throws DOMException{ /* if (needsSyncData()) { synchronizeData(); } // make sure we can make the replacement if (!canModify(nextSibling)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } Node parent = this.getParentNode(); if (content == null || content.length() == 0) { // remove current node if (parent !=null) { // check if node in the tree parent.removeChild(this); return null; } } Text currentNode = null; if (isReadOnly()){ Text newNode = this.ownerDocument().createTextNode(content); if (parent !=null) { // check if node in the tree parent.insertBefore(newNode, this); parent.removeChild(this); currentNode = newNode; } else { return newNode; } } else { this.setData(content); currentNode = this; } Node sibling = currentNode.getNextSibling(); while ( sibling !=null) { parent.removeChild(sibling); sibling = currentNode.getNextSibling(); } return currentNode; */ return null; //Pending }
// in src/org/apache/xml/utils/UnImplNode.java
public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getNodeValue() throws DOMException { return dtm.getNodeValue(node); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getStringValue() throws DOMException { return dtm.getStringValue(node).toString(); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getData() throws DOMException { return dtm.getNodeValue(node); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String substringData(int offset, int count) throws DOMException { return getData().substring(offset,offset+count); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public String getTextContent() throws DOMException { return dtm.getStringValue(node).toString(); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node renameNode(Node n, String namespaceURI, String name) throws DOMException{ return n; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Text replaceWholeText(String content) throws DOMException{ /* if (needsSyncData()) { synchronizeData(); } // make sure we can make the replacement if (!canModify(nextSibling)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } Node parent = this.getParentNode(); if (content == null || content.length() == 0) { // remove current node if (parent !=null) { // check if node in the tree parent.removeChild(this); return null; } } Text currentNode = null; if (isReadOnly()){ Text newNode = this.ownerDocument().createTextNode(content); if (parent !=null) { // check if node in the tree parent.insertBefore(newNode, this); parent.removeChild(this); currentNode = newNode; } else { return newNode; } } else { this.setData(content); currentNode = this; } Node sibling = currentNode.getNextSibling(); while ( sibling !=null) { parent.removeChild(sibling); sibling = currentNode.getNextSibling(); } return currentNode; */ return null; //Pending }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node nextNode() throws DOMException { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.nextNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItemNS(Node arg) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public Object getParameter(String name) throws DOMException { if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { return Boolean.TRUE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ if ((fFeatures & ENTITIES) == 0 && (fFeatures & CDATA) == 0 && (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && (fFeatures & NAMESPACES) != 0 && (fFeatures & NAMESPACEDECLS) != 0 && (fFeatures & WELLFORMED) != 0 && (fFeatures & COMMENTS) != 0) { return Boolean.TRUE; } return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { return fDOMErrorHandler; } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { return null; } else { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public void setParameter(String name, Object value) throws DOMException { // If the value is a boolean if (value instanceof Boolean) { boolean state = ((Boolean) value).booleanValue(); if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { fFeatures = state ? fFeatures | COMMENTS : fFeatures & ~COMMENTS; // comments if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { fFeatures = state ? fFeatures | CDATA : fFeatures & ~CDATA; // cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { fFeatures = state ? fFeatures | ENTITIES : fFeatures & ~ENTITIES; // entities if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { fFeatures = state ? fFeatures | NAMESPACES : fFeatures & ~NAMESPACES; // namespaces if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { fFeatures = state ? fFeatures | NAMESPACEDECLS : fFeatures & ~NAMESPACEDECLS; // namespace-declarations if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { fFeatures = state ? fFeatures | SPLITCDATA : fFeatures & ~SPLITCDATA; // split-cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { fFeatures = state ? fFeatures | WELLFORMED : fFeatures & ~WELLFORMED; // well-formed if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { fFeatures = state ? fFeatures | DISCARDDEFAULT : fFeatures & ~DISCARDDEFAULT; // discard-default-content if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures & ~PRETTY_PRINT; // format-pretty-print if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { fFeatures = state ? fFeatures | XMLDECL : fFeatures & ~XMLDECL; if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); } else { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures & ~ELEM_CONTENT_WHITESPACE; // element-content-whitespace if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { // false is not supported if (!state) { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) ) { // true is not supported if (state) { String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); } */ } } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { // infoset if (state) { fFeatures &= ~ENTITIES; fFeatures &= ~CDATA; fFeatures &= ~SCHEMAVALIDATE; fFeatures &= ~DTNORMALIZE; fFeatures |= NAMESPACES; fFeatures |= NAMESPACEDECLS; fFeatures |= WELLFORMED; fFeatures |= ELEM_CONTENT_WHITESPACE; fFeatures |= COMMENTS; fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } } else { // If this is a non-boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } } // If the parameter value is not a boolean else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { if (value == null || value instanceof DOMErrorHandler) { fDOMErrorHandler = (DOMErrorHandler)value; } else { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { if (value != null) { if (!(value instanceof String)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } else { // If this is a boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) || name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL) || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) || name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public String writeToString(Node nodeArg) throws DOMException, LSException { // return null is nodeArg is null. Should an Exception be thrown instead? if (nodeArg == null) { return null; } // Should we reset the serializer configuration before each write operation? // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode){ // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // StringWriter to Output to StringWriter output = new StringWriter(); // try { // Set the Serializer's Writer to a StringWriter serializer.setWriter(output); // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } // return the serialized string return output.toString(); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeNamedItem(String name) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node setNamedItem(Node arg) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node setNamedItemNS(Node arg) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node appendChild(Node newChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getNodeValue() throws DOMException { return m_attribute.getSimpleString(); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeChild(Node oldChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setNodeValue(String nodeValue) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setPrefix(String prefix) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setValue(String value) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected int findAndEliminateRedundant(int start, int firstOccuranceIndex, ExpressionOwner firstOccuranceOwner, ElemTemplateElement psuedoVarRecipient, Vector paths) throws org.w3c.dom.DOMException { MultistepExprHolder head = null; MultistepExprHolder tail = null; int numPathsFound = 0; int n = paths.size(); Expression expr1 = firstOccuranceOwner.getExpression(); if(DEBUG) assertIsLocPathIterator(expr1, firstOccuranceOwner); boolean isGlobal = (paths == m_absPaths); LocPathIterator lpi = (LocPathIterator)expr1; int stepCount = countSteps(lpi); for(int j = start; j < n; j++) { ExpressionOwner owner2 = (ExpressionOwner)paths.elementAt(j); if(null != owner2) { Expression expr2 = owner2.getExpression(); boolean isEqual = expr2.deepEquals(lpi); if(isEqual) { LocPathIterator lpi2 = (LocPathIterator)expr2; if(null == head) { head = new MultistepExprHolder(firstOccuranceOwner, stepCount, null); tail = head; numPathsFound++; } tail.m_next = new MultistepExprHolder(owner2, stepCount, null); tail = tail.m_next; // Null out the occurance, so we don't have to test it again. paths.setElementAt(null, j); // foundFirst = true; numPathsFound++; } } } // Change all globals in xsl:templates, etc, to global vars no matter what. if((0 == numPathsFound) && isGlobal) { head = new MultistepExprHolder(firstOccuranceOwner, stepCount, null); numPathsFound++; } if(null != head) { ElemTemplateElement root = isGlobal ? psuedoVarRecipient : findCommonAncestor(head); LocPathIterator sharedIter = (LocPathIterator)head.m_exprOwner.getExpression(); ElemVariable var = createPseudoVarDecl(root, sharedIter, isGlobal); if(DIAGNOSE_MULTISTEPLIST) System.err.println("Created var: "+var.getName()+(isGlobal ? "(Global)" : "")); QName uniquePseudoVarName = var.getName(); while(null != head) { ExpressionOwner owner = head.m_exprOwner; if(DIAGNOSE_MULTISTEPLIST) diagnoseLineNumber(owner.getExpression()); changeToVarRef(uniquePseudoVarName, owner, paths, root); head = head.m_next; } // Replace the first occurance with the variable's XPath, so // that further reduction may take place if needed. paths.setElementAt(var.getSelect(), firstOccuranceIndex); } return numPathsFound; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected int oldFindAndEliminateRedundant(int start, int firstOccuranceIndex, ExpressionOwner firstOccuranceOwner, ElemTemplateElement psuedoVarRecipient, Vector paths) throws org.w3c.dom.DOMException { QName uniquePseudoVarName = null; boolean foundFirst = false; int numPathsFound = 0; int n = paths.size(); Expression expr1 = firstOccuranceOwner.getExpression(); if(DEBUG) assertIsLocPathIterator(expr1, firstOccuranceOwner); boolean isGlobal = (paths == m_absPaths); LocPathIterator lpi = (LocPathIterator)expr1; for(int j = start; j < n; j++) { ExpressionOwner owner2 = (ExpressionOwner)paths.elementAt(j); if(null != owner2) { Expression expr2 = owner2.getExpression(); boolean isEqual = expr2.deepEquals(lpi); if(isEqual) { LocPathIterator lpi2 = (LocPathIterator)expr2; if(!foundFirst) { foundFirst = true; // Insert variable decl into psuedoVarRecipient // We want to insert this into the first legitimate // position for a variable. ElemVariable var = createPseudoVarDecl(psuedoVarRecipient, lpi, isGlobal); if(null == var) return 0; uniquePseudoVarName = var.getName(); changeToVarRef(uniquePseudoVarName, firstOccuranceOwner, paths, psuedoVarRecipient); // Replace the first occurance with the variable's XPath, so // that further reduction may take place if needed. paths.setElementAt(var.getSelect(), firstOccuranceIndex); numPathsFound++; } changeToVarRef(uniquePseudoVarName, owner2, paths, psuedoVarRecipient); // Null out the occurance, so we don't have to test it again. paths.setElementAt(null, j); // foundFirst = true; numPathsFound++; } } } // Change all globals in xsl:templates, etc, to global vars no matter what. if((0 == numPathsFound) && (paths == m_absPaths)) { ElemVariable var = createPseudoVarDecl(psuedoVarRecipient, lpi, true); if(null == var) return 0; uniquePseudoVarName = var.getName(); changeToVarRef(uniquePseudoVarName, firstOccuranceOwner, paths, psuedoVarRecipient); paths.setElementAt(var.getSelect(), firstOccuranceIndex); numPathsFound++; } return numPathsFound; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createPseudoVarDecl( ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi, boolean isGlobal) throws org.w3c.dom.DOMException { QName uniquePseudoVarName = new QName (PSUEDOVARNAMESPACE, "#"+getPseudoVarID()); if(isGlobal) { return createGlobalPseudoVarDecl(uniquePseudoVarName, (StylesheetRoot)psuedoVarRecipient, lpi); } else return createLocalPseudoVarDecl(uniquePseudoVarName, psuedoVarRecipient, lpi); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createGlobalPseudoVarDecl(QName uniquePseudoVarName, StylesheetRoot stylesheetRoot, LocPathIterator lpi) throws org.w3c.dom.DOMException { ElemVariable psuedoVar = new ElemVariable(); psuedoVar.setIsTopLevel(true); XPath xpath = new XPath(lpi); psuedoVar.setSelect(xpath); psuedoVar.setName(uniquePseudoVarName); Vector globalVars = stylesheetRoot.getVariablesAndParamsComposed(); psuedoVar.setIndex(globalVars.size()); globalVars.addElement(psuedoVar); return psuedoVar; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createLocalPseudoVarDecl(QName uniquePseudoVarName, ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi) throws org.w3c.dom.DOMException { ElemVariable psuedoVar = new ElemVariablePsuedo(); XPath xpath = new XPath(lpi); psuedoVar.setSelect(xpath); psuedoVar.setName(uniquePseudoVarName); ElemVariable var = addVarDeclToElem(psuedoVarRecipient, lpi, psuedoVar); lpi.exprSetParent(var); return var; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable addVarDeclToElem( ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi, ElemVariable psuedoVar) throws org.w3c.dom.DOMException { // Create psuedo variable element ElemTemplateElement ete = psuedoVarRecipient.getFirstChildElem(); lpi.callVisitors(null, m_varNameCollector); // If the location path contains variables, we have to insert the // psuedo variable after the reference. (Otherwise, we want to // insert it as close as possible to the top, so we'll be sure // it is in scope for any other vars. if (m_varNameCollector.getVarCount() > 0) { ElemTemplateElement baseElem = getElemFromExpression(lpi); ElemVariable varElem = getPrevVariableElem(baseElem); while (null != varElem) { if (m_varNameCollector.doesOccur(varElem.getName())) { psuedoVarRecipient = varElem.getParentElem(); ete = varElem.getNextSiblingElem(); break; } varElem = getPrevVariableElem(varElem); } } if ((null != ete) && (Constants.ELEMNAME_PARAMVARIABLE == ete.getXSLToken())) { // Can't stick something in front of a param, so abandon! (see variable13.xsl) if(isParam(lpi)) return null; while (null != ete) { ete = ete.getNextSiblingElem(); if ((null != ete) && Constants.ELEMNAME_PARAMVARIABLE != ete.getXSLToken()) break; } } psuedoVarRecipient.insertBefore(psuedoVar, ete); m_varNameCollector.reset(); return psuedoVar; }
// in src/org/apache/xalan/templates/ElemSort.java
public Node appendChild(Node newChild) throws DOMException { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node appendChild(Node newChild) throws DOMException { if (null == newChild) { error(XSLTErrorResources.ER_NULL_CHILD, null); //"Trying to add a null child!"); } ElemTemplateElement elem = (ElemTemplateElement) newChild; if (null == m_firstChild) { m_firstChild = elem; } else { ElemTemplateElement last = (ElemTemplateElement) getLastChild(); last.m_nextSibling = elem; } elem.m_parentNode = this; return newChild; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { if (oldChild == null || oldChild.getParentNode() != this) return null; ElemTemplateElement newChildElem = ((ElemTemplateElement) newChild); ElemTemplateElement oldChildElem = ((ElemTemplateElement) oldChild); // Fix up previous sibling. ElemTemplateElement prev = (ElemTemplateElement) oldChildElem.getPreviousSibling(); if (null != prev) prev.m_nextSibling = newChildElem; // Fix up parent (this) if (m_firstChild == oldChildElem) m_firstChild = newChildElem; newChildElem.m_parentNode = this; oldChildElem.m_parentNode = null; newChildElem.m_nextSibling = oldChildElem.m_nextSibling; oldChildElem.m_nextSibling = null; // newChildElem.m_stylesheet = oldChildElem.m_stylesheet; // oldChildElem.m_stylesheet = null; return newChildElem; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { if(null == refChild) { appendChild(newChild); return newChild; } if(newChild == refChild) { // hmm... return newChild; } Node node = m_firstChild; Node prev = null; boolean foundit = false; while (null != node) { // If the newChild is already in the tree, it is first removed. if(newChild == node) { if(null != prev) ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)node.getNextSibling(); else m_firstChild = (ElemTemplateElement)node.getNextSibling(); node = node.getNextSibling(); continue; // prev remains the same. } if(refChild == node) { if(null != prev) { ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)newChild; } else { m_firstChild = (ElemTemplateElement)newChild; } ((ElemTemplateElement)newChild).m_nextSibling = (ElemTemplateElement)refChild; ((ElemTemplateElement)newChild).setParentElem(this); prev = newChild; node = node.getNextSibling(); foundit = true; continue; } prev = node; node = node.getNextSibling(); } if(!foundit) throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild was not found in insertBefore method!"); else return newChild; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public String getNodeValue() throws DOMException { return m_attributeNode.getNodeValue(); }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setNodeValue(String arg0) throws DOMException { }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node insertBefore(Node arg0, Node arg1) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node replaceChild(Node arg0, Node arg1) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node removeChild(Node arg0) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node appendChild(Node arg0) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setPrefix(String arg0) throws DOMException { }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public String getTextContent() throws DOMException { return textContent; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setTextContent(String textContent) throws DOMException { this.textContent = textContent; }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public Object evaluate( String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) throws XPathException, DOMException { XPathExpression xpathExpression = createExpression(expression, resolver); return xpathExpression.evaluate(contextNode, type, result); }
// in src/org/apache/xpath/NodeSet.java
public Node nextNode() throws DOMException { if ((m_next) < this.size()) { Node next = this.elementAt(m_next); m_next++; return next; } else return null; }
// in src/org/apache/xpath/NodeSet.java
public Node previousNode() throws DOMException { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return null; }
(Domain) TransletException 12
              
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename, boolean append) throws TransletException { try { final TransletOutputHandlerFactory factory = TransletOutputHandlerFactory.newInstance(); String dirStr = new File(filename).getParent(); if ((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } factory.setEncoding(_encoding); factory.setOutputMethod(_method); factory.setWriter(new FileWriter(filename, append)); factory.setOutputType(TransletOutputHandlerFactory.STREAM); final SerializationHandler handler = factory.getSerializationHandler(); transferOutputSettings(handler); handler.startDocument(); return handler; } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void characters(final String string, SerializationHandler handler) throws TransletException { if (string != null) { //final int length = string.length(); try { handler.characters(string); } catch (Exception e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { int nodeID = getNodeIdent(node); if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) { boolean escapeBit = false; boolean oldEscapeSetting = false; try { for (int i = 0; i < _size; i++) { if (_dontEscape != null) { escapeBit = _dontEscape.getBit(i); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } handler.characters(_textArray[i]); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } } } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom, boolean cacheDOM) throws Exception { try { final String originalUri = uri; MultiDOM multiplexer = (MultiDOM)dom; // Prepend URI base to URI (from context) if (base != null && base.length() != 0) { uri = SystemIDResolver.getAbsoluteURI(uri, base); } // Return an empty iterator if the URI is clearly invalid // (to prevent some unncessary MalformedURL exceptions). if (uri == null || uri.length() == 0) { return(EmptyIterator.getInstance()); } // Check if this DOM has already been added to the multiplexer int mask = multiplexer.getDocumentMask(uri); if (mask != -1) { DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri)) .getDOMImpl(); if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); } } // Check if we can get the DOM from a DOMCache DOMCache cache = translet.getDOMCache(); DOM newdom; mask = multiplexer.nextMask(); // peek if (cache != null) { newdom = cache.retrieveDocument(base, originalUri, translet); if (newdom == null) { final Exception e = new FileNotFoundException(originalUri); throw new TransletException(e); } } else { // Parse the input document and construct DOM object // Trust the DTMManager to pick the right parser and // set up the DOM correctly. XSLTCDTMManager dtmManager = (XSLTCDTMManager)multiplexer .getDTMManager(); DOMEnhancedForDTM enhancedDOM = (DOMEnhancedForDTM) dtmManager.getDTM(new StreamSource(uri), false, null, true, false, translet.hasIdCall(), cacheDOM); newdom = enhancedDOM; // Cache the stylesheet DOM in the Templates object if (cacheDOM) { TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); if (templates != null) { templates.setStylesheetDOM(enhancedDOM); } } translet.prepassDocument(enhancedDOM); enhancedDOM.setDocumentURI(uri); } // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); multiplexer.addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); } catch (Exception e) { throw e; } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { try { dispatchCharactersEvents(node, handler, false); } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private final void copy(final int node, SerializationHandler handler, boolean isChild) throws TransletException { int nodeID = makeNodeIdentity(node); int eType = _exptype2(nodeID); int type = _exptype2Type(eType); try { switch(type) { case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: for(int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } break; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); break; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); break; case DTM.TEXT_NODE: boolean oldEscapeSetting = false; boolean escapeBit = false; if (_dontEscape != null) { escapeBit = _dontEscape.getBit(getNodeIdent(node)); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } copyTextNode(nodeID, handler); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } break; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, eType, handler); break; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); break; default: if (type == DTM.ELEMENT_NODE) { // Start element definition final String name = copyElement(nodeID, eType, handler); //if(isChild) => not to copy any namespaces from parents // else copy all namespaces in scope copyNS(nodeID, handler,!isChild); copyAttributes(nodeID, handler); // Copy element children for (int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } // Close element definition handler.endElement(name); } // Shallow copy of attribute to output handler else { final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); } break; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void copyPI(final int node, SerializationHandler handler) throws TransletException { final String target = getNodeName(node); final String value = getStringValueX(node); try { handler.processingInstruction(target, value); } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { int nodeID = makeNodeIdentity(node); int exptype = _exptype2(nodeID); int type = _exptype2Type(exptype); try { switch(type) { case DTM.ELEMENT_NODE: final String name = copyElement(nodeID, exptype, handler); copyNS(nodeID, handler, true); return name; case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: return EMPTYSTRING; case DTM.TEXT_NODE: copyTextNode(nodeID, handler); return null; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); return null; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); return null; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); return null; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, exptype, handler); return null; default: final String uri1 = getNamespaceName(node); if (uri1.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri1); } handler.addAttribute(getNodeName(node), getNodeValue(node)); return null; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
public final void initialize(int node, int last, DOM dom, SortSettings settings) throws TransletException { _dom = dom; _node = node; _last = last; _settings = settings; int levels = settings.getSortOrders().length; _values = new Object[levels]; // -- W. Eliot Kimber (eliot@isogen.com) String colFactClassname = System.getProperty("org.apache.xalan.xsltc.COLLATOR_FACTORY"); if (colFactClassname != null) { try { Object candObj = ObjectFactory.findProviderClass( colFactClassname, ObjectFactory.findClassLoader(), true); _collatorFactory = (CollatorFactory)candObj; } catch (ClassNotFoundException e) { throw new TransletException(e); } Locale[] locales = settings.getLocales(); _collators = new Collator[levels]; for (int i = 0; i < levels; i++){ _collators[i] = _collatorFactory.getCollator(locales[i]); } _collator = _collators[0]; } else { _collators = settings.getCollators(); _collator = _collators[0]; } }
11
              
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
40
              
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final DOMAdapter makeDOMAdapter(DOM dom) throws TransletException { setRootForKeys(dom.getDocument()); return new DOMAdapter(dom, namesArray, urisArray, typesArray, namespaceArray); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public void buildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root) throws TransletException { }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename, boolean append) throws TransletException { try { final TransletOutputHandlerFactory factory = TransletOutputHandlerFactory.newInstance(); String dirStr = new File(filename).getParent(); if ((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } factory.setEncoding(_encoding); factory.setOutputMethod(_method); factory.setWriter(new FileWriter(filename, append)); factory.setOutputType(TransletOutputHandlerFactory.STREAM); final SerializationHandler handler = factory.getSerializationHandler(); transferOutputSettings(handler); handler.startDocument(); return handler; } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename) throws TransletException { return openOutputHandler(filename, false); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void transform(DOM document, SerializationHandler handler) throws TransletException { try { transform(document, document.getIterator(), handler); } finally { _keyIndexes = null; } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void characters(final String string, SerializationHandler handler) throws TransletException { if (string != null) { //final int length = string.length(); try { handler.characters(string); } catch (Exception e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { characters(node, handler); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { characters(node, handler); return null; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { int nodeID = getNodeIdent(node); if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) { boolean escapeBit = false; boolean oldEscapeSetting = false; try { for (int i = 0; i < _size; i++) { if (_dontEscape != null) { escapeBit = _dontEscape.getBit(i); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } handler.characters(_textArray[i]); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } } } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { return null; }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void copy(final int node, SerializationHandler handler) throws TransletException { _dom.copy(node, handler); }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void copy(DTMAxisIterator nodes,SerializationHandler handler) throws TransletException { _dom.copy(nodes, handler); }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (_enhancedDOM != null) { return _enhancedDOM.shallowCopy(node, handler); } else { return _dom.shallowCopy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void characters(final int textNode, SerializationHandler handler) throws TransletException { if (_enhancedDOM != null) { _enhancedDOM.characters(textNode, handler); } else { _dom.characters(textNode, handler); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public String lookupNamespace(int node, String prefix) throws TransletException { return _dom.lookupNamespace(node, prefix); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.copy(node, handler); } else { super.copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.copy(nodes, handler); } else { super.copy(nodes, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { return _dom.shallowCopy(node, handler); } else { return super.shallowCopy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.characters(node, handler); } else { super.characters(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { if (_dom != null) { return _dom.lookupNamespace(node, prefix); } else { return super.lookupNamespace(node, prefix); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { int anode, nsnode; final AncestorIterator ancestors = new AncestorIterator(); if (isElement(node)) { ancestors.includeSelf(); } ancestors.setStartNode(node); while ((anode = ancestors.next()) != DTM.NULL) { final NamespaceIterator namespaces = new NamespaceIterator(); namespaces.setStartNode(anode); while ((nsnode = namespaces.next()) != DTM.NULL) { if (getLocalName(nsnode).equals(prefix)) { return getNodeValue(nsnode); } } } BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { try { dispatchCharactersEvents(node, handler, false); } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(SerializationHandler handler) throws TransletException { copy(getDocument(), handler); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { copy(node, handler, false ); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private final void copy(final int node, SerializationHandler handler, boolean isChild) throws TransletException { int nodeID = makeNodeIdentity(node); int eType = _exptype2(nodeID); int type = _exptype2Type(eType); try { switch(type) { case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: for(int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } break; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); break; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); break; case DTM.TEXT_NODE: boolean oldEscapeSetting = false; boolean escapeBit = false; if (_dontEscape != null) { escapeBit = _dontEscape.getBit(getNodeIdent(node)); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } copyTextNode(nodeID, handler); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } break; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, eType, handler); break; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); break; default: if (type == DTM.ELEMENT_NODE) { // Start element definition final String name = copyElement(nodeID, eType, handler); //if(isChild) => not to copy any namespaces from parents // else copy all namespaces in scope copyNS(nodeID, handler,!isChild); copyAttributes(nodeID, handler); // Copy element children for (int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } // Close element definition handler.endElement(name); } // Shallow copy of attribute to output handler else { final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); } break; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void copyPI(final int node, SerializationHandler handler) throws TransletException { final String target = getNodeName(node); final String value = getStringValueX(node); try { handler.processingInstruction(target, value); } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { int nodeID = makeNodeIdentity(node); int exptype = _exptype2(nodeID); int type = _exptype2Type(exptype); try { switch(type) { case DTM.ELEMENT_NODE: final String name = copyElement(nodeID, exptype, handler); copyNS(nodeID, handler, true); return name; case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: return EMPTYSTRING; case DTM.TEXT_NODE: copyTextNode(nodeID, handler); return null; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); return null; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); return null; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); return null; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, exptype, handler); return null; default: final String uri1 = getNamespaceName(node); if (uri1.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri1); } handler.addAttribute(getNodeName(node), getNodeValue(node)); return null; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
public final void initialize(int node, int last, DOM dom, SortSettings settings) throws TransletException { _dom = dom; _node = node; _last = last; _settings = settings; int levels = settings.getSortOrders().length; _values = new Object[levels]; // -- W. Eliot Kimber (eliot@isogen.com) String colFactClassname = System.getProperty("org.apache.xalan.xsltc.COLLATOR_FACTORY"); if (colFactClassname != null) { try { Object candObj = ObjectFactory.findProviderClass( colFactClassname, ObjectFactory.findClassLoader(), true); _collatorFactory = (CollatorFactory)candObj; } catch (ClassNotFoundException e) { throw new TransletException(e); } Locale[] locales = settings.getLocales(); _collators = new Collator[levels]; for (int i = 0; i < levels; i++){ _collators[i] = _collatorFactory.getCollator(locales[i]); } _collator = _collators[0]; } else { _collators = settings.getCollators(); _collator = _collators[0]; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void copy(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (node == DTM.NULL) { return ""; } return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].shallowCopy(node, handler); }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void characters(final int textNode, SerializationHandler handler) throws TransletException { if (textNode != DTM.NULL) { _adapters[textNode >>> DTMManager.IDENT_DTM_NODE_BITS].characters(textNode, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public String lookupNamespace(int node, String prefix) throws TransletException { return _main.lookupNamespace(node, prefix); }
(Domain) WrappedRuntimeException 49
              
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
public DTMAxisIterator cloneIterator() { try { final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone(); clone._isRestartable = false; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public static void main(String args[]) { System.out.println("Starting..."); CoroutineManager co = new CoroutineManager(); int appCoroutineID = co.co_joinCoroutineSet(-1); if (appCoroutineID == -1) { System.out.println("ERROR: Couldn't allocate coroutine number.\n"); return; } IncrementalSAXSource parser= createIncrementalSAXSource(); // Use a serializer as our sample output org.apache.xml.serialize.XMLSerializer trace; trace=new org.apache.xml.serialize.XMLSerializer(System.out,null); parser.setContentHandler(trace); parser.setLexicalHandler(trace); // Tell coroutine to begin parsing, run while parsing is in progress for(int arg=0;arg<args.length;++arg) { try { InputSource source = new InputSource(args[arg]); Object result=null; boolean more=true; parser.startParse(source); for(result = parser.deliverMoreNodes(more); result==Boolean.TRUE; result = parser.deliverMoreNodes(more)) { System.out.println("\nSome parsing successful, trying more.\n"); // Special test: Terminate parsing early. if(arg+1<args.length && "!".equals(args[arg+1])) { ++arg; more=false; } } if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE) { System.out.println("\nParser ended (EOF or on request).\n"); } else if (result == null) { System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n"); } else if (result instanceof Exception) { throw new org.apache.xml.utils.WrappedRuntimeException((Exception)result); // System.out.println("\nParser threw exception:"); // ((Exception)result).printStackTrace(); } } catch(SAXException e) { e.printStackTrace(); } } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) { if(DEBUG && null != source) System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId() ); XMLStringFactory xstringFactory = m_xsf; int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); addDTM(dtm, dtmPos, 0); // if (DUMPTREE) // { // dtm.dumpDTM(); // } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader = null; SAX2DTM dtm; try { InputSource xmlSource; if (null == source) { xmlSource = null; } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } if (source==null && unique && !incremental && !doIndexing) { // Special case to support RTF construction into shared DTM. // It should actually still work for other uses, // but may be slightly deoptimized relative to the base // to allow it to deal with carrying multiple documents. // // %REVIEW% This is a sloppy way to request this mode; // we need to consider architectural improvements. dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } /************************************************************** // EXPERIMENTAL 3/22/02 else if(JKESS_XNI_EXPERIMENT && m_incremental) { dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } **************************************************************/ // Create the basic SAX2DTM. else { dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); boolean haveXercesParser = (null != reader) && (reader.getClass() .getName() .equals("org.apache.xerces.parsers.SAXParser") ); if (haveXercesParser) { incremental = true; // No matter what. %REVIEW% } // If the reader is null, but they still requested an incremental // build, then we still want to set up the IncrementalSAXSource stuff. if (m_incremental && incremental /* || ((null == reader) && incremental) */) { IncrementalSAXSource coParser=null; if (haveXercesParser) { // IncrementalSAXSource_Xerces to avoid threading. try { coParser =(IncrementalSAXSource) Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance(); } catch( Exception ex ) { ex.printStackTrace(); coParser=null; } } if (coParser==null ) { // Create a IncrementalSAXSource to run on the secondary thread. if (null == reader) { coParser = new IncrementalSAXSource_Filter(); } else { IncrementalSAXSource_Filter filter = new IncrementalSAXSource_Filter(); filter.setXMLReader(reader); coParser=filter; } } /************************************************************** // EXPERIMENTAL 3/22/02 if (JKESS_XNI_EXPERIMENT && m_incremental && dtm instanceof XNI2DTM && coParser instanceof IncrementalSAXSource_Xerces) { org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc= ((IncrementalSAXSource_Xerces)coParser) .getXNIParserConfiguration(); if (xpc!=null) { // Bypass SAX; listen to the XNI stream ((XNI2DTM)dtm).setIncrementalXNISource(xpc); } else { // Listen to the SAX stream (will fail, diagnostically...) dtm.setIncrementalSAXSource(coParser); } } else ***************************************************************/ // Have the DTM set itself up as IncrementalSAXSource's listener. dtm.setIncrementalSAXSource(coParser); if (null == xmlSource) { // Then the user will construct it themselves. return dtm; } if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } reader.setDTDHandler(dtm); try { // Launch parsing coroutine. Launches a second thread, // if we're using IncrementalSAXSource.filter(). coParser.startParse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } else { if (null == reader) { // Then the user will construct it themselves. return dtm; } // not incremental reader.setContentHandler(dtm); reader.setDTDHandler(dtm); if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); } } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected boolean nextNode() { if (null == m_incrementalSAXSource) return false; if (m_endDocumentOccured) { clearCoRoutine(); return false; } Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true); // gotMore may be a Boolean (TRUE if still parsing, FALSE if // EOF) or an exception if IncrementalSAXSource malfunctioned // (code error rather than user error). // // %REVIEW% Currently the ErrorHandlers sketched herein are // no-ops, so I'm going to initially leave this also as a // no-op. if (!(gotMore instanceof Boolean)) { if(gotMore instanceof RuntimeException) { throw (RuntimeException)gotMore; } else if(gotMore instanceof Exception) { throw new WrappedRuntimeException((Exception)gotMore); } // for now... clearCoRoutine(); return false; // %TBD% } if (gotMore != Boolean.TRUE) { // EOF reached without satisfying the request clearCoRoutine(); // Drop connection, stop trying // %TBD% deregister as its listener? } return true; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
static public final Properties getDefaultMethodProperties(String method) { String fileName = null; Properties defaultProperties = null; // According to this article : Double-check locking does not work // http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html try { synchronized (m_synch_object) { if (null == m_xml_properties) // double check { fileName = PROP_FILE_XML; m_xml_properties = loadPropertiesFile(fileName, null); } } if (method.equals(Method.XML)) { defaultProperties = m_xml_properties; } else if (method.equals(Method.HTML)) { if (null == m_html_properties) // double check { fileName = PROP_FILE_HTML; m_html_properties = loadPropertiesFile(fileName, m_xml_properties); } defaultProperties = m_html_properties; } else if (method.equals(Method.TEXT)) { if (null == m_text_properties) // double check { fileName = PROP_FILE_TEXT; m_text_properties = loadPropertiesFile(fileName, m_xml_properties); if (null == m_text_properties.getProperty(OutputKeys.ENCODING)) { String mimeEncoding = Encodings.getMimeEncoding(null); m_text_properties.put( OutputKeys.ENCODING, mimeEncoding); } } defaultProperties = m_text_properties; } else if (method.equals(Method.UNKNOWN)) { if (null == m_unknown_properties) // double check { fileName = PROP_FILE_UNKNOWN; m_unknown_properties = loadPropertiesFile(fileName, m_xml_properties); } defaultProperties = m_unknown_properties; } else { // TODO: Calculate res file from name. defaultProperties = m_xml_properties; } } catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); } // wrap these cached defaultProperties in a new Property object just so // that the caller of this method can't modify the default values return new Properties(defaultProperties); }
// in src/org/apache/xml/serializer/CharInfo.java
static CharInfo getCharInfo(String entitiesFileName, String method) { CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName); if (charInfo != null) { return mutableCopyOf(charInfo); } // try to load it internally - cache try { charInfo = getCharInfoBasedOnPrivilege(entitiesFileName, method, true); // Put the common copy of charInfo in the cache, but return // a copy of it. m_getCharInfoCache.put(entitiesFileName, charInfo); return mutableCopyOf(charInfo); } catch (Exception e) {} // try to load it externally - do not cache try { return getCharInfoBasedOnPrivilege(entitiesFileName, method, false); } catch (Exception e) {} String absoluteEntitiesFileName; if (entitiesFileName.indexOf(':') < 0) { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName); } else { try { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null); } catch (TransformerException te) { throw new WrappedRuntimeException(te); } } return getCharInfoBasedOnPrivilege(entitiesFileName, method, false); }
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
// in src/org/apache/xml/serializer/ToStream.java
public void serialize(Node node) throws IOException { try { TreeWalker walker = new TreeWalker(this); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/Encodings.java
private static EncodingInfo[] loadEncodingInfo() { try { final InputStream is; is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(), ENCODINGS_FILE); Properties props = new Properties(); if (is != null) { props.load(is); is.close(); } else { // Seems to be no real need to force failure here, let the // system do its best... The issue is not really very critical, // and the output will be in any case _correct_ though maybe not // always human-friendly... :) // But maybe report/log the resource problem? // Any standard ways to report/log errors (in static context)? } int totalEntries = props.size(); List encodingInfo_list = new ArrayList(); Enumeration keys = props.keys(); for (int i = 0; i < totalEntries; ++i) { String javaName = (String) keys.nextElement(); String val = props.getProperty(javaName); int len = lengthOfMimeNames(val); String mimeName; char highChar; if (len == 0) { // There is no property value, only the javaName, so try and recover mimeName = javaName; highChar = '\u0000'; // don't know the high code point, will need to test every character } else { try { // Get the substring after the Mime names final String highVal = val.substring(len).trim(); highChar = (char) Integer.decode(highVal).intValue(); } catch( NumberFormatException e) { highChar = 0; } String mimeNames = val.substring(0, len); StringTokenizer st = new StringTokenizer(mimeNames, ","); for (boolean first = true; st.hasMoreTokens(); first = false) { mimeName = st.nextToken(); EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar); encodingInfo_list.add(ei); _encodingTableKeyMime.put(mimeName.toUpperCase(), ei); if (first) _encodingTableKeyJava.put(javaName.toUpperCase(), ei); } } } // Convert the Vector of EncodingInfo objects into an array of them, // as that is the kind of thing this method returns. EncodingInfo[] ret_ei = new EncodingInfo[encodingInfo_list.size()]; encodingInfo_list.toArray(ret_ei); return ret_ei; } catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); } catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); } }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
public void serializeDOM3(Node node) throws IOException { try { DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler, fErrorHandler, fSerializerFilter, fNewLine); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing, boolean hasUserReader, int size, boolean buildIdIndex, boolean newNameTable) { if(DEBUG && null != source) { System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId()); } int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } dtm.setDocumentURI(source.getSystemId()); addDTM(dtm, dtmPos, 0); dom2sax.setContentHandler(dtm); try { dom2sax.parse(); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader; InputSource xmlSource; if (null == source) { xmlSource = null; reader = null; hasUserReader = false; // Make sure the user didn't lie } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } // Create the basic SAX2DTM. SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); if (null == reader) { // Then the user will construct it themselves. return dtm; } reader.setContentHandler(dtm.getBuilder()); if (!hasUserReader || null == reader.getDTDHandler()) { reader.setDTDHandler(dtm); } if(!hasUserReader || null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } finally { if (!hasUserReader) { releaseXMLReader(reader); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); } } }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/Stylesheet.java
protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs) { int s = getImportCount(); for (int j = 0; j < s; j++) { getImport(j).callVisitors(visitor); } s = getIncludeCount(); for (int j = 0; j < s; j++) { getInclude(j).callVisitors(visitor); } s = getOutputCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getOutput(j)); } // Next, add in the attribute-set elements s = getAttributeSetCount(); for (int j = 0; j < s; j++) { ElemAttributeSet attrSet = getAttributeSet(j); if (visitor.visitTopLevelInstruction(attrSet)) { attrSet.callChildVisitors(visitor); } } // Now the decimal-formats s = getDecimalFormatCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getDecimalFormat(j)); } // Now the keys s = getKeyCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getKey(j)); } // And the namespace aliases s = getNamespaceAliasCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getNamespaceAlias(j)); } // Next comes the templates s = getTemplateCount(); for (int j = 0; j < s; j++) { try { ElemTemplate template = getTemplate(j); if (visitor.visitTopLevelInstruction(template)) { template.callChildVisitors(visitor); } } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } } // Then, the variables s = getVariableOrParamCount(); for (int j = 0; j < s; j++) { ElemVariable var = getVariableOrParam(j); if (visitor.visitTopLevelVariableOrParamDecl(var)) { var.callChildVisitors(visitor); } } // And lastly the whitespace preserving and stripping elements s = getStripSpaceCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getStripSpace(j)); } s = getPreserveSpaceCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getPreserveSpace(j)); } if(null != m_NonXslTopLevel) { java.util.Enumeration elements = m_NonXslTopLevel.elements(); while(elements.hasMoreElements()) { ElemTemplateElement elem = (ElemTemplateElement)elements.nextElement(); if (visitor.visitTopLevelInstruction(elem)) { elem.callChildVisitors(visitor); } } } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected WalkingIterator createIteratorFromSteps(final WalkingIterator wi, int numSteps) { WalkingIterator newIter = new WalkingIterator(wi.getPrefixResolver()); try { AxesWalker walker = (AxesWalker)wi.getFirstWalker().clone(); newIter.setFirstWalker(walker); walker.setLocPathIterator(newIter); for(int i = 1; i < numSteps; i++) { AxesWalker next = (AxesWalker)walker.getNextWalker().clone(); walker.setNextWalker(next); next.setLocPathIterator(newIter); walker = next; } walker.setNextWalker(null); } catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); } return newIter; }
// in src/org/apache/xalan/transformer/KeyTable.java
private Hashtable getRefsTable() { if (m_refsTable == null) { // initial capacity set to a prime number to improve hash performance m_refsTable = new Hashtable(89); KeyIterator ki = (KeyIterator) (m_keyNodes).getContainedIter(); XPathContext xctxt = ki.getXPathContext(); Vector keyDecls = getKeyDeclarations(); int nKeyDecls = keyDecls.size(); int currentNode; m_keyNodes.reset(); while (DTM.NULL != (currentNode = m_keyNodes.nextNode())) { try { for (int keyDeclIdx = 0; keyDeclIdx < nKeyDecls; keyDeclIdx++) { KeyDeclaration keyDeclaration = (KeyDeclaration) keyDecls.elementAt(keyDeclIdx); XObject xuse = keyDeclaration.getUse().execute(xctxt, currentNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); addValueInRefsTable(xctxt, exprResult, currentNode); } else { DTMIterator i = ((XNodeSet)xuse).iterRaw(); int currentNodeInUseClause; while (DTM.NULL != (currentNodeInUseClause = i.nextNode())) { DTM dtm = xctxt.getDTM(currentNodeInUseClause); XMLString exprResult = dtm.getStringValue(currentNodeInUseClause); addValueInRefsTable(xctxt, exprResult, currentNode); } } } } catch (TransformerException te) { throw new WrappedRuntimeException(te); } } } return m_refsTable; }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
void apply(TransformerImpl transformer) { try { // Are all these clones deep enough? SerializationHandler rtf = transformer.getResultTreeHandler(); if (rtf != null) { // restore serializer fields rtf.setNamespaceMappings((NamespaceMappings)m_nsSupport.clone()); } XPathContext xpc = transformer.getXPathContext(); xpc.setVarStack((VariableStack) m_variableStacks.clone()); xpc.setCurrentNodeStack((IntStack) m_currentNodes.clone()); xpc.setCurrentExpressionNodeStack( (IntStack) m_currentExpressionNodes.clone()); xpc.setContextNodeListsStack((Stack) m_contextNodeLists.clone()); if (m_contextNodeList != null) xpc.pushContextNodeList((DTMIterator) m_contextNodeList.clone()); xpc.setAxesIteratorStackStacks((Stack) m_axesIteratorStack.clone()); transformer.m_currentTemplateRuleIsNull = (BoolStack) m_currentTemplateRuleIsNull.clone(); transformer.m_currentTemplateElements = (ObjectStack) m_currentTemplateElements.clone(); transformer.m_currentMatchTemplates = (Stack) m_currentMatchTemplates.clone(); transformer.m_currentMatchedNodes = (NodeVector) m_currentMatchNodes.clone(); transformer.m_countersTable = (CountersTable) m_countersTable.clone(); if (m_attrSetStack != null) transformer.m_attrSetStack = (Stack) m_attrSetStack.clone(); } catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
public short filterNode(int testNode) { boolean foundKey = false; Vector keys = m_keyDeclarations; QName name = m_name; KeyIterator ki = (KeyIterator)(((XNodeSet)m_keysNodes).getContainedIter()); org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); if(null == xctxt) assertion(false, "xctxt can not be null here!"); try { XMLString lookupKey = m_ref; // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // Query from the node, according the the select pattern in the // use attribute in xsl:key. XObject xuse = kd.getUse().execute(xctxt, testNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); if (lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } else { DTMIterator nl = ((XNodeSet)xuse).iterRaw(); int useNode; while (DTM.NULL != (useNode = nl.nextNode())) { DTM dtm = getDTM(useNode); XMLString exprResult = dtm.getStringValue(useNode); if ((null != exprResult) && lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } } } // end for(int i = 0; i < nDeclarations; i++) } catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setDocumentLocator(Locator locator) { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } m_resultContentHandler.setDocumentLocator(locator); }
// in src/org/apache/xalan/lib/Extensions.java
public static NodeSet nodeset(ExpressionContext myProcessor, Object rtf) { String textNodeValue; if (rtf instanceof NodeIterator) { return new NodeSet((NodeIterator) rtf); } else { if (rtf instanceof String) { textNodeValue = (String) rtf; } else if (rtf instanceof Boolean) { textNodeValue = new XBoolean(((Boolean) rtf).booleanValue()).str(); } else if (rtf instanceof Double) { textNodeValue = new XNumber(((Double) rtf).doubleValue()).str(); } else { textNodeValue = rtf.toString(); } // This no longer will work right since the DTM. // Document myDoc = myProcessor.getContextNode().getOwnerDocument(); try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document myDoc = db.newDocument(); Text textNode = myDoc.createTextNode(textNodeValue); DocumentFragment docFrag = myDoc.createDocumentFragment(); docFrag.appendChild(textNode); return new NodeSet(docFrag); } catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); } } }
// in src/org/apache/xalan/lib/Extensions.java
public static Node checkEnvironment(ExpressionContext myContext) { Document factoryDocument; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); factoryDocument = db.newDocument(); } catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); } Node resultNode = null; try { // First use reflection to try to load Which, which is a // better version of EnvironmentCheck resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument); if (null != resultNode) return resultNode; // If reflection failed, fallback to our internal EnvironmentCheck EnvironmentCheck envChecker = new EnvironmentCheck(); Hashtable h = envChecker.getEnvironmentHash(); resultNode = factoryDocument.createElement("checkEnvironmentExtension"); envChecker.appendEnvironmentReport(resultNode, factoryDocument, h); envChecker = null; } catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return resultNode; }
// in src/org/apache/xpath/objects/XBooleanStatic.java
public boolean equals(XObject obj2) { try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XObjectFactory.java
static public XObject create(Object val, XPathContext xctxt) { XObject result; if (val instanceof XObject) { result = (XObject) val; } else if (val instanceof String) { result = new XString((String) val); } else if (val instanceof Boolean) { result = new XBoolean((Boolean)val); } else if (val instanceof Number) { result = new XNumber(((Number) val)); } else if (val instanceof DTM) { DTM dtm = (DTM)val; try { int dtmRoot = dtm.getDocument(); DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF); iter.setStartNode(dtmRoot); DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(dtmRoot, xctxt); result = new XNodeSet(iterator); } catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); } } else if (val instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)val; try { DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(iter.getStartNode(), xctxt); result = new XNodeSet(iterator); } catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); } } else if (val instanceof DTMIterator) { result = new XNodeSet((DTMIterator) val); } // This next three instanceofs are a little worrysome, since a NodeList // might also implement a Node! else if (val instanceof org.w3c.dom.Node) { result = new XNodeSetForDOM((org.w3c.dom.Node)val, xctxt); } // This must come after org.w3c.dom.Node, since many Node implementations // also implement NodeList. else if (val instanceof org.w3c.dom.NodeList) { result = new XNodeSetForDOM((org.w3c.dom.NodeList)val, xctxt); } else if (val instanceof org.w3c.dom.traversal.NodeIterator) { result = new XNodeSetForDOM((org.w3c.dom.traversal.NodeIterator)val, xctxt); } else { result = new XObject(val); } return result; }
// in src/org/apache/xpath/objects/XNumber.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (t == XObject.CLASS_NODESET) return obj2.equals(this); else if(t == XObject.CLASS_BOOLEAN) return obj2.bool() == bool(); else return m_val == obj2.num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XString.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (XObject.CLASS_NODESET == t) return obj2.equals(this); // If at least one object to be compared is a boolean, then each object // to be compared is converted to a boolean as if by applying the // boolean function. else if(XObject.CLASS_BOOLEAN == t) return obj2.bool() == bool(); // Otherwise, if at least one object to be compared is a number, then each object // to be compared is converted to a number as if by applying the number function. else if(XObject.CLASS_NUMBER == t) return obj2.num() == num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } // Otherwise, both objects to be compared are converted to strings as // if by applying the string function. return xstr().equals(obj2.xstr()); }
// in src/org/apache/xpath/objects/XString.java
public int compareToIgnoreCase(XMLString str) { // %REVIEW% Like it says, @since 1.2. Doesn't exist in earlier // versions of Java, hence we can't yet shell out to it. We can implement // it as character-by-character compare, but doing so efficiently // is likely to be (ahem) interesting. // // However, since nobody is actually _using_ this method yet: // return str().compareToIgnoreCase(str.toString()); throw new org.apache.xml.utils.WrappedRuntimeException( new java.lang.NoSuchMethodException( "Java 1.2 method, not yet implemented")); }
// in src/org/apache/xpath/objects/XBoolean.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XRTreeFrag.java
public boolean equals(XObject obj2) { try { if (XObject.CLASS_NODESET == obj2.getType()) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. return obj2.equals(this); } else if (XObject.CLASS_BOOLEAN == obj2.getType()) { return bool() == obj2.bool(); } else if (XObject.CLASS_NUMBER == obj2.getType()) { return num() == obj2.num(); } else if (XObject.CLASS_NODESET == obj2.getType()) { return xstr().equals(obj2.xstr()); } else if (XObject.CLASS_STRING == obj2.getType()) { return xstr().equals(obj2.xstr()); } else if (XObject.CLASS_RTREEFRAG == obj2.getType()) { // Probably not so good. Think about this. return xstr().equals(obj2.xstr()); } else { return super.equals(obj2); } } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean equals(XObject obj2) { try { return compare(obj2, S_EQ); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
public void loadPropertyFile(String file, Properties target) { try { // Use SecuritySupport class to provide privileged access to property file InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(), file); // get a buffered version BufferedInputStream bis = new BufferedInputStream(is); target.load(bis); // and load up the property bag from this bis.close(); // close out after reading } catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); } }
// in src/org/apache/xpath/functions/FuncPosition.java
public int getPositionInContextNodeList(XPathContext xctxt) { // System.out.println("FuncPosition- entry"); // If we're in a predicate, then this will return non-null. SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList(); if (null != iter) { int prox = iter.getProximityPosition(xctxt); // System.out.println("FuncPosition- prox: "+prox); return prox; } DTMIterator cnl = xctxt.getContextNodeList(); if (null != cnl) { int n = cnl.getCurrentNode(); if(n == DTM.NULL) { if(cnl.getCurrentPos() == 0) return 0; // Then I think we're in a sort. See sort21.xsl. So the iterator has // already been spent, and is not on the node we're processing. // It's highly possible that this is an issue for other context-list // functions. Shouldn't be a problem for last(), and it shouldn't be // a problem for current(). try { cnl = cnl.cloneWithReset(); } catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } int currentNode = xctxt.getContextNode(); // System.out.println("currentNode: "+currentNode); while(DTM.NULL != (n = cnl.nextNode())) { if(n == currentNode) break; } } // System.out.println("n: "+n); // System.out.println("FuncPosition- cnl.getCurrentPos(): "+cnl.getCurrentPos()); return cnl.getCurrentPos(); } // System.out.println("FuncPosition - out of guesses: -1"); return -1; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
public void setRoot(int context, Object environment) { super.setRoot(context, environment); try { if (null != m_exprs) { int n = m_exprs.length; DTMIterator newIters[] = new DTMIterator[n]; for (int i = 0; i < n; i++) { DTMIterator iter = m_exprs[i].asIterator(m_execContext, context); newIters[i] = iter; iter.nextNode(); } m_iterators = newIters; } } catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr ) throws org.apache.xml.utils.WrappedRuntimeException { PrefixResolver savedResolver = xctxt.getNamespaceContext(); XNodeSet result = null; try { xctxt.pushCurrentNode(context); xctxt.setNamespaceContext(prefixResolver); // The setRoot operation can take place with a reset operation, // and so we may not be in the context of LocPathIterator#nextNode, // so we have to set up the variable context, execute the expression, // and then restore the variable context. if (isTopLevel) { // System.out.println("calling m_expr.execute(getXPathContext())"); VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int savedStart = vars.getStackFrame(); vars.setStackFrame(stackFrame); result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); result.setShouldCacheNodes(true); // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } else result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); } catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); } finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); } return result; }
// in src/org/apache/xpath/axes/IteratorPool.java
public synchronized DTMIterator getInstance() { // Check if the pool is empty. if (m_freeStack.isEmpty()) { // Create a new object if so. try { return (DTMIterator)m_orig.clone(); } catch (Exception ex) { throw new WrappedRuntimeException(ex); } } else { // Remove object from end of free pool. DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1); return result; } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public void resetProximityPositions() { int nPredicates = getPredicateCount(); if (nPredicates > 0) { if (null == m_proximityPositions) m_proximityPositions = new int[nPredicates]; for (int i = 0; i < nPredicates; i++) { try { initProximityPosition(i); } catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); } } } }
// in src/org/apache/xpath/operations/Variable.java
public void fixupVariables(java.util.Vector vars, int globalsSize) { m_fixUpWasCalled = true; int sz = vars.size(); for (int i = vars.size()-1; i >= 0; i--) { QName qn = (QName)vars.elementAt(i); // System.out.println("qn: "+qn); if(qn.equals(m_qname)) { if(i < globalsSize) { m_isGlobal = true; m_index = i; } else { m_index = i-globalsSize; } return; } } java.lang.String msg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_COULD_NOT_FIND_VAR, new Object[]{m_qname.toString()}); TransformerException te = new TransformerException(msg, this); throw new org.apache.xml.utils.WrappedRuntimeException(te); }
45
              
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
1
              
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr ) throws org.apache.xml.utils.WrappedRuntimeException { PrefixResolver savedResolver = xctxt.getNamespaceContext(); XNodeSet result = null; try { xctxt.pushCurrentNode(context); xctxt.setNamespaceContext(prefixResolver); // The setRoot operation can take place with a reset operation, // and so we may not be in the context of LocPathIterator#nextNode, // so we have to set up the variable context, execute the expression, // and then restore the variable context. if (isTopLevel) { // System.out.println("calling m_expr.execute(getXPathContext())"); VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int savedStart = vars.getStackFrame(); vars.setStackFrame(stackFrame); result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); result.setShouldCacheNodes(true); // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } else result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); } catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); } finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); } return result; }
(Domain) WrongNumberArgsException 9
              
// in src/org/apache/xalan/templates/FuncDocument.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_ONE_OR_TWO, null)); //"1 or 2"); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); }
// in src/org/apache/xpath/functions/FuncSubstring.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function3Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null)); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1"); }
// in src/org/apache/xpath/functions/FuncConcat.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null)); }
// in src/org/apache/xpath/functions/Function2Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null)); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null)); }
0 28
              
// in src/org/apache/xalan/templates/FuncDocument.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if ((argNum < 1) || (argNum > 2)) reportWrongNumberArgs(); }
// in src/org/apache/xalan/templates/FuncDocument.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_ONE_OR_TWO, null)); //"1 or 2"); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if ((argNum > 3) || (argNum < 2)) reportWrongNumberArgs(); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { // throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 0) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); }
// in src/org/apache/xpath/functions/FuncSubstring.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum < 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FuncSubstring.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function3Args.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (argNum < 2) super.setArg(arg, argNum); else if (2 == argNum) { m_arg2 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function3Args.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 3) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function3Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null)); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum > 1) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1"); }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (argNum < 3) super.setArg(arg, argNum); else { if (null == m_args) { m_args = new Expression[1]; m_args[0] = arg; } else { // Slow but space conservative. Expression[] args = new Expression[m_args.length + 1]; System.arraycopy(m_args, 0, args, 0, m_args.length); args[m_args.length] = arg; m_args = args; } arg.exprSetParent(this); } }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { m_argVec.addElement(arg); arg.exprSetParent(this); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
// in src/org/apache/xpath/functions/FuncExtFunction.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncConcat.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum < 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FuncConcat.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null)); }
// in src/org/apache/xpath/functions/Function2Args.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { // System.out.println("argNum: "+argNum); if (argNum == 0) super.setArg(arg, argNum); else if (1 == argNum) { m_arg1 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function2Args.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function2Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null)); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (0 == argNum) { m_arg0 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 1) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null)); }
(Lib) XPathExpressionException 9
              
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
9
              
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
9
              
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public String evaluate(Object item) throws XPathExpressionException { return (String)this.evaluate( item, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public String evaluate(InputSource source) throws XPathExpressionException { return (String)this.evaluate( source, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public String evaluate(String expression, Object item) throws XPathExpressionException { return (String)this.evaluate( expression, item, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public String evaluate(String expression, InputSource source) throws XPathExpressionException { return (String)this.evaluate( expression, source, XPathConstants.STRING ); }
(Lib) Error 8
              
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
static final String getSignature(Class clazz) { if (clazz.isArray()) { final StringBuffer sb = new StringBuffer(); Class cl = clazz; while (cl.isArray()) { sb.append("["); cl = cl.getComponentType(); } sb.append(getSignature(cl)); return sb.toString(); } else if (clazz.isPrimitive()) { if (clazz == Integer.TYPE) { return "I"; } else if (clazz == Byte.TYPE) { return "B"; } else if (clazz == Long.TYPE) { return "J"; } else if (clazz == Float.TYPE) { return "F"; } else if (clazz == Double.TYPE) { return "D"; } else if (clazz == Short.TYPE) { return "S"; } else if (clazz == Character.TYPE) { return "C"; } else if (clazz == Boolean.TYPE) { return "Z"; } else if (clazz == Void.TYPE) { return "V"; } else { final String name = clazz.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.UNKNOWN_SIG_TYPE_ERR,name); throw new Error(err.toString()); } } else { return "L" + clazz.getName().replace('.', '/') + ';'; } }
// in src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java
public void releaseSlot(LocalVariableGen lvg) { final int size = lvg.getType().getSize(); final int slot = lvg.getIndex(); final int limit = _free; for (int i = 0; i < limit; i++) { if (_slotsTaken[i] == slot) { int j = i + size; while (j < limit) { _slotsTaken[i++] = _slotsTaken[j++]; } _free -= size; return; } } String state = "Variable slot allocation error"+ "(size="+size+", slot="+slot+", limit="+limit+")"; ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, state); throw new Error(err.toString()); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public final boolean getBit(int bit) { if (DEBUG_ASSERTIONS) { if (bit >= _bitSize) { throw new Error( "Programmer's assertion in BitArray.getBit"); } } return((_bits[bit>>>5] & _masks[bit%32]) != 0); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public final void setBit(int bit) { if (DEBUG_ASSERTIONS) { if (bit >= _bitSize) { throw new Error( "Programmer's assertion in BitArray.getBit"); } } if (bit >= _bitSize) return; final int i = (bit >>> 5); if (i < _first) _first = i; if (i > _last) _last = i; _bits[i] |= _masks[bit % 32]; }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void setDriver(String d) { throw new Error( "This method is not supported. " + "All connection information is handled by the JDBC datasource provider"); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void setURL(String url) { throw new Error( "This method is not supported. " + "All connection information is handled by the JDBC datasource provider"); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private static DocumentBuilder getParser() { try { // we'd really like to cache those DocumentBuilders, but we can't because: // 1. thread safety. parsers are not thread-safe, so at least // we need one instance per a thread. // 2. parsers are non-reentrant, so now we are looking at having a // pool of parsers. // 3. then the class loading issue. The look-up procedure of // DocumentBuilderFactory.newInstance() depends on context class loader // and system properties, which may change during the execution of JVM. // // so we really have to create a fresh DocumentBuilder every time we need one // - KK DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); return dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); } }
// in src/org/apache/xpath/patterns/StepPattern.java
private final boolean checkProximityPosition(XPathContext xctxt, int predPos, DTM dtm, int context, int pos) { try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.PRECEDINGSIBLING); for (int child = traverser.first(context); DTM.NULL != child; child = traverser.next(context, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { throw new Error("Why: Should never have been called"); } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos--; if (pos < 1) return false; } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return (pos == 1); }
1
              
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
0
(Lib) EmptyStackException 7
              
// in src/org/apache/xml/utils/NamespaceSupport2.java
public void popContext () { Context2 parentContext=currentContext.getParent(); if(parentContext==null) throw new EmptyStackException(); else currentContext = parentContext; }
// in src/org/apache/xml/utils/IntStack.java
public final int peek() { try { return m_map[m_firstFree - 1]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/IntStack.java
public int peek(int n) { try { return m_map[m_firstFree-(1+n)]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/IntStack.java
public void setTop(int val) { try { m_map[m_firstFree - 1] = val; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public Object peek() { try { return m_map[m_firstFree - 1]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public Object peek(int n) { try { return m_map[m_firstFree-(1+n)]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public void setTop(Object val) { try { m_map[m_firstFree - 1] = val; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
6
              
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
0
(Lib) IOException 6
              
// in src/org/apache/xml/serializer/ToStream.java
protected int writeUTF16Surrogate(char c, char ch[], int i, int end) throws IOException { int codePoint = 0; if (i + 1 >= end) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c)})); } final char high = c; final char low = ch[i+1]; if (!Encodings.isLowUTF16Surrogate(low)) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c) + " " + Integer.toHexString(low)})); } final java.io.Writer writer = m_writer; // If we make it to here we have a valid high, low surrogate pair if (m_encodingInfo.isInEncoding(c,low)) { // If the character formed by the surrogate pair // is in the encoding, so just write it out writer.write(ch,i,2); } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref final String encoding = getEncoding(); if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ codePoint = Encodings.toCodePoint(high, low); // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(codePoint)); writer.write(';'); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(ch, i, 2); } } // non-zero only if character reference was written out. return codePoint; }
// in src/org/apache/xml/serializer/ToStream.java
private int accumDefaultEscape( Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF); if (i == pos) { if (Encodings.isHighUTF16Surrogate(ch)) { // Should be the UTF-16 low surrogate of the hig/low pair. char next; // Unicode code point formed from the high/low pair. int codePoint = 0; if (i + 1 >= len) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = chars[++i]; if (!(Encodings.isLowUTF16Surrogate(next))) throw new IOException( Utils.messages.createMessage( MsgKey .ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch) + " " + Integer.toHexString(next)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); codePoint = Encodings.toCodePoint(ch,next); } writer.write("&#"); writer.write(Integer.toString(codePoint)); writer.write(';'); pos += 2; // count the two characters that went into writing out this entity } else { /* This if check is added to support control characters in XML 1.1. * If a character is a Control Character within C0 and C1 range, it is desirable * to write it out as Numeric Character Reference(NCR) regardless of XML Version * being used for output document. */ if (isCharacterInC0orC1Range(ch) || isNELorLSEPCharacter(ch)) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if ((!escapingNotNeeded(ch) || ( (fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))) && m_elemContext.m_currentElemDepth > 0) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else { writer.write(ch); } pos++; // count the single character that was processed } } return pos; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
0 107
              
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void serialize(Node node) throws IOException { }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
static private Properties loadPropertiesFile( final String resourceName, Properties defaults) throws IOException { // This static method should eventually be moved to a thread-specific class // so that we can cache the ContextClassLoader and bottleneck all properties file // loading throughout Xalan. Properties props = new Properties(defaults); InputStream is = null; BufferedInputStream bis = null; try { if (ACCESS_CONTROLLER_CLASS != null) { is = (InputStream) AccessController .doPrivileged(new PrivilegedAction() { public Object run() { return OutputPropertiesFactory.class .getResourceAsStream(resourceName); } }); } else { // User may be using older JDK ( JDK < 1.2 ) is = OutputPropertiesFactory.class .getResourceAsStream(resourceName); } bis = new BufferedInputStream(is); props.load(bis); }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final int c) throws IOException { /* If we are close to the end of the buffer then flush it. * Remember the buffer can hold a few more bytes than BYTES_MAX */ if (count >= BYTES_MAX) flushBuffer(); if (c < 0x80) { m_outputBytes[count++] = (byte) (c); } else if (c < 0x800) { m_outputBytes[count++] = (byte) (0xc0 + (c >> 6)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } else if (c < 0x10000) { m_outputBytes[count++] = (byte) (0xe0 + (c >> 12)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } else { m_outputBytes[count++] = (byte) (0xf0 + (c >> 18)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 12) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final char chars[], final int start, final int length) throws java.io.IOException { // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. int lengthx3 = 3*length; if (lengthx3 >= BYTES_MAX - count) { // The requested length is greater than the unused part of the buffer flushBuffer(); if (lengthx3 > BYTES_MAX) { /* * The requested length exceeds the size of the buffer. * Cut the buffer up into chunks, each of which will * not cause an overflow to the output buffer m_outputBytes, * and make multiple recursive calls. * Be careful about integer overflows in multiplication. */ int split = length/CHARS_MAX; final int chunks; if (length % CHARS_MAX > 0) chunks = split + 1; else chunks = split; int end_chunk = start; for (int chunk = 1; chunk <= chunks; chunk++) { int start_chunk = end_chunk; end_chunk = start + (int) ((((long) length) * chunk) / chunks); // Adjust the end of the chunk if it ends on a high char // of a Unicode surrogate pair and low char of the pair // is not going to be in the same chunk final char c = chars[end_chunk - 1]; int ic = chars[end_chunk - 1]; if (c >= 0xD800 && c <= 0xDBFF) { // The last Java char that we were going // to process is the first of a // Java surrogate char pair that // represent a Unicode character. if (end_chunk < start + length) { // Avoid spanning by including the low // char in the current chunk of chars. end_chunk++; } else { /* This is the last char of the last chunk, * and it is the high char of a high/low pair with * no low char provided. * TODO: error message needed. * The char array incorrectly ends in a high char * of a high/low surrogate pair, but there is * no corresponding low as the high is the last char */ end_chunk--; } } int len_chunk = (end_chunk - start_chunk); this.write(chars,start_chunk, len_chunk); } return; } } final int n = length+start; final byte[] buf_loc = m_outputBytes; // local reference for faster access int count_loc = count; // local integer for faster access int i = start; { /* This block could be omitted and the code would produce * the same result. But this block exists to give the JIT * a better chance of optimizing a tight and common loop which * occurs when writing out ASCII characters. */ char c; for(; i < n && (c = chars[i])< 0x80 ; i++ ) buf_loc[count_loc++] = (byte)c; } for (; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf_loc[count_loc++] = (byte) (c); else if (c < 0x800) { buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } /** * The following else if condition is added to support XML 1.1 Characters for * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]* * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate) * [1101 11yy] [yyxx xxxx] (low surrogate) * * uuuuu = wwww + 1 */ else if (c >= 0xD800 && c <= 0xDBFF) { char high, low; high = c; i++; low = chars[i]; buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0)); buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30)); buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f)); } else { buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12)); buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } } // Store the local integer back into the instance variable count = count_loc; }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final String s) throws IOException { // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. final int length = s.length(); int lengthx3 = 3*length; if (lengthx3 >= BYTES_MAX - count) { // The requested length is greater than the unused part of the buffer flushBuffer(); if (lengthx3 > BYTES_MAX) { /* * The requested length exceeds the size of the buffer, * so break it up in chunks that don't exceed the buffer size. */ final int start = 0; int split = length/CHARS_MAX; final int chunks; if (length % CHARS_MAX > 0) chunks = split + 1; else chunks = split; int end_chunk = 0; for (int chunk = 1; chunk <= chunks; chunk++) { int start_chunk = end_chunk; end_chunk = start + (int) ((((long) length) * chunk) / chunks); s.getChars(start_chunk,end_chunk, m_inputChars,0); int len_chunk = (end_chunk - start_chunk); // Adjust the end of the chunk if it ends on a high char // of a Unicode surrogate pair and low char of the pair // is not going to be in the same chunk final char c = m_inputChars[len_chunk - 1]; if (c >= 0xD800 && c <= 0xDBFF) { // Exclude char in this chunk, // to avoid spanning a Unicode character // that is in two Java chars as a high/low surrogate end_chunk--; len_chunk--; if (chunk == chunks) { /* TODO: error message needed. * The String incorrectly ends in a high char * of a high/low surrogate pair, but there is * no corresponding low as the high is the last char * Recover by ignoring this last char. */ } } this.write(m_inputChars,0, len_chunk); } return; } } s.getChars(0, length , m_inputChars, 0); final char[] chars = m_inputChars; final int n = length; final byte[] buf_loc = m_outputBytes; // local reference for faster access int count_loc = count; // local integer for faster access int i = 0; { /* This block could be omitted and the code would produce * the same result. But this block exists to give the JIT * a better chance of optimizing a tight and common loop which * occurs when writing out ASCII characters. */ char c; for(; i < n && (c = chars[i])< 0x80 ; i++ ) buf_loc[count_loc++] = (byte)c; } for (; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf_loc[count_loc++] = (byte) (c); else if (c < 0x800) { buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } /** * The following else if condition is added to support XML 1.1 Characters for * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]* * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate) * [1101 11yy] [yyxx xxxx] (low surrogate) * * uuuuu = wwww + 1 */ else if (c >= 0xD800 && c <= 0xDBFF) { char high, low; high = c; i++; low = chars[i]; buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0)); buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30)); buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f)); } else { buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12)); buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } } // Store the local integer back into the instance variable count = count_loc; }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void flushBuffer() throws IOException { if (count > 0) { m_os.write(m_outputBytes, 0, count); count = 0; } }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void flush() throws java.io.IOException { flushBuffer(); m_os.flush(); }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void close() throws java.io.IOException { flushBuffer(); m_os.close(); }
// in src/org/apache/xml/serializer/SerializerBase.java
public ContentHandler asContentHandler() throws IOException { return this; }
// in src/org/apache/xml/serializer/SerializerBase.java
public DOMSerializer asDOMSerializer() throws IOException { return this; }
// in src/org/apache/xml/serializer/SerializerBase.java
public Object asDOM3Serializer() throws IOException { return new org.apache.xml.serializer.dom3.DOM3SerializerImpl(this); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(char chars[], int start, int length) throws java.io.IOException { int n = length+start; for (int i = start; i < n; i++) { m_os.write(chars[i]); } }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(int c) throws IOException { m_os.write(c); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(String s) throws IOException { int n = s.length(); for (int i = 0; i < n; i++) { m_os.write(s.charAt(i)); } }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void flush() throws java.io.IOException { m_os.flush(); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void close() throws java.io.IOException { m_os.close(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
private void flushBuffer() throws IOException { // Just for tracing purposes if (count > 0) { char[] chars = new char[count]; for(int i=0; i<count; i++) chars[i] = (char) buf[i]; if (m_tracer != null) m_tracer.fireGenerateEvent( SerializerTrace.EVENTTYPE_OUTPUT_CHARACTERS, chars, 0, chars.length); count = 0; } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void flush() throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.flush(); // from here on just for tracing purposes flushBuffer(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void close() throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.close(); // from here on just for tracing purposes flushBuffer(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final int c) throws IOException { // send to the real writer if (m_writer != null) m_writer.write(c); // ---------- from here on just collect for tracing purposes /* If we are close to the end of the buffer then flush it. * Remember the buffer can hold a few more characters than buf_length */ if (count >= buf_length) flushBuffer(); if (c < 0x80) { buf[count++] = (byte) (c); } else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final char chars[], final int start, final int length) throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.write(chars, start, length); // from here on just collect for tracing purposes int lengthx3 = (length << 1) + length; if (lengthx3 >= buf_length) { /* If the request length exceeds the size of the output buffer, * flush the output buffer and make the buffer bigger to handle. */ flushBuffer(); setBufferSize(2 * lengthx3); } if (lengthx3 > buf_length - count) { flushBuffer(); } final int n = length + start; for (int i = start; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf[count++] = (byte) (c); else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final String s) throws IOException { // send to the real writer if (m_writer != null) m_writer.write(s); // from here on just collect for tracing purposes final int length = s.length(); // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. int lengthx3 = (length << 1) + length; if (lengthx3 >= buf_length) { /* If the request length exceeds the size of the output buffer, * flush the output buffer and make the buffer bigger to handle. */ flushBuffer(); setBufferSize(2 * lengthx3); } if (lengthx3 > buf_length - count) { flushBuffer(); } for (int i = 0; i < length; i++) { final char c = s.charAt(i); if (c < 0x80) buf[count++] = (byte) (c); else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public ContentHandler asContentHandler() throws IOException { /* don't return the real handler ( m_handler ) because * that would expose the real handler to the outside. * Keep m_handler private so it can be internally swapped * to an HTML handler. */ return this; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void serialize(Node node) throws IOException { if (m_firstTagNotEmitted) { flush(); } m_handler.serialize(node); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public DOMSerializer asDOMSerializer() throws IOException { return m_handler.asDOMSerializer(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public Object asDOM3Serializer() throws IOException { return m_handler.asDOM3Serializer(); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void serialize(Node node) throws IOException { }
// in src/org/apache/xml/serializer/ToTextStream.java
void writeNormalizedChars( final char ch[], final int start, final int length, final boolean useLineSep) throws IOException, org.xml.sax.SAXException { final String encoding = getEncoding(); final java.io.Writer writer = m_writer; final int end = start + length; /* copy a few "constants" before the loop for performance */ final char S_LINEFEED = CharInfo.S_LINEFEED; // This for() loop always increments i by one at the end // of the loop. Additional increments of i adjust for when // two input characters (a high/low UTF16 surrogate pair) // are processed. for (int i = start; i < end; i++) { final char c = ch[i]; if (S_LINEFEED == c && useLineSep) { writer.write(m_lineSep, 0, m_lineSepLen); // one input char processed } else if (m_encodingInfo.isInEncoding(c)) { writer.write(c); // one input char processed } else if (Encodings.isHighUTF16Surrogate(c)) { final int codePoint = writeUTF16Surrogate(c, ch, i, end); if (codePoint != 0) { // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(codePoint); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } i++; // two input chars processed } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(c)); writer.write(';'); // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(c); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(c); } // one input char was processed } } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void processAttribute( java.io.Writer writer, String name, String value, ElemDesc elemDesc) throws IOException { writer.write(' '); if ( ((value.length() == 0) || value.equalsIgnoreCase(name)) && elemDesc != null && elemDesc.isAttrFlagSet(name, ElemDesc.ATTREMPTY)) { writer.write(name); } else { // %REVIEW% %OPT% // Two calls to single-char write may NOT // be more efficient than one to string-write... writer.write(name); writer.write("=\""); if ( elemDesc != null && elemDesc.isAttrFlagSet(name, ElemDesc.ATTRURL)) writeAttrURI(writer, value, m_specialEscapeURLs); else writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void writeAttrURI( final java.io.Writer writer, String string, boolean doURLEscaping) throws IOException { // http://www.ietf.org/rfc/rfc2396.txt says: // A URI is always in an "escaped" form, since escaping or unescaping a // completed URI might change its semantics. Normally, the only time // escape encodings can safely be made is when the URI is being created // from its component parts; each component may have its own set of // characters that are reserved, so only the mechanism responsible for // generating or interpreting that component can determine whether or // not escaping a character will change its semantics. Likewise, a URI // must be separated into its components before the escaped characters // within those components can be safely decoded. // // ...So we do our best to do limited escaping of the URL, without // causing damage. If the URL is already properly escaped, in theory, this // function should not change the string value. final int end = string.length(); if (end > m_attrBuff.length) { m_attrBuff = new char[end*2 + 1]; } string.getChars(0,end, m_attrBuff, 0); final char[] chars = m_attrBuff; int cleanStart = 0; int cleanLength = 0; char ch = 0; for (int i = 0; i < end; i++) { ch = chars[i]; if ((ch < 32) || (ch > 126)) { if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } if (doURLEscaping) { // Encode UTF16 to UTF8. // Reference is Unicode, A Primer, by Tony Graham. // Page 92. // Note that Kay doesn't escape 0x20... // if(ch == 0x20) // Not sure about this... -sb // { // writer.write(ch); // } // else if (ch <= 0x7F) { writer.write('%'); writer.write(makeHHString(ch)); } else if (ch <= 0x7FF) { // Clear low 6 bits before rotate, put high 4 bits in low byte, // and set two high bits. int high = (ch >> 6) | 0xC0; int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit writer.write('%'); writer.write(makeHHString(high)); writer.write('%'); writer.write(makeHHString(low)); } else if (Encodings.isHighUTF16Surrogate(ch)) // high surrogate { // I'm sure this can be done in 3 instructions, but I choose // to try and do it exactly like it is done in the book, at least // until we are sure this is totally clean. I don't think performance // is a big issue with this particular function, though I could be // wrong. Also, the stuff below clearly does more masking than // it needs to do. // Clear high 6 bits. int highSurrogate = ((int) ch) & 0x03FF; // Middle 4 bits (wwww) + 1 // "Note that the value of wwww from the high surrogate bit pattern // is incremented to make the uuuuu bit pattern in the scalar value // so the surrogate pair don't address the BMP." int wwww = ((highSurrogate & 0x03C0) >> 6); int uuuuu = wwww + 1; // next 4 bits int zzzz = (highSurrogate & 0x003C) >> 2; // low 2 bits int yyyyyy = ((highSurrogate & 0x0003) << 4) & 0x30; // Get low surrogate character. ch = chars[++i]; // Clear high 6 bits. int lowSurrogate = ((int) ch) & 0x03FF; // put the middle 4 bits into the bottom of yyyyyy (byte 3) yyyyyy = yyyyyy | ((lowSurrogate & 0x03C0) >> 6); // bottom 6 bits. int xxxxxx = (lowSurrogate & 0x003F); int byte1 = 0xF0 | (uuuuu >> 2); // top 3 bits of uuuuu int byte2 = 0x80 | (((uuuuu & 0x03) << 4) & 0x30) | zzzz; int byte3 = 0x80 | yyyyyy; int byte4 = 0x80 | xxxxxx; writer.write('%'); writer.write(makeHHString(byte1)); writer.write('%'); writer.write(makeHHString(byte2)); writer.write('%'); writer.write(makeHHString(byte3)); writer.write('%'); writer.write(makeHHString(byte4)); } else { int high = (ch >> 12) | 0xE0; // top 4 bits int middle = ((ch & 0x0FC0) >> 6) | 0x80; // middle 6 bits int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit writer.write('%'); writer.write(makeHHString(high)); writer.write('%'); writer.write(makeHHString(middle)); writer.write('%'); writer.write(makeHHString(low)); } } else if (escapingNotNeeded(ch)) { writer.write(ch); } else { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } // In this character range we have first written out any previously accumulated // "clean" characters, then processed the current more complicated character, // which may have incremented "i". // We now we reset the next possible clean character. cleanStart = i + 1; } // Since http://www.ietf.org/rfc/rfc2396.txt refers to the URI grammar as // not allowing quotes in the URI proper syntax, nor in the fragment // identifier, we believe that it's OK to double escape quotes. else if (ch == '"') { // If the character is a '%' number number, try to avoid double-escaping. // There is a question if this is legal behavior. // Dmitri Ilyin: to check if '%' number number is invalid. It must be checked if %xx is a sign, that would be encoded // The encoded signes are in Hex form. So %xx my be in form %3C that is "<" sign. I will try to change here a little. // if( ((i+2) < len) && isASCIIDigit(stringArray[i+1]) && isASCIIDigit(stringArray[i+2]) ) // We are no longer escaping '%' if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } // Mike Kay encodes this as &#34;, so he may know something I don't? if (doURLEscaping) writer.write("%22"); else writer.write("&quot;"); // we have to escape this, I guess. // We have written out any clean characters, then the escaped '%' and now we // We now we reset the next possible clean character. cleanStart = i + 1; } else if (ch == '&') { // HTML 4.01 reads, "Authors should use "&amp;" (ASCII decimal 38) // instead of "&" to avoid confusion with the beginning of a character // reference (entity reference open delimiter). if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } writer.write("&amp;"); cleanStart = i + 1; } else { // no processing for this character, just count how // many characters in a row that we have that need no processing cleanLength++; } } // are there any clean characters at the end of the array // that we haven't processed yet? if (cleanLength > 1) { // if the whole string can be written out as-is do so // otherwise write out the clean chars at the end of the // array if (cleanStart == 0) writer.write(string); else writer.write(chars, cleanStart, cleanLength); } else if (cleanLength == 1) { // a little optimization for 1 clean character // (we could have let the previous if(...) handle them all) writer.write(ch); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void writeAttrString( final java.io.Writer writer, String string, String encoding) throws IOException { final int end = string.length(); if (end > m_attrBuff.length) { m_attrBuff = new char[end * 2 + 1]; } string.getChars(0, end, m_attrBuff, 0); final char[] chars = m_attrBuff; int cleanStart = 0; int cleanLength = 0; char ch = 0; for (int i = 0; i < end; i++) { ch = chars[i]; // System.out.println("SPECIALSSIZE: "+SPECIALSSIZE); // System.out.println("ch: "+(int)ch); // System.out.println("m_maxCharacter: "+(int)m_maxCharacter); // System.out.println("m_attrCharsMap[ch]: "+(int)m_attrCharsMap[ch]); if (escapingNotNeeded(ch) && (!m_charInfo.shouldMapAttrChar(ch))) { cleanLength++; } else if ('<' == ch || '>' == ch) { cleanLength++; // no escaping in this case, as specified in 15.2 } else if ( ('&' == ch) && ((i + 1) < end) && ('{' == chars[i + 1])) { cleanLength++; // no escaping in this case, as specified in 15.2 } else { if (cleanLength > 0) { writer.write(chars,cleanStart,cleanLength); cleanLength = 0; } int pos = accumDefaultEntity(writer, ch, i, chars, end, false, true); if (i != pos) { i = pos - 1; } else { if (Encodings.isHighUTF16Surrogate(ch)) { writeUTF16Surrogate(ch, chars, i, end); i++; // two input characters processed // this increments by one and the for() // loop itself increments by another one. } // The next is kind of a hack to keep from escaping in the case // of Shift_JIS and the like. /* else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF) && (ch != 160)) { writer.write(ch); // no escaping in this case } else */ String outputStringForChar = m_charInfo.getOutputStringForChar(ch); if (null != outputStringForChar) { writer.write(outputStringForChar); } else if (escapingNotNeeded(ch)) { writer.write(ch); // no escaping in this case } else { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } } cleanStart = i + 1; } } // end of for() // are there any clean characters at the end of the array // that we haven't processed yet? if (cleanLength > 1) { // if the whole string can be written out as-is do so // otherwise write out the clean chars at the end of the // array if (cleanStart == 0) writer.write(string); else writer.write(chars, cleanStart, cleanLength); } else if (cleanLength == 1) { // a little optimization for 1 clean character // (we could have let the previous if(...) handle them all) writer.write(ch); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException,SAXException { /* * process the collected attributes */ for (int i = 0; i < nAttrs; i++) { processAttribute( writer, m_attributes.getQName(i), m_attributes.getValue(i), m_elemContext.m_elementDesc); } }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void serialize(Node node) throws IOException { return; }
// in src/org/apache/xml/serializer/ToStream.java
public void serialize(Node node) throws IOException { try { TreeWalker walker = new TreeWalker(this); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/ToStream.java
void outputEntityDecl(String name, String value) throws IOException { final java.io.Writer writer = m_writer; writer.write("<!ENTITY "); writer.write(name); writer.write(" \""); writer.write(value); writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); }
// in src/org/apache/xml/serializer/ToStream.java
protected final void outputLineSep() throws IOException { m_writer.write(m_lineSep, 0, m_lineSepLen); }
// in src/org/apache/xml/serializer/ToStream.java
protected void indent(int depth) throws IOException { if (m_startNewLine) outputLineSep(); /* For m_indentAmount > 0 this extra test might be slower * but Xalan's default value is 0, so this extra test * will run faster in that situation. */ if (m_indentAmount > 0) printSpace(depth * m_indentAmount); }
// in src/org/apache/xml/serializer/ToStream.java
protected void indent() throws IOException { indent(m_elemContext.m_currentElemDepth); }
// in src/org/apache/xml/serializer/ToStream.java
private void printSpace(int n) throws IOException { final java.io.Writer writer = m_writer; for (int i = 0; i < n; i++) { writer.write(' '); } }
// in src/org/apache/xml/serializer/ToStream.java
protected int writeUTF16Surrogate(char c, char ch[], int i, int end) throws IOException { int codePoint = 0; if (i + 1 >= end) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c)})); } final char high = c; final char low = ch[i+1]; if (!Encodings.isLowUTF16Surrogate(low)) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c) + " " + Integer.toHexString(low)})); } final java.io.Writer writer = m_writer; // If we make it to here we have a valid high, low surrogate pair if (m_encodingInfo.isInEncoding(c,low)) { // If the character formed by the surrogate pair // is in the encoding, so just write it out writer.write(ch,i,2); } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref final String encoding = getEncoding(); if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ codePoint = Encodings.toCodePoint(high, low); // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(codePoint)); writer.write(';'); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(ch, i, 2); } } // non-zero only if character reference was written out. return codePoint; }
// in src/org/apache/xml/serializer/ToStream.java
int accumDefaultEntity( java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { if (!escLF && CharInfo.S_LINEFEED == ch) { writer.write(m_lineSep, 0, m_lineSepLen); } else { // if this is text node character and a special one of those, // or if this is a character from attribute value and a special one of those if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch))) { String outputStringForChar = m_charInfo.getOutputStringForChar(ch); if (null != outputStringForChar) { writer.write(outputStringForChar); } else return i; } else return i; } return i + 1; }
// in src/org/apache/xml/serializer/ToStream.java
void writeNormalizedChars( char ch[], int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException { final java.io.Writer writer = m_writer; int end = start + length; for (int i = start; i < end; i++) { char c = ch[i]; if (CharInfo.S_LINEFEED == c && useSystemLineSeparator) { writer.write(m_lineSep, 0, m_lineSepLen); } else if (isCData && (!escapingNotNeeded(c))) { // if (i != 0) if (m_cdataTagOpen) closeCDATA(); // This needs to go into a function... if (Encodings.isHighUTF16Surrogate(c)) { writeUTF16Surrogate(c, ch, i, end); i++ ; // process two input characters } else { writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } // if ((i != 0) && (i < (end - 1))) // if (!m_cdataTagOpen && (i < (end - 1))) // { // writer.write(CDATA_DELIMITER_OPEN); // m_cdataTagOpen = true; // } } else if ( isCData && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1]) && ('>' == ch[i + 2]))) { writer.write(CDATA_CONTINUE); i += 2; } else { if (escapingNotNeeded(c)) { if (isCData && !m_cdataTagOpen) { writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } writer.write(c); } // This needs to go into a function... else if (Encodings.isHighUTF16Surrogate(c)) { if (m_cdataTagOpen) closeCDATA(); writeUTF16Surrogate(c, ch, i, end); i++; // process two input characters } else { if (m_cdataTagOpen) closeCDATA(); writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
private int processLineFeed(final char[] chars, int i, int lastProcessed, final Writer writer) throws IOException { if (!m_lineSepUse || (m_lineSepLen ==1 && m_lineSep[0] == CharInfo.S_LINEFEED)){ // We are leaving the new-line alone, and it is just // being added to the 'clean' characters, // so the last dirty character processed remains unchanged } else { writeOutCleanChars(chars, i, lastProcessed); writer.write(m_lineSep, 0, m_lineSepLen); lastProcessed = i; } return lastProcessed; }
// in src/org/apache/xml/serializer/ToStream.java
private void writeOutCleanChars(final char[] chars, int i, int lastProcessed) throws IOException { int startClean; startClean = lastProcessed + 1; if (startClean < i) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } }
// in src/org/apache/xml/serializer/ToStream.java
private int processDirty( char[] chars, int end, int i, char ch, int lastDirty, boolean fromTextNode) throws IOException { int startClean = lastDirty + 1; // if we have some clean characters accumulated // process them before the dirty one. if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // process the "dirty" character if (CharInfo.S_LINEFEED == ch && fromTextNode) { m_writer.write(m_lineSep, 0, m_lineSepLen); } else { startClean = accumDefaultEscape( m_writer, (char)ch, i, chars, end, fromTextNode, false); i = startClean - 1; } // Return the index of the last character that we just processed // which is a dirty character. return i; }
// in src/org/apache/xml/serializer/ToStream.java
private int accumDefaultEscape( Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF); if (i == pos) { if (Encodings.isHighUTF16Surrogate(ch)) { // Should be the UTF-16 low surrogate of the hig/low pair. char next; // Unicode code point formed from the high/low pair. int codePoint = 0; if (i + 1 >= len) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = chars[++i]; if (!(Encodings.isLowUTF16Surrogate(next))) throw new IOException( Utils.messages.createMessage( MsgKey .ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch) + " " + Integer.toHexString(next)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); codePoint = Encodings.toCodePoint(ch,next); } writer.write("&#"); writer.write(Integer.toString(codePoint)); writer.write(';'); pos += 2; // count the two characters that went into writing out this entity } else { /* This if check is added to support control characters in XML 1.1. * If a character is a Control Character within C0 and C1 range, it is desirable * to write it out as Numeric Character Reference(NCR) regardless of XML Version * being used for output document. */ if (isCharacterInC0orC1Range(ch) || isNELorLSEPCharacter(ch)) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if ((!escapingNotNeeded(ch) || ( (fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))) && m_elemContext.m_currentElemDepth > 0) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else { writer.write(ch); } pos++; // count the single character that was processed } } return pos; }
// in src/org/apache/xml/serializer/ToStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException { /* real SAX attributes are not passed in, so process the * attributes that were collected after the startElement call. * _attribVector is a "cheap" list for Stream serializer output * accumulated over a series of calls to attribute(name,value) */ String encoding = getEncoding(); for (int i = 0; i < nAttrs; i++) { // elementAt is JDK 1.1.8 final String name = m_attributes.getQName(i); final String value = m_attributes.getValue(i); writer.write(' '); writer.write(name); writer.write("=\""); writeAttrString(writer, value, encoding); writer.write('\"'); } }
// in src/org/apache/xml/serializer/ToStream.java
public void writeAttrString( Writer writer, String string, String encoding) throws IOException { final int len = string.length(); if (len > m_attrBuff.length) { m_attrBuff = new char[len*2 + 1]; } string.getChars(0,len, m_attrBuff, 0); final char[] stringChars = m_attrBuff; for (int i = 0; i < len; i++) { char ch = stringChars[i]; if (m_charInfo.shouldMapAttrChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" accumDefaultEscape(writer, ch, i, stringChars, len, false, true); } else { if (0x0 <= ch && ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: writer.write("&#9;"); break; case CharInfo.S_LINEFEED: writer.write("&#10;"); break; case CharInfo.S_CARRIAGERETURN: writer.write("&#13;"); break; default: writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars writer.write(ch); } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writer.write("&#8232;"); } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just write it out writer.write(ch); } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out a character ref writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void write(char[] arg0, int arg1, int arg2) throws IOException { m_stringbuf.append(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/ToStream.java
public void flush() throws IOException { }
// in src/org/apache/xml/serializer/ToStream.java
public void close() throws IOException { }
// in src/org/apache/xml/serializer/ToStream.java
private void DTDprolog() throws SAXException, IOException { final java.io.Writer writer = m_writer; if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } if (m_inDoctype) { writer.write(" ["); writer.write(m_lineSep, 0, m_lineSepLen); m_inDoctype = false; } }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
public void serializeDOM3(Node node) throws IOException { try { DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler, fErrorHandler, fSerializerFilter, fNewLine); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowIOException() throws IOException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public ContentHandler asContentHandler() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void serialize(Node node) throws IOException { couldThrowIOException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public DOMSerializer asDOMSerializer() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public Object asDOM3Serializer() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getTreeAsText(String treeURL) throws IOException { m_treeURL = treeURL; m_trustedAgent.m_getData = true; m_trustedAgent.m_getSource = true; m_callThread = Thread.currentThread(); try { synchronized (m_callThread) { m_callThread.wait(); } } catch (InterruptedException ie) { System.out.println(ie.getMessage()); } return m_sourceText; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private void readObject(java.io.ObjectInputStream inStream) throws IOException, ClassNotFoundException { inStream.defaultReadObject(); // Needed assignment of non-serialized fields // A TransformerFactory is not guaranteed to be serializable, // so we create one here m_tfactory = TransformerFactory.newInstance(); }
// in src/org/apache/xalan/xsltc/runtime/output/TransletOutputHandlerFactory.java
public SerializationHandler getSerializationHandler() throws IOException, ParserConfigurationException { SerializationHandler result = null; switch (_outputType) { case STREAM : if (_method == null) { result = new ToUnknownStream(); } else if (_method.equalsIgnoreCase("xml")) { result = new ToXMLStream(); } else if (_method.equalsIgnoreCase("html")) { result = new ToHTMLStream(); } else if (_method.equalsIgnoreCase("text")) { result = new ToTextStream(); } if (result != null && _indentNumber >= 0) { result.setIndentAmount(_indentNumber); } result.setEncoding(_encoding); if (_writer != null) { result.setWriter(_writer); } else { result.setOutputStream(_ostream); } return result; case DOM : _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling) : new SAX2DOM(); _lexHandler = (LexicalHandler) _handler; // falls through case SAX : if (_method == null) { _method = "xml"; // default case } if (_lexHandler == null) { result = new ToXMLSAXHandler(_handler, _encoding); } else { result = new ToXMLSAXHandler( _handler, _lexHandler, _encoding); } return result; } return null; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
private String entryName(File f) throws IOException { return f.getName().replace(File.separatorChar, '/'); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
public void outputToJar() throws IOException { // create the manifest final Manifest manifest = new Manifest(); final java.util.jar.Attributes atrs = manifest.getMainAttributes(); atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.2"); final Map map = manifest.getEntries(); // create manifest Enumeration classes = _bcelClasses.elements(); final String now = (new Date()).toString(); final java.util.jar.Attributes.Name dateAttr = new java.util.jar.Attributes.Name("Date"); while (classes.hasMoreElements()) { final JavaClass clazz = (JavaClass)classes.nextElement(); final String className = clazz.getClassName().replace('.','/'); final java.util.jar.Attributes attr = new java.util.jar.Attributes(); attr.put(dateAttr, now); map.put(className+".class", attr); } final File jarFile = new File(_destDir, _jarFileName); final JarOutputStream jos = new JarOutputStream(new FileOutputStream(jarFile), manifest); classes = _bcelClasses.elements(); while (classes.hasMoreElements()) { final JavaClass clazz = (JavaClass)classes.nextElement(); final String className = clazz.getClassName().replace('.','/'); jos.putNextEntry(new JarEntry(className+".class")); final ByteArrayOutputStream out = new ByteArrayOutputStream(2048); clazz.dump(out); // dump() closes it's output stream out.writeTo(jos); } jos.close(); }
// in src/org/apache/xalan/xsltc/compiler/util/MarkerInstruction.java
final public void dump(DataOutputStream out) throws IOException { }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(_bitSize); out.writeInt(_mask); out.writeObject(_bits); out.flush(); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _bitSize = in.readInt(); _intSize = (_bitSize >>> 5) + 1; _mask = in.readInt(); _bits = (int[])in.readObject(); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _handler.startDocument(); parse(_dom); _handler.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
private void parse(Node node) throws IOException, SAXException { if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: _handler.startCDATA(); _handler.characters(node.getNodeValue()); _handler.endCDATA(); break; case Node.COMMENT_NODE: // should be handled!!! _handler.comment(node.getNodeValue()); break; case Node.DOCUMENT_NODE: _handler.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _handler.endDocument(); break; case Node.DOCUMENT_FRAGMENT_NODE: next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } break; case Node.ELEMENT_NODE: // Generate SAX event to start element final String qname = node.getNodeName(); _handler.startElement(null, null, qname); int colon; String prefix; final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace attributes first for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a namespace declaration? if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uriAttr); } } // Process all non-namespace attributes next NamespaceMappings nm = new NamespaceMappings(); for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a regular attribute? if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); // Uri may be implicitly declared if (uriAttr != null && !uriAttr.equals(EMPTYSTRING) ) { colon = qnameAttr.lastIndexOf(':'); // Fix for bug 26319 // For attributes not given an prefix explictly // but having a namespace uri we need // to explicitly generate the prefix String newPrefix = nm.lookupPrefix(uriAttr); if (newPrefix == null) newPrefix = nm.generateNextPrefix(); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : newPrefix; _handler.namespaceAfterStartElement(prefix, uriAttr); _handler.addAttribute((prefix + ":" + qnameAttr), attr.getNodeValue()); } else { _handler.addAttribute(qnameAttr, attr.getNodeValue()); } } } // Now element namespace and children final String uri = node.getNamespaceURI(); final String localName = node.getLocalName(); // Uri may be implicitly declared if (uri != null) { colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uri); }else { // Fix for bug 26319 // If an element foo is created using // createElementNS(null,locName) // then the element should be serialized // <foo xmlns=" "/> if (uri == null && localName != null) { prefix = EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, EMPTYSTRING); } } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _handler.endElement(qname); break; case Node.PROCESSING_INSTRUCTION_NODE: _handler.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: _handler.characters(node.getNodeValue()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _sax.startDocument(); parse(_dom); _sax.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void parse(Node node) throws IOException, SAXException { Node first = null; if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_FRAGMENT_NODE: case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: final String cdata = node.getNodeValue(); if (_lex != null) { _lex.startCDATA(); _sax.characters(cdata.toCharArray(), 0, cdata.length()); _lex.endCDATA(); } else { // in the case where there is no lex handler, we still // want the text of the cdate to make its way through. _sax.characters(cdata.toCharArray(), 0, cdata.length()); } break; case Node.COMMENT_NODE: // should be handled!!! if (_lex != null) { final String value = node.getNodeValue(); _lex.comment(value.toCharArray(), 0, value.length()); } break; case Node.DOCUMENT_NODE: _sax.setDocumentLocator(this); _sax.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _sax.endDocument(); break; case Node.ELEMENT_NODE: String prefix; List pushedPrefixes = new ArrayList(); final AttributesImpl attrs = new AttributesImpl(); final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace declarations for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore everything but NS declarations here if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } } // Process all other attributes for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore NS declarations here if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); final String localNameAttr = getLocalName(attr); // Uri may be implicitly declared if (uriAttr != null) { final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } // Add attribute to list attrs.addAttribute(attr.getNamespaceURI(), getLocalName(attr), qnameAttr, "CDATA", attr.getNodeValue()); } } // Now process the element itself final String qname = node.getNodeName(); final String uri = node.getNamespaceURI(); final String localName = getLocalName(node); // Uri may be implicitly declared if (uri != null) { final int colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uri)) { pushedPrefixes.add(prefix); } } // Generate SAX event to start element if (_saxImpl != null) { _saxImpl.startElement(uri, localName, qname, attrs, node); } else { _sax.startElement(uri, localName, qname, attrs); } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _sax.endElement(uri, localName, qname); // Generate endPrefixMapping() for all pushed prefixes final int nPushedPrefixes = pushedPrefixes.size(); for (int i = 0; i < nPushedPrefixes; i++) { endPrefixMapping((String) pushedPrefixes.get(i)); } break; case Node.PROCESSING_INSTRUCTION_NODE: _sax.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: final String data = node.getNodeValue(); _sax.characters(data.toCharArray(), 0, data.length()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException { is.defaultReadObject(); if (is.readBoolean()) { _uriResolver = (URIResolver) is.readObject(); } _tfactory = new TransformerFactoryImpl(); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void writeObject(ObjectOutputStream os) throws IOException, ClassNotFoundException { os.defaultWriteObject(); if (_uriResolver instanceof Serializable) { os.writeBoolean(true); os.writeObject((Serializable) _uriResolver); } else { os.writeBoolean(false); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
private void readFromInputStream(byte[] bytes, InputStream input, int size) throws IOException { int n = 0; int offset = 0; int length = size; while (length > 0 && (n = input.read(bytes, offset, length)) > 0) { offset = offset + n; length = length - n; } }
// in src/org/apache/xalan/templates/ElemForEach.java
private void readObject(ObjectInputStream os) throws IOException, ClassNotFoundException { os.defaultReadObject(); m_xpath = null; }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/Stylesheet.java
private void writeObject(ObjectOutputStream stream) throws IOException { // System.out.println("Writing Stylesheet"); stream.defaultWriteObject(); // System.out.println("Done writing Stylesheet"); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (String systemId) throws org.xml.sax.SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (m_entityResolver != null) { return m_entityResolver.resolveEntity(publicId, systemId); } else { return null; } }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public ContentHandler asContentHandler() throws IOException { return m_serializer.asContentHandler(); }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public DOMSerializer asDOMSerializer() throws IOException { if (m_old_DOMSerializer == null) { m_old_DOMSerializer = new DOMSerializerWrapper(m_serializer.asDOMSerializer()); } return m_old_DOMSerializer; }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public void serialize(Node node) throws IOException { m_dom.serialize(node); }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/lib/Redirect.java
public SerializationHandler createSerializationHandler( TransformerImpl transformer, FileOutputStream ostream, File file, OutputProperties format) throws java.io.IOException, TransformerException { SerializationHandler serializer = transformer.createSerializationHandler( new StreamResult(ostream), format); return serializer; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException {}
// in src/org/apache/xpath/SourceTreeManager.java
public Source resolveURI( String base, String urlString, SourceLocator locator) throws TransformerException, IOException { Source source = null; if (null != m_uriResolver) { source = m_uriResolver.resolve(urlString, base); } if (null == source) { String uri = SystemIDResolver.getAbsoluteURI(urlString, base); source = new StreamSource(uri); } return source; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
(Lib) SAXNotSupportedException 6
              
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double max(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double maxValue = - Double.MAX_VALUE; for (int i = 0; i < contextNodes.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result > maxValue) maxValue = result; } xctxt.popContextNodeList(); return maxValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double min(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double minValue = Double.MAX_VALUE; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result < minValue) minValue = result; } xctxt.popContextNodeList(); return minValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double sum(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double sum = 0; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); sum = sum + result; } xctxt.popContextNodeList(); return sum; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList map(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; Document lDoc = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); NodeSet resultSet = new NodeSet(); resultSet.setShouldCacheNodes(true); for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!resultSet.contains(n)) resultSet.addNode(n); } } else { if (lDoc == null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); lDoc = db.newDocument(); } Element element = null; if (object instanceof XNumber) element = lDoc.createElementNS(EXSL_URI, "exsl:number"); else if (object instanceof XBoolean) element = lDoc.createElementNS(EXSL_URI, "exsl:boolean"); else element = lDoc.createElementNS(EXSL_URI, "exsl:string"); Text textNode = lDoc.createTextNode(object.str()); element.appendChild(textNode); resultSet.addNode(element); } } catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); return resultSet; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { if (myContext instanceof XPathContext.XPathExpressionContext) { XPathContext xctxt = null; try { xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); return dynamicXPath.execute(xctxt, myContext.getContextNode(), xctxt.getNamespaceContext()); } catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); } } else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate " }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList closure(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSet closureSet = new NodeSet(); closureSet.setShouldCacheNodes(true); NodeList iterationList = nl; do { NodeSet iterationSet = new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt); xctxt.pushContextNodeList(contextNodes); for (int i = 0; i < iterationList.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!iterationSet.contains(n)) iterationSet.addNode(n); } } else { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); iterationList = iterationSet; for (int i = 0; i < iterationList.getLength(); i++) { Node n = iterationList.item(i); if (!closureSet.contains(n)) closureSet.addNode(n); } } while(iterationList.getLength() > 0); return closureSet; }
0 16
              
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double max(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double maxValue = - Double.MAX_VALUE; for (int i = 0; i < contextNodes.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result > maxValue) maxValue = result; } xctxt.popContextNodeList(); return maxValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double min(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double minValue = Double.MAX_VALUE; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result < minValue) minValue = result; } xctxt.popContextNodeList(); return minValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double sum(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double sum = 0; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); sum = sum + result; } xctxt.popContextNodeList(); return sum; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList map(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; Document lDoc = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); NodeSet resultSet = new NodeSet(); resultSet.setShouldCacheNodes(true); for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!resultSet.contains(n)) resultSet.addNode(n); } } else { if (lDoc == null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); lDoc = db.newDocument(); } Element element = null; if (object instanceof XNumber) element = lDoc.createElementNS(EXSL_URI, "exsl:number"); else if (object instanceof XBoolean) element = lDoc.createElementNS(EXSL_URI, "exsl:boolean"); else element = lDoc.createElementNS(EXSL_URI, "exsl:string"); Text textNode = lDoc.createTextNode(object.str()); element.appendChild(textNode); resultSet.addNode(element); } } catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); return resultSet; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { if (myContext instanceof XPathContext.XPathExpressionContext) { XPathContext xctxt = null; try { xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); return dynamicXPath.execute(xctxt, myContext.getContextNode(), xctxt.getNamespaceContext()); } catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); } } else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate " }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList closure(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSet closureSet = new NodeSet(); closureSet.setShouldCacheNodes(true); NodeList iterationList = nl; do { NodeSet iterationSet = new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt); xctxt.pushContextNodeList(contextNodes); for (int i = 0; i < iterationList.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!iterationSet.contains(n)) iterationSet.addNode(n); } } else { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); iterationList = iterationSet; for (int i = 0; i < iterationList.getLength(); i++) { Node n = iterationList.item(i); if (!closureSet.contains(n)) closureSet.addNode(n); } } while(iterationList.getLength() > 0); return closureSet; }
// in src/org/apache/xalan/lib/Extensions.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { return ExsltDynamic.evaluate(myContext, xpathExpr); }
(Domain) InternalError 5
              
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
private ArrayList getCandidateChunks(ClassGenerator classGen, int totalMethodSize) { Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList(); Stack subChunkStack = new Stack(); boolean openChunkAtCurrLevel = false; boolean firstInstruction = true; InstructionHandle currentHandle; if (m_openChunks != 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS)) .toString(); throw new InternalError(msg); } // Scan instructions in the method, keeping track of the nesting level // of outlineable chunks. // // currLevelChunks // keeps track of the child chunks of a chunk. For each chunk, // there will be a pair of entries: the InstructionHandles for the // start and for the end of the chunk // subChunkStack // a stack containing the partially accumulated currLevelChunks for // each chunk that's still open at the current position in the // InstructionList. // candidateChunks // the list of chunks which have been accepted as candidates chunks // for outlining do { // Get the next instruction. The loop will perform one extra // iteration after it reaches the end of the InstructionList, with // currentHandle set to null. currentHandle = instructions.hasNext() ? (InstructionHandle) instructions.next() : null; Instruction inst = (currentHandle != null) ? currentHandle.getInstruction() : null; // At the first iteration, create a chunk representing all the // code in the method. This is done just to simplify the logic - // this chunk can never be outlined because it will be too big. if (firstInstruction) { openChunkAtCurrLevel = true; currLevelChunks.add(currentHandle); firstInstruction = false; } // Found a new chunk if (inst instanceof OutlineableChunkStart) { // If last MarkerInstruction encountered was an // OutlineableChunkStart, this represents the first chunk // nested within that previous chunk - push the list of chunks // from the outer level onto the stack if (openChunkAtCurrLevel) { subChunkStack.push(currLevelChunks); currLevelChunks = new ArrayList(); } openChunkAtCurrLevel = true; currLevelChunks.add(currentHandle); // Close off an open chunk } else if (currentHandle == null || inst instanceof OutlineableChunkEnd) { ArrayList nestedSubChunks = null; // If the last MarkerInstruction encountered was an // OutlineableChunkEnd, it means that the current instruction // marks the end of a chunk that contained child chunks. // Those children might need to be examined below in case they // are better candidates for outlining than the current chunk. if (!openChunkAtCurrLevel) { nestedSubChunks = currLevelChunks; currLevelChunks = (ArrayList)subChunkStack.pop(); } // Get the handle for the start of this chunk (the last entry // in currLevelChunks) InstructionHandle chunkStart = (InstructionHandle) currLevelChunks.get( currLevelChunks.size()-1); int chunkEndPosition = (currentHandle != null) ? currentHandle.getPosition() : totalMethodSize; int chunkSize = chunkEndPosition - chunkStart.getPosition(); // Two ranges of chunk size to consider: // // 1. [0,TARGET_METHOD_SIZE] // Keep this chunk in consideration as a candidate, // and ignore its subchunks, if any - there's nothing to be // gained by outlining both the current chunk and its // children! // // 2. (TARGET_METHOD_SIZE,+infinity) // Ignore this chunk - it's too big. Add its subchunks // as candidates, after merging adjacent chunks to produce // chunks that are as large as possible if (chunkSize <= TARGET_METHOD_SIZE) { currLevelChunks.add(currentHandle); } else { if (!openChunkAtCurrLevel) { int childChunkCount = nestedSubChunks.size() / 2; if (childChunkCount > 0) { Chunk[] childChunks = new Chunk[childChunkCount]; // Gather all the child chunks of the current chunk for (int i = 0; i < childChunkCount; i++) { InstructionHandle start = (InstructionHandle) nestedSubChunks .get(i*2); InstructionHandle end = (InstructionHandle) nestedSubChunks .get(i*2+1); childChunks[i] = new Chunk(start, end); } // Merge adjacent siblings ArrayList mergedChildChunks = mergeAdjacentChunks(childChunks); // Add chunks that mean minimum size requirements // to the list of candidate chunks for outlining for (int i = 0; i < mergedChildChunks.size(); i++) { Chunk mergedChunk = (Chunk)mergedChildChunks.get(i); int mergedSize = mergedChunk.getChunkSize(); if (mergedSize >= MINIMUM_OUTLINEABLE_CHUNK_SIZE && mergedSize <= TARGET_METHOD_SIZE) { candidateChunks.add(mergedChunk); } } } } // Drop the chunk which was too big currLevelChunks.remove(currLevelChunks.size() - 1); } // currLevelChunks contains pairs of InstructionHandles. If // its size is an odd number, the loop has encountered the // start of a chunk at this level, but not its end. openChunkAtCurrLevel = ((currLevelChunks.size() & 0x1) == 1); } } while (currentHandle != null); return candidateChunks; }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
public Method[] outlineChunks(ClassGenerator classGen, int originalMethodSize) { ArrayList methodsOutlined = new ArrayList(); int currentMethodSize = originalMethodSize; int outlinedCount = 0; boolean moreMethodsOutlined; String originalMethodName = getName(); // Special handling for initialization methods. No other methods can // include the less than and greater than characters in their names, // so we munge the names here. if (originalMethodName.equals("<init>")) { originalMethodName = "$lt$init$gt$"; } else if (originalMethodName.equals("<clinit>")) { originalMethodName = "$lt$clinit$gt$"; } // Loop until the original method comes in under the JVM limit or // the loop was unable to outline any more methods do { // Get all the best candidates for outlining, and sort them in // ascending order of size ArrayList candidateChunks = getCandidateChunks(classGen, currentMethodSize); Collections.sort(candidateChunks); moreMethodsOutlined = false; // Loop over the candidates for outlining, from the largest to the // smallest and outline them one at a time, until the loop has // outlined all or the original method comes in under the JVM // limit on the size of a method. for (int i = candidateChunks.size()-1; i >= 0 && currentMethodSize > TARGET_METHOD_SIZE; i--) { Chunk chunkToOutline = (Chunk)candidateChunks.get(i); methodsOutlined.add(outline(chunkToOutline.getChunkStart(), chunkToOutline.getChunkEnd(), originalMethodName + "$outline$" + outlinedCount, classGen)); outlinedCount++; moreMethodsOutlined = true; InstructionList il = getInstructionList(); InstructionHandle lastInst = il.getEnd(); il.setPositions(); // Check the size of the method now currentMethodSize = lastInst.getPosition() + lastInst.getInstruction().getLength(); } } while (moreMethodsOutlined && currentMethodSize > TARGET_METHOD_SIZE); // Outlining failed to reduce the size of the current method // sufficiently. Throw an internal error. if (currentMethodSize > MAX_METHOD_SIZE) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG)) .toString(); throw new InternalError(msg); } Method[] methodsArr = new Method[methodsOutlined.size() + 1]; methodsOutlined.toArray(methodsArr); methodsArr[methodsOutlined.size()] = getThisMethod(); return methodsArr; }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
private Method outline(InstructionHandle first, InstructionHandle last, String outlinedMethodName, ClassGenerator classGen) { // We're not equipped to deal with exception handlers yet. Bail out! if (getExceptionHandlers().length != 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_TRY_CATCH)) .toString(); throw new InternalError(msg); } int outlineChunkStartOffset = first.getPosition(); int outlineChunkEndOffset = last.getPosition() + last.getInstruction().getLength(); ConstantPoolGen cpg = getConstantPool(); // Create new outlined method with signature: // // private final outlinedMethodName(CopyLocals copyLocals); // // CopyLocals is an object that is used to copy-in/copy-out local // variables that are used by the outlined method. Only locals whose // value is potentially set or referenced outside the range of the // chunk that is being outlined will be represented in CopyLocals. The // type of the variable for copying local variables is actually // generated to be unique - it is not named CopyLocals. // // The outlined method never needs to be referenced outside of this // class, and will never be overridden, so we mark it private final. final InstructionList newIL = new InstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); final String argTypeName = xsltc.getHelperClassName(); final Type[] argTypes = new Type[] {(new ObjectType(argTypeName)).toJCType()}; final String argName = "copyLocals"; final String[] argNames = new String[] {argName}; int methodAttributes = ACC_PRIVATE | ACC_FINAL; final boolean isStaticMethod = (getAccessFlags() & ACC_STATIC) != 0; if (isStaticMethod) { methodAttributes = methodAttributes | ACC_STATIC; } final MethodGenerator outlinedMethodGen = new MethodGenerator(methodAttributes, org.apache.bcel.generic.Type.VOID, argTypes, argNames, outlinedMethodName, getClassName(), newIL, cpg); // Create class for copying local variables to the outlined method. // The fields the class will need to contain will be determined as the // code in the outlineable chunk is examined. ClassGenerator copyAreaCG = new ClassGenerator(argTypeName, OBJECT_CLASS, argTypeName+".java", ACC_FINAL | ACC_PUBLIC | ACC_SUPER, null, classGen.getStylesheet()) { public boolean isExternal() { return true; } }; ConstantPoolGen copyAreaCPG = copyAreaCG.getConstantPool(); copyAreaCG.addEmptyConstructor(ACC_PUBLIC); // Number of fields in the copy class int copyAreaFieldCount = 0; // The handle for the instruction after the last one to be outlined. // Note that this should never end up being null. An outlineable chunk // won't contain a RETURN instruction or other branch out of the chunk, // and the JVM specification prohibits code in a method from just // "falling off the end" so this should always point to a valid handle. InstructionHandle limit = last.getNext(); // InstructionLists for copying values into and out of an instance of // CopyLocals: // oldMethCoypInIL - from locals in old method into an instance // of the CopyLocals class (oldMethCopyInIL) // oldMethCopyOutIL - from CopyLocals back into locals in the old // method // newMethCopyInIL - from CopyLocals into locals in the new // method // newMethCopyOutIL - from locals in new method into the instance // of the CopyLocals class InstructionList oldMethCopyInIL = new InstructionList(); InstructionList oldMethCopyOutIL = new InstructionList(); InstructionList newMethCopyInIL = new InstructionList(); InstructionList newMethCopyOutIL = new InstructionList(); // Allocate instance of class in which we'll copy in or copy out locals // and make two copies: last copy is used to invoke constructor; // other two are used for references to fields in the CopyLocals object InstructionHandle outlinedMethodCallSetup = oldMethCopyInIL.append(new NEW(cpg.addClass(argTypeName))); oldMethCopyInIL.append(InstructionConstants.DUP); oldMethCopyInIL.append(InstructionConstants.DUP); oldMethCopyInIL.append( new INVOKESPECIAL(cpg.addMethodref(argTypeName, "<init>", "()V"))); // Generate code to invoke the new outlined method, and place the code // on oldMethCopyOutIL InstructionHandle outlinedMethodRef; if (isStaticMethod) { outlinedMethodRef = oldMethCopyOutIL.append( new INVOKESTATIC(cpg.addMethodref( classGen.getClassName(), outlinedMethodName, outlinedMethodGen.getSignature()))); } else { oldMethCopyOutIL.append(InstructionConstants.THIS); oldMethCopyOutIL.append(InstructionConstants.SWAP); outlinedMethodRef = oldMethCopyOutIL.append( new INVOKEVIRTUAL(cpg.addMethodref( classGen.getClassName(), outlinedMethodName, outlinedMethodGen.getSignature()))); } // Used to keep track of the first in a sequence of // OutlineableChunkStart instructions boolean chunkStartTargetMappingsPending = false; InstructionHandle pendingTargetMappingHandle = null; // Used to keep track of the last instruction that was copied InstructionHandle lastCopyHandle = null; // Keeps track of the mapping from instruction handles in the old // method to instruction handles in the outlined method. Only need // to track instructions that are targeted by something else in the // generated BCEL HashMap targetMap = new HashMap(); // Keeps track of the mapping from local variables in the old method // to local variables in the outlined method. HashMap localVarMap = new HashMap(); HashMap revisedLocalVarStart = new HashMap(); HashMap revisedLocalVarEnd = new HashMap(); // Pass 1: Make copies of all instructions, append them to the new list // and associate old instruction references with the new ones, i.e., // a 1:1 mapping. The special marker instructions are not copied. // Also, identify local variables whose values need to be copied into or // out of the new outlined method, and builds up targetMap and // localVarMap as described above. The code identifies those local // variables first so that they can have fixed slots in the stack // frame for the outlined method assigned them ahead of all those // variables that don't need to exist for the entirety of the outlined // method invocation. for (InstructionHandle ih = first; ih != limit; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); // MarkerInstructions are not copied, so if something else targets // one, the targetMap will point to the nearest copied sibling // InstructionHandle: for an OutlineableChunkEnd, the nearest // preceding sibling; for an OutlineableChunkStart, the nearest // following sibling. if (inst instanceof MarkerInstruction) { if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); } else { if (!chunkStartTargetMappingsPending) { chunkStartTargetMappingsPending = true; pendingTargetMappingHandle = ih; } } } } else { // Copy the instruction and append it to the outlined method's // InstructionList. Instruction c = inst.copy(); // Use clone for shallow copy if (c instanceof BranchInstruction) { lastCopyHandle = newIL.append((BranchInstruction)c); } else { lastCopyHandle = newIL.append(c); } if (c instanceof LocalVariableInstruction || c instanceof RET) { // For any instruction that touches a local variable, // check whether the local variable's value needs to be // copied into or out of the outlined method. If so, // generate the code to perform the necessary copying, and // use localVarMap to map the variable in the original // method to the variable in the new method. IndexedInstruction lvi = (IndexedInstruction)c; int oldLocalVarIndex = lvi.getIndex(); LocalVariableGen oldLVG = getLocalVariableRegistry() .lookupRegisteredLocalVariable(oldLocalVarIndex, ih.getPosition()); LocalVariableGen newLVG = (LocalVariableGen)localVarMap.get(oldLVG); // Has the code already mapped this local variable to a // local in the new method? if (localVarMap.get(oldLVG) == null) { // Determine whether the local variable needs to be // copied into or out of the outlined by checking // whether the range of instructions in which the // variable is accessible is outside the range of // instructions in the outlineable chunk. // Special case a chunk start offset of zero: a local // variable live at that position must be a method // parameter, so the code doesn't need to check whether // the variable is live before that point; being live // at offset zero is sufficient to know that the value // must be copied in to the outlined method. boolean copyInLocalValue = offsetInLocalVariableGenRange(oldLVG, (outlineChunkStartOffset != 0) ? outlineChunkStartOffset-1 : 0); boolean copyOutLocalValue = offsetInLocalVariableGenRange(oldLVG, outlineChunkEndOffset+1); // For any variable that needs to be copied into or out // of the outlined method, create a field in the // CopyLocals class, and generate the necessary code for // copying the value. if (copyInLocalValue || copyOutLocalValue) { String varName = oldLVG.getName(); Type varType = oldLVG.getType(); newLVG = outlinedMethodGen.addLocalVariable(varName, varType, null, null); int newLocalVarIndex = newLVG.getIndex(); String varSignature = varType.getSignature(); // Record the mapping from the old local to the new localVarMap.put(oldLVG, newLVG); copyAreaFieldCount++; String copyAreaFieldName = "field" + copyAreaFieldCount; copyAreaCG.addField( new Field(ACC_PUBLIC, copyAreaCPG.addUtf8(copyAreaFieldName), copyAreaCPG.addUtf8(varSignature), null, copyAreaCPG.getConstantPool())); int fieldRef = cpg.addFieldref(argTypeName, copyAreaFieldName, varSignature); if (copyInLocalValue) { // Generate code for the old method to store the // value of the local into the correct field in // CopyLocals prior to invocation of the // outlined method. oldMethCopyInIL.append( InstructionConstants.DUP); InstructionHandle copyInLoad = oldMethCopyInIL.append( loadLocal(oldLocalVarIndex, varType)); oldMethCopyInIL.append(new PUTFIELD(fieldRef)); // If the end of the live range of the old // variable was in the middle of the outlined // chunk. Make the load of its value the new // end of its range. if (!copyOutLocalValue) { revisedLocalVarEnd.put(oldLVG, copyInLoad); } // Generate code for start of the outlined // method to copy the value from a field in // CopyLocals to the new local in the outlined // method newMethCopyInIL.append( InstructionConstants.ALOAD_1); newMethCopyInIL.append(new GETFIELD(fieldRef)); newMethCopyInIL.append( storeLocal(newLocalVarIndex, varType)); } if (copyOutLocalValue) { // Generate code for the end of the outlined // method to copy the value from the new local // variable into a field in CopyLocals // method newMethCopyOutIL.append( InstructionConstants.ALOAD_1); newMethCopyOutIL.append( loadLocal(newLocalVarIndex, varType)); newMethCopyOutIL.append(new PUTFIELD(fieldRef)); // Generate code to copy the value from a field // in CopyLocals into a local in the original // method following invocation of the outlined // method. oldMethCopyOutIL.append( InstructionConstants.DUP); oldMethCopyOutIL.append(new GETFIELD(fieldRef)); InstructionHandle copyOutStore = oldMethCopyOutIL.append( storeLocal(oldLocalVarIndex, varType)); // If the start of the live range of the old // variable was in the middle of the outlined // chunk. Make this store into it the new start // of its range. if (!copyInLocalValue) { revisedLocalVarStart.put(oldLVG, copyOutStore); } } } } } if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); } // If this is the first instruction copied following a sequence // of OutlineableChunkStart instructions, indicate that the // sequence of old instruction all map to this newly created // instruction if (chunkStartTargetMappingsPending) { do { targetMap.put(pendingTargetMappingHandle, lastCopyHandle); pendingTargetMappingHandle = pendingTargetMappingHandle.getNext(); } while(pendingTargetMappingHandle != ih); chunkStartTargetMappingsPending = false; } } } // Pass 2: Walk old and new instruction lists, updating branch targets // and local variable references in the new list InstructionHandle ih = first; InstructionHandle ch = newIL.getStart(); while (ch != null) { // i == old instruction; c == copied instruction Instruction i = ih.getInstruction(); Instruction c = ch.getInstruction(); if (i instanceof BranchInstruction) { BranchInstruction bc = (BranchInstruction)c; BranchInstruction bi = (BranchInstruction)i; InstructionHandle itarget = bi.getTarget(); // old target // New target must be in targetMap InstructionHandle newTarget = (InstructionHandle)targetMap.get(itarget); bc.setTarget(newTarget); // Handle LOOKUPSWITCH or TABLESWITCH which may have many // target instructions if (bi instanceof Select) { InstructionHandle[] itargets = ((Select)bi).getTargets(); InstructionHandle[] ctargets = ((Select)bc).getTargets(); // Update all targets for (int j=0; j < itargets.length; j++) { ctargets[j] = (InstructionHandle)targetMap.get(itargets[j]); } } } else if (i instanceof LocalVariableInstruction || i instanceof RET) { // For any instruction that touches a local variable, // map the location of the variable in the original // method to its location in the new method. IndexedInstruction lvi = (IndexedInstruction)c; int oldLocalVarIndex = lvi.getIndex(); LocalVariableGen oldLVG = getLocalVariableRegistry() .lookupRegisteredLocalVariable(oldLocalVarIndex, ih.getPosition()); LocalVariableGen newLVG = (LocalVariableGen)localVarMap.get(oldLVG); int newLocalVarIndex; if (newLVG == null) { // Create new variable based on old variable - use same // name and type, but we will let the variable be active // for the entire outlined method. // LocalVariableGen oldLocal = oldLocals[oldLocalVarIndex]; String varName = oldLVG.getName(); Type varType = oldLVG.getType(); newLVG = outlinedMethodGen.addLocalVariable(varName, varType, null, null); newLocalVarIndex = newLVG.getIndex(); localVarMap.put(oldLVG, newLVG); // The old variable's live range was wholly contained in // the outlined chunk. There should no longer be stores // of values into it or loads of its value, so we can just // mark its live range as the reference to the outlined // method. revisedLocalVarStart.put(oldLVG, outlinedMethodRef); revisedLocalVarEnd.put(oldLVG, outlinedMethodRef); } else { newLocalVarIndex = newLVG.getIndex(); } lvi.setIndex(newLocalVarIndex); } // If the old instruction marks the end of the range of a local // variable, make sure that any slots on the stack reserved for // local variables are made available for reuse by calling // MethodGenerator.removeLocalVariable if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters(); for (int idx = 0; idx < targeters.length; idx++) { InstructionTargeter targeter = targeters[idx]; if (targeter instanceof LocalVariableGen && ((LocalVariableGen)targeter).getEnd()==ih) { Object newLVG = localVarMap.get(targeter); if (newLVG != null) { outlinedMethodGen.removeLocalVariable( (LocalVariableGen)newLVG); } } } } // If the current instruction in the original list was a marker, // it wasn't copied, so don't advance through the list of copied // instructions yet. if (!(i instanceof MarkerInstruction)) { ch = ch.getNext(); } ih = ih.getNext(); } // POP the reference to the CopyLocals object from the stack oldMethCopyOutIL.append(InstructionConstants.POP); // Now that the generation of the outlined code is complete, update // the old local variables with new start and end ranges, as required. Iterator revisedLocalVarStartPairIter = revisedLocalVarStart.entrySet() .iterator(); while (revisedLocalVarStartPairIter.hasNext()) { Map.Entry lvgRangeStartPair = (Map.Entry)revisedLocalVarStartPairIter.next(); LocalVariableGen lvg = (LocalVariableGen)lvgRangeStartPair.getKey(); InstructionHandle startInst = (InstructionHandle)lvgRangeStartPair.getValue(); lvg.setStart(startInst); } Iterator revisedLocalVarEndPairIter = revisedLocalVarEnd.entrySet() .iterator(); while (revisedLocalVarEndPairIter.hasNext()) { Map.Entry lvgRangeEndPair = (Map.Entry)revisedLocalVarEndPairIter.next(); LocalVariableGen lvg = (LocalVariableGen)lvgRangeEndPair.getKey(); InstructionHandle endInst = (InstructionHandle)lvgRangeEndPair.getValue(); lvg.setEnd(endInst); } xsltc.dumpClass(copyAreaCG.getJavaClass()); // Assemble the instruction lists so that the old method invokes the // new outlined method InstructionList oldMethodIL = getInstructionList(); oldMethodIL.insert(first, oldMethCopyInIL); oldMethodIL.insert(first, oldMethCopyOutIL); // Insert the copying code into the outlined method newIL.insert(newMethCopyInIL); newIL.append(newMethCopyOutIL); newIL.append(InstructionConstants.RETURN); // Discard instructions in outlineable chunk from old method try { oldMethodIL.delete(first, last); } catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } } // Make a copy for the new method of all exceptions that might be thrown String[] exceptions = getExceptions(); for (int i = 0; i < exceptions.length; i++) { outlinedMethodGen.addException(exceptions[i]); } return outlinedMethodGen.getThisMethod(); }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
public void markChunkEnd() { // m_chunkTree.markChunkEnd(); getInstructionList() .append(OutlineableChunkEnd.OUTLINEABLECHUNKEND); m_openChunks--; if (m_openChunks < 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS)) .toString(); throw new InternalError(msg); } }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
boolean widenConditionalBranchTargetOffsets() { boolean ilChanged = false; int maxOffsetChange = 0; InstructionList il = getInstructionList(); // Loop through all the instructions, finding those that would be // affected by inserting new instructions in the InstructionList, and // calculating the maximum amount by which the relative offset between // two instructions could possibly change. // In part this loop duplicates code in // org.apache.bcel.generic.InstructionList.setPosition(), which does // this to determine whether to use 16-bit or 32-bit offsets for GOTO // and JSR instructions. Ideally, that method would do the same for // conditional branch instructions, but it doesn't, so we duplicate the // processing here. for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); switch (inst.getOpcode()) { // Instructions that may have 16-bit or 32-bit branch targets. // The size of the branch offset might increase by two bytes. case Constants.GOTO: case Constants.JSR: maxOffsetChange = maxOffsetChange + 2; break; // Instructions that contain padding for alignment purposes // Up to three bytes of padding might be needed. For greater // accuracy, we should be able to discount any padding already // added to these instructions by InstructionList.setPosition(), // their APIs do not expose that information. case Constants.TABLESWITCH: case Constants.LOOKUPSWITCH: maxOffsetChange = maxOffsetChange + 3; break; // Instructions that might be rewritten by this method as a // conditional branch followed by an unconditional branch. // The unconditional branch would require five bytes. case Constants.IF_ACMPEQ: case Constants.IF_ACMPNE: case Constants.IF_ICMPEQ: case Constants.IF_ICMPGE: case Constants.IF_ICMPGT: case Constants.IF_ICMPLE: case Constants.IF_ICMPLT: case Constants.IF_ICMPNE: case Constants.IFEQ: case Constants.IFGE: case Constants.IFGT: case Constants.IFLE: case Constants.IFLT: case Constants.IFNE: case Constants.IFNONNULL: case Constants.IFNULL: maxOffsetChange = maxOffsetChange + 5; break; } } // Now that the maximum number of bytes by which the method might grow // has been determined, look for conditional branches to see which // might possibly exceed the 16-bit relative offset. for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); if (inst instanceof IfInstruction) { IfInstruction oldIfInst = (IfInstruction)inst; BranchHandle oldIfHandle = (BranchHandle)ih; InstructionHandle target = oldIfInst.getTarget(); int relativeTargetOffset = target.getPosition() - oldIfHandle.getPosition(); // Consider the worst case scenario in which the conditional // branch and its target are separated by all the instructions // in the method that might increase in size. If that results // in a relative offset that cannot be represented as a 32-bit // signed quantity, rewrite the instruction as described above. if ((relativeTargetOffset - maxOffsetChange < MIN_BRANCH_TARGET_OFFSET) || (relativeTargetOffset + maxOffsetChange > MAX_BRANCH_TARGET_OFFSET)) { // Invert the logic of the IF instruction, and append // that to the InstructionList following the original IF // instruction InstructionHandle nextHandle = oldIfHandle.getNext(); IfInstruction invertedIfInst = oldIfInst.negate(); BranchHandle invertedIfHandle = il.append(oldIfHandle, invertedIfInst); // Append an unconditional branch to the target of the // original IF instruction after the new IF instruction BranchHandle gotoHandle = il.append(invertedIfHandle, new GOTO(target)); // If the original IF was the last instruction in // InstructionList, add a new no-op to act as the target // of the new IF if (nextHandle == null) { nextHandle = il.append(gotoHandle, NOP); } // Make the new IF instruction branch around the GOTO invertedIfHandle.updateTarget(target, nextHandle); // If anything still "points" to the old IF instruction, // make adjustments to refer to either the new IF or GOTO // instruction if (oldIfHandle.hasTargeters()) { InstructionTargeter[] targeters = oldIfHandle.getTargeters(); for (int i = 0; i < targeters.length; i++) { InstructionTargeter targeter = targeters[i]; // Ideally, one should simply be able to use // InstructionTargeter.updateTarget to change // references to the old IF instruction to the new // IF instruction. However, if a LocalVariableGen // indicated the old IF marked the end of the range // in which the IF variable is in use, the live // range of the variable must extend to include the // newly created GOTO instruction. The need for // this sort of specific knowledge of an // implementor of the InstructionTargeter interface // makes the code more fragile. Future implementors // of the interface might have similar requirements // which wouldn't be accommodated seemlessly. if (targeter instanceof LocalVariableGen) { LocalVariableGen lvg = (LocalVariableGen) targeter; if (lvg.getStart() == oldIfHandle) { lvg.setStart(invertedIfHandle); } else if (lvg.getEnd() == oldIfHandle) { lvg.setEnd(gotoHandle); } } else { targeter.updateTarget(oldIfHandle, invertedIfHandle); } } } try { il.delete(oldIfHandle); } catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); } // Adjust the pointer in the InstructionList to point after // the newly inserted IF instruction ih = gotoHandle; // Indicate that this method rewrote at least one IF ilChanged = true; } } } // Did this method rewrite any IF instructions? return ilChanged; }
1
              
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
0
(Domain) InternalRuntimeError 4
              
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static DTMAxisIterator nodeList2Iterator( org.w3c.dom.NodeList nodeList, Translet translet, DOM dom) { // First pass: build w3c DOM for all nodes not proxied from our DOM. // // Notice: this looses some (esp. parent) context for these nodes, // so some way to wrap the original nodes inside a DTMAxisIterator // might be preferable in the long run. int n = 0; // allow for change in list length, just in case. Document doc = null; DTMManager dtmManager = null; int[] proxyNodes = new int[nodeList.getLength()]; if (dom instanceof MultiDOM) dtmManager = ((MultiDOM) dom).getDTMManager(); for (int i = 0; i < nodeList.getLength(); ++i) { org.w3c.dom.Node node = nodeList.item(i); if (node instanceof DTMNodeProxy) { DTMNodeProxy proxy = (DTMNodeProxy)node; DTM nodeDTM = proxy.getDTM(); int handle = proxy.getDTMNodeNumber(); boolean isOurDOM = (nodeDTM == dom); if (!isOurDOM && dtmManager != null) { try { isOurDOM = (nodeDTM == dtmManager.getDTM(handle)); } catch (ArrayIndexOutOfBoundsException e) { // invalid node handle, so definitely not our doc } } if (isOurDOM) { proxyNodes[i] = handle; ++n; continue; } } proxyNodes[i] = DTM.NULL; int nodeType = node.getNodeType(); if (doc == null) { if (dom instanceof MultiDOM == false) { runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM"); return null; } try { AbstractTranslet at = (AbstractTranslet) translet; doc = at.newDocument("", "__top__"); } catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; } } // Use one dummy element as container for each node of the // list. That way, it is easier to detect resp. avoid // funny things which change the number of nodes, // e.g. auto-concatenation of text nodes. Element mid; switch (nodeType) { case org.w3c.dom.Node.ELEMENT_NODE: case org.w3c.dom.Node.TEXT_NODE: case org.w3c.dom.Node.CDATA_SECTION_NODE: case org.w3c.dom.Node.COMMENT_NODE: case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: mid = doc.createElementNS(null, "__dummy__"); mid.appendChild(doc.importNode(node, true)); doc.getDocumentElement().appendChild(mid); ++n; break; case org.w3c.dom.Node.ATTRIBUTE_NODE: // The mid element also serves as a container for // attributes, avoiding problems with conflicting // attributes or node order. mid = doc.createElementNS(null, "__dummy__"); mid.setAttributeNodeNS((Attr)doc.importNode(node, true)); doc.getDocumentElement().appendChild(mid); ++n; break; default: // Better play it safe for all types we aren't sure we know // how to deal with. runTimeError(RUN_TIME_INTERNAL_ERR, "Don't know how to convert node type " + nodeType); } } // w3cDOM -> DTM -> DOMImpl DTMAxisIterator iter = null, childIter = null, attrIter = null; if (doc != null) { final MultiDOM multiDOM = (MultiDOM) dom; DOM idom = (DOM)dtmManager.getDTM(new DOMSource(doc), false, null, true, false); // Create DOMAdapter and register with MultiDOM DOMAdapter domAdapter = new DOMAdapter(idom, translet.getNamesArray(), translet.getUrisArray(), translet.getTypesArray(), translet.getNamespaceArray()); multiDOM.addDOMAdapter(domAdapter); DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD); DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD); iter = new AbsoluteIterator( new StepIterator(iter1, iter2)); iter.setStartNode(DTMDefaultBase.ROOTNODE); childIter = idom.getAxisIterator(Axis.CHILD); attrIter = idom.getAxisIterator(Axis.ATTRIBUTE); } // Second pass: find DTM handles for every node in the list. int[] dtmHandles = new int[n]; n = 0; for (int i = 0; i < nodeList.getLength(); ++i) { if (proxyNodes[i] != DTM.NULL) { dtmHandles[n++] = proxyNodes[i]; continue; } org.w3c.dom.Node node = nodeList.item(i); DTMAxisIterator iter3 = null; int nodeType = node.getNodeType(); switch (nodeType) { case org.w3c.dom.Node.ELEMENT_NODE: case org.w3c.dom.Node.TEXT_NODE: case org.w3c.dom.Node.CDATA_SECTION_NODE: case org.w3c.dom.Node.COMMENT_NODE: case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: iter3 = childIter; break; case org.w3c.dom.Node.ATTRIBUTE_NODE: iter3 = attrIter; break; default: // Should not happen, as first run should have got all these throw new InternalRuntimeError("Mismatched cases"); } if (iter3 != null) { iter3.setStartNode(iter.next()); dtmHandles[n] = iter3.next(); // For now, play it self and perform extra checks: if (dtmHandles[n] == DTMAxisIterator.END) throw new InternalRuntimeError("Expected element missing at " + i); if (iter3.next() != DTMAxisIterator.END) throw new InternalRuntimeError("Too many elements at " + i); ++n; } } if (n != dtmHandles.length) throw new InternalRuntimeError("Nodes lost in second pass"); return new ArrayNodeListIterator(dtmHandles); }
0 0
(Lib) LSException 4
              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean write(Node nodeArg, LSOutput destination) throws LSException { // If the destination is null if (destination == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use // Serializer serializer = getXMLSerializer(xmlVersion); Serializer serializer = fXMLSerializer; serializer.reset(); // If the node has not been seen if ( nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = destination.getEncoding(); if (fEncoding == null ) { fEncoding = getInputEncoding(nodeArg); fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } // If the encoding is not recognized throw an exception. // Note: The serializer defaults to UTF-8 when created if (!Encodings.isRecognizedEncoding(fEncoding)) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // The LSSerializer will use the LSOutput object to determine // where to serialize the output to in the following order the // first one that is not null and not an empty string will be // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, // 3. LSOutput.systemId // 1.LSOutput.characterStream Writer writer = destination.getCharacterStream(); if (writer == null ) { // 2.LSOutput.byteStream OutputStream outputStream = destination.getByteStream(); if ( outputStream == null) { // 3. LSOutput.systemId String uri = destination.getSystemId(); if (uri == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // Expand the System Id and obtain an absolute URI for it. String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower case // letters "a"--"z", digits, and the characters plus ("+"), period // ("."), and hyphen ("-") are allowed. For resiliency, programs // interpreting URLs should treat upper case letters as equivalent to // lower case in scheme names (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host.equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } } else { // 2.LSOutput.byteStream serializer.setOutputStream(outputStream); } } else { // 1.LSOutput.characterStream serializer.setWriter(writer); } // The associated media type by default is set to text/xml on // org.apache.xml.serializer.SerializerBase. // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM node fDOMSerializer.serializeDOM3(nodeArg); } catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean writeToURI(Node nodeArg, String uri) throws LSException { // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, // 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = getInputEncoding(nodeArg); if (fEncoding == null ) { fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // If the specified encoding is not supported an // "unsupported-encoding" fatal error is raised. ?? if (uri == null) { String msg = Utils.messages.createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // REVISIT: Can this be used to get an absolute expanded URI String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower // case letters "a"--"z", digits, and the characters plus ("+"), // period ("."), and hyphen ("-") are allowed. For resiliency, // programs interpreting URLs should treat upper case letters as // equivalent to lower case in scheme names // (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host .equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM // node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
0 3
              
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean write(Node nodeArg, LSOutput destination) throws LSException { // If the destination is null if (destination == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use // Serializer serializer = getXMLSerializer(xmlVersion); Serializer serializer = fXMLSerializer; serializer.reset(); // If the node has not been seen if ( nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = destination.getEncoding(); if (fEncoding == null ) { fEncoding = getInputEncoding(nodeArg); fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } // If the encoding is not recognized throw an exception. // Note: The serializer defaults to UTF-8 when created if (!Encodings.isRecognizedEncoding(fEncoding)) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // The LSSerializer will use the LSOutput object to determine // where to serialize the output to in the following order the // first one that is not null and not an empty string will be // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, // 3. LSOutput.systemId // 1.LSOutput.characterStream Writer writer = destination.getCharacterStream(); if (writer == null ) { // 2.LSOutput.byteStream OutputStream outputStream = destination.getByteStream(); if ( outputStream == null) { // 3. LSOutput.systemId String uri = destination.getSystemId(); if (uri == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // Expand the System Id and obtain an absolute URI for it. String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower case // letters "a"--"z", digits, and the characters plus ("+"), period // ("."), and hyphen ("-") are allowed. For resiliency, programs // interpreting URLs should treat upper case letters as equivalent to // lower case in scheme names (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host.equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } } else { // 2.LSOutput.byteStream serializer.setOutputStream(outputStream); } } else { // 1.LSOutput.characterStream serializer.setWriter(writer); } // The associated media type by default is set to text/xml on // org.apache.xml.serializer.SerializerBase. // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM node fDOMSerializer.serializeDOM3(nodeArg); } catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public String writeToString(Node nodeArg) throws DOMException, LSException { // return null is nodeArg is null. Should an Exception be thrown instead? if (nodeArg == null) { return null; } // Should we reset the serializer configuration before each write operation? // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode){ // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // StringWriter to Output to StringWriter output = new StringWriter(); // try { // Set the Serializer's Writer to a StringWriter serializer.setWriter(output); // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } // return the serialized string return output.toString(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean writeToURI(Node nodeArg, String uri) throws LSException { // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, // 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = getInputEncoding(nodeArg); if (fEncoding == null ) { fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // If the specified encoding is not supported an // "unsupported-encoding" fatal error is raised. ?? if (uri == null) { String msg = Utils.messages.createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // REVISIT: Can this be used to get an absolute expanded URI String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower // case letters "a"--"z", digits, and the characters plus ("+"), // period ("."), and hyphen ("-") are allowed. For resiliency, // programs interpreting URLs should treat upper case letters as // equivalent to lower case in scheme names // (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host .equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM // node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
(Domain) XPathProcessorException 4
              
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(String expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected, m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
0 0
(Domain) CompilerException 3
              
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public Stylesheet makeStylesheet(SyntaxTreeNode element) throws CompilerException { try { Stylesheet stylesheet; if (element instanceof Stylesheet) { stylesheet = (Stylesheet)element; } else { stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); // Map the default NS if not already defined if (element.lookupNamespace(EMPTYSTRING) == null) { element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING); } } stylesheet.setParser(this); return stylesheet; } catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode getStylesheet(SyntaxTreeNode root) throws CompilerException { // Assume that this is a pure XSL stylesheet if there is not // <?xml-stylesheet ....?> processing instruction if (_target == null) { if (!_rootNamespaceDef) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_URI_ERR); throw new CompilerException(msg.toString()); } return(root); } // Find the xsl:stylesheet or xsl:transform with this reference if (_target.charAt(0) == '#') { SyntaxTreeNode element = findStylesheet(root, _target.substring(1)); if (element == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_TARGET_ERR, _target, root); throw new CompilerException(msg.toString()); } return(element); } else { return(loadExternalStylesheet(_target)); } }
1
              
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
3
              
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public Stylesheet makeStylesheet(SyntaxTreeNode element) throws CompilerException { try { Stylesheet stylesheet; if (element instanceof Stylesheet) { stylesheet = (Stylesheet)element; } else { stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); // Map the default NS if not already defined if (element.lookupNamespace(EMPTYSTRING) == null) { element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING); } } stylesheet.setParser(this); return stylesheet; } catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode getStylesheet(SyntaxTreeNode root) throws CompilerException { // Assume that this is a pure XSL stylesheet if there is not // <?xml-stylesheet ....?> processing instruction if (_target == null) { if (!_rootNamespaceDef) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_URI_ERR); throw new CompilerException(msg.toString()); } return(root); } // Find the xsl:stylesheet or xsl:transform with this reference if (_target.charAt(0) == '#') { SyntaxTreeNode element = findStylesheet(root, _target.substring(1)); if (element == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_TARGET_ERR, _target, root); throw new CompilerException(msg.toString()); } return(element); } else { return(loadExternalStylesheet(_target)); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode loadExternalStylesheet(String location) throws CompilerException { InputSource source; // Check if the location is URL or a local file if ((new File(location)).exists()) source = new InputSource("file:"+location); else source = new InputSource(location); SyntaxTreeNode external = (SyntaxTreeNode)parse(source); return(external); }
(Lib) NoSuchElementException 4
              
// in src/org/apache/xml/utils/NamespaceSupport2.java
public Object nextElement() { if(hasMoreElements()) { String tmp=lookahead; lookahead=null; return tmp; } else throw new java.util.NoSuchElementException(); }
// in src/org/apache/xml/serializer/dom3/NamespaceSupport.java
public Object nextElement() { if (counter< size){ return fPrefixes[counter++]; } throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration."); }
// in src/org/apache/xalan/templates/ElemNumber.java
public String nextToken() { if (currentPosition >= maxPosition) { throw new NoSuchElementException(); } int start = currentPosition; while ((currentPosition < maxPosition) && Character.isLetterOrDigit(str.charAt(currentPosition))) { currentPosition++; } if ((start == currentPosition) && (!Character.isLetterOrDigit(str.charAt(currentPosition)))) { currentPosition++; } return str.substring(start, currentPosition); }
// in src/org/apache/xalan/transformer/NumeratorFormatter.java
String nextToken() { if (currentPosition >= maxPosition) { throw new NoSuchElementException(); } int start = currentPosition; while ((currentPosition < maxPosition) && Character.isLetterOrDigit(str.charAt(currentPosition))) { currentPosition++; } if ((start == currentPosition) && (!Character.isLetterOrDigit(str.charAt(currentPosition)))) { currentPosition++; } return str.substring(start, currentPosition); }
0 0
(Lib) NoSuchMethodException 7
              
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(thisCoroutine)) throw new java.lang.NoSuchMethodException(); while(m_nextCoroutine != thisCoroutine) { try { wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? } } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; notify(); while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY) { try { // System.out.println("waiting..."); wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? } } if(m_nextCoroutine==NOBODY) { // Pass it along co_exit(thisCoroutine); // And inform this coroutine that its partners are Going Away // %REVIEW% Should this throw/return something more useful? throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request"); } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; m_activeIDs.clear(thisCoroutine); notify(); }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
0 8
              
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(thisCoroutine)) throw new java.lang.NoSuchMethodException(); while(m_nextCoroutine != thisCoroutine) { try { wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? } } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; notify(); while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY) { try { // System.out.println("waiting..."); wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? } } if(m_nextCoroutine==NOBODY) { // Pass it along co_exit(thisCoroutine); // And inform this coroutine that its partners are Going Away // %REVIEW% Should this throw/return something more useful? throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request"); } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; m_activeIDs.clear(thisCoroutine); notify(); }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
(Lib) SQLException 3
              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public Connection getConnection() throws SQLException { if (jdbcSource == null) { try { findDatasource(); } catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); } } try { if (user != null || pwd != null) { Object arglist[] = { user, pwd }; return (Connection) getConnectionWithArgs.invoke(jdbcSource, arglist); } else { Object arglist[] = {}; return (Connection) getConnection.invoke(jdbcSource, arglist); } } catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
2
              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
15
              
// in src/org/apache/xalan/lib/sql/SQLQueryParser.java
public void registerOutputParameters(CallableStatement cstmt) throws SQLException { // Register output parameters if call. if ( m_IsCallable && m_hasOutput ) { for ( int indx = 0 ; indx < m_Parameters.size() ; indx++ ) { QueryParameter parm = (QueryParameter) m_Parameters.elementAt(indx); if ( parm.isOutput() ) { //System.out.println("chrysalisSQLStatement() Registering output parameter for parm " + indx); cstmt.registerOutParameter(indx + 1, parm.getType()); } } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized Connection getConnection( )throws IllegalArgumentException, SQLException { PooledConnection pcon = null; // We will fill up the pool any time it is less than the // Minimum. THis could be cause by the enableing and disabling // or the pool. // if ( m_pool.size() < m_PoolMinSize ) { initializePool(); } // find a connection not in use for ( int x = 0; x < m_pool.size(); x++ ) { pcon = (PooledConnection) m_pool.elementAt(x); // Check to see if the Connection is in use if ( pcon.inUse() == false ) { // Mark it as in use pcon.setInUse(true); // return the JDBC Connection stored in the // PooledConnection object return pcon.getConnection(); } } // Could not find a free connection, // create and add a new one // Create a new JDBC Connection Connection con = createConnection(); // Create a new PooledConnection, passing it the JDBC // Connection pcon = new PooledConnection(con); // Mark the connection as in use pcon.setInUse(true); // Add the new PooledConnection object to the pool m_pool.addElement(pcon); // return the new Connection return pcon.getConnection(); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void releaseConnection( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection " + x); } if (! isEnabled()) { con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } } else { // Set it's inuse attribute to false, which // releases it for use pcon.setInUse(false); } break; } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
private Connection createConnection( )throws SQLException { Connection con = null; // Create a Connection directly from the Driver that was loaded // with the context class loader. This is to support JDK1.4 con = m_Driver.connect(m_url, m_ConnectionProtocol ); return con; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xalan/lib/sql/XConnection.java
private void initFromElement( Element e )throws SQLException { Properties prop = new Properties(); String driver = ""; String dbURL = ""; Node n = e.getFirstChild(); if (null == n) return; // really need to throw an error do { String nName = n.getNodeName(); if (nName.equalsIgnoreCase("dbdriver")) { driver = ""; Node n1 = n.getFirstChild(); if (null != n1) { driver = n1.getNodeValue(); } } if (nName.equalsIgnoreCase("dburl")) { dbURL = ""; Node n1 = n.getFirstChild(); if (null != n1) { dbURL = n1.getNodeValue(); } } if (nName.equalsIgnoreCase("password")) { String s = ""; Node n1 = n.getFirstChild(); if (null != n1) { s = n1.getNodeValue(); } prop.put("password", s); } if (nName.equalsIgnoreCase("user")) { String s = ""; Node n1 = n.getFirstChild(); if (null != n1) { s = n1.getNodeValue(); } prop.put("user", s); } if (nName.equalsIgnoreCase("protocol")) { String Name = ""; NamedNodeMap attrs = n.getAttributes(); Node n1 = attrs.getNamedItem("name"); if (null != n1) { String s = ""; Name = n1.getNodeValue(); Node n2 = n.getFirstChild(); if (null != n2) s = n2.getNodeValue(); prop.put(Name, s); } } } while ( (n = n.getNextSibling()) != null); init(driver, dbURL, prop); }
// in src/org/apache/xalan/lib/sql/XConnection.java
private void init( String driver, String dbURL, Properties prop )throws SQLException { Connection con = null; if (DEBUG) System.out.println("XConnection, Connection Init"); String user = prop.getProperty("user"); if (user == null) user = ""; String passwd = prop.getProperty("password"); if (passwd == null) passwd = ""; String poolName = driver + dbURL + user + passwd; ConnectionPool cpool = m_PoolMgr.getPool(poolName); if (cpool == null) { if (DEBUG) { System.out.println("XConnection, Creating Connection"); System.out.println(" Driver :" + driver); System.out.println(" URL :" + dbURL); System.out.println(" user :" + user); System.out.println(" passwd :" + passwd); } DefaultConnectionPool defpool = new DefaultConnectionPool(); if ((DEBUG) && (defpool == null)) System.out.println("Failed to Create a Default Connection Pool"); defpool.setDriver(driver); defpool.setURL(dbURL); defpool.setProtocol(prop); // Only enable pooling in the default pool if we are explicatly // told too. if (m_DefaultPoolingEnabled) defpool.setPoolEnabled(true); m_PoolMgr.registerPool(poolName, defpool); m_ConnectionPool = defpool; } else { m_ConnectionPool = cpool; } m_IsDefaultPool = true; // // Let's test to see if we really can connect // Just remember to give it back after the test. // try { con = m_ConnectionPool.getConnection(); } catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; } finally { if ( con != null ) m_ConnectionPool.releaseConnection(con); } }
// in src/org/apache/xalan/lib/sql/XConnection.java
public void close( )throws SQLException { if (DEBUG) System.out.println("Entering XConnection.close()"); // // This function is included just for Legacy support // If it is really called then we must me using a single // document interface, so close all open documents. while(m_OpenSQLDocuments.size() != 0) { SQLDocument d = (SQLDocument) m_OpenSQLDocuments.elementAt(0); try { // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. d.close(m_IsDefaultPool); } catch (Exception se ) {} m_OpenSQLDocuments.removeElementAt(0); } if ( null != m_Connection ) { m_ConnectionPool.releaseConnection(m_Connection); m_Connection = null; } if (DEBUG) System.out.println("Exiting XConnection.close"); }
// in src/org/apache/xalan/lib/sql/XConnection.java
public void close(ExpressionContext exprContext, Object doc) throws SQLException { if (DEBUG) System.out.println("Entering XConnection.close(" + doc + ")"); SQLDocument sqlDoc = locateSQLDocument(exprContext, doc); if (sqlDoc != null) { // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. sqlDoc.close(m_IsDefaultPool); m_OpenSQLDocuments.remove(sqlDoc); } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public Connection getConnection() throws SQLException { if (jdbcSource == null) { try { findDatasource(); } catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); } } try { if (user != null || pwd != null) { Object arglist[] = { user, pwd }; return (Connection) getConnectionWithArgs.invoke(jdbcSource, arglist); } else { Object arglist[] = {}; return (Connection) getConnection.invoke(jdbcSource, arglist); } } catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void releaseConnection(Connection con) throws SQLException { con.close(); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void releaseConnectionOnError(Connection con) throws SQLException { con.close(); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
public void execute(XConnection xconn, SQLQueryParser query) throws SQLException { try { m_StreamingMode = "true".equals(xconn.getFeature("streaming")); m_MultipleResults = "true".equals(xconn.getFeature("multiple-results")); m_IsStatementCachingEnabled = "true".equals(xconn.getFeature("cache-statements")); m_XConnection = xconn; m_QueryParser = query; executeSQLStatement(); createExpandedNameTable(); // Start the document here m_DocumentIdx = addElement(0, m_Document_TypeID, DTM.NULL, DTM.NULL); m_SQLIdx = addElement(1, m_SQL_TypeID, m_DocumentIdx, DTM.NULL); if ( ! m_MultipleResults ) extractSQLMetaData(m_ResultSet.getMetaData()); // Only grab the first row, subsequent rows will be // fetched on demand. // We need to do this here so at least on row is set up // to measure when we are actually reading rows. // We won't grab the first record in case the skip function // is applied prior to looking at the first record. // JCG Changed 9/15/04 // addRowToDTMFromResultSet(); } catch(SQLException e) { m_HasErrors = true; throw e; } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
(Lib) XPathFunctionException 3
              
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
public Object evaluate(List args) throws XPathFunctionException { Vector argsVec = listToVector(args); try { // The method key and ExpressionContext are set to null. return m_handler.callFunction(m_funcName, argsVec, null, null); } catch (TransformerException e) { throw new XPathFunctionException(e); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
1
              
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
1
              
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
public Object evaluate(List args) throws XPathFunctionException { Vector argsVec = listToVector(args); try { // The method key and ExpressionContext are set to null. return m_handler.callFunction(m_funcName, argsVec, null, null); } catch (TransformerException e) { throw new XPathFunctionException(e); } }
(Lib) ClassCastException 2
              
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
protected int addNode(Node node, int parentIndex, int previousSibling, int forceNodeType) { int nodeIndex = m_nodes.size(); // Have we overflowed a DTM Identity's addressing range? if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS)) { try { if(m_mgr==null) throw new ClassCastException(); // Handle as Extended Addressing DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr; int id=mgrD.getFirstFreeDTMID(); mgrD.addDTM(this,id,nodeIndex); m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS); } catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; } } m_size++; // ensureSize(nodeIndex); int type; if(NULL==forceNodeType) type = node.getNodeType(); else type=forceNodeType; // %REVIEW% The Namespace Spec currently says that Namespaces are // processed in a non-namespace-aware manner, by matching the // QName, even though there is in fact a namespace assigned to // these nodes in the DOM. If and when that changes, we will have // to consider whether we check the namespace-for-namespaces // rather than the node name. // // %TBD% Note that the DOM does not necessarily explicitly declare // all the namespaces it uses. DOM Level 3 will introduce a // namespace-normalization operation which reconciles that, and we // can request that users invoke it or otherwise ensure that the // tree is namespace-well-formed before passing the DOM to Xalan. // But if they don't, what should we do about it? We probably // don't want to alter the source DOM (and may not be able to do // so if it's read-only). The best available answer might be to // synthesize additional DTM Namespace Nodes that don't correspond // to DOM Attr Nodes. if (Node.ATTRIBUTE_NODE == type) { String name = node.getNodeName(); if (name.startsWith("xmlns:") || name.equals("xmlns")) { type = DTM.NAMESPACE_NODE; } } m_nodes.addElement(node); m_firstch.setElementAt(NOTPROCESSED,nodeIndex); m_nextsib.setElementAt(NOTPROCESSED,nodeIndex); m_prevsib.setElementAt(previousSibling,nodeIndex); m_parent.setElementAt(parentIndex,nodeIndex); if(DTM.NULL != parentIndex && type != DTM.ATTRIBUTE_NODE && type != DTM.NAMESPACE_NODE) { // If the DTM parent had no children, this becomes its first child. if(NOTPROCESSED == m_firstch.elementAt(parentIndex)) m_firstch.setElementAt(nodeIndex,parentIndex); } String nsURI = node.getNamespaceURI(); // Deal with the difference between Namespace spec and XSLT // definitions of local name. (The former says PIs don't have // localnames; the latter says they do.) String localName = (type == Node.PROCESSING_INSTRUCTION_NODE) ? node.getNodeName() : node.getLocalName(); // Hack to make DOM1 sort of work... if(((type == Node.ELEMENT_NODE) || (type == Node.ATTRIBUTE_NODE)) && null == localName) localName = node.getNodeName(); // -sb ExpandedNameTable exnt = m_expandedNameTable; // %TBD% Nodes created with the old non-namespace-aware DOM // calls createElement() and createAttribute() will never have a // localname. That will cause their expandedNameID to be just the // nodeType... which will keep them from being matched // successfully by name. Since the DOM makes no promise that // those will participate in namespace processing, this is // officially accepted as Not Our Fault. But it might be nice to // issue a diagnostic message! if(node.getLocalName()==null && (type==Node.ELEMENT_NODE || type==Node.ATTRIBUTE_NODE)) { // warning("DOM 'level 1' node "+node.getNodeName()+" won't be mapped properly in DOM2DTM."); } int expandedNameID = (null != localName) ? exnt.getExpandedTypeID(nsURI, localName, type) : exnt.getExpandedTypeID(type); m_exptype.setElementAt(expandedNameID,nodeIndex); indexNode(expandedNameID, nodeIndex); if (DTM.NULL != previousSibling) m_nextsib.setElementAt(nodeIndex,previousSibling); // This should be done after m_exptype has been set, and probably should // always be the last thing we do if (type == DTM.NAMESPACE_NODE) declareNamespaceInContext(parentIndex,nodeIndex); return nodeIndex; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected void addNewDTMID(int nodeIndex) { try { if(m_mgr==null) throw new ClassCastException(); // Handle as Extended Addressing DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr; int id=mgrD.getFirstFreeDTMID(); mgrD.addDTM(this,id,nodeIndex); m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS); } catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; } }
0 1
              
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public int compareTo(Object o) throws ClassCastException { ElemTemplateElement ro = (ElemTemplateElement) o; int roPrecedence = ro.getStylesheetComposed().getImportCountComposed(); int myPrecedence = this.getStylesheetComposed().getImportCountComposed(); if (myPrecedence < roPrecedence) return -1; else if (myPrecedence > roPrecedence) return 1; else return this.getUid() - ro.getUid(); }
(Domain) DTMConfigurationException 2
              
// in src/org/apache/xml/dtm/DTMManager.java
public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException { DTMManager factoryImpl = null; try { factoryImpl = (DTMManager) ObjectFactory .createObject(defaultPropName, defaultClassName); } catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); } if (factoryImpl == null) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null)); //"No default implementation found"); } factoryImpl.setXMLStringFactory(xsf); return factoryImpl; }
1
              
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
1
              
// in src/org/apache/xml/dtm/DTMManager.java
public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException { DTMManager factoryImpl = null; try { factoryImpl = (DTMManager) ObjectFactory .createObject(defaultPropName, defaultClassName); } catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); } if (factoryImpl == null) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null)); //"No default implementation found"); } factoryImpl.setXMLStringFactory(xsf); return factoryImpl; }
(Lib) XPathFactoryConfigurationException 2
              
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
0 2
              
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
(Lib) Exception 1
              
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
0 13
              
// in src/org/apache/xml/utils/ListingErrorHandler.java
protected static String getSourceLine(String sourceUrl, int lineNum) throws Exception { URL url = null; // Get a URL from the sourceUrl try { // Try to get a URL from it as-is url = new URL(sourceUrl); } catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } } String line = null; InputStream is = null; BufferedReader br = null; try { // Open the URL and read to our specified line URLConnection uc = url.openConnection(); is = uc.getInputStream(); br = new BufferedReader(new InputStreamReader(is)); // Not the most efficient way, but it works // (Feel free to patch to seek to the appropriate line) for (int i = 1; i <= lineNum; i++) { line = br.readLine(); } } // Allow exceptions to propagate from here, but ensure // streams are closed! finally { br.close(); is.close(); } // Return whatever we found return line; }
// in src/org/apache/xml/utils/NodeVector.java
public void sort(int a[], int lo0, int hi0) throws Exception { int lo = lo0; int hi = hi0; // pause(lo, hi); if (lo >= hi) { return; } else if (lo == hi - 1) { /* * sort a two element list by swapping if necessary */ if (a[lo] > a[hi]) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; } return; } /* * Pick a pivot and move it out of the way */ int mid = (lo + hi) >>> 1; int pivot = a[mid]; a[mid] = a[hi]; a[hi] = pivot; while (lo < hi) { /* * Search forward from a[lo] until an element is found that * is greater than the pivot or lo >= hi */ while (a[lo] <= pivot && lo < hi) { lo++; } /* * Search backward from a[hi] until element is found that * is less than the pivot, or lo >= hi */ while (pivot <= a[hi] && lo < hi) { hi--; } /* * Swap elements a[lo] and a[hi] */ if (lo < hi) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; // pause(); } // if (stopRequested) { // return; // } } /* * Put the median in the "center" of the list */ a[hi0] = a[hi]; a[hi] = pivot; /* * Recursive calls, elements a[lo0] to a[lo-1] are less than or * equal to pivot, elements a[hi+1] to a[hi0] are greater than * pivot. */ sort(a, lo0, lo - 1); sort(a, hi + 1, hi0); }
// in src/org/apache/xml/utils/NodeVector.java
public void sort() throws Exception { sort(m_map, 0, m_firstFree - 1); }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowException() throws Exception { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void setCdataSectionElements(Hashtable h) throws Exception { couldThrowException(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getSourceTreeAsText() throws Exception { return getTreeAsText(m_documentURL); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getStyleTreeAsText() throws Exception { return getTreeAsText(m_styleURL); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getResultTreeAsText() throws Exception { return escapeString(getHtmlText()); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom) throws Exception { return document(uri, base, translet, dom, false); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom, boolean cacheDOM) throws Exception { try { final String originalUri = uri; MultiDOM multiplexer = (MultiDOM)dom; // Prepend URI base to URI (from context) if (base != null && base.length() != 0) { uri = SystemIDResolver.getAbsoluteURI(uri, base); } // Return an empty iterator if the URI is clearly invalid // (to prevent some unncessary MalformedURL exceptions). if (uri == null || uri.length() == 0) { return(EmptyIterator.getInstance()); } // Check if this DOM has already been added to the multiplexer int mask = multiplexer.getDocumentMask(uri); if (mask != -1) { DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri)) .getDOMImpl(); if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); } } // Check if we can get the DOM from a DOMCache DOMCache cache = translet.getDOMCache(); DOM newdom; mask = multiplexer.nextMask(); // peek if (cache != null) { newdom = cache.retrieveDocument(base, originalUri, translet); if (newdom == null) { final Exception e = new FileNotFoundException(originalUri); throw new TransletException(e); } } else { // Parse the input document and construct DOM object // Trust the DTMManager to pick the right parser and // set up the DOM correctly. XSLTCDTMManager dtmManager = (XSLTCDTMManager)multiplexer .getDTMManager(); DOMEnhancedForDTM enhancedDOM = (DOMEnhancedForDTM) dtmManager.getDTM(new StreamSource(uri), false, null, true, false, translet.hasIdCall(), cacheDOM); newdom = enhancedDOM; // Cache the stylesheet DOM in the Templates object if (cacheDOM) { TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); if (templates != null) { templates.setStylesheetDOM(enhancedDOM); } } translet.prepassDocument(enhancedDOM); enhancedDOM.setDocumentURI(uri); } // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); multiplexer.addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); } catch (Exception e) { throw e; } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(DTMAxisIterator arg1, String baseURI, AbstractTranslet translet, DOM dom) throws Exception { UnionIterator union = new UnionIterator(dom); int node = DTM.NULL; while ((node = arg1.next()) != DTM.NULL) { String uri = dom.getStringValueX(node); //document(node-set) if true; document(node-set,node-set) if false if (baseURI == null) { baseURI = dom.getDocumentURI(node); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } union.addIterator(document(uri, baseURI, translet, dom)); } return(union); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(DOM newdom, AbstractTranslet translet, DOM dom) throws Exception { DTMManager dtmManager = ((MultiDOM)dom).getDTMManager(); // Need to migrate the cached DTM to the new DTMManager if (dtmManager != null && newdom instanceof DTM) { ((DTM)newdom).migrateTo(dtmManager); } translet.prepassDocument(newdom); // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); ((MultiDOM)dom).addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transformIdentity(Source source, SerializationHandler handler) throws Exception { // Get systemId from source if (source != null) { _sourceSystemId = source.getSystemId(); } if (source instanceof StreamSource) { final StreamSource stream = (StreamSource) source; final InputStream streamInput = stream.getInputStream(); final Reader streamReader = stream.getReader(); final XMLReader reader = _readerManager.getXMLReader(); try { // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Create input source from source InputSource input; if (streamInput != null) { input = new InputSource(streamInput); input.setSystemId(_sourceSystemId); } else if (streamReader != null) { input = new InputSource(streamReader); input.setSystemId(_sourceSystemId); } else if (_sourceSystemId != null) { input = new InputSource(_sourceSystemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } // Start pushing SAX events reader.parse(input); } finally { _readerManager.releaseXMLReader(reader); } } else if (source instanceof SAXSource) { final SAXSource sax = (SAXSource) source; XMLReader reader = sax.getXMLReader(); final InputSource input = sax.getInputSource(); boolean userReader = true; try { // Create a reader if not set by user if (reader == null) { reader = _readerManager.getXMLReader(); userReader = false; } // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Start pushing SAX events reader.parse(input); } finally { if (!userReader) { _readerManager.releaseXMLReader(reader); } } } else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; new DOM2TO(domsrc.getNode(), handler).parse(); } else if (source instanceof XSLTCSource) { final DOM dom = ((XSLTCSource) source).getDOM(null, _translet); ((SAXImpl)dom).copy(handler); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } }
(Lib) IllegalStateException 1
              
// in src/org/apache/xml/dtm/DTMException.java
public synchronized Throwable initCause(Throwable cause) { if ((this.containedException == null) && (cause != null)) { throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause"); } if (cause == this) { throw new IllegalArgumentException( XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted"); } this.containedException = cause; return this; }
0 0
(Lib) NamingException 1
              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
protected void findDatasource() throws NamingException { try { InitialContext context = new InitialContext(); jdbcSource = context.lookup(jndiPath); Class withArgs[] = { String.class, String.class }; getConnectionWithArgs = jdbcSource.getClass().getDeclaredMethod("getConnection", withArgs); Class noArgs[] = { }; getConnection = jdbcSource.getClass().getDeclaredMethod("getConnection", noArgs); } catch (NamingException e) { throw e; } catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); } }
1
              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
1
              
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
protected void findDatasource() throws NamingException { try { InitialContext context = new InitialContext(); jdbcSource = context.lookup(jndiPath); Class withArgs[] = { String.class, String.class }; getConnectionWithArgs = jdbcSource.getClass().getDeclaredMethod("getConnection", withArgs); Class noArgs[] = { }; getConnection = jdbcSource.getClass().getDeclaredMethod("getConnection", noArgs); } catch (NamingException e) { throw e; } catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); } }
(Lib) NumberFormatException 1
              
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Number() throws javax.xml.transform.TransformerException { if (null != m_token) { // Mutate the token to remove the quotes and have the XNumber object // already made. double num; try { // XPath 1.0 does not support number in exp notation if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1)) throw new NumberFormatException(); num = Double.valueOf(m_token).doubleValue(); } catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); } m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
0 0
(Lib) SAXNotRecognizedException 1
              
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
0 10
              
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
(Domain) StopException 1
              
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
0 0
(Domain) StopParseException 1
              
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws org.xml.sax.SAXException { throw new StopParseException(); }
0 0
(Lib) UnsupportedEncodingException 1
              
// in src/org/apache/xml/serializer/Encodings.java
static Writer getWriter(OutputStream output, String encoding) throws UnsupportedEncodingException { for (int i = 0; i < _encodings.length; ++i) { if (_encodings[i].name.equalsIgnoreCase(encoding)) { try { String javaName = _encodings[i].javaName; OutputStreamWriter osw = new OutputStreamWriter(output,javaName); return osw; } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying } catch (UnsupportedEncodingException usee) { // keep trying } } } try { return new OutputStreamWriter(output, encoding); } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); } }
1
              
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
1
              
// in src/org/apache/xml/serializer/Encodings.java
static Writer getWriter(OutputStream output, String encoding) throws UnsupportedEncodingException { for (int i = 0; i < _encodings.length; ++i) { if (_encodings[i].name.equalsIgnoreCase(encoding)) { try { String javaName = _encodings[i].javaName; OutputStreamWriter osw = new OutputStreamWriter(output,javaName); return osw; } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying } catch (UnsupportedEncodingException usee) { // keep trying } } } try { return new OutputStreamWriter(output, encoding); } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); } }
(Lib) UnsupportedOperationException 1
              
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public void remove() { throw new UnsupportedOperationException(); }
0 0
(Lib) SAXParseException 1
              
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(Attributes attrs) throws org.xml.sax.SAXParseException { String value = attrs.getValue("xml:space"); if(null == value) { m_spacePreserveStack.push(m_spacePreserveStack.peekOrFalse()); } else if(value.equals("preserve")) { m_spacePreserveStack.push(true); } else if(value.equals("default")) { m_spacePreserveStack.push(false); } else { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_XMLSPACE_VALUE, null), locator)); //"Illegal value for xml:space", locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); } m_spacePreserveStack.push(m_spacePreserveStack.peek()); } }
1
              
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
2
              
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(boolean b) throws org.xml.sax.SAXParseException { m_spacePreserveStack.push(b); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(Attributes attrs) throws org.xml.sax.SAXParseException { String value = attrs.getValue("xml:space"); if(null == value) { m_spacePreserveStack.push(m_spacePreserveStack.peekOrFalse()); } else if(value.equals("preserve")) { m_spacePreserveStack.push(true); } else if(value.equals("default")) { m_spacePreserveStack.push(false); } else { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_XMLSPACE_VALUE, null), locator)); //"Illegal value for xml:space", locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); } m_spacePreserveStack.push(m_spacePreserveStack.peek()); } }
Explicit thrown (throw new...): 1042/1204
Explicit thrown ratio: 86.5%
Builder thrown ratio: 2.1%
Variable thrown ratio: 13.2%
Checked Runtime Total
Domain 112 249 361
Lib 7 162 169
Total 119 411

Caught Exceptions Summary

A (Domain) exception is defined in the application. A (Lib) exception is defined in the JDK or in a library. An exception can be caught, and it happens that the catch block contains a throw (e.g. for wrapping a low-level exception). Hovering over a number triggers showing code snippets from the application code.

Type Exception Caught
(directly)
Caught
with Thrown
(Lib) Exception 285
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (Exception e) { pw.println("line: logSourceLine unavailable due to: " + e.getMessage()); pw.println(); }
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e2) { // Ooops, just bail (suggestions for a safe thing // to do in this case appreciated) e2.printStackTrace(); }
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception e) { // Fallback if this fails (implemented in createIncrementalSAXSource) is // to attempt Xerces-1 incremental setup. Can't do tail-call in // constructor, so create new, copy Xerces-1 initialization, // then throw it away... Ugh. IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser()); this.fParseSomeSetup=dummy.fParseSomeSetup; this.fParseSome=dummy.fParseSome; this.fIncrementalParser=dummy.fIncrementalParser; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (Exception ex) { arg = new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch( Exception ex ) { ex.printStackTrace(); coParser=null; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) {}
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/res/XMLMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(FORMAT_FAILED); fmsg += " " + msg; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (Exception e) { //User may be using older JDK ( JDK <1.2 ). Allow him/her to use it. // But don't try to use doPrivileged }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception e) { /* even the message that the message is not in the bundle is * not there ... this is really bad */ msg = "The message key '" + msgKey + "' is not in the message class '" + m_resourceBundleName+"'"; }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception e) { throwex = true; try { // Get the message that the format failed. fmsg = java.text.MessageFormat.format( MsgKey.BAD_MSGFORMAT, new Object[] { msgKey, m_resourceBundleName }); fmsg += " " + msg; } catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (Exception e){}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception except) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (Exception e) { }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception exc) { fgThrowableInitCauseMethod = null; fgThrowableMethodsAvailable = false; }
// in src/org/apache/xml/serializer/EncodingInfo.java
catch (Exception e) { isInEncoding = false; // If for some reason the encoding is null, e.g. // for a temporary result tree, we should just // say that every character is in the encoding. if (encoding == null) isInEncoding = true; }
// in src/org/apache/xml/serializer/EncodingInfo.java
catch (Exception e) { isInEncoding = false; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { this.showStatus("Could not prime the pump!"); System.out.println("Could not prime the pump!"); e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception any_error) { any_error.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { // what can you do? }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, e.getMessage(), node); reportError(FATAL, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Import.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Include.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { _dom = null; }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { return(System.currentTimeMillis()); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (Exception e) { return this; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (Exception ex) { version = -1; }
// in src/org/apache/xalan/templates/ElemElement.java
catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
catch (Exception iae) { templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{ patternStr }); return XString.EMPTYSTRING; //throw new XSLProcessorException(iae); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception ioe){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { System.err.println("# WARNING: -out " + args[i] + " threw " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { System.err.println("appendEnvironmentReport threw: " + e2.toString()); e2.printStackTrace(); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { /* no-op, don't add it */ }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { if (null != clazz) { // We must have found the class itself, just not the // method, so we (probably) have JAXP 1.0.1 h.put(ERROR + VERSION + "JAXP", "1.0.1"); h.put(ERROR, ERROR_FOUND); } else { // We couldn't even find the class, and don't have // any JAXP support at all, or only have the // transform half of it h.put(ERROR + VERSION + "JAXP", CLASS_NOTPRESENT); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e1) { h.put(VERSION + "xalan1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2x", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "crimson", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "ant", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(ERROR + VERSION + "DOM", "ERROR attempting to load DOM level 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/SQLQueryParser.java
catch (Exception tx) { // if ( ! parm.isOutput() ) throw new SQLException(tx.toString()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { if (DEBUG) { System.out.println("Testing Connection, FAILED"); e.printStackTrace(); } return false; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addElement: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addAttributeToNode: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Cloning attributes"); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Getting String Value"); return null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception se ) {}
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { setError(e, exprContext); return null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { eDoc = null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { //m_Error = null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { // Empty We are final Anyway }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception origEx) { // For now let's assume that the relative method is not supported. // So let's do it manually. try { for (int x=0; x<value; x++) { if (! m_ResultSet.next()) break; } } catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { m_XConnection.setError(e, this, checkWarnings()); //error("ERROR Extracting Metadata"); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_LABEL_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CATALOGUE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DISPLAY_SIZE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPENAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_PRECISION_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCALE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCHEMA_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_TABLE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CASESENSITIVE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DEFINITELYWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISNULLABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSIGNED_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSEARCHABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { return false; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/XPathException.java
catch (Exception e){}
// in src/org/apache/xpath/XPathException.java
catch (Exception e){}
// in src/org/apache/xpath/XPathException.java
catch (Exception e) { s.println("Could not print stack trace..."); }
// in src/org/apache/xpath/XPathContext.java
catch (Exception e) {}
// in src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
catch (Exception e) { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncExtElementAvailable.java
catch (Exception e) { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { return new XString(result); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/res/XPATHMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); fmsg += " " + msg; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { e.printStackTrace(); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { return false; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
124
            
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
(Lib) IOException 139
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(IOException ex) { arg=ex; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (IOException ex) { arg = ex; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/SerializerBase.java
catch(IOException ioe) { }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch(IOException e) { // what? me worry? }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { // ignore ? }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (java.io.IOException e) { }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { continue; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.io.IOException ioe){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(IOException ioe){}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/xslt/Process.java
catch(java.io.IOException ie) {}
// in src/org/apache/xalan/xslt/Process.java
catch (java.io.IOException e) { }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
58
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
(Lib) MissingResourceException 114
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
57
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
(Lib) SecurityException 113
            
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se) {// user.dir not accessible from applet }
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (SecurityException se) { return "file:" + localPath; }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (SecurityException se) { return systemId; }
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/utils/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/DTMManager.java
catch (SecurityException ex){}
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/serializer/TreeWalker.java
catch (SecurityException se) {// user.dir not accessible from applet }
// in src/org/apache/xml/serializer/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // No-op for sandbox/applet case, leave null -sc }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // No-op for sandbox/applet case, leave null -sc }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (SecurityException se) { return "file:" + localPath; }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (SecurityException se) { return systemId; }
// in src/org/apache/xml/serializer/Encodings.java
catch (SecurityException se) { encoding = DEFAULT_MIME_ENCODING; }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (SecurityException se) { // user.dir not accessible from applet }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SecurityException se) {}
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se) { // For applet context, etc. h.put( "java.version", "WARNING: SecurityException thrown accessing system version properties"); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se2) { // For applet context, etc. h.put( "java.class.path", "WARNING: SecurityException thrown accessing system classpath properties"); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch(SecurityException e){ throw e; }
19
            
// in src/org/apache/xml/utils/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch(SecurityException e){ throw e; }
(Lib) TransformerException 110
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (TransformerException te) { // ignore }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (TransformerException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { _result = null; }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { // nada }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException te) { // well, we tried. }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e2) { new TransformerConfigurationException(e2); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored - transformation cannot be continued }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored - transformation cannot be continued }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { if (_errorListener != null) postErrorToListener("File not found: " + e.getMessage()); return(null); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch( TransformerException e2) { new TransformerConfigurationException(e2); }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException se) { // Ignore this for right now }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/templates/ElemUnknown.java
catch (TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/transformer/KeyIterator.java
catch (TransformerException se) { // TODO: What to do? }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (javax.xml.transform.TransformerException te) {te.printStackTrace();}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException se) { return DTMWSFilter.INHERIT; }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
87
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
(Lib) SAXException 84
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (SAXException ex) { arg = ex; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(SAXException e) { e.printStackTrace(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
catch (SAXException e) { // falls through }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (SAXException e) { // falls through }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/ToStream.java
catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (SAXException se) { // ignore ? }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/NamespaceMappings.java
catch (SAXException e) { // not much we can do if they aren't willing to listen }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { runTimeError(RUN_TIME_COPY_ERR); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) {}
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { reportError(ERROR, new ErrorMsg(e.getMessage())); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) {}
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { return; }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException e) {}
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (SAXException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (SAXException e) { // Falls through }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException e) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { tException = new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemAttribute.java
catch (SAXException e) { }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (org.xml.sax.SAXException se){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { // We don't care. }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se){}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (SAXException e) { // do something? }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
53
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
(Lib) ClassNotFoundException 70
            
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
catch (ClassNotFoundException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassNotFoundException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, node); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { System.err.println(e); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectType.java
catch (ClassNotFoundException e) { _clazz = null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (ClassNotFoundException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (ClassNotFoundException e) { // For now, just let this go. We'll catch it when we try to invoke a method. }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException cnfe) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException cnfe) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionNamespacesManager.java
catch (ClassNotFoundException e) { return new ExtensionNamespaceSupport( ns, "org.apache.xalan.extensions.ExtensionHandlerJavaPackage", new Object[]{ns, "javapackage", className + "."}); }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
catch (ClassNotFoundException e) { return null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
71
            
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
(Lib) CloneNotSupportedException 43
            
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMNodeList.java
catch(CloneNotSupportedException cnse) { m_iter = dtmIterator; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xalan/xsltc/dom/ForwardPositionIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/FilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NthIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MatchingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/StepIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/templates/TemplateList.java
catch (CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/templates/OutputProperties.java
catch (CloneNotSupportedException e) { return null; }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (CloneNotSupportedException e) { refNodes = null; }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (CloneNotSupportedException cnse) { // should never happen. return null; }
// in src/org/apache/xalan/trace/PrintTraceListener.java
catch (CloneNotSupportedException cnse) { m_pw.println( " [Can't trace nodelist because it it threw a CloneNotSupportedException]"); return; }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/XPathContext.java
catch (CloneNotSupportedException cnse) { return null; // error reporting? }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/axes/OneStepIterator.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/OneStepIterator.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
// in src/org/apache/xpath/axes/AxesWalker.java
catch (CloneNotSupportedException cnse) { return -1; }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (CloneNotSupportedException cnse) { return -1; }
13
            
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
(Lib) ParserConfigurationException 30
            
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException pce) { throw pce; // pass along pce }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ParserConfigurationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.SAX_PARSER_CONFIG_ERR); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (ParserConfigurationException e) { BasisLibrary.runTimeError(BasisLibrary.NAMESPACES_SUPPORT_ERR); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (ParserConfigurationException e) { fatalError(e); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/xslt/Process.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/xslt/Process.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
22
            
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException pce) { throw pce; // pass along pce }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
(Lib) NumberFormatException 21
            
// in src/org/apache/xml/utils/XMLStringDefault.java
catch (NumberFormatException nfe) { return Double.NaN; }
// in src/org/apache/xml/utils/URI.java
catch (NumberFormatException nfe) { // can't happen }
// in src/org/apache/xml/serializer/Version.java
catch (NumberFormatException nfe) { return 0; }
// in src/org/apache/xml/serializer/utils/URI.java
catch (NumberFormatException nfe) { // can't happen }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (NumberFormatException e) { sign = false; }
// in src/org/apache/xml/serializer/Encodings.java
catch( NumberFormatException e) { highChar = 0; }
// in src/org/apache/xalan/Version.java
catch (NumberFormatException nfe) { return 0; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return Double.NaN; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return Double.NaN; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return(-1); // ??? }
// in src/org/apache/xalan/xsltc/dom/NodeCounter.java
catch (NumberFormatException e) { _groupSize = 0; }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (NumberFormatException e) { num = new Double(Double.NEGATIVE_INFINITY); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (NumberFormatException e) { // ignore }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (NumberFormatException e) { // Falls through }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/templates/ElemNumber.java
catch (NumberFormatException ex) { formatter.setGroupingUsed(false); }
// in src/org/apache/xalan/lib/ExsltBase.java
catch (NumberFormatException e) { d= Double.NaN; }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); }
// in src/org/apache/xpath/objects/XStringForFSB.java
catch (NumberFormatException nfe) { // This should catch double periods, empty strings. return Double.NaN; }
// in src/org/apache/xpath/objects/XString.java
catch (NumberFormatException e){}
0
(Lib) UnsupportedEncodingException 21
            
// in src/org/apache/xml/utils/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (UnsupportedEncodingException e) { reader = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/ToStream.java
catch (UnsupportedEncodingException uee) { osw = null; }
// in src/org/apache/xml/serializer/ToStream.java
catch (UnsupportedEncodingException e) { // We can't really get here, UTF-8 is always supported // This try-catch exists to make the compiler happy e.printStackTrace(); }
// in src/org/apache/xml/serializer/Encodings.java
catch (UnsupportedEncodingException usee) { // keep trying }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/Output.java
catch (java.io.UnsupportedEncodingException e) { ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_ENCODING, _encoding, this); parser.reportError(Constants.WARNING, msg); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
1
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
(Lib) TransformerConfigurationException 20
            
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerConfigurationException e) {}
19
            
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
(Lib) PrivilegedActionException 15
            
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
15
            
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
(Lib) NoSuchMethodException 13
            
// in src/org/apache/xml/dtm/DTMException.java
catch (NoSuchMethodException nsme) { // do nothing }
// in src/org/apache/xml/dtm/DTMException.java
catch (NoSuchMethodException nsme) { exception = null; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(java.lang.NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "CPO, shut down the garbage smashers on the detention level!" e.printStackTrace(System.err); fCoroutineManager.co_exit(fSourceCoroutineID); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { return e; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(new SAXParser()); return iss; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(parser); return iss; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
// in src/org/apache/xpath/XPathException.java
catch (NoSuchMethodException nsme) { // do nothing }
// in src/org/apache/xpath/XPathContext.java
catch (NoSuchMethodException nsme) {}
3
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
(Lib) RuntimeException 13
            
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re); return null; }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
10
            
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
(Lib) InvocationTargetException 11
            
// in src/org/apache/xml/dtm/DTMException.java
catch (InvocationTargetException ite) { exception = null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
14
            
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
(Lib) ClassCastException 10
            
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
catch (ClassCastException cce) { return false; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
catch (ClassCastException cce) { return false; }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
catch (ClassCastException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
catch (ClassCastException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (ClassCastException cce) { tok = -1; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (ClassCastException cce) { tok = 0; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); }
1
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
(Lib) ArrayIndexOutOfBoundsException 9
            
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. }
// in src/org/apache/xml/serializer/dom3/DOMStringListImpl.java
catch (ArrayIndexOutOfBoundsException e) { return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (ArrayIndexOutOfBoundsException e) { // invalid node handle, so definitely not our doc }
7
            
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. }
(Lib) FactoryConfigurationError 9
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
9
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
(Lib) SQLException 9
            
// in src/org/apache/xalan/lib/sql/PooledConnection.java
catch (SQLException sqle) { System.err.println(sqle.getMessage()); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(SQLException e) { m_HasErrors = true; throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch (SQLException se) {}
2
            
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(SQLException e) { m_HasErrors = true; throw e; }
(Lib) AbstractMethodError 8
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (AbstractMethodError ame) { }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/xslt/Process.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/xslt/Process.java
catch (AbstractMethodError ame){}
// in src/org/apache/xpath/SourceTreeManager.java
catch (AbstractMethodError ame){}
0
(Lib) IllegalAccessException 8
            
// in src/org/apache/xml/utils/ObjectPool.java
catch (IllegalAccessException ex){}
// in src/org/apache/xml/dtm/DTMException.java
catch (IllegalAccessException iae) { exception = null; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (IllegalAccessException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae); return false; }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
2
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
(Lib) MalformedURLException 8
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (MalformedURLException e) { return null; }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
6
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
(Lib) NoSuchMethodError 8
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (NoSuchMethodError ex2) { }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( NoSuchMethodError ex2 ) { }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( NoSuchMethodError ex2 ) { }
// in src/org/apache/xalan/xslt/Process.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/xslt/Process.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xpath/SourceTreeManager.java
catch( NoSuchMethodError ex2 ) { }
0
(Lib) ParseException 8
            
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { System.out.println("ParseException " + pe.getErrorOffset()); return -2; // Invalid. }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
0
(Lib) InterruptedException 7
            
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { ie.printStackTrace(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (InterruptedException ie){}
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch (InterruptedException ie) { if (DEBUG) System.err.println(ie.getMessage()); }
0
(Lib) SAXNotRecognizedException 7
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(SAXNotRecognizedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(org.xml.sax.SAXNotRecognizedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXNotRecognizedException e){}
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (SAXNotRecognizedException e){}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXNotRecognizedException snre){}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXNotRecognizedException e){}
1
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
(Lib) TargetLostException 7
            
// in src/org/apache/xalan/xsltc/compiler/Stylesheet.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
1
            
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
(Domain) ConfigurationError 6
            
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (ObjectFactory.ConfigurationError e) { e.printStackTrace(); }
2
            
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
(Domain) IllegalArgumentException 6
            
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { runTimeError(FORMAT_NUMBER_ERR, Double.toString(number), pattern); return(EMPTYSTRING); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie); return null; }
1
            
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
(Lib) InstantiationException 6
            
// in src/org/apache/xml/utils/ObjectPool.java
catch (InstantiationException ex){}
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (InstantiationException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
2
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
(Lib) NoSuchElementException 6
            
// in src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
catch (NoSuchElementException e) { reportError(parent, parser, ErrorMsg.ATTR_VAL_TEMPLATE_ERR, value); }
// in src/org/apache/xalan/templates/AVT.java
catch (java.util.NoSuchElementException ex) { error = XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ name, stringedValue }); break; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
0
(Lib) NullPointerException 6
            
// in src/org/apache/xml/dtm/ref/ExtendedType.java
catch(NullPointerException e) { return false; }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (NullPointerException npe) { tok = -1; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (NullPointerException npe) { tok = 0; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
3
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
(Lib) SAXNotSupportedException 6
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(SAXNotSupportedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(org.xml.sax.SAXNotSupportedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXNotSupportedException e){}
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (SAXNotSupportedException e){}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXNotSupportedException e){}
1
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
(Lib) Throwable 6
            
// in src/org/apache/xml/dtm/DTMException.java
catch (Throwable e) {}
// in src/org/apache/xml/dtm/DTMException.java
catch (Throwable e) { s.println("Could not print stack trace..."); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(Throwable throwable) { throwable.printStackTrace(); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/Extensions.java
catch (Throwable t) { // Simply return null; no need to report error return null; }
1
            
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
(Domain) TypeCheckError 6
            
// in src/org/apache/xalan/xsltc/compiler/Choose.java
catch (TypeCheckError e) { // handled later! }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (TypeCheckError e) { reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Sort.java
catch (TypeCheckError e) { val = "text"; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
// in src/org/apache/xalan/xsltc/compiler/Step.java
catch (TypeCheckError e) { }
1
            
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
(Lib) FileNotFoundException 4
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (FileNotFoundException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (FileNotFoundException e) { continue; }
1
            
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
(Lib) LSException 3
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
3
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
(Lib) NamingException 3
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException e) { throw e; }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { return false; }
2
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException e) { throw e; }
(Lib) SAXParseException 3
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(SAXParseException se) { // ignore }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXParseException spe) { fatalError(spe); }
0
(Domain) CompilerException 2
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
(Lib) IndexOutOfBoundsException 2
            
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
0
(Domain) MalformedURIException 2
            
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
2
            
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
(Domain) StopParseException 2
            
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (StopParseException e ) { // startElement encountered so do not parse further }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (StopParseException spe) { // OK, good. }
0
(Domain) TransletException 2
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
(Domain) WrappedRuntimeException 2
            
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
1
            
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
(Domain) WrongNumberArgsException 2
            
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { ; // should never happen }
0
(Lib) XPathFunctionException 2
            
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
2
            
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
(Domain) XPathProcessorException 2
            
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
2
            
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
(Lib) ClassFormatError 1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
(Lib) EmptyStackException 1
            
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (java.util.EmptyStackException ese) { return null; }
0
(Lib) Error 1
            
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Error e) { if (_debug) e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
0
(Domain) GetOptsException 1
            
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (GetOptsException ex) { System.err.println(ex); printUsage(); // exits with code '-1' }
0
(Lib) LinkageError 1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
(Domain) StopException 1
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(StopException ex) { // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); }
0
(Lib) TransformerFactoryConfigurationError 1
            
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
0
(Lib) UnknownHostException 1
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
0
(Lib) UnknownServiceException 1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }

Exception Recast Summary

There is a common practice of throwing exceptions from within a catch block (e.g. for wrapping a low-level exception). The following table summarizes the usage of this practice in the application. The last column gives the number of times it happens for a pair of exceptions. The graph below the table graphically renders the same information. For a given node, its color represents its origin (blue means library exception, orange means domain exception); the left-most number is the number of times it is thrown, the right-most is the number of times it is caught.

Catch Throw
(Lib) NullPointerException
(Lib) TransformerConfigurationException
(Lib) XPathExpressionException
1
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
2
                    
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
(Lib) Exception
(Lib) SAXException
(Domain) ConfigurationError
(Domain) WrappedRuntimeException
(Domain) DTMException
(Lib) RuntimeException
(Domain) TransletException
(Lib) TransformerConfigurationException
(Lib) TransformerException
(Domain) IllegalArgumentException
(Lib) SQLException
(Domain) XPathException
(Lib) XPathExpressionException
Unknown
7
                    
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
45
                    
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
12
                    
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
1
                    
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
3
                    
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
7
                    
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
6
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
18
                    
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
1
                    
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
1
                    
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
2
                    
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
1
                    
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
20
                    
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
(Domain) TypeCheckError
(Domain) TypeCheckError
1
                    
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
(Domain) CompilerException
(Lib) SAXException
1
                    
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
(Domain) IllegalArgumentException
(Lib) UnsupportedEncodingException
1
                    
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
(Lib) MalformedURLException
(Domain) WrappedRuntimeException
(Lib) RuntimeException
(Lib) TransformerException
Unknown
1
                    
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
2
                    
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
2
                    
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
1
                    
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
(Lib) SecurityException
(Domain) WrappedRuntimeException
(Lib) RuntimeException
(Lib) TransformerConfigurationException
Unknown
1
                    
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
1
                    
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
1
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
16
                    
// in src/org/apache/xml/utils/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch(SecurityException e){ throw e; }
(Domain) WrappedRuntimeException
(Lib) TransformerException
1
                    
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
(Lib) ParserConfigurationException
(Lib) RuntimeException
(Lib) TransformerException
(Lib) SAXException
(Lib) TransformerConfigurationException
(Domain) WrappedRuntimeException
(Lib) Error
Unknown
1
                    
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
4
                    
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
9
                    
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
2
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
4
                    
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
1
                    
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
1
                    
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException pce) { throw pce; // pass along pce }
(Lib) RuntimeException
(Lib) TransformerException
Unknown
1
                    
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
9
                    
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
(Lib) SAXException
(Lib) TransformerException
(Domain) DTMException
(Lib) RuntimeException
(Domain) WrappedRuntimeException
(Domain) TransletException
(Lib) SAXException
(Lib) TransformerConfigurationException
(Lib) XPathExpressionException
Unknown
34
                    
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
1
                    
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
2
                    
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
2
                    
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
2
                    
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
1
                    
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
7
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
1
                    
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
3
                    
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
(Domain) TransletException
(Lib) TransformerException
1
                    
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
(Lib) TransformerException
(Lib) SAXException
(Domain) WrappedRuntimeException
(Domain) IllegalArgumentException
(Lib) TransformerConfigurationException
(Lib) SAXParseException
(Lib) TransformerException
(Lib) XPathFunctionException
(Domain) XPathException
(Lib) DOMException
(Lib) XPathExpressionException
(Lib) RuntimeException
Unknown
30
                    
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
12
                    
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
2
                    
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
9
                    
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
1
                    
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
2
                    
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
1
                    
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
6
                    
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
1
                    
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
4
                    
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
6
                    
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
13
                    
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
(Domain) XPathProcessorException
(Lib) TransformerException
Unknown
1
                    
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
1
                    
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
(Lib) IOException
(Lib) TransformerException
(Lib) RuntimeException
(Domain) WrappedRuntimeException
(Lib) SAXException
(Lib) TransformerConfigurationException
(Lib) XPathExpressionException
Unknown
10
                    
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
6
                    
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
3
                    
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
35
                    
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
2
                    
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
1
                    
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
1
                    
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
(Domain) MalformedURIException
(Lib) TransformerException
2
                    
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
(Lib) ClassNotFoundException
(Domain) WrappedRuntimeException
(Domain) ConfigurationError
(Domain) TransletException
(Lib) TransformerConfigurationException
(Lib) TransformerException
Unknown
1
                    
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
30
                    
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
2
                    
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
1
                    
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
7
                    
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
30
                    
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
(Lib) InstantiationException
(Lib) TransformerConfigurationException
(Lib) TransformerException
1
                    
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
                    
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
(Lib) IllegalAccessException
(Lib) TransformerConfigurationException
(Lib) TransformerException
1
                    
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
                    
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
(Lib) ArrayIndexOutOfBoundsException
(Lib) EmptyStackException
Unknown
6
                    
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
1
                    
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. }
(Lib) MissingResourceException
(Lib) MissingResourceException
57
                    
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
(Lib) FactoryConfigurationError
(Lib) SAXException
9
                    
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
(Lib) PrivilegedActionException
Unknown
15
                    
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
(Domain) ConfigurationError
(Domain) DTMConfigurationException
(Domain) IllegalArgumentException
1
                    
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
1
                    
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
(Lib) UnsupportedEncodingException
Unknown
1
                    
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
(Lib) Throwable
(Domain) WrappedRuntimeException
1
                    
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
(Lib) NoSuchMethodException
(Lib) SAXException
(Lib) NamingException
2
                    
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
1
                    
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
(Lib) InvocationTargetException
(Lib) TransformerException
Unknown
5
                    
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
9
                    
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
(Lib) ClassCastException
(Domain) CompilerException
1
                    
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
(Lib) SAXNotRecognizedException
(Lib) TransformerConfigurationException
1
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
(Lib) SAXNotSupportedException
(Lib) TransformerConfigurationException
1
                    
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
(Lib) CloneNotSupportedException
(Domain) WrappedRuntimeException
(Domain) DTMException
(Lib) RuntimeException
Unknown
6
                    
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
4
                    
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
2
                    
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
1
                    
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
(Lib) LSException
Unknown
3
                    
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
(Lib) TransformerConfigurationException
(Lib) RuntimeException
(Lib) TransformerException
(Lib) TransformerConfigurationException
Unknown
1
                    
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
2
                    
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
3
                    
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
13
                    
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
(Lib) TargetLostException
(Domain) InternalError
1
                    
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
(Lib) FileNotFoundException
(Lib) RuntimeException
1
                    
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
(Lib) ClassFormatError
(Lib) TransformerConfigurationException
1
                    
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
(Lib) LinkageError
(Lib) TransformerConfigurationException
1
                    
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
(Lib) UnknownServiceException
(Lib) TransformerException
1
                    
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
(Lib) SQLException
Unknown
2
                    
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(SQLException e) { m_HasErrors = true; throw e; }
(Lib) NamingException
(Lib) SQLException
Unknown
1
                    
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
1
                    
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException e) { throw e; }
(Lib) XPathFunctionException
(Domain) WrappedRuntimeException
2
                    
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }

Caught / Thrown Exception

Not all exceptions are thrown AND caught in the same project. The following table gives the exceptions types with respect to this. The lower left hand side sell lists all exceptions thrown but not caught (prevalent for libraries), the upper right-hand side lists all exceptions caught but not thrown (usually coming from external dependencies).

Thrown Not Thrown
Caught
Type Name
(Lib) NullPointerException
(Lib) Exception
(Domain) TypeCheckError
(Domain) CompilerException
(Domain) IllegalArgumentException
(Domain) WrongNumberArgsException
(Domain) WrappedRuntimeException
(Lib) RuntimeException
(Domain) StopException
(Lib) SAXException
(Domain) StopParseException
(Domain) TransletException
(Lib) TransformerException
(Domain) XPathProcessorException
(Lib) IOException
(Domain) MalformedURIException
(Lib) EmptyStackException
(Lib) ArrayIndexOutOfBoundsException
(Lib) MissingResourceException
(Lib) NumberFormatException
(Domain) ConfigurationError
(Lib) UnsupportedEncodingException
(Lib) NoSuchMethodException
(Lib) ClassCastException
(Lib) SAXNotRecognizedException
(Lib) SAXNotSupportedException
(Lib) NoSuchElementException
(Lib) LSException
(Lib) TransformerConfigurationException
(Lib) SAXParseException
(Lib) Error
(Lib) SQLException
(Lib) NamingException
(Lib) XPathFunctionException
Type Name
(Domain) GetOptsException
(Lib) MalformedURLException
(Lib) SecurityException
(Lib) ParserConfigurationException
(Lib) ClassNotFoundException
(Lib) InstantiationException
(Lib) IllegalAccessException
(Lib) FactoryConfigurationError
(Lib) NoSuchMethodError
(Lib) AbstractMethodError
(Lib) PrivilegedActionException
(Lib) Throwable
(Lib) InvocationTargetException
(Lib) CloneNotSupportedException
(Lib) InterruptedException
(Lib) IndexOutOfBoundsException
(Lib) TargetLostException
(Lib) FileNotFoundException
(Lib) UnknownHostException
(Lib) ClassFormatError
(Lib) LinkageError
(Lib) UnknownServiceException
(Lib) TransformerFactoryConfigurationError
(Lib) ParseException
Not caught
Type Name
(Domain) DTMConfigurationException
(Lib) IllegalStateException
(Domain) DTMDOMException
(Domain) DTMException
(Lib) DOMException
(Domain) InternalRuntimeError
(Domain) InternalError
(Lib) UnsupportedOperationException
(Domain) XPathException
(Lib) XPathExpressionException
(Lib) XPathFactoryConfigurationException

Methods called in Catch and Finally Blocks

The following shows the methods that are called inside catch blocks (first column) and finally blocks (second column). For each method, we give the number of times it is called in a catch block (second sub-column), and the total number of calls (third sub-column). If the method name is red, it means that it is only called from catch/finally blocks. Hovering over a number triggers showing code snippets from the application code.

Catch Finally
Method Nbr Nbr total
getMessage 85
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (Exception e) { pw.println("line: logSourceLine unavailable due to: " + e.getMessage()); pw.println(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { reportError(ERROR, new ErrorMsg(e.getMessage())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, e.getMessage(), node); reportError(FATAL, err); }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { if (_errorListener != null) postErrorToListener("File not found: " + e.getMessage()); return(null); }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch (InterruptedException ie) { if (DEBUG) System.err.println(ie.getMessage()); }
// in src/org/apache/xalan/lib/sql/PooledConnection.java
catch (SQLException sqle) { System.err.println(sqle.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addElement: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addAttributeToNode: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
123
toString 61
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { runTimeError(FORMAT_NUMBER_ERR, Double.toString(number), pattern); return(EMPTYSTRING); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
// in src/org/apache/xalan/xsltc/dom/ForwardPositionIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/FilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NthIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MatchingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/StepIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { System.err.println("# WARNING: -out " + args[i] + " threw " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { System.err.println("appendEnvironmentReport threw: " + e2.toString()); e2.printStackTrace(); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(ERROR + VERSION + "DOM", "ERROR attempting to load DOM level 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
452
Locale 57
                  
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
136
getBundle 57
                  
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
116
printStackTrace 54
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e2) { // Ooops, just bail (suggestions for a safe thing // to do in this case appreciated) e2.printStackTrace(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(java.lang.NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "CPO, shut down the garbage smashers on the detention level!" e.printStackTrace(System.err); fCoroutineManager.co_exit(fSourceCoroutineID); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(SAXException e) { e.printStackTrace(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch( Exception ex ) { ex.printStackTrace(); coParser=null; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/ToStream.java
catch (UnsupportedEncodingException e) { // We can't really get here, UTF-8 is always supported // This try-catch exists to make the compiler happy e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { this.showStatus("Could not prime the pump!"); System.out.println("Could not prime the pump!"); e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception any_error) { any_error.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { ie.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Error e) { if (_debug) e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Import.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Include.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(Throwable throwable) { throwable.printStackTrace(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (javax.xml.transform.TransformerException te) {te.printStackTrace();}
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { System.err.println("appendEnvironmentReport threw: " + e2.toString()); e2.printStackTrace(); }
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { if (DEBUG) { System.out.println("Testing Connection, FAILED"); e.printStackTrace(); } return false; }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (ObjectFactory.ConfigurationError e) { e.printStackTrace(); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { e.printStackTrace(); }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
63
println 48
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (Exception e) { pw.println("line: logSourceLine unavailable due to: " + e.getMessage()); pw.println(); }
// in src/org/apache/xml/dtm/DTMException.java
catch (Throwable e) { s.println("Could not print stack trace..."); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(StopException ex) { // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { this.showStatus("Could not prime the pump!"); System.out.println("Could not prime the pump!"); e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { System.err.println(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (GetOptsException ex) { System.err.println(ex); printUsage(); // exits with code '-1' }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (ClassNotFoundException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (InstantiationException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (IllegalAccessException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/trace/PrintTraceListener.java
catch (CloneNotSupportedException cnse) { m_pw.println( " [Can't trace nodelist because it it threw a CloneNotSupportedException]"); return; }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { System.err.println("# WARNING: -out " + args[i] + " threw " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { System.err.println("appendEnvironmentReport threw: " + e2.toString()); e2.printStackTrace(); }
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { if (DEBUG) { System.out.println("Testing Connection, FAILED"); e.printStackTrace(); } return false; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch (InterruptedException ie) { if (DEBUG) System.err.println(ie.getMessage()); }
// in src/org/apache/xalan/lib/sql/PooledConnection.java
catch (SQLException sqle) { System.err.println(sqle.getMessage()); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { System.out.println("ParseException " + pe.getErrorOffset()); return -2; // Invalid. }
// in src/org/apache/xpath/XPathException.java
catch (Exception e) { s.println("Could not print stack trace..."); }
594
ErrorMsg 42
                  
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (TypeCheckError e) { reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ParserConfigurationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.SAX_PARSER_CONFIG_ERR); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { reportError(ERROR, new ErrorMsg(e.getMessage())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassNotFoundException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, node); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, e.getMessage(), node); reportError(FATAL, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Error e) { if (_debug) e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/Output.java
catch (java.io.UnsupportedEncodingException e) { ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_ENCODING, _encoding, this); parser.reportError(Constants.WARNING, msg); }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
199
getException 34
                  
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
50
fatalError 27
                  
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/templates/ElemUnknown.java
catch (TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (ParserConfigurationException e) { fatalError(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXParseException spe) { fatalError(spe); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
49
createMessage 26
                  
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
// in src/org/apache/xalan/templates/AVT.java
catch (java.util.NoSuchElementException ex) { error = XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ name, stringedValue }); break; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
205
put 25
                  
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se) { // For applet context, etc. h.put( "java.version", "WARNING: SecurityException thrown accessing system version properties"); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se2) { // For applet context, etc. h.put( "java.class.path", "WARNING: SecurityException thrown accessing system classpath properties"); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { if (null != clazz) { // We must have found the class itself, just not the // method, so we (probably) have JAXP 1.0.1 h.put(ERROR + VERSION + "JAXP", "1.0.1"); h.put(ERROR, ERROR_FOUND); } else { // We couldn't even find the class, and don't have // any JAXP support at all, or only have the // transform half of it h.put(ERROR + VERSION + "JAXP", CLASS_NOTPRESENT); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e1) { h.put(VERSION + "xalan1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2x", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "crimson", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "ant", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(ERROR + VERSION + "DOM", "ERROR attempting to load DOM level 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); }
596
runTimeError 22
                  
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { runTimeError(FORMAT_NUMBER_ERR, Double.toString(number), pattern); return(EMPTYSTRING); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { runTimeError(RUN_TIME_COPY_ERR); }
// in src/org/apache/xalan/xsltc/dom/ForwardPositionIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (ParserConfigurationException e) { BasisLibrary.runTimeError(BasisLibrary.NAMESPACES_SUPPORT_ERR); }
// in src/org/apache/xalan/xsltc/dom/FilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NthIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MatchingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/StepIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
59
error 20
                  
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae); return false; }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
catch (Exception iae) { templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{ patternStr }); return XString.EMPTYSTRING; //throw new XSLProcessorException(iae); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addElement: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addAttributeToNode: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Cloning attributes"); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Getting String Value"); return null; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); }
223
reportError 20
                  
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (TypeCheckError e) { reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ParserConfigurationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.SAX_PARSER_CONFIG_ERR); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { reportError(ERROR, new ErrorMsg(e.getMessage())); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassNotFoundException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, node); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, e.getMessage(), node); reportError(FATAL, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Error e) { if (_debug) e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
catch (NoSuchElementException e) { reportError(parent, parser, ErrorMsg.ATTR_VAL_TEMPLATE_ERR, value); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/Output.java
catch (java.io.UnsupportedEncodingException e) { ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_ENCODING, _encoding, this); parser.reportError(Constants.WARNING, msg); }
130
setError 18
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { setError(e, exprContext); return null; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception origEx) { // For now let's assume that the relative method is not supported. // So let's do it manually. try { for (int x=0; x<value; x++) { if (! m_ResultSet.next()) break; } } catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { m_XConnection.setError(e, this, checkWarnings()); //error("ERROR Extracting Metadata"); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
22
BufferedReader 16
                  
// in src/org/apache/xml/utils/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (UnsupportedEncodingException e) { reader = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
33
InputStreamReader 16
                  
// in src/org/apache/xml/utils/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (UnsupportedEncodingException e) { reader = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
33
addAttributeToNode 16
                  
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_LABEL_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CATALOGUE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DISPLAY_SIZE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPENAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_PRECISION_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCALE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCHEMA_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_TABLE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CASESENSITIVE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DEFINITELYWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISNULLABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSIGNED_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSEARCHABLE_TypeID, lastColHeaderIdx); }
36
forName 15
                  
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
34
getClassLoader 15
                  
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
45
loadClass 15
                  
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
30
XBooleanStatic 11
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
20
getErrorListener 11
                  
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/templates/ElemUnknown.java
catch (TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
55
handleError 11
                  
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; }
47
createXMLMessage 8
                  
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
83
createLSException
7
                  
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
7
fillInStackTrace
7
                  
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
7
getLocator 7
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
29
appendChild 6
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
60
checkWarnings 6
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception origEx) { // For now let's assume that the relative method is not supported. // So let's do it manually. try { for (int x=0; x<value; x++) { if (! m_ResultSet.next()) break; } } catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { m_XConnection.setError(e, this, checkWarnings()); //error("ERROR Extracting Metadata"); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
10
getClass 6
                  
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
65
createXPATHMessage 5
                  
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
137
debug
5
                  
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
5
doExit 5
                  
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
10
getName 5
                  
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
192
popContextNodeList 5
                  
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
16
popCurrentNode 5
                  
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
35
postErrorToListener
5
                  
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { if (_errorListener != null) postErrorToListener("File not found: " + e.getMessage()); return(null); }
5
setLocator 5
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
7
setNamespaceAware 5
                  
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
24
DOMErrorImpl 4
                  
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
29
clearCoRoutine 4
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
12
getMethod 4
                  
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
33
getTargetException
4
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
4
getTypeString 4
                  
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
19
indexOf 4
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
182
SAXSourceLocator 3
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
10
URL 3
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
16
close 3
                  
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
89
createElement 3
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
16
createTextNode 3
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
18
findClassLoader 3
                  
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
71
findProviderClass 3
                  
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
63
getLocalizedMessage 3
                  
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
6
getMessageAndLocation 3
                  
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
15
getParser 3
                  
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
86
length 3
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
489
warn 3
                  
// in src/org/apache/xalan/templates/ElemElement.java
catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
32
Double 2
                  
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (NumberFormatException e) { num = new Double(Double.NEGATIVE_INFINITY); }
70
IncrementalSAXSource_Filter 2
                  
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(new SAXParser()); return iss; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(parser); return iss; }
5
NodeSet 2
                  
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
34
SAXParser
2
                  
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception e) { // Fallback if this fails (implemented in createIncrementalSAXSource) is // to attempt Xerces-1 incremental setup. Can't do tail-call in // constructor, so create new, copy Xerces-1 initialization, // then throw it away... Ugh. IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser()); this.fParseSomeSetup=dummy.fParseSomeSetup; this.fParseSome=dummy.fParseSome; this.fIncrementalParser=dummy.fIncrementalParser; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(new SAXParser()); return iss; }
2
append 2
                  
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
1946
co_exit 2
                  
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(java.lang.NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "CPO, shut down the garbage smashers on the detention level!" e.printStackTrace(System.err); fCoroutineManager.co_exit(fSourceCoroutineID); }
4
equals 2
                  
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
936
getAbsoluteURI 2
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
28
getLineNumber 2
                  
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
46
getListOfEnums 2
                  
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
4
getPatternString 2
                  
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
19
getSAXLocator 2
                  
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
26
getString 2
                  
// in src/org/apache/xml/res/XMLMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(FORMAT_FAILED); fmsg += " " + msg; }
// in src/org/apache/xpath/res/XPATHMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); fmsg += " " + msg; }
79
getSystemId 2
                  
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
98
getTypeFromXObject 2
                  
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
3
getXMLReader 2
                  
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
33
hasErrors
2
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
2
logMsg 2
                  
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; logMsg("Reading-" + key + "= threw: " + e.toString()); }
14
newInstance 2
                  
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
113
newSAXParser 2
                  
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
14
postExceptionFromThread
2
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
2
setAttribute 2
                  
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
29
setXMLReader 2
                  
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(new SAXParser()); return iss; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(parser); return iss; }
6
ExtensionNamespaceSupport 1
                  
// in src/org/apache/xalan/extensions/ExtensionNamespacesManager.java
catch (ClassNotFoundException e) { return new ExtensionNamespaceSupport( ns, "org.apache.xalan.extensions.ExtensionHandlerJavaPackage", new Object[]{ns, "javapackage", className + "."}); }
19
IncrementalSAXSource_Xerces 1
                  
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception e) { // Fallback if this fails (implemented in createIncrementalSAXSource) is // to attempt Xerces-1 incremental setup. Can't do tail-call in // constructor, so create new, copy Xerces-1 initialization, // then throw it away... Ugh. IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser()); this.fParseSomeSetup=dummy.fParseSomeSetup; this.fParseSome=dummy.fParseSome; this.fIncrementalParser=dummy.fIncrementalParser; }
3
PrintWriter 1
                  
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
20
StringWriter 1
                  
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
5
XNodeSet 1
                  
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); }
22
XString 1
                  
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { return new XString(result); }
33
createWarning 1
                  
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
7
createXSLTCTransformerFactory 1
                  
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
8
currentTimeMillis 1
                  
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { return(System.currentTimeMillis()); }
10
declaredXSLNS
1
                  
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
1
executeFallbacks 1
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
3
format 1
                  
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception e) { throwex = true; try { // Get the message that the format failed. fmsg = java.text.MessageFormat.format( MsgKey.BAD_MSGFORMAT, new Object[] { msgKey, m_resourceBundleName }); fmsg += " " + msg; } catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; } }
47
getColumnNumber 1
                  
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
28
getContainedIter 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
6
getDTM 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
131
getDTMIterator 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
3
getDTMManager 1
                  
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); }
36
getDeclaredPrefixes 1
                  
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
4
getEnd 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
14
getErrorMsg
1
                  
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
1
getErrorOffset
1
                  
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { System.out.println("ParseException " + pe.getErrorOffset()); return -2; // Invalid. }
1
getFunctionName 1
                  
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
8
getHref 1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); }
5
getLocalPart 1
                  
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
31
getMsgMgr 1
                  
// in src/org/apache/xalan/templates/ElemElement.java
catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; }
16
getNamespaceForPrefix 1
                  
// in src/org/apache/xpath/compiler/Lexer.java
catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); }
26
getStart 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
23
getTargeters 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
3
getTargets 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
3
hasFallbackChildren 1
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
3
initXPath 1
                  
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
3
isSecureProcessing 1
                  
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
13
next 1
                  
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception origEx) { // For now let's assume that the relative method is not supported. // So let's do it manually. try { for (int x=0; x<value; x++) { if (! m_ResultSet.next()) break; } } catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); } }
145
nextNode 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
98
print 1
                  
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
60
printLocation 1
                  
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
7
printUsage 1
                  
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (GetOptsException ex) { System.err.println(ex); printUsage(); // exits with code '-1' }
7
releaseConnectionOnError 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
2
setEnd 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
46
setFeature 1
                  
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
28
setGroupingUsed 1
                  
// in src/org/apache/xalan/templates/ElemNumber.java
catch (NumberFormatException ex) { formatter.setGroupingUsed(false); }
3
setStart 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
54
showStatus 1
                  
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { this.showStatus("Could not prime the pump!"); System.out.println("Could not prime the pump!"); e.printStackTrace(); }
6
startsWith 1
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
117
substring 1
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
339
updateTarget 1
                  
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
3
warning 1
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
25
Method Nbr Nbr total
close 53
                  
// in src/org/apache/xml/utils/ListingErrorHandler.java
finally { br.close(); is.close(); }
// in src/org/apache/xml/utils/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/utils/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/utils/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xml/dtm/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/dtm/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/dtm/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
finally { if (bis != null) { bis.close(); } if (is != null) { is.close(); } }
// in src/org/apache/xml/serializer/CharInfo.java
finally { if (is != null) { try { is.close(); } catch (Exception except) {} } }
// in src/org/apache/xml/serializer/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/serializer/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xml/serializer/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/lib/PipeDocument.java
finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/lib/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/lib/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/lib/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xalan/extensions/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
// in src/org/apache/xpath/functions/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xpath/functions/ObjectFactory.java
finally { // try to close the input stream if one was opened. if (fis != null) { try { fis.close(); } // Ignore the exception. catch (IOException exc) {} } }
// in src/org/apache/xpath/functions/ObjectFactory.java
finally { try { // try to close the reader. rd.close(); } // Ignore the exception. catch (IOException exc) {} }
89
popCurrentNode 22
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemWithParam.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xalan/templates/ElemCopy.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xalan/templates/ElemVariable.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); }
// in src/org/apache/xpath/axes/OneStepIterator.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/axes/OneStepIterator.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
finally { xctxt.popCurrentNode(); xctxt.popIteratorRoot(); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
finally { xctxt.popCurrentNode(); xctxt.popNamespaceContext(); xctxt.popSubContextList(); m_predicateIndex = -1; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
finally { xctxt.popCurrentNode(); }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
finally { xctxt.popCurrentNode(); }
35
getTraceManager 20
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemNumber.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemComment.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); }
101
fireExtensionEndEvent
11
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); }
11
free 9
                  
// in src/org/apache/xml/utils/DOMHelper.java
finally { StringBufferPool.free(buf); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
finally { StringBufferPool.free(buf); }
// in src/org/apache/xalan/templates/AVT.java
finally { if(USE_OBJECT_POOL){ StringBufferPool.free(buffer); StringBufferPool.free(exprBuffer); }else{ buffer = null; exprBuffer = null; }; }
// in src/org/apache/xalan/templates/AVT.java
finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); }; }
// in src/org/apache/xalan/templates/AVT.java
finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); } }
// in src/org/apache/xalan/templates/ElemNumber.java
finally { StringBufferPool.free(formattedNumber); }
// in src/org/apache/xalan/templates/ElemNumber.java
finally { StringBufferPool.free(stringBuf); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
finally { StringBufferPool.free(buf); }
12
getDebug 9
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemNumber.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemComment.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
89
popElemTemplateElement 8
                  
// in src/org/apache/xalan/templates/ElemExtensionCall.java
finally { transformer.popElemTemplateElement(); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { transformer.popElemTemplateElement(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
finally { transformer.popElemTemplateElement(); xctxt.setSAXLocator(savedLocator); // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(thisframe); }
// in src/org/apache/xalan/templates/ElemUnknown.java
finally { transformer.popElemTemplateElement(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { this.popElemTemplateElement(); }
11
popNamespaceContext
8
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xalan/templates/TemplateList.java
finally { xctxt.popNamespaceContext(); }
// in src/org/apache/xalan/templates/TemplateList.java
finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); }
// in src/org/apache/xalan/templates/TemplateList.java
finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { xctxt.popNamespaceContext(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
finally { xctxt.popCurrentNode(); xctxt.popNamespaceContext(); xctxt.popSubContextList(); m_predicateIndex = -1; }
8
fireTraceEndEvent 7
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemNumber.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemComment.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
35
popCurrentNodeAndExpression
7
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xalan/templates/TemplateList.java
finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); }
// in src/org/apache/xalan/templates/TemplateList.java
finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xpath/Expression.java
finally { xctxt.popCurrentNodeAndExpression(); }
// in src/org/apache/xpath/Expression.java
finally { xctxt.popCurrentNodeAndExpression(); }
7
releaseXMLReader 6
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
finally { if (!hasUserReader) { releaseXMLReader(reader); } }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
finally { _readerManager.releaseXMLReader(reader); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
finally { if (!userReader) { _readerManager.releaseXMLReader(reader); } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } }
7
detach 5
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { pred.detach(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { pred.detach(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { pred.detach(); }
35
popContextNodeList 5
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { xctxt.popContextNodeList(); }
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { xctxt.popContextNodeList(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
16
ExtensionEvent 4
                  
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); }
10
popCurrentExpressionNode
4
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xpath/XPath.java
finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); }
4
popSubContextList
4
                  
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
finally { xctxt.popCurrentNode(); xctxt.popNamespaceContext(); xctxt.popSubContextList(); m_predicateIndex = -1; }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popSubContextList(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popSubContextList(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popSubContextList(); }
4
unlink 4
                  
// in src/org/apache/xalan/templates/XUnresolvedVariable.java
finally { // These two statements need to be combined into one operation. // vars.setStackFrame(currentFrame); if(-1 != velem.m_frameSize) vars.unlink(currentFrame); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
finally { transformer.popElemTemplateElement(); xctxt.setSAXLocator(savedLocator); // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(thisframe); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
6
popPredicatePos
3
                  
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popPredicatePos(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popPredicatePos(); }
// in src/org/apache/xpath/patterns/StepPattern.java
finally { xctxt.popPredicatePos(); }
3
popSAXLocator
3
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); }
3
reset 3
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { m_hasTransformThreadErrorCatcher = false; // This looks to be redundent to the one done in TransformNode. reset(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { this.reset(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; }
77
setLastUsedWalker 3
                  
// in src/org/apache/xpath/axes/AxesWalker.java
finally { lpi.setLastUsedWalker(savedWalker); }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
finally { wi().setLastUsedWalker(savedWalker); }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
finally { wi().setLastUsedWalker(savedWalker); }
7
setLength 3
                  
// in src/org/apache/xalan/templates/AVT.java
finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); }; }
// in src/org/apache/xalan/templates/AVT.java
finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; }
24
setStackFrame 3
                  
// in src/org/apache/xpath/axes/BasicTestIterator.java
finally { if (-1 != m_stackFrame) { // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
finally { if (-1 != m_stackFrame) { // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } }
// in src/org/apache/xpath/axes/DescendantIterator.java
finally { if (-1 != m_stackFrame) { // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } }
17
XNodeSet 2
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
22
XPath 2
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
36
endDocument 2
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { rth.endDocument(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); }
34
fireSelectedEndEvent 2
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); }
3
freeInstance 2
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; }
4
getInstance 2
                  
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } }
37
popCurrentTemplateRuleIsNull
2
                  
// in src/org/apache/xalan/templates/ElemForEach.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); }
2
popMode
2
                  
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); }
2
println 2
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
finally { if (DEBUG) System.out.println("leaving query()"); }
// in src/org/apache/xalan/lib/sql/XConnection.java
finally { if (DEBUG) System.out.println("leaving query()"); }
594
processingInstruction 2
                  
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); }
// in src/org/apache/xalan/templates/ElemValueOf.java
finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); }
38
setContentHandler 2
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
finally { treeWalker.setContentHandler(null); }
35
setCurrentStylesheet 2
                  
// in src/org/apache/xalan/xsltc/compiler/Import.java
finally { parser.setCurrentStylesheet(context); }
// in src/org/apache/xalan/xsltc/compiler/Include.java
finally { parser.setCurrentStylesheet(context); }
6
wi 2
                  
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
finally { wi().setLastUsedWalker(savedWalker); }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
finally { wi().setLastUsedWalker(savedWalker); }
22
TransformerException 1
                  
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
195
clearCoRoutine 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { m_isTransformDone = true; if (m_inputContentHandler instanceof TransformerHandlerImpl) { ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine(); } // synchronized (this) // { // notifyAll(); // } }
12
flushPending 1
                  
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
40
getBuffer 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; }
3
getNodeType 1
                  
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); }
191
getResultTreeHandler 1
                  
// in src/org/apache/xalan/templates/ElemTextLiteral.java
finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } }
16
getVarStack 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
23
notify 1
                  
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
finally { synchronized (m_callThread) { m_callThread.notify(); } }
4
pop 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); }
50
popBaseIndentifier 1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
finally { handler.popBaseIndentifier(); }
2
popCurrentMatched 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); }
3
popImportSource
1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); }
1
popImportURL
1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); }
1
popIteratorRoot
1
                  
// in src/org/apache/xpath/axes/MatchPatternIterator.java
finally { xctxt.popCurrentNode(); xctxt.popIteratorRoot(); }
1
popNamespaceSupport
1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); }
1
release 1
                  
// in src/org/apache/xalan/transformer/TransformerImpl.java
finally { if (shouldRelease) mgr.release(dtm, hardDelete); }
6
releaseConnection 1
                  
// in src/org/apache/xalan/lib/sql/XConnection.java
finally { if ( con != null ) m_ConnectionPool.releaseConnection(con); }
4
setDTDHandler 1
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); }
10
setErrorHandler 1
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); }
11
setNamespaceContext 1
                  
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); }
7
setProperty 1
                  
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); }
124
setSAXLocator 1
                  
// in src/org/apache/xalan/templates/ElemCallTemplate.java
finally { transformer.popElemTemplateElement(); xctxt.setSAXLocator(savedLocator); // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(thisframe); }
6
setStylesheetType 1
                  
// in src/org/apache/xalan/processor/ProcessorInclude.java
finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); }
2
setcontentHandler 1
                  
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
finally { treeWalker.setcontentHandler(null); }
2

Reference Table

This table concatenates the results of the previous tables.

Checked/Runtime Type Exception Thrown Thrown from Catch Declared Caught directly Caught
with Thrown
Caught
with Thrown Runtime
unknown (Lib) . 0 0 0 0 0 0
unknown (Lib) AbstractMethodError 0 0 0 8
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (AbstractMethodError ame) { }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/xslt/Process.java
catch (AbstractMethodError ame){}
// in src/org/apache/xalan/xslt/Process.java
catch (AbstractMethodError ame){}
// in src/org/apache/xpath/SourceTreeManager.java
catch (AbstractMethodError ame){}
0 0
unknown (Lib) ArrayIndexOutOfBoundsException 23
            
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException { /* try { return fastArray[(position*slotsize)+offset]; } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (1)"); if (offset>=slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); return chunk[slotpos + offset]; } }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos + offset] = value; // ATOMIC! } }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getFunction(int i) throws ArrayIndexOutOfBoundsException { if (null == m_functions) throw new ArrayIndexOutOfBoundsException(); return (String) m_functions.elementAt(i); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getElement(int i) throws ArrayIndexOutOfBoundsException { if (null == m_elements) throw new ArrayIndexOutOfBoundsException(); return (String) m_elements.elementAt(i); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExcludeResultPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExcludeResultPrefixs) throw new ArrayIndexOutOfBoundsException(); return m_ExcludeResultPrefixs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public StylesheetComposed getImport(int i) throws ArrayIndexOutOfBoundsException { if (null == m_imports) throw new ArrayIndexOutOfBoundsException(); return (StylesheetComposed) m_imports.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public Stylesheet getInclude(int i) throws ArrayIndexOutOfBoundsException { if (null == m_includes) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includes.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public DecimalFormatProperties getDecimalFormat(int i) throws ArrayIndexOutOfBoundsException { if (null == m_DecimalFormatDeclarations) throw new ArrayIndexOutOfBoundsException(); return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getStripSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespaceStrippingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespaceStrippingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespacePreservingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public OutputProperties getOutput(int i) throws ArrayIndexOutOfBoundsException { if (null == m_output) throw new ArrayIndexOutOfBoundsException(); return (OutputProperties) m_output.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException { if (null == m_keyDeclarations) throw new ArrayIndexOutOfBoundsException(); return (KeyDeclaration) m_keyDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemAttributeSet getAttributeSet(int i) throws ArrayIndexOutOfBoundsException { if (null == m_attributeSets) throw new ArrayIndexOutOfBoundsException(); return (ElemAttributeSet) m_attributeSets.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemVariable getVariableOrParam(int i) throws ArrayIndexOutOfBoundsException { if (null == m_topLevelVariables) throw new ArrayIndexOutOfBoundsException(); return (ElemVariable) m_topLevelVariables.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemTemplate getTemplate(int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); return (ElemTemplate) m_templates.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public NamespaceAlias getNamespaceAlias(int i) throws ArrayIndexOutOfBoundsException { if (null == m_prefix_aliases) throw new ArrayIndexOutOfBoundsException(); return (NamespaceAlias) m_prefix_aliases.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i)); m_templates.setElementAt(v, i); v.setStylesheet(this); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public Stylesheet getIncludeComposed(int i) throws ArrayIndexOutOfBoundsException { if (-1 == i) return this; if (null == m_includesComposed) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includesComposed.elementAt(i); }
// in src/org/apache/xpath/NodeSet.java
public void removeElementAt(int i) { if (null == m_map) return; if (i >= m_firstFree) throw new ArrayIndexOutOfBoundsException(i + " >= " + m_firstFree); else if (i < 0) throw new ArrayIndexOutOfBoundsException(i); if (i < m_firstFree - 1) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1); m_firstFree--; m_map[m_firstFree] = null; }
0 23
            
// in src/org/apache/xml/dtm/ref/CustomStringPool.java
public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { return(String) m_intToString.elementAt(i); }
// in src/org/apache/xml/dtm/ref/DTMSafeStringPool.java
public synchronized String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { return super.indexToString(i); }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException { /* try { return fastArray[(position*slotsize)+offset]; } catch(ArrayIndexOutOfBoundsException aioobe) */ { // System.out.println("Using slow read (1)"); if (offset>=slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); return chunk[slotpos + offset]; } }
// in src/org/apache/xml/dtm/ref/ChunkedIntArray.java
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException { /* try { fastArray[( position*slotsize)+offset] = value; } catch(ArrayIndexOutOfBoundsException aioobe) */ { if (offset >= slotsize) throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot"); position*=slotsize; int chunkpos = position >> lowbits; int slotpos = position & lowmask; int[] chunk = chunks.elementAt(chunkpos); chunk[slotpos + offset] = value; // ATOMIC! } }
// in src/org/apache/xml/dtm/ref/DTMStringPool.java
public String indexToString(int i) throws java.lang.ArrayIndexOutOfBoundsException { if(i==NULL) return null; return (String) m_intToString.elementAt(i); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ArrayList getAttributeSetComposed(QName name) throws ArrayIndexOutOfBoundsException { return (ArrayList) m_attrSets.get(name); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getFunction(int i) throws ArrayIndexOutOfBoundsException { if (null == m_functions) throw new ArrayIndexOutOfBoundsException(); return (String) m_functions.elementAt(i); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public String getElement(int i) throws ArrayIndexOutOfBoundsException { if (null == m_elements) throw new ArrayIndexOutOfBoundsException(); return (String) m_elements.elementAt(i); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExtensionElementPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExtensionElementURIs) throw new ArrayIndexOutOfBoundsException(); return m_ExtensionElementURIs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public String getExcludeResultPrefix(int i) throws ArrayIndexOutOfBoundsException { if (null == m_ExcludeResultPrefixs) throw new ArrayIndexOutOfBoundsException(); return m_ExcludeResultPrefixs.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public StylesheetComposed getImport(int i) throws ArrayIndexOutOfBoundsException { if (null == m_imports) throw new ArrayIndexOutOfBoundsException(); return (StylesheetComposed) m_imports.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public Stylesheet getInclude(int i) throws ArrayIndexOutOfBoundsException { if (null == m_includes) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includes.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public DecimalFormatProperties getDecimalFormat(int i) throws ArrayIndexOutOfBoundsException { if (null == m_DecimalFormatDeclarations) throw new ArrayIndexOutOfBoundsException(); return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getStripSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespaceStrippingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespaceStrippingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public WhiteSpaceInfo getPreserveSpace(int i) throws ArrayIndexOutOfBoundsException { if (null == m_whitespacePreservingElements) throw new ArrayIndexOutOfBoundsException(); return (WhiteSpaceInfo) m_whitespacePreservingElements.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public OutputProperties getOutput(int i) throws ArrayIndexOutOfBoundsException { if (null == m_output) throw new ArrayIndexOutOfBoundsException(); return (OutputProperties) m_output.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public KeyDeclaration getKey(int i) throws ArrayIndexOutOfBoundsException { if (null == m_keyDeclarations) throw new ArrayIndexOutOfBoundsException(); return (KeyDeclaration) m_keyDeclarations.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemAttributeSet getAttributeSet(int i) throws ArrayIndexOutOfBoundsException { if (null == m_attributeSets) throw new ArrayIndexOutOfBoundsException(); return (ElemAttributeSet) m_attributeSets.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemVariable getVariableOrParam(int i) throws ArrayIndexOutOfBoundsException { if (null == m_topLevelVariables) throw new ArrayIndexOutOfBoundsException(); return (ElemVariable) m_topLevelVariables.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public NamespaceAlias getNamespaceAlias(int i) throws ArrayIndexOutOfBoundsException { if (null == m_prefix_aliases) throw new ArrayIndexOutOfBoundsException(); return (NamespaceAlias) m_prefix_aliases.elementAt(i); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public StylesheetComposed getImportComposed(int i) throws ArrayIndexOutOfBoundsException { StylesheetRoot root = getStylesheetRoot(); // Get the stylesheet that is offset past this stylesheet. // Thus, if the index of this stylesheet is 3, an argument // to getImportComposed of 0 will return the 4th stylesheet // in the global import list. return root.getGlobalImport(1 + m_importNumber + i); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public Stylesheet getIncludeComposed(int i) throws ArrayIndexOutOfBoundsException { if (-1 == i) return this; if (null == m_includesComposed) throw new ArrayIndexOutOfBoundsException(); return (Stylesheet) m_includesComposed.elementAt(i); }
9
            
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. }
// in src/org/apache/xml/serializer/dom3/DOMStringListImpl.java
catch (ArrayIndexOutOfBoundsException e) { return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (ArrayIndexOutOfBoundsException e) { // invalid node handle, so definitely not our doc }
7
            
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch(java.lang.ArrayIndexOutOfBoundsException e) { if(nodeHandle==DTM.NULL) return null; // Accept as a special case. else throw e; // Programming error; want to know about it. }
0
unknown (Lib) ClassCastException 2
            
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
protected int addNode(Node node, int parentIndex, int previousSibling, int forceNodeType) { int nodeIndex = m_nodes.size(); // Have we overflowed a DTM Identity's addressing range? if(m_dtmIdent.size() == (nodeIndex>>>DTMManager.IDENT_DTM_NODE_BITS)) { try { if(m_mgr==null) throw new ClassCastException(); // Handle as Extended Addressing DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr; int id=mgrD.getFirstFreeDTMID(); mgrD.addDTM(this,id,nodeIndex); m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS); } catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; } } m_size++; // ensureSize(nodeIndex); int type; if(NULL==forceNodeType) type = node.getNodeType(); else type=forceNodeType; // %REVIEW% The Namespace Spec currently says that Namespaces are // processed in a non-namespace-aware manner, by matching the // QName, even though there is in fact a namespace assigned to // these nodes in the DOM. If and when that changes, we will have // to consider whether we check the namespace-for-namespaces // rather than the node name. // // %TBD% Note that the DOM does not necessarily explicitly declare // all the namespaces it uses. DOM Level 3 will introduce a // namespace-normalization operation which reconciles that, and we // can request that users invoke it or otherwise ensure that the // tree is namespace-well-formed before passing the DOM to Xalan. // But if they don't, what should we do about it? We probably // don't want to alter the source DOM (and may not be able to do // so if it's read-only). The best available answer might be to // synthesize additional DTM Namespace Nodes that don't correspond // to DOM Attr Nodes. if (Node.ATTRIBUTE_NODE == type) { String name = node.getNodeName(); if (name.startsWith("xmlns:") || name.equals("xmlns")) { type = DTM.NAMESPACE_NODE; } } m_nodes.addElement(node); m_firstch.setElementAt(NOTPROCESSED,nodeIndex); m_nextsib.setElementAt(NOTPROCESSED,nodeIndex); m_prevsib.setElementAt(previousSibling,nodeIndex); m_parent.setElementAt(parentIndex,nodeIndex); if(DTM.NULL != parentIndex && type != DTM.ATTRIBUTE_NODE && type != DTM.NAMESPACE_NODE) { // If the DTM parent had no children, this becomes its first child. if(NOTPROCESSED == m_firstch.elementAt(parentIndex)) m_firstch.setElementAt(nodeIndex,parentIndex); } String nsURI = node.getNamespaceURI(); // Deal with the difference between Namespace spec and XSLT // definitions of local name. (The former says PIs don't have // localnames; the latter says they do.) String localName = (type == Node.PROCESSING_INSTRUCTION_NODE) ? node.getNodeName() : node.getLocalName(); // Hack to make DOM1 sort of work... if(((type == Node.ELEMENT_NODE) || (type == Node.ATTRIBUTE_NODE)) && null == localName) localName = node.getNodeName(); // -sb ExpandedNameTable exnt = m_expandedNameTable; // %TBD% Nodes created with the old non-namespace-aware DOM // calls createElement() and createAttribute() will never have a // localname. That will cause their expandedNameID to be just the // nodeType... which will keep them from being matched // successfully by name. Since the DOM makes no promise that // those will participate in namespace processing, this is // officially accepted as Not Our Fault. But it might be nice to // issue a diagnostic message! if(node.getLocalName()==null && (type==Node.ELEMENT_NODE || type==Node.ATTRIBUTE_NODE)) { // warning("DOM 'level 1' node "+node.getNodeName()+" won't be mapped properly in DOM2DTM."); } int expandedNameID = (null != localName) ? exnt.getExpandedTypeID(nsURI, localName, type) : exnt.getExpandedTypeID(type); m_exptype.setElementAt(expandedNameID,nodeIndex); indexNode(expandedNameID, nodeIndex); if (DTM.NULL != previousSibling) m_nextsib.setElementAt(nodeIndex,previousSibling); // This should be done after m_exptype has been set, and probably should // always be the last thing we do if (type == DTM.NAMESPACE_NODE) declareNamespaceInContext(parentIndex,nodeIndex); return nodeIndex; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected void addNewDTMID(int nodeIndex) { try { if(m_mgr==null) throw new ClassCastException(); // Handle as Extended Addressing DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr; int id=mgrD.getFirstFreeDTMID(); mgrD.addDTM(this,id,nodeIndex); m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS); } catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; } }
0 1
            
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public int compareTo(Object o) throws ClassCastException { ElemTemplateElement ro = (ElemTemplateElement) o; int roPrecedence = ro.getStylesheetComposed().getImportCountComposed(); int myPrecedence = this.getStylesheetComposed().getImportCountComposed(); if (myPrecedence < roPrecedence) return -1; else if (myPrecedence > roPrecedence) return 1; else return this.getUid() - ro.getUid(); }
10
            
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
catch (ClassCastException cce) { return false; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
catch (ClassCastException cce) { return false; }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch(ClassCastException e) { // %REVIEW% Wrong error message, but I've been told we're trying // not to add messages right not for I18N reasons. // %REVIEW% Should this be a Fatal Error? error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available"; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
catch (ClassCastException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
catch (ClassCastException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (ClassCastException cce) { tok = -1; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (ClassCastException cce) { tok = 0; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); }
1
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
0
unknown (Lib) ClassFormatError 0 0 0 1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
0
unknown (Lib) ClassNotFoundException 0 0 21
            
// in src/org/apache/xml/utils/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private void readObject(java.io.ObjectInputStream inStream) throws IOException, ClassNotFoundException { inStream.defaultReadObject(); // Needed assignment of non-serialized fields // A TransformerFactory is not guaranteed to be serializable, // so we create one here m_tfactory = TransformerFactory.newInstance(); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _bitSize = in.readInt(); _intSize = (_bitSize >>> 5) + 1; _mask = in.readInt(); _bits = (int[])in.readObject(); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException { is.defaultReadObject(); if (is.readBoolean()) { _uriResolver = (URIResolver) is.readObject(); } _tfactory = new TransformerFactoryImpl(); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void writeObject(ObjectOutputStream os) throws IOException, ClassNotFoundException { os.defaultWriteObject(); if (_uriResolver instanceof Serializable) { os.writeBoolean(true); os.writeObject((Serializable) _uriResolver); } else { os.writeBoolean(false); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/templates/ElemForEach.java
private void readObject(ObjectInputStream os) throws IOException, ClassNotFoundException { os.defaultReadObject(); m_xpath = null; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/extensions/ExtensionHandler.java
static Class getClassForName(String className) throws ClassNotFoundException { // Hack for backwards compatibility with XalanJ1 stylesheets if(className.equals("org.apache.xalan.xslt.extensions.Redirect")) { className = "org.apache.xalan.lib.Redirect"; } return ObjectFactory.findProviderClass( className, ObjectFactory.findClassLoader(), true); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
70
            
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
catch (ClassNotFoundException e) { return false; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassNotFoundException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, node); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { System.err.println(e); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (ClassNotFoundException e) { final ErrorMsg msg = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, _className); getParser().reportError(Constants.ERROR, msg); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectType.java
catch (ClassNotFoundException e) { _clazz = null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (ClassNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err= new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR,_className); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (ClassNotFoundException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (ClassNotFoundException e) { // For now, just let this go. We'll catch it when we try to invoke a method. }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException cnfe) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException cnfe) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionNamespacesManager.java
catch (ClassNotFoundException e) { return new ExtensionNamespaceSupport( ns, "org.apache.xalan.extensions.ExtensionHandlerJavaPackage", new Object[]{ns, "javapackage", className + "."}); }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
catch (ClassNotFoundException e) { return null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
71
            
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
31
unknown (Lib) CloneNotSupportedException 0 0 30
            
// in src/org/apache/xml/utils/IntStack.java
public Object clone() throws CloneNotSupportedException { return (IntStack) super.clone(); }
// in src/org/apache/xml/utils/BoolStack.java
public Object clone() throws CloneNotSupportedException { return super.clone(); }
// in src/org/apache/xml/utils/IntVector.java
public Object clone() throws CloneNotSupportedException { return new IntVector(this); }
// in src/org/apache/xml/utils/NodeVector.java
public Object clone() throws CloneNotSupportedException { NodeVector clone = (NodeVector) super.clone(); if ((null != this.m_map) && (this.m_map == clone.m_map)) { clone.m_map = new int[this.m_map.length]; System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length); } return clone; }
// in src/org/apache/xml/utils/ObjectVector.java
public Object clone() throws CloneNotSupportedException { return new ObjectVector(this); }
// in src/org/apache/xml/utils/ObjectStack.java
public Object clone() throws CloneNotSupportedException { return (ObjectStack) super.clone(); }
// in src/org/apache/xml/serializer/NamespaceMappings.java
public Object clone() throws CloneNotSupportedException { NamespaceMappings clone = new NamespaceMappings(); clone.m_nodeStack = (NamespaceMappings.Stack) m_nodeStack.clone(); clone.count = this.count; clone.m_namespaces = (Hashtable) m_namespaces.clone(); clone.count = count; return clone; }
// in src/org/apache/xml/serializer/NamespaceMappings.java
public Object clone() throws CloneNotSupportedException { NamespaceMappings.Stack clone = new NamespaceMappings.Stack(); clone.max = this.max; clone.top = this.top; clone.m_stack = new Object[clone.max]; for (int i=0; i <= top; i++) { // We are just copying references to immutable MappingRecord objects here // so it is OK if the clone has references to these. clone.m_stack[i] = this.m_stack[i]; } return clone; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
public Object clone() throws CloneNotSupportedException { return super.clone(); }
// in src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
public Object clone() throws CloneNotSupportedException { TemplateSubPatternAssociation tspa = (TemplateSubPatternAssociation) super.clone(); tspa.m_next = null; return tspa; }
// in src/org/apache/xpath/VariableStack.java
public synchronized Object clone() throws CloneNotSupportedException { VariableStack vs = (VariableStack) super.clone(); // I *think* I can get away with a shallow clone here? vs._stackFrames = (XObject[]) _stackFrames.clone(); vs._links = (int[]) _links.clone(); return vs; }
// in src/org/apache/xpath/NodeSetDTM.java
public Object clone() throws CloneNotSupportedException { NodeSetDTM clone = (NodeSetDTM) super.clone(); return clone; }
// in src/org/apache/xpath/NodeSetDTM.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { NodeSetDTM clone = (NodeSetDTM) clone(); clone.reset(); return clone; }
// in src/org/apache/xpath/NodeSet.java
public NodeIterator cloneWithReset() throws CloneNotSupportedException { NodeSet clone = (NodeSet) clone(); clone.reset(); return clone; }
// in src/org/apache/xpath/NodeSet.java
public Object clone() throws CloneNotSupportedException { NodeSet clone = (NodeSet) super.clone(); if ((null != this.m_map) && (this.m_map == clone.m_map)) { clone.m_map = new Node[this.m_map.length]; System.arraycopy(this.m_map, 0, clone.m_map, 0, this.m_map.length); } return clone; }
// in src/org/apache/xpath/axes/BasicTestIterator.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { ChildTestIterator clone = (ChildTestIterator) super.cloneWithReset(); clone.resetProximityPositions(); return clone; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
public Object clone() throws CloneNotSupportedException { UnionPathIterator clone = (UnionPathIterator) super.clone(); if (m_iterators != null) { int n = m_iterators.length; clone.m_iterators = new DTMIterator[n]; for (int i = 0; i < n; i++) { clone.m_iterators[i] = (DTMIterator)m_iterators[i].clone(); } } return clone; }
// in src/org/apache/xpath/axes/WalkingIterator.java
public Object clone() throws CloneNotSupportedException { WalkingIterator clone = (WalkingIterator) super.clone(); // clone.m_varStackPos = this.m_varStackPos; // clone.m_varStackContext = this.m_varStackContext; if (null != m_firstWalker) { clone.m_firstWalker = m_firstWalker.cloneDeep(clone, null); } return clone; }
// in src/org/apache/xpath/axes/OneStepIterator.java
public Object clone() throws CloneNotSupportedException { // Do not access the location path itterator during this operation! OneStepIterator clone = (OneStepIterator) super.clone(); if(m_iterator != null) { clone.m_iterator = m_iterator.cloneIterator(); } return clone; }
// in src/org/apache/xpath/axes/OneStepIterator.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { OneStepIterator clone = (OneStepIterator) super.cloneWithReset(); clone.m_iterator = m_iterator; return clone; }
// in src/org/apache/xpath/axes/IteratorPool.java
public synchronized DTMIterator getInstanceOrThrow() throws CloneNotSupportedException { // Check if the pool is empty. if (m_freeStack.isEmpty()) { // Create a new object if so. return (DTMIterator)m_orig.clone(); } else { // Remove object from end of free pool. DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1); return result; } }
// in src/org/apache/xpath/axes/NodeSequence.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { NodeSequence seq = (NodeSequence)super.clone(); seq.m_next = 0; if (m_cache != null) { // In making this clone of an iterator we are making // another NodeSequence object it has a reference // to the same IteratorCache object as the original // so we need to remember that more than one // NodeSequence object shares the cache. m_cache.increaseUseCount(); } return seq; }
// in src/org/apache/xpath/axes/NodeSequence.java
public Object clone() throws CloneNotSupportedException { NodeSequence clone = (NodeSequence) super.clone(); if (null != m_iter) clone.m_iter = (DTMIterator) m_iter.clone(); if (m_cache != null) { // In making this clone of an iterator we are making // another NodeSequence object it has a reference // to the same IteratorCache object as the original // so we need to remember that more than one // NodeSequence object shares the cache. m_cache.increaseUseCount(); } return clone; }
// in src/org/apache/xpath/axes/ChildTestIterator.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { ChildTestIterator clone = (ChildTestIterator) super.cloneWithReset(); clone.m_traverser = m_traverser; return clone; }
// in src/org/apache/xpath/axes/FilterExprWalker.java
public Object clone() throws CloneNotSupportedException { FilterExprWalker clone = (FilterExprWalker) super.clone(); if (null != m_exprObj) clone.m_exprObj = (XNodeSet) m_exprObj.clone(); return clone; }
// in src/org/apache/xpath/axes/AxesWalker.java
public Object clone() throws CloneNotSupportedException { // Do not access the location path itterator during this operation! AxesWalker clone = (AxesWalker) super.clone(); //clone.setCurrentNode(clone.m_root); // clone.m_isFresh = true; return clone; }
// in src/org/apache/xpath/axes/AxesWalker.java
AxesWalker cloneDeep(WalkingIterator cloneOwner, Vector cloneList) throws CloneNotSupportedException { AxesWalker clone = findClone(this, cloneList); if(null != clone) return clone; clone = (AxesWalker)this.clone(); clone.setLocPathIterator(cloneOwner); if(null != cloneList) { cloneList.addElement(this); cloneList.addElement(clone); } if(wi().m_lastUsedWalker == this) cloneOwner.m_lastUsedWalker = clone; if(null != m_nextWalker) clone.m_nextWalker = m_nextWalker.cloneDeep(cloneOwner, cloneList); // If you don't check for the cloneList here, you'll go into an // recursive infinate loop. if(null != cloneList) { if(null != m_prevWalker) clone.m_prevWalker = m_prevWalker.cloneDeep(cloneOwner, cloneList); } else { if(null != m_nextWalker) clone.m_nextWalker.m_prevWalker = clone; } return clone; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { LocPathIterator clone; // clone = (LocPathIterator) clone(); clone = (LocPathIterator)m_clones.getInstanceOrThrow(); clone.m_execContext = m_execContext; clone.m_cdtm = m_cdtm; clone.m_context = m_context; clone.m_currentContextNode = m_currentContextNode; clone.m_stackFrame = m_stackFrame; // clone.reset(); return clone; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public Object clone() throws CloneNotSupportedException { // Do not access the location path itterator during this operation! PredicatedNodeTest clone = (PredicatedNodeTest) super.clone(); if ((null != this.m_proximityPositions) && (this.m_proximityPositions == clone.m_proximityPositions)) { clone.m_proximityPositions = new int[this.m_proximityPositions.length]; System.arraycopy(this.m_proximityPositions, 0, clone.m_proximityPositions, 0, this.m_proximityPositions.length); } if(clone.m_lpi == this) clone.m_lpi = (LocPathIterator)clone; return clone; }
// in src/org/apache/xpath/axes/DescendantIterator.java
public DTMIterator cloneWithReset() throws CloneNotSupportedException { DescendantIterator clone = (DescendantIterator) super.cloneWithReset(); clone.m_traverser = m_traverser; clone.resetProximityPositions(); return clone; }
43
            
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMNodeList.java
catch(CloneNotSupportedException cnse) { m_iter = dtmIterator; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xalan/xsltc/dom/ForwardPositionIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/FilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiValuedNodeHeapIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NthIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MatchingIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/DupFilterIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/StepIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/NodeIteratorBase.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/CurrentNodeListIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/AbsoluteIterator.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; }
// in src/org/apache/xalan/templates/TemplateList.java
catch (CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse){}
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/templates/OutputProperties.java
catch (CloneNotSupportedException e) { return null; }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (CloneNotSupportedException e) { refNodes = null; }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (CloneNotSupportedException cnse) { // should never happen. return null; }
// in src/org/apache/xalan/trace/PrintTraceListener.java
catch (CloneNotSupportedException cnse) { m_pw.println( " [Can't trace nodelist because it it threw a CloneNotSupportedException]"); return; }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/XPathContext.java
catch (CloneNotSupportedException cnse) { return null; // error reporting? }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/axes/OneStepIterator.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/OneStepIterator.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
// in src/org/apache/xpath/axes/AxesWalker.java
catch (CloneNotSupportedException cnse) { return -1; }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/ReverseAxesWalker.java
catch (CloneNotSupportedException cnse) { // can't happen }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (CloneNotSupportedException cnse) { return -1; }
13
            
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/axes/NodeSequence.java
catch (CloneNotSupportedException e) { // This should never happen e.printStackTrace(); RuntimeException rte = new RuntimeException(e.getMessage()); throw rte; }
7
checked (Domain) CompilerException
public final class CompilerException extends Exception {
    static final long serialVersionUID = 1732939618562742663L;

    private String _msg;

    public CompilerException() {
	super();
    }
    
    public CompilerException(Exception e) {
	super(e.toString());
	_msg = e.toString(); 
    }
    
    public CompilerException(String message) {
	super(message);
	_msg = message;
    }

    public String getMessage() {
	final int col = _msg.indexOf(':');

	if (col > -1)
	    return(_msg.substring(col));
	else
	    return(_msg);
    }
}
3
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public Stylesheet makeStylesheet(SyntaxTreeNode element) throws CompilerException { try { Stylesheet stylesheet; if (element instanceof Stylesheet) { stylesheet = (Stylesheet)element; } else { stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); // Map the default NS if not already defined if (element.lookupNamespace(EMPTYSTRING) == null) { element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING); } } stylesheet.setParser(this); return stylesheet; } catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode getStylesheet(SyntaxTreeNode root) throws CompilerException { // Assume that this is a pure XSL stylesheet if there is not // <?xml-stylesheet ....?> processing instruction if (_target == null) { if (!_rootNamespaceDef) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_URI_ERR); throw new CompilerException(msg.toString()); } return(root); } // Find the xsl:stylesheet or xsl:transform with this reference if (_target.charAt(0) == '#') { SyntaxTreeNode element = findStylesheet(root, _target.substring(1)); if (element == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_TARGET_ERR, _target, root); throw new CompilerException(msg.toString()); } return(element); } else { return(loadExternalStylesheet(_target)); } }
1
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); }
3
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public Stylesheet makeStylesheet(SyntaxTreeNode element) throws CompilerException { try { Stylesheet stylesheet; if (element instanceof Stylesheet) { stylesheet = (Stylesheet)element; } else { stylesheet = new Stylesheet(); stylesheet.setSimplified(); stylesheet.addElement(element); stylesheet.setAttributes((AttributeList) element.getAttributes()); // Map the default NS if not already defined if (element.lookupNamespace(EMPTYSTRING) == null) { element.addPrefixMapping(EMPTYSTRING, EMPTYSTRING); } } stylesheet.setParser(this); return stylesheet; } catch (ClassCastException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.NOT_STYLESHEET_ERR, element); throw new CompilerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode getStylesheet(SyntaxTreeNode root) throws CompilerException { // Assume that this is a pure XSL stylesheet if there is not // <?xml-stylesheet ....?> processing instruction if (_target == null) { if (!_rootNamespaceDef) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_URI_ERR); throw new CompilerException(msg.toString()); } return(root); } // Find the xsl:stylesheet or xsl:transform with this reference if (_target.charAt(0) == '#') { SyntaxTreeNode element = findStylesheet(root, _target.substring(1)); if (element == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.MISSING_XSLT_TARGET_ERR, _target, root); throw new CompilerException(msg.toString()); } return(element); } else { return(loadExternalStylesheet(_target)); } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
private SyntaxTreeNode loadExternalStylesheet(String location) throws CompilerException { InputSource source; // Check if the location is URL or a local file if ((new File(location)).exists()) source = new InputSource("file:"+location); else source = new InputSource(location); SyntaxTreeNode external = (SyntaxTreeNode)parse(source); return(external); }
2
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (CompilerException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
0
runtime (Domain) ConfigurationError
static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 2036619216663421552L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 7772782876036961354L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 5122054096615067992L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 8859254254255146542L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -2293620736651286953L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -4417969773510154215L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 3326843611085065902L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -5948733402959678002L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -6072257854297546607L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -1877553852268428278L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 2276082712114762609L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 3273432303767233578L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -7640369932165775029L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = 8564305128443551853L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }static class ConfigurationError 
        extends Error {
                static final long serialVersionUID = -5782303800588797207L;
        //
        // Data
        //

        /** Exception. */
        private Exception exception;

        //
        // Constructors
        //

        /**
         * Construct a new instance with the specified detail string and
         * exception.
         */
        ConfigurationError(String msg, Exception x) {
            super(msg);
            this.exception = x;
        } // <init>(String,Exception)

        //
        // Public methods
        //

        /** Returns the exception associated to this error. */
        Exception getException() {
            return exception;
        } // getException():Exception

    }
90
            
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
75
            
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
105
            
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/utils/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/utils/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/dtm/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/xslt/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/lib/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xalan/extensions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String fallbackClassName) throws ConfigurationError { return createObject(factoryId, null, fallbackClassName); }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object createObject(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { Class factoryClass = lookUpFactoryClass(factoryId, propertiesFilename, fallbackClassName); if (factoryClass == null) { throw new ConfigurationError( "Provider for " + factoryId + " cannot be found", null); } try{ Object instance = factoryClass.newInstance(); debugPrintln("created new instance of factory " + factoryId); return instance; } catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId) throws ConfigurationError { return lookUpFactoryClass(factoryId, null, null); }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class lookUpFactoryClass(String factoryId, String propertiesFilename, String fallbackClassName) throws ConfigurationError { String factoryClassName = lookUpFactoryClassName(factoryId, propertiesFilename, fallbackClassName); ClassLoader cl = findClassLoader(); if (factoryClassName == null) { factoryClassName = fallbackClassName; } // assert(className != null); try{ Class providerClass = findProviderClass(factoryClassName, cl, true); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return providerClass; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + factoryClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static ClassLoader findClassLoader() throws ConfigurationError { // Figure out which ClassLoader to use for loading the provider // class. If there is a Context ClassLoader then use it. ClassLoader context = SecuritySupport.getContextClassLoader(); ClassLoader system = SecuritySupport.getSystemClassLoader(); ClassLoader chain = system; while (true) { if (context == chain) { // Assert: we are on JDK 1.1 or we have no Context ClassLoader // or any Context ClassLoader in chain of system classloader // (including extension ClassLoader) so extend to widest // ClassLoader (always look in system ClassLoader if Xalan // is in boot/extension/system classpath and in current // ClassLoader otherwise); normal classloaders delegate // back to system ClassLoader first so this widening doesn't // change the fact that context ClassLoader will be consulted ClassLoader current = ObjectFactory.class.getClassLoader(); chain = system; while (true) { if (current == chain) { // Assert: Current ClassLoader in chain of // boot/extension/system ClassLoaders return system; } if (chain == null) { break; } chain = SecuritySupport.getParentClassLoader(chain); } // Assert: Current ClassLoader not in chain of // boot/extension/system ClassLoaders return current; } if (chain == null) { // boot ClassLoader reached break; } // Check for any extension ClassLoaders in chain up to // boot ClassLoader chain = SecuritySupport.getParentClassLoader(chain); }; // Assert: Context ClassLoader not in chain of // boot/extension/system ClassLoaders return context; }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Object newInstance(String className, ClassLoader cl, boolean doFallback) throws ConfigurationError { // assert(className != null); try{ Class providerClass = findProviderClass(className, cl, doFallback); Object instance = providerClass.newInstance(); debugPrintln("created new instance of " + providerClass + " using ClassLoader: " + cl); return instance; } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + className + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); } }
// in src/org/apache/xpath/functions/ObjectFactory.java
static Class findProviderClass(String className, ClassLoader cl, boolean doFallback) throws ClassNotFoundException, ConfigurationError { //throw security exception if the calling thread is not allowed to access the //class. Restrict the access to the package classes as specified in java.security policy. SecurityManager security = System.getSecurityManager(); try{ if (security != null){ final int lastDot = className.lastIndexOf('.'); String packageName = className; if (lastDot != -1) packageName = className.substring(0, lastDot); security.checkPackageAccess(packageName); } }catch(SecurityException e){ throw e; } Class providerClass; if (cl == null) { // XXX Use the bootstrap ClassLoader. There is no way to // load a class using the bootstrap ClassLoader that works // in both JDK 1.1 and Java 2. However, this should still // work b/c the following should be true: // // (cl == null) iff current ClassLoader == null // // Thus Class.forName(String) will use the current // ClassLoader which will be the bootstrap ClassLoader. providerClass = Class.forName(className); } else { try { providerClass = cl.loadClass(className); } catch (ClassNotFoundException x) { if (doFallback) { // Fall back to current classloader ClassLoader current = ObjectFactory.class.getClassLoader(); if (current == null) { providerClass = Class.forName(className); } else if (cl != current) { cl = current; providerClass = cl.loadClass(className); } else { throw x; } } else { throw x; } } } return providerClass; }
6
            
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/xslt/Process.java
catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (ObjectFactory.ConfigurationError e) { e.printStackTrace(); }
2
            
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
2
unknown (Lib) DOMException 18
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public Object getParameter(String name) throws DOMException { if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { return Boolean.TRUE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ if ((fFeatures & ENTITIES) == 0 && (fFeatures & CDATA) == 0 && (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && (fFeatures & NAMESPACES) != 0 && (fFeatures & NAMESPACEDECLS) != 0 && (fFeatures & WELLFORMED) != 0 && (fFeatures & COMMENTS) != 0) { return Boolean.TRUE; } return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { return fDOMErrorHandler; } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { return null; } else { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public void setParameter(String name, Object value) throws DOMException { // If the value is a boolean if (value instanceof Boolean) { boolean state = ((Boolean) value).booleanValue(); if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { fFeatures = state ? fFeatures | COMMENTS : fFeatures & ~COMMENTS; // comments if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { fFeatures = state ? fFeatures | CDATA : fFeatures & ~CDATA; // cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { fFeatures = state ? fFeatures | ENTITIES : fFeatures & ~ENTITIES; // entities if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { fFeatures = state ? fFeatures | NAMESPACES : fFeatures & ~NAMESPACES; // namespaces if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { fFeatures = state ? fFeatures | NAMESPACEDECLS : fFeatures & ~NAMESPACEDECLS; // namespace-declarations if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { fFeatures = state ? fFeatures | SPLITCDATA : fFeatures & ~SPLITCDATA; // split-cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { fFeatures = state ? fFeatures | WELLFORMED : fFeatures & ~WELLFORMED; // well-formed if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { fFeatures = state ? fFeatures | DISCARDDEFAULT : fFeatures & ~DISCARDDEFAULT; // discard-default-content if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures & ~PRETTY_PRINT; // format-pretty-print if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { fFeatures = state ? fFeatures | XMLDECL : fFeatures & ~XMLDECL; if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); } else { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures & ~ELEM_CONTENT_WHITESPACE; // element-content-whitespace if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { // false is not supported if (!state) { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) ) { // true is not supported if (state) { String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); } */ } } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { // infoset if (state) { fFeatures &= ~ENTITIES; fFeatures &= ~CDATA; fFeatures &= ~SCHEMAVALIDATE; fFeatures &= ~DTNORMALIZE; fFeatures |= NAMESPACES; fFeatures |= NAMESPACEDECLS; fFeatures |= WELLFORMED; fFeatures |= ELEM_CONTENT_WHITESPACE; fFeatures |= COMMENTS; fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } } else { // If this is a non-boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } } // If the parameter value is not a boolean else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { if (value == null || value instanceof DOMErrorHandler) { fDOMErrorHandler = (DOMErrorHandler)value; } else { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { if (value != null) { if (!(value instanceof String)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } else { // If this is a boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) || name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL) || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) || name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void throwDOMException(short code, String msg) { String themsg = XSLMessages.createMessage(msg, null); throw new DOMException(code, themsg); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { if(null == refChild) { appendChild(newChild); return newChild; } if(newChild == refChild) { // hmm... return newChild; } Node node = m_firstChild; Node prev = null; boolean foundit = false; while (null != node) { // If the newChild is already in the tree, it is first removed. if(newChild == node) { if(null != prev) ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)node.getNextSibling(); else m_firstChild = (ElemTemplateElement)node.getNextSibling(); node = node.getNextSibling(); continue; // prev remains the same. } if(refChild == node) { if(null != prev) { ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)newChild; } else { m_firstChild = (ElemTemplateElement)newChild; } ((ElemTemplateElement)newChild).m_nextSibling = (ElemTemplateElement)refChild; ((ElemTemplateElement)newChild).setParentElem(this); prev = newChild; node = node.getNextSibling(); foundit = true; continue; } prev = node; node = node.getNextSibling(); } if(!foundit) throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild was not found in insertBefore method!"); else return newChild; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node cloneNode(boolean arg0) { throw new DOMException(DOMException.NOT_SUPPORTED_ERR,null); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public String getNamespaceForPrefix(String prefix, Node context) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_RESOLVER, null); throw new DOMException(DOMException.NAMESPACE_ERR, fmsg); // Unable to resolve prefix with null prefix resolver. }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
1
            
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
127
            
// in src/org/apache/xml/utils/UnImplNode.java
public Node appendChild(Node newChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"appendChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr removeAttributeNode(Attr oldAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNode not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr setAttributeNode(Attr newAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNode not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void removeAttribute(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttribute not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setAttribute(String name, String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttribute not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNodeNS not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNS not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNS not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public String getNodeValue() throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeValue not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setNodeValue(String nodeValue) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setNodeValue not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public void setValue(String value) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"insertBefore not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node removeChild(Node oldChild) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!"); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setPrefix(String prefix) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setPrefix not supported!"); }
// in src/org/apache/xml/utils/UnImplNode.java
public Element createElement(String tagName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public CDATASection createCDATASection(String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr createAttribute(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public EntityReference createEntityReference(String name) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node importNode(Node importedNode, boolean deep) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setData(String data) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public String substringData(int offset, int count) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void appendData(String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void insertData(int offset, String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void deleteData(int offset, int count) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public void replaceData(int offset, int count, String arg) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); }
// in src/org/apache/xml/utils/UnImplNode.java
public Text splitText(int offset) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node adoptNode(Node source) throws DOMException { error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); return null; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/utils/UnImplNode.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xml/utils/UnImplNode.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/utils/UnImplNode.java
public Node renameNode(Node n, String namespaceURI, String name) throws DOMException{ return n; }
// in src/org/apache/xml/utils/UnImplNode.java
public Text replaceWholeText(String content) throws DOMException{ /* if (needsSyncData()) { synchronizeData(); } // make sure we can make the replacement if (!canModify(nextSibling)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } Node parent = this.getParentNode(); if (content == null || content.length() == 0) { // remove current node if (parent !=null) { // check if node in the tree parent.removeChild(this); return null; } } Text currentNode = null; if (isReadOnly()){ Text newNode = this.ownerDocument().createTextNode(content); if (parent !=null) { // check if node in the tree parent.insertBefore(newNode, this); parent.removeChild(this); currentNode = newNode; } else { return newNode; } } else { this.setData(content); currentNode = this; } Node sibling = currentNode.getNextSibling(); while ( sibling !=null) { parent.removeChild(sibling); sibling = currentNode.getNextSibling(); } return currentNode; */ return null; //Pending }
// in src/org/apache/xml/utils/UnImplNode.java
public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; }
// in src/org/apache/xml/utils/UnImplNode.java
public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getNodeValue() throws DOMException { return dtm.getNodeValue(node); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getStringValue() throws DOMException { return dtm.getStringValue(node).toString(); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String getData() throws DOMException { return dtm.getNodeValue(node); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final String substringData(int offset, int count) throws DOMException { return getData().substring(offset,offset+count); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public String getTextContent() throws DOMException { return dtm.getStringValue(node).toString(); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node renameNode(Node n, String namespaceURI, String name) throws DOMException{ return n; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Text replaceWholeText(String content) throws DOMException{ /* if (needsSyncData()) { synchronizeData(); } // make sure we can make the replacement if (!canModify(nextSibling)) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null)); } Node parent = this.getParentNode(); if (content == null || content.length() == 0) { // remove current node if (parent !=null) { // check if node in the tree parent.removeChild(this); return null; } } Text currentNode = null; if (isReadOnly()){ Text newNode = this.ownerDocument().createTextNode(content); if (parent !=null) { // check if node in the tree parent.insertBefore(newNode, this); parent.removeChild(this); currentNode = newNode; } else { return newNode; } } else { this.setData(content); currentNode = this; } Node sibling = currentNode.getNextSibling(); while ( sibling !=null) { parent.removeChild(sibling); sibling = currentNode.getNextSibling(); } return currentNode; */ return null; //Pending }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node nextNode() throws DOMException { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.nextNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItemNS(Node arg) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public Object getParameter(String name) throws DOMException { if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { return Boolean.TRUE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ if ((fFeatures & ENTITIES) == 0 && (fFeatures & CDATA) == 0 && (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && (fFeatures & NAMESPACES) != 0 && (fFeatures & NAMESPACEDECLS) != 0 && (fFeatures & WELLFORMED) != 0 && (fFeatures & COMMENTS) != 0) { return Boolean.TRUE; } return Boolean.FALSE; } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { return fDOMErrorHandler; } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { return null; } else { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public void setParameter(String name, Object value) throws DOMException { // If the value is a boolean if (value instanceof Boolean) { boolean state = ((Boolean) value).booleanValue(); if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { fFeatures = state ? fFeatures | COMMENTS : fFeatures & ~COMMENTS; // comments if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { fFeatures = state ? fFeatures | CDATA : fFeatures & ~CDATA; // cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { fFeatures = state ? fFeatures | ENTITIES : fFeatures & ~ENTITIES; // entities if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty( DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { fFeatures = state ? fFeatures | NAMESPACES : fFeatures & ~NAMESPACES; // namespaces if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { fFeatures = state ? fFeatures | NAMESPACEDECLS : fFeatures & ~NAMESPACEDECLS; // namespace-declarations if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { fFeatures = state ? fFeatures | SPLITCDATA : fFeatures & ~SPLITCDATA; // split-cdata-sections if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { fFeatures = state ? fFeatures | WELLFORMED : fFeatures & ~WELLFORMED; // well-formed if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { fFeatures = state ? fFeatures | DISCARDDEFAULT : fFeatures & ~DISCARDDEFAULT; // discard-default-content if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures & ~PRETTY_PRINT; // format-pretty-print if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_FORMAT_PRETTY_PRINT, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { fFeatures = state ? fFeatures | XMLDECL : fFeatures & ~XMLDECL; if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); } else { fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures & ~ELEM_CONTENT_WHITESPACE; // element-content-whitespace if (state) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { // false is not supported if (!state) { // Here we have to add the Xalan specific DOM Message Formatter String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); } } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) ) { // true is not supported if (state) { String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } else { if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); } */ } } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { // infoset if (state) { fFeatures &= ~ENTITIES; fFeatures &= ~CDATA; fFeatures &= ~SCHEMAVALIDATE; fFeatures &= ~DTNORMALIZE; fFeatures |= NAMESPACES; fFeatures |= NAMESPACEDECLS; fFeatures |= WELLFORMED; fFeatures |= ELEM_CONTENT_WHITESPACE; fFeatures |= COMMENTS; fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); } } else { // If this is a non-boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } } // If the parameter value is not a boolean else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { if (value == null || value instanceof DOMErrorHandler) { fDOMErrorHandler = (DOMErrorHandler)value; } else { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } } else if ( name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { if (value != null) { if (!(value instanceof String)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_SUPPORTED, new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } else { // If this is a boolean parameter a type mismatch should be thrown. if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) || name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL) || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) || name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS) || name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { String msg = Utils.messages.createMessage( MsgKey.ER_TYPE_MISMATCH_ERR, new Object[] { name }); throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); } // Parameter is not recognized String msg = Utils.messages.createMessage( MsgKey.ER_FEATURE_NOT_FOUND, new Object[] { name }); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public String writeToString(Node nodeArg) throws DOMException, LSException { // return null is nodeArg is null. Should an Exception be thrown instead? if (nodeArg == null) { return null; } // Should we reset the serializer configuration before each write operation? // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode){ // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // StringWriter to Output to StringWriter output = new StringWriter(); // try { // Set the Serializer's Writer to a StringWriter serializer.setWriter(output); // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } // return the serialized string return output.toString(); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeNamedItem(String name) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node setNamedItem(Node arg) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node setNamedItemNS(Node arg) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node appendChild(Node newChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getNodeValue() throws DOMException { return m_attribute.getSimpleString(); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node removeChild(Node oldChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); return null; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setNodeValue(String nodeValue) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setPrefix(String prefix) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setValue(String value) throws DOMException { throwDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, XSLTErrorResources.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected int findAndEliminateRedundant(int start, int firstOccuranceIndex, ExpressionOwner firstOccuranceOwner, ElemTemplateElement psuedoVarRecipient, Vector paths) throws org.w3c.dom.DOMException { MultistepExprHolder head = null; MultistepExprHolder tail = null; int numPathsFound = 0; int n = paths.size(); Expression expr1 = firstOccuranceOwner.getExpression(); if(DEBUG) assertIsLocPathIterator(expr1, firstOccuranceOwner); boolean isGlobal = (paths == m_absPaths); LocPathIterator lpi = (LocPathIterator)expr1; int stepCount = countSteps(lpi); for(int j = start; j < n; j++) { ExpressionOwner owner2 = (ExpressionOwner)paths.elementAt(j); if(null != owner2) { Expression expr2 = owner2.getExpression(); boolean isEqual = expr2.deepEquals(lpi); if(isEqual) { LocPathIterator lpi2 = (LocPathIterator)expr2; if(null == head) { head = new MultistepExprHolder(firstOccuranceOwner, stepCount, null); tail = head; numPathsFound++; } tail.m_next = new MultistepExprHolder(owner2, stepCount, null); tail = tail.m_next; // Null out the occurance, so we don't have to test it again. paths.setElementAt(null, j); // foundFirst = true; numPathsFound++; } } } // Change all globals in xsl:templates, etc, to global vars no matter what. if((0 == numPathsFound) && isGlobal) { head = new MultistepExprHolder(firstOccuranceOwner, stepCount, null); numPathsFound++; } if(null != head) { ElemTemplateElement root = isGlobal ? psuedoVarRecipient : findCommonAncestor(head); LocPathIterator sharedIter = (LocPathIterator)head.m_exprOwner.getExpression(); ElemVariable var = createPseudoVarDecl(root, sharedIter, isGlobal); if(DIAGNOSE_MULTISTEPLIST) System.err.println("Created var: "+var.getName()+(isGlobal ? "(Global)" : "")); QName uniquePseudoVarName = var.getName(); while(null != head) { ExpressionOwner owner = head.m_exprOwner; if(DIAGNOSE_MULTISTEPLIST) diagnoseLineNumber(owner.getExpression()); changeToVarRef(uniquePseudoVarName, owner, paths, root); head = head.m_next; } // Replace the first occurance with the variable's XPath, so // that further reduction may take place if needed. paths.setElementAt(var.getSelect(), firstOccuranceIndex); } return numPathsFound; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected int oldFindAndEliminateRedundant(int start, int firstOccuranceIndex, ExpressionOwner firstOccuranceOwner, ElemTemplateElement psuedoVarRecipient, Vector paths) throws org.w3c.dom.DOMException { QName uniquePseudoVarName = null; boolean foundFirst = false; int numPathsFound = 0; int n = paths.size(); Expression expr1 = firstOccuranceOwner.getExpression(); if(DEBUG) assertIsLocPathIterator(expr1, firstOccuranceOwner); boolean isGlobal = (paths == m_absPaths); LocPathIterator lpi = (LocPathIterator)expr1; for(int j = start; j < n; j++) { ExpressionOwner owner2 = (ExpressionOwner)paths.elementAt(j); if(null != owner2) { Expression expr2 = owner2.getExpression(); boolean isEqual = expr2.deepEquals(lpi); if(isEqual) { LocPathIterator lpi2 = (LocPathIterator)expr2; if(!foundFirst) { foundFirst = true; // Insert variable decl into psuedoVarRecipient // We want to insert this into the first legitimate // position for a variable. ElemVariable var = createPseudoVarDecl(psuedoVarRecipient, lpi, isGlobal); if(null == var) return 0; uniquePseudoVarName = var.getName(); changeToVarRef(uniquePseudoVarName, firstOccuranceOwner, paths, psuedoVarRecipient); // Replace the first occurance with the variable's XPath, so // that further reduction may take place if needed. paths.setElementAt(var.getSelect(), firstOccuranceIndex); numPathsFound++; } changeToVarRef(uniquePseudoVarName, owner2, paths, psuedoVarRecipient); // Null out the occurance, so we don't have to test it again. paths.setElementAt(null, j); // foundFirst = true; numPathsFound++; } } } // Change all globals in xsl:templates, etc, to global vars no matter what. if((0 == numPathsFound) && (paths == m_absPaths)) { ElemVariable var = createPseudoVarDecl(psuedoVarRecipient, lpi, true); if(null == var) return 0; uniquePseudoVarName = var.getName(); changeToVarRef(uniquePseudoVarName, firstOccuranceOwner, paths, psuedoVarRecipient); paths.setElementAt(var.getSelect(), firstOccuranceIndex); numPathsFound++; } return numPathsFound; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createPseudoVarDecl( ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi, boolean isGlobal) throws org.w3c.dom.DOMException { QName uniquePseudoVarName = new QName (PSUEDOVARNAMESPACE, "#"+getPseudoVarID()); if(isGlobal) { return createGlobalPseudoVarDecl(uniquePseudoVarName, (StylesheetRoot)psuedoVarRecipient, lpi); } else return createLocalPseudoVarDecl(uniquePseudoVarName, psuedoVarRecipient, lpi); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createGlobalPseudoVarDecl(QName uniquePseudoVarName, StylesheetRoot stylesheetRoot, LocPathIterator lpi) throws org.w3c.dom.DOMException { ElemVariable psuedoVar = new ElemVariable(); psuedoVar.setIsTopLevel(true); XPath xpath = new XPath(lpi); psuedoVar.setSelect(xpath); psuedoVar.setName(uniquePseudoVarName); Vector globalVars = stylesheetRoot.getVariablesAndParamsComposed(); psuedoVar.setIndex(globalVars.size()); globalVars.addElement(psuedoVar); return psuedoVar; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable createLocalPseudoVarDecl(QName uniquePseudoVarName, ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi) throws org.w3c.dom.DOMException { ElemVariable psuedoVar = new ElemVariablePsuedo(); XPath xpath = new XPath(lpi); psuedoVar.setSelect(xpath); psuedoVar.setName(uniquePseudoVarName); ElemVariable var = addVarDeclToElem(psuedoVarRecipient, lpi, psuedoVar); lpi.exprSetParent(var); return var; }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemVariable addVarDeclToElem( ElemTemplateElement psuedoVarRecipient, LocPathIterator lpi, ElemVariable psuedoVar) throws org.w3c.dom.DOMException { // Create psuedo variable element ElemTemplateElement ete = psuedoVarRecipient.getFirstChildElem(); lpi.callVisitors(null, m_varNameCollector); // If the location path contains variables, we have to insert the // psuedo variable after the reference. (Otherwise, we want to // insert it as close as possible to the top, so we'll be sure // it is in scope for any other vars. if (m_varNameCollector.getVarCount() > 0) { ElemTemplateElement baseElem = getElemFromExpression(lpi); ElemVariable varElem = getPrevVariableElem(baseElem); while (null != varElem) { if (m_varNameCollector.doesOccur(varElem.getName())) { psuedoVarRecipient = varElem.getParentElem(); ete = varElem.getNextSiblingElem(); break; } varElem = getPrevVariableElem(varElem); } } if ((null != ete) && (Constants.ELEMNAME_PARAMVARIABLE == ete.getXSLToken())) { // Can't stick something in front of a param, so abandon! (see variable13.xsl) if(isParam(lpi)) return null; while (null != ete) { ete = ete.getNextSiblingElem(); if ((null != ete) && Constants.ELEMNAME_PARAMVARIABLE != ete.getXSLToken()) break; } } psuedoVarRecipient.insertBefore(psuedoVar, ete); m_varNameCollector.reset(); return psuedoVar; }
// in src/org/apache/xalan/templates/ElemSort.java
public Node appendChild(Node newChild) throws DOMException { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node appendChild(Node newChild) throws DOMException { if (null == newChild) { error(XSLTErrorResources.ER_NULL_CHILD, null); //"Trying to add a null child!"); } ElemTemplateElement elem = (ElemTemplateElement) newChild; if (null == m_firstChild) { m_firstChild = elem; } else { ElemTemplateElement last = (ElemTemplateElement) getLastChild(); last.m_nextSibling = elem; } elem.m_parentNode = this; return newChild; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node replaceChild(Node newChild, Node oldChild) throws DOMException { if (oldChild == null || oldChild.getParentNode() != this) return null; ElemTemplateElement newChildElem = ((ElemTemplateElement) newChild); ElemTemplateElement oldChildElem = ((ElemTemplateElement) oldChild); // Fix up previous sibling. ElemTemplateElement prev = (ElemTemplateElement) oldChildElem.getPreviousSibling(); if (null != prev) prev.m_nextSibling = newChildElem; // Fix up parent (this) if (m_firstChild == oldChildElem) m_firstChild = newChildElem; newChildElem.m_parentNode = this; oldChildElem.m_parentNode = null; newChildElem.m_nextSibling = oldChildElem.m_nextSibling; oldChildElem.m_nextSibling = null; // newChildElem.m_stylesheet = oldChildElem.m_stylesheet; // oldChildElem.m_stylesheet = null; return newChildElem; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public Node insertBefore(Node newChild, Node refChild) throws DOMException { if(null == refChild) { appendChild(newChild); return newChild; } if(newChild == refChild) { // hmm... return newChild; } Node node = m_firstChild; Node prev = null; boolean foundit = false; while (null != node) { // If the newChild is already in the tree, it is first removed. if(newChild == node) { if(null != prev) ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)node.getNextSibling(); else m_firstChild = (ElemTemplateElement)node.getNextSibling(); node = node.getNextSibling(); continue; // prev remains the same. } if(refChild == node) { if(null != prev) { ((ElemTemplateElement)prev).m_nextSibling = (ElemTemplateElement)newChild; } else { m_firstChild = (ElemTemplateElement)newChild; } ((ElemTemplateElement)newChild).m_nextSibling = (ElemTemplateElement)refChild; ((ElemTemplateElement)newChild).setParentElem(this); prev = newChild; node = node.getNextSibling(); foundit = true; continue; } prev = node; node = node.getNextSibling(); } if(!foundit) throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild was not found in insertBefore method!"); else return newChild; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public String getNodeValue() throws DOMException { return m_attributeNode.getNodeValue(); }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setNodeValue(String arg0) throws DOMException { }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node insertBefore(Node arg0, Node arg1) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node replaceChild(Node arg0, Node arg1) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node removeChild(Node arg0) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public Node appendChild(Node arg0) throws DOMException { return null; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setPrefix(String arg0) throws DOMException { }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public short compareDocumentPosition(Node other) throws DOMException { return 0; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public String getTextContent() throws DOMException { return textContent; }
// in src/org/apache/xpath/domapi/XPathNamespaceImpl.java
public void setTextContent(String textContent) throws DOMException { this.textContent = textContent; }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public Object evaluate( String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) throws XPathException, DOMException { XPathExpression xpathExpression = createExpression(expression, resolver); return xpathExpression.evaluate(contextNode, type, result); }
// in src/org/apache/xpath/NodeSet.java
public Node nextNode() throws DOMException { if ((m_next) < this.size()) { Node next = this.elementAt(m_next); m_next++; return next; } else return null; }
// in src/org/apache/xpath/NodeSet.java
public Node previousNode() throws DOMException { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return null; }
0 0 0
runtime (Domain) DTMConfigurationException
public class DTMConfigurationException extends DTMException {
    static final long serialVersionUID = -4607874078818418046L;

    /**
     * Create a new <code>DTMConfigurationException</code> with no
     * detail mesage.
     */
    public DTMConfigurationException() {
        super("Configuration Error");
    }

    /**
     * Create a new <code>DTMConfigurationException</code> with
     * the <code>String </code> specified as an error message.
     *
     * @param msg The error message for the exception.
     */
    public DTMConfigurationException(String msg) {
        super(msg);
    }

    /**
     * Create a new <code>DTMConfigurationException</code> with a
     * given <code>Exception</code> base cause of the error.
     *
     * @param e The exception to be encapsulated in a
     * DTMConfigurationException.
     */
    public DTMConfigurationException(Throwable e) {
        super(e);
    }

    /**
     * Create a new <code>DTMConfigurationException</code> with the
     * given <code>Exception</code> base cause and detail message.
     *
     * @param msg The detail message.
     * @param e The exception to be wrapped in a DTMConfigurationException
     */
    public DTMConfigurationException(String msg, Throwable e) {
        super(msg, e);
    }

    /**
     * Create a new DTMConfigurationException from a message and a Locator.
     *
     * <p>This constructor is especially useful when an application is
     * creating its own exception from within a DocumentHandler
     * callback.</p>
     *
     * @param message The error or warning message.
     * @param locator The locator object for the error or warning.
     */
    public DTMConfigurationException(String message,
                                             SourceLocator locator) {
        super(message, locator);
    }

    /**
     * Wrap an existing exception in a DTMConfigurationException.
     *
     * @param message The error or warning message, or null to
     *                use the message from the embedded exception.
     * @param locator The locator object for the error or warning.
     * @param e Any exception.
     */
    public DTMConfigurationException(String message,
                                             SourceLocator locator,
                                             Throwable e) {
        super(message, locator, e);
    }
}
2
            
// in src/org/apache/xml/dtm/DTMManager.java
public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException { DTMManager factoryImpl = null; try { factoryImpl = (DTMManager) ObjectFactory .createObject(defaultPropName, defaultClassName); } catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); } if (factoryImpl == null) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null)); //"No default implementation found"); } factoryImpl.setXMLStringFactory(xsf); return factoryImpl; }
1
            
// in src/org/apache/xml/dtm/DTMManager.java
catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); }
1
            
// in src/org/apache/xml/dtm/DTMManager.java
public static DTMManager newInstance(XMLStringFactory xsf) throws DTMConfigurationException { DTMManager factoryImpl = null; try { factoryImpl = (DTMManager) ObjectFactory .createObject(defaultPropName, defaultClassName); } catch (ObjectFactory.ConfigurationError e) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException()); //"No default implementation found"); } if (factoryImpl == null) { throw new DTMConfigurationException(XMLMessages.createXMLMessage( XMLErrorResources.ER_NO_DEFAULT_IMPL, null)); //"No default implementation found"); } factoryImpl.setXMLStringFactory(xsf); return factoryImpl; }
0 0 0
unknown (Domain) DTMDOMException
public class DTMDOMException extends org.w3c.dom.DOMException
{
    static final long serialVersionUID = 1895654266613192414L;
  /**
   * Constructs a DOM/DTM exception.
   *
   * @param code
   * @param message
   */
  public DTMDOMException(short code, String message)
  {
    super(code, message);
  }

  /**
   * Constructor DTMDOMException
   *
   *
   * @param code
   */
  public DTMDOMException(short code)
  {
    super(code, "");
  }
}
43
            
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node cloneNode(boolean deep) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element getDocumentElement() { int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle)) { switch(dtm.getNodeType(kidhandle)) { case Node.ELEMENT_NODE: if(elementhandle!=DTM.NULL) { elementhandle=DTM.NULL; // More than one; ill-formed. kidhandle=dtm.getLastChild(dochandle); // End loop } else elementhandle=kidhandle; break; // These are harmless; document is still wellformed case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: case Node.DOCUMENT_TYPE_NODE: break; default: elementhandle=DTM.NULL; // ill-formed kidhandle=dtm.getLastChild(dochandle); // End loop break; } } if(elementhandle==DTM.NULL) throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); else return (Element)(dtm.getNode(elementhandle)); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final DocumentFragment createDocumentFragment() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text createTextNode(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Comment createComment(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void normalize() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public final void setValue(String value) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public String getInputEncoding() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public boolean getStrictErrorChecking() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public void setStrictErrorChecking(boolean strictErrorChecking) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public DocumentType createDocumentType(String qualifiedName,String publicId, String systemId) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeProxy.java
public Document createDocument(String namespaceURI,String qualfiedName,DocumentType doctype) { // Could create a DTM... but why, when it'd have to be permanantly empty? throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public NodeFilter getFilter() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node nextNode() throws DOMException { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.nextNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
public Node previousNode() { if(!valid) throw new DTMDOMException(DOMException.INVALID_STATE_ERR); int handle=dtm_iter.previousNode(); if (handle==DTM.NULL) return null; return dtm_iter.getDTM(handle).getNode(handle); }
0 0 0 0 0
runtime (Domain) DTMException
public class DTMException extends RuntimeException {
    static final long serialVersionUID = -775576419181334734L;

    /** Field locator specifies where the error occured.
     *  @serial */
    SourceLocator locator;

    /**
     * Method getLocator retrieves an instance of a SourceLocator
     * object that specifies where an error occured.
     *
     * @return A SourceLocator object, or null if none was specified.
     */
    public SourceLocator getLocator() {
        return locator;
    }

    /**
     * Method setLocator sets an instance of a SourceLocator
     * object that specifies where an error occured.
     *
     * @param location A SourceLocator object, or null to clear the location.
     */
    public void setLocator(SourceLocator location) {
        locator = location;
    }

    /** Field containedException specifies a wrapped exception.  May be null.
     *  @serial */
    Throwable containedException;

    /**
     * This method retrieves an exception that this exception wraps.
     *
     * @return An Throwable object, or null.
     * @see #getCause
     */
    public Throwable getException() {
        return containedException;
    }

    /**
     * Returns the cause of this throwable or <code>null</code> if the
     * cause is nonexistent or unknown.  (The cause is the throwable that
     * caused this throwable to get thrown.)
     */
    public Throwable getCause() {

        return ((containedException == this)
                ? null
                : containedException);
    }

    /**
     * Initializes the <i>cause</i> of this throwable to the specified value.
     * (The cause is the throwable that caused this throwable to get thrown.)
     *
     * <p>This method can be called at most once.  It is generally called from
     * within the constructor, or immediately after creating the
     * throwable.  If this throwable was created
     * with {@link #DTMException(Throwable)} or
     * {@link #DTMException(String,Throwable)}, this method cannot be called
     * even once.
     *
     * @param  cause the cause (which is saved for later retrieval by the
     *         {@link #getCause()} method).  (A <tt>null</tt> value is
     *         permitted, and indicates that the cause is nonexistent or
     *         unknown.)
     * @return  a reference to this <code>Throwable</code> instance.
     * @throws IllegalArgumentException if <code>cause</code> is this
     *         throwable.  (A throwable cannot
     *         be its own cause.)
     * @throws IllegalStateException if this throwable was
     *         created with {@link #DTMException(Throwable)} or
     *         {@link #DTMException(String,Throwable)}, or this method has already
     *         been called on this throwable.
     */
    public synchronized Throwable initCause(Throwable cause) {

        if ((this.containedException == null) && (cause != null)) {
            throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause");
        }

        if (cause == this) {
            throw new IllegalArgumentException(
                XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted");
        }

        this.containedException = cause;

        return this;
    }

    /**
     * Create a new DTMException.
     *
     * @param message The error or warning message.
     */
    public DTMException(String message) {

        super(message);

        this.containedException = null;
        this.locator            = null;
    }

    /**
     * Create a new DTMException wrapping an existing exception.
     *
     * @param e The exception to be wrapped.
     */
    public DTMException(Throwable e) {

        super(e.getMessage());

        this.containedException = e;
        this.locator            = null;
    }

    /**
     * Wrap an existing exception in a DTMException.
     *
     * <p>This is used for throwing processor exceptions before
     * the processing has started.</p>
     *
     * @param message The error or warning message, or null to
     *                use the message from the embedded exception.
     * @param e Any exception
     */
    public DTMException(String message, Throwable e) {

        super(((message == null) || (message.length() == 0))
              ? e.getMessage()
              : message);

        this.containedException = e;
        this.locator            = null;
    }

    /**
     * Create a new DTMException from a message and a Locator.
     *
     * <p>This constructor is especially useful when an application is
     * creating its own exception from within a DocumentHandler
     * callback.</p>
     *
     * @param message The error or warning message.
     * @param locator The locator object for the error or warning.
     */
    public DTMException(String message, SourceLocator locator) {

        super(message);

        this.containedException = null;
        this.locator            = locator;
    }

    /**
     * Wrap an existing exception in a DTMException.
     *
     * @param message The error or warning message, or null to
     *                use the message from the embedded exception.
     * @param locator The locator object for the error or warning.
     * @param e Any exception
     */
    public DTMException(String message, SourceLocator locator,
                                Throwable e) {

        super(message);

        this.containedException = e;
        this.locator            = locator;
    }

    /**
     * Get the error message with location information
     * appended.
     */
    public String getMessageAndLocation() {

        StringBuffer sbuffer = new StringBuffer();
        String       message = super.getMessage();

        if (null != message) {
            sbuffer.append(message);
        }

        if (null != locator) {
            String systemID = locator.getSystemId();
            int    line     = locator.getLineNumber();
            int    column   = locator.getColumnNumber();

            if (null != systemID) {
                sbuffer.append("; SystemID: ");
                sbuffer.append(systemID);
            }

            if (0 != line) {
                sbuffer.append("; Line#: ");
                sbuffer.append(line);
            }

            if (0 != column) {
                sbuffer.append("; Column#: ");
                sbuffer.append(column);
            }
        }

        return sbuffer.toString();
    }

    /**
     * Get the location information as a string.
     *
     * @return A string with location info, or null
     * if there is no location information.
     */
    public String getLocationAsString() {

        if (null != locator) {
            StringBuffer sbuffer  = new StringBuffer();
            String       systemID = locator.getSystemId();
            int          line     = locator.getLineNumber();
            int          column   = locator.getColumnNumber();

            if (null != systemID) {
                sbuffer.append("; SystemID: ");
                sbuffer.append(systemID);
            }

            if (0 != line) {
                sbuffer.append("; Line#: ");
                sbuffer.append(line);
            }

            if (0 != column) {
                sbuffer.append("; Column#: ");
                sbuffer.append(column);
            }

            return sbuffer.toString();
        } else {
            return null;
        }
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     */
    public void printStackTrace() {
        printStackTrace(new java.io.PrintWriter(System.err, true));
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     * @param s The stream where the dump will be sent to.
     */
    public void printStackTrace(java.io.PrintStream s) {
        printStackTrace(new java.io.PrintWriter(s));
    }

    /**
     * Print the the trace of methods from where the error
     * originated.  This will trace all nested exception
     * objects, as well as this object.
     * @param s The writer where the dump will be sent to.
     */
    public void printStackTrace(java.io.PrintWriter s) {

        if (s == null) {
            s = new java.io.PrintWriter(System.err, true);
        }

        try {
            String locInfo = getLocationAsString();

            if (null != locInfo) {
                s.println(locInfo);
            }

            super.printStackTrace(s);
        } catch (Throwable e) {}

        boolean isJdk14OrHigher = false;
        try {
            Throwable.class.getMethod("getCause",null);
            isJdk14OrHigher = true;
        } catch (NoSuchMethodException nsme) {
            // do nothing
        }        

        // The printStackTrace method of the Throwable class in jdk 1.4 
        // and higher will include the cause when printing the backtrace.
        // The following code is only required when using jdk 1.3 or lower                
        if (!isJdk14OrHigher) {
            Throwable exception = getException();
    
            for (int i = 0; (i < 10) && (null != exception); i++) {
                s.println("---------");
    
                try {
                    if (exception instanceof DTMException) {
                        String locInfo =
                            ((DTMException) exception)
                                .getLocationAsString();
    
                        if (null != locInfo) {
                            s.println(locInfo);
                        }
                    }
    
                    exception.printStackTrace(s);
                } catch (Throwable e) {
                    s.println("Could not print stack trace...");
                }
    
                try {
                    Method meth =
                        ((Object) exception).getClass().getMethod("getException",
                            null);
    
                    if (null != meth) {
                        Throwable prev = exception;
    
                        exception = (Throwable) meth.invoke(exception, null);
    
                        if (prev == exception) {
                            break;
                        }
                    } else {
                        exception = null;
                    }
                } catch (InvocationTargetException ite) {
                    exception = null;
                } catch (IllegalAccessException iae) {
                    exception = null;
                } catch (NoSuchMethodException nsme) {
                    exception = null;
                }
            }
        }
    }public static class DTMException extends org.w3c.dom.DOMException
  {
          static final long serialVersionUID = -8290238117162437678L;
    /**
     * Constructs a DOM/DTM exception.
     *
     * @param code
     * @param message
     */
    public DTMException(short code, String message)
    {
      super(code, message);
    }

    /**
     * Constructor DTMException
     *
     *
     * @param code
     */
    public DTMException(short code)
    {
      super(code, "");
    }
  }
26
            
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItem(Node newNode) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItem(String name) { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node setNamedItemNS(Node arg) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMNamedNodeMap.java
public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { throw new DTMException(DTMException.NO_MODIFICATION_ALLOWED_ERR); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
public DTMAxisTraverser getAxisTraverser(final int axis) { DTMAxisTraverser traverser; if (null == m_traversers) // Cache of stateless traversers for this DTM { m_traversers = new DTMAxisTraverser[Axis.getNamesLength()]; traverser = null; } else { traverser = m_traversers[axis]; // Share/reuse existing traverser if (traverser != null) return traverser; } switch (axis) // Generate new traverser { case Axis.ANCESTOR : traverser = new AncestorTraverser(); break; case Axis.ANCESTORORSELF : traverser = new AncestorOrSelfTraverser(); break; case Axis.ATTRIBUTE : traverser = new AttributeTraverser(); break; case Axis.CHILD : traverser = new ChildTraverser(); break; case Axis.DESCENDANT : traverser = new DescendantTraverser(); break; case Axis.DESCENDANTORSELF : traverser = new DescendantOrSelfTraverser(); break; case Axis.FOLLOWING : traverser = new FollowingTraverser(); break; case Axis.FOLLOWINGSIBLING : traverser = new FollowingSiblingTraverser(); break; case Axis.NAMESPACE : traverser = new NamespaceTraverser(); break; case Axis.NAMESPACEDECLS : traverser = new NamespaceDeclsTraverser(); break; case Axis.PARENT : traverser = new ParentTraverser(); break; case Axis.PRECEDING : traverser = new PrecedingTraverser(); break; case Axis.PRECEDINGSIBLING : traverser = new PrecedingSiblingTraverser(); break; case Axis.SELF : traverser = new SelfTraverser(); break; case Axis.ALL : traverser = new AllFromRootTraverser(); break; case Axis.ALLFROMNODE : traverser = new AllFromNodeTraverser(); break; case Axis.PRECEDINGANDANCESTOR : traverser = new PrecedingAndAncestorTraverser(); break; case Axis.DESCENDANTSFROMROOT : traverser = new DescendantFromRootTraverser(); break; case Axis.DESCENDANTSORSELFFROMROOT : traverser = new DescendantOrSelfFromRootTraverser(); break; case Axis.ROOT : traverser = new RootTraverser(); break; case Axis.FILTEREDLIST : return null; // Don't want to throw an exception for this one. default : throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_UNKNOWN_AXIS_TYPE, new Object[]{Integer.toString(axis)})); //"Unknown axis traversal type: "+axis); } if (null == traverser) throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_AXIS_TRAVERSER_NOT_SUPPORTED, new Object[]{Axis.getNames(axis)})); // "Axis traverser not supported: " // + Axis.names[axis]); m_traversers[axis] = traverser; return traverser; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public void addDTM(DTM dtm, int id, int offset) { if(id>=IDENT_MAX_DTMS) { // TODO: %REVIEW% Not really the right error message. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null)); //"No more DTM IDs are available!"); } // We used to just allocate the array size to IDENT_MAX_DTMS. // But we expect to increase that to 16 bits, and I'm not willing // to allocate that much space unless needed. We could use one of our // handy-dandy Fast*Vectors, but this will do for now. // %REVIEW% int oldlen=m_dtms.length; if(oldlen<=id) { // Various growth strategies are possible. I think we don't want // to over-allocate excessively, and I'm willing to reallocate // more often to get that. See also Fast*Vector classes. // // %REVIEW% Should throw a more diagnostic error if we go over the max... int newlen=Math.min((id+256),IDENT_MAX_DTMS); DTM new_m_dtms[] = new DTM[newlen]; System.arraycopy(m_dtms,0,new_m_dtms,0,oldlen); m_dtms=new_m_dtms; int new_m_dtm_offsets[] = new int[newlen]; System.arraycopy(m_dtm_offsets,0,new_m_dtm_offsets,0,oldlen); m_dtm_offsets=new_m_dtm_offsets; } m_dtms[id] = dtm; m_dtm_offsets[id]=offset; dtm.documentRegistration(); // The DTM should have been told who its manager was when we created it. // Do we need to allow for adopting DTMs _not_ created by this manager? }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) { if(DEBUG && null != source) System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId() ); XMLStringFactory xstringFactory = m_xsf; int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); addDTM(dtm, dtmPos, 0); // if (DUMPTREE) // { // dtm.dumpDTM(); // } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader = null; SAX2DTM dtm; try { InputSource xmlSource; if (null == source) { xmlSource = null; } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } if (source==null && unique && !incremental && !doIndexing) { // Special case to support RTF construction into shared DTM. // It should actually still work for other uses, // but may be slightly deoptimized relative to the base // to allow it to deal with carrying multiple documents. // // %REVIEW% This is a sloppy way to request this mode; // we need to consider architectural improvements. dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } /************************************************************** // EXPERIMENTAL 3/22/02 else if(JKESS_XNI_EXPERIMENT && m_incremental) { dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } **************************************************************/ // Create the basic SAX2DTM. else { dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); boolean haveXercesParser = (null != reader) && (reader.getClass() .getName() .equals("org.apache.xerces.parsers.SAXParser") ); if (haveXercesParser) { incremental = true; // No matter what. %REVIEW% } // If the reader is null, but they still requested an incremental // build, then we still want to set up the IncrementalSAXSource stuff. if (m_incremental && incremental /* || ((null == reader) && incremental) */) { IncrementalSAXSource coParser=null; if (haveXercesParser) { // IncrementalSAXSource_Xerces to avoid threading. try { coParser =(IncrementalSAXSource) Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance(); } catch( Exception ex ) { ex.printStackTrace(); coParser=null; } } if (coParser==null ) { // Create a IncrementalSAXSource to run on the secondary thread. if (null == reader) { coParser = new IncrementalSAXSource_Filter(); } else { IncrementalSAXSource_Filter filter = new IncrementalSAXSource_Filter(); filter.setXMLReader(reader); coParser=filter; } } /************************************************************** // EXPERIMENTAL 3/22/02 if (JKESS_XNI_EXPERIMENT && m_incremental && dtm instanceof XNI2DTM && coParser instanceof IncrementalSAXSource_Xerces) { org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc= ((IncrementalSAXSource_Xerces)coParser) .getXNIParserConfiguration(); if (xpc!=null) { // Bypass SAX; listen to the XNI stream ((XNI2DTM)dtm).setIncrementalXNISource(xpc); } else { // Listen to the SAX stream (will fail, diagnostically...) dtm.setIncrementalSAXSource(coParser); } } else ***************************************************************/ // Have the DTM set itself up as IncrementalSAXSource's listener. dtm.setIncrementalSAXSource(coParser); if (null == xmlSource) { // Then the user will construct it themselves. return dtm; } if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } reader.setDTDHandler(dtm); try { // Launch parsing coroutine. Launches a second thread, // if we're using IncrementalSAXSource.filter(). coParser.startParse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } else { if (null == reader) { // Then the user will construct it themselves. return dtm; } // not incremental reader.setContentHandler(dtm); reader.setDTDHandler(dtm); if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); } } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source); } } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public XMLReader getXMLReader(Source inputSource) { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; // If user did not supply a reader, ask for one from the reader manager if (null == reader) { if (m_readerManager == null) { m_readerManager = XMLReaderManager.getInstance(); } reader = m_readerManager.getXMLReader(); } return reader; } catch (SAXException se) { throw new DTMException(se.getMessage(), se); } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM createDocumentFragment() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); Node df = doc.createDocumentFragment(); return getDTM(new DOMSource(df), true, null, false, false); } catch (Exception e) { throw new DTMException(e); } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setNodeValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setValue(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public void setPrefix(String value) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node insertBefore(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node replaceChild(Node a, Node b) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node appendChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node removeChild(Node a) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java
public Node cloneNode(boolean deep) {throw new DTMException(NOT_SUPPORTED_ERR);}
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
protected void error(String msg) { throw new DTMException(msg); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator getTypedAxisIterator(int axis, int type) { DTMAxisIterator iterator = null; /* This causes an error when using patterns for elements that do not exist in the DOM (translet types which do not correspond to a DOM type are mapped to the DOM.ELEMENT type). */ // if (type == NO_TYPE) { // return(EMPTYITERATOR); // } // else if (type == ELEMENT) { // iterator = new FilterIterator(getAxisIterator(axis), // getElementFilter()); // } // else { switch (axis) { case Axis.SELF : iterator = new TypedSingletonIterator(type); break; case Axis.CHILD : iterator = new TypedChildrenIterator(type); break; case Axis.PARENT : return (new ParentIterator().setNodeType(type)); case Axis.ANCESTOR : return (new TypedAncestorIterator(type)); case Axis.ANCESTORORSELF : return ((new TypedAncestorIterator(type)).includeSelf()); case Axis.ATTRIBUTE : return (new TypedAttributeIterator(type)); case Axis.DESCENDANT : iterator = new TypedDescendantIterator(type); break; case Axis.DESCENDANTORSELF : iterator = (new TypedDescendantIterator(type)).includeSelf(); break; case Axis.FOLLOWING : iterator = new TypedFollowingIterator(type); break; case Axis.PRECEDING : iterator = new TypedPrecedingIterator(type); break; case Axis.FOLLOWINGSIBLING : iterator = new TypedFollowingSiblingIterator(type); break; case Axis.PRECEDINGSIBLING : iterator = new TypedPrecedingSiblingIterator(type); break; case Axis.NAMESPACE : iterator = new TypedNamespaceIterator(type); break; case Axis.ROOT : iterator = new TypedRootIterator(type); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: typed iterator for axis " //+ Axis.names[axis] + "not implemented"); } } return (iterator); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator getAxisIterator(final int axis) { DTMAxisIterator iterator = null; switch (axis) { case Axis.SELF : iterator = new SingletonIterator(); break; case Axis.CHILD : iterator = new ChildrenIterator(); break; case Axis.PARENT : return (new ParentIterator()); case Axis.ANCESTOR : return (new AncestorIterator()); case Axis.ANCESTORORSELF : return ((new AncestorIterator()).includeSelf()); case Axis.ATTRIBUTE : return (new AttributeIterator()); case Axis.DESCENDANT : iterator = new DescendantIterator(); break; case Axis.DESCENDANTORSELF : iterator = (new DescendantIterator()).includeSelf(); break; case Axis.FOLLOWING : iterator = new FollowingIterator(); break; case Axis.PRECEDING : iterator = new PrecedingIterator(); break; case Axis.FOLLOWINGSIBLING : iterator = new FollowingSiblingIterator(); break; case Axis.PRECEDINGSIBLING : iterator = new PrecedingSiblingIterator(); break; case Axis.NAMESPACE : iterator = new NamespaceIterator(); break; case Axis.ROOT : iterator = new RootIterator(); break; default : throw new DTMException(XMLMessages.createXMLMessage( XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED, new Object[]{Axis.getNames(axis)})); //"Error: iterator for axis '" + Axis.names[axis] //+ "' not implemented"); } return (iterator); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final PrecedingIterator clone = (PrecedingIterator) super.clone(); final int[] stackCopy = new int[_stack.length]; System.arraycopy(_stack, 0, stackCopy, 0, _stack.length); clone._stack = stackCopy; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; // must set to false for any clone try { final AncestorIterator clone = (AncestorIterator) super.clone(); clone._startNode = _startNode; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; try { final PrecedingIterator clone = (PrecedingIterator) super.clone(); final int[] stackCopy = new int[_stack.length]; System.arraycopy(_stack, 0, stackCopy, 0, _stack.length); clone._stack = stackCopy; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public DTMAxisIterator cloneIterator() { _isRestartable = false; // must set to false for any clone try { final AncestorIterator clone = (AncestorIterator) super.clone(); clone._startNode = _startNode; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); } }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing, boolean hasUserReader, int size, boolean buildIdIndex, boolean newNameTable) { if(DEBUG && null != source) { System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId()); } int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } dtm.setDocumentURI(source.getSystemId()); addDTM(dtm, dtmPos, 0); dom2sax.setContentHandler(dtm); try { dom2sax.parse(); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader; InputSource xmlSource; if (null == source) { xmlSource = null; reader = null; hasUserReader = false; // Make sure the user didn't lie } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } // Create the basic SAX2DTM. SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); if (null == reader) { // Then the user will construct it themselves. return dtm; } reader.setContentHandler(dtm.getBuilder()); if (!hasUserReader || null == reader.getDTDHandler()) { reader.setDTDHandler(dtm); } if(!hasUserReader || null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } finally { if (!hasUserReader) { releaseXMLReader(reader); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); } } }
6
            
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
catch (CloneNotSupportedException e) { throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported."); }
0 0 0 0
unknown (Lib) EmptyStackException 7
            
// in src/org/apache/xml/utils/NamespaceSupport2.java
public void popContext () { Context2 parentContext=currentContext.getParent(); if(parentContext==null) throw new EmptyStackException(); else currentContext = parentContext; }
// in src/org/apache/xml/utils/IntStack.java
public final int peek() { try { return m_map[m_firstFree - 1]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/IntStack.java
public int peek(int n) { try { return m_map[m_firstFree-(1+n)]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/IntStack.java
public void setTop(int val) { try { m_map[m_firstFree - 1] = val; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public Object peek() { try { return m_map[m_firstFree - 1]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public Object peek(int n) { try { return m_map[m_firstFree-(1+n)]; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
// in src/org/apache/xml/utils/ObjectStack.java
public void setTop(Object val) { try { m_map[m_firstFree - 1] = val; } catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); } }
6
            
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/IntStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
// in src/org/apache/xml/utils/ObjectStack.java
catch (ArrayIndexOutOfBoundsException e) { throw new EmptyStackException(); }
0 1
            
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (java.util.EmptyStackException ese) { return null; }
0 0
runtime (Lib) Error 8
            
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
static final String getSignature(Class clazz) { if (clazz.isArray()) { final StringBuffer sb = new StringBuffer(); Class cl = clazz; while (cl.isArray()) { sb.append("["); cl = cl.getComponentType(); } sb.append(getSignature(cl)); return sb.toString(); } else if (clazz.isPrimitive()) { if (clazz == Integer.TYPE) { return "I"; } else if (clazz == Byte.TYPE) { return "B"; } else if (clazz == Long.TYPE) { return "J"; } else if (clazz == Float.TYPE) { return "F"; } else if (clazz == Double.TYPE) { return "D"; } else if (clazz == Short.TYPE) { return "S"; } else if (clazz == Character.TYPE) { return "C"; } else if (clazz == Boolean.TYPE) { return "Z"; } else if (clazz == Void.TYPE) { return "V"; } else { final String name = clazz.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.UNKNOWN_SIG_TYPE_ERR,name); throw new Error(err.toString()); } } else { return "L" + clazz.getName().replace('.', '/') + ';'; } }
// in src/org/apache/xalan/xsltc/compiler/util/SlotAllocator.java
public void releaseSlot(LocalVariableGen lvg) { final int size = lvg.getType().getSize(); final int slot = lvg.getIndex(); final int limit = _free; for (int i = 0; i < limit; i++) { if (_slotsTaken[i] == slot) { int j = i + size; while (j < limit) { _slotsTaken[i++] = _slotsTaken[j++]; } _free -= size; return; } } String state = "Variable slot allocation error"+ "(size="+size+", slot="+slot+", limit="+limit+")"; ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, state); throw new Error(err.toString()); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public final boolean getBit(int bit) { if (DEBUG_ASSERTIONS) { if (bit >= _bitSize) { throw new Error( "Programmer's assertion in BitArray.getBit"); } } return((_bits[bit>>>5] & _masks[bit%32]) != 0); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public final void setBit(int bit) { if (DEBUG_ASSERTIONS) { if (bit >= _bitSize) { throw new Error( "Programmer's assertion in BitArray.getBit"); } } if (bit >= _bitSize) return; final int i = (bit >>> 5); if (i < _first) _first = i; if (i > _last) _last = i; _bits[i] |= _masks[bit % 32]; }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void setDriver(String d) { throw new Error( "This method is not supported. " + "All connection information is handled by the JDBC datasource provider"); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void setURL(String url) { throw new Error( "This method is not supported. " + "All connection information is handled by the JDBC datasource provider"); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private static DocumentBuilder getParser() { try { // we'd really like to cache those DocumentBuilders, but we can't because: // 1. thread safety. parsers are not thread-safe, so at least // we need one instance per a thread. // 2. parsers are non-reentrant, so now we are looking at having a // pool of parsers. // 3. then the class loading issue. The look-up procedure of // DocumentBuilderFactory.newInstance() depends on context class loader // and system properties, which may change during the execution of JVM. // // so we really have to create a fresh DocumentBuilder every time we need one // - KK DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); return dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); } }
// in src/org/apache/xpath/patterns/StepPattern.java
private final boolean checkProximityPosition(XPathContext xctxt, int predPos, DTM dtm, int context, int pos) { try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.PRECEDINGSIBLING); for (int child = traverser.first(context); DTM.NULL != child; child = traverser.next(context, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { throw new Error("Why: Should never have been called"); } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos--; if (pos < 1) return false; } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return (pos == 1); }
1
            
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
0 1
            
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Error e) { if (_debug) e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
0 0
checked (Lib) Exception 1
            
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
0 13
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
protected static String getSourceLine(String sourceUrl, int lineNum) throws Exception { URL url = null; // Get a URL from the sourceUrl try { // Try to get a URL from it as-is url = new URL(sourceUrl); } catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } } String line = null; InputStream is = null; BufferedReader br = null; try { // Open the URL and read to our specified line URLConnection uc = url.openConnection(); is = uc.getInputStream(); br = new BufferedReader(new InputStreamReader(is)); // Not the most efficient way, but it works // (Feel free to patch to seek to the appropriate line) for (int i = 1; i <= lineNum; i++) { line = br.readLine(); } } // Allow exceptions to propagate from here, but ensure // streams are closed! finally { br.close(); is.close(); } // Return whatever we found return line; }
// in src/org/apache/xml/utils/NodeVector.java
public void sort(int a[], int lo0, int hi0) throws Exception { int lo = lo0; int hi = hi0; // pause(lo, hi); if (lo >= hi) { return; } else if (lo == hi - 1) { /* * sort a two element list by swapping if necessary */ if (a[lo] > a[hi]) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; } return; } /* * Pick a pivot and move it out of the way */ int mid = (lo + hi) >>> 1; int pivot = a[mid]; a[mid] = a[hi]; a[hi] = pivot; while (lo < hi) { /* * Search forward from a[lo] until an element is found that * is greater than the pivot or lo >= hi */ while (a[lo] <= pivot && lo < hi) { lo++; } /* * Search backward from a[hi] until element is found that * is less than the pivot, or lo >= hi */ while (pivot <= a[hi] && lo < hi) { hi--; } /* * Swap elements a[lo] and a[hi] */ if (lo < hi) { int T = a[lo]; a[lo] = a[hi]; a[hi] = T; // pause(); } // if (stopRequested) { // return; // } } /* * Put the median in the "center" of the list */ a[hi0] = a[hi]; a[hi] = pivot; /* * Recursive calls, elements a[lo0] to a[lo-1] are less than or * equal to pivot, elements a[hi+1] to a[hi0] are greater than * pivot. */ sort(a, lo0, lo - 1); sort(a, hi + 1, hi0); }
// in src/org/apache/xml/utils/NodeVector.java
public void sort() throws Exception { sort(m_map, 0, m_firstFree - 1); }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowException() throws Exception { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void setCdataSectionElements(Hashtable h) throws Exception { couldThrowException(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getSourceTreeAsText() throws Exception { return getTreeAsText(m_documentURL); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getStyleTreeAsText() throws Exception { return getTreeAsText(m_styleURL); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getResultTreeAsText() throws Exception { return escapeString(getHtmlText()); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom) throws Exception { return document(uri, base, translet, dom, false); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom, boolean cacheDOM) throws Exception { try { final String originalUri = uri; MultiDOM multiplexer = (MultiDOM)dom; // Prepend URI base to URI (from context) if (base != null && base.length() != 0) { uri = SystemIDResolver.getAbsoluteURI(uri, base); } // Return an empty iterator if the URI is clearly invalid // (to prevent some unncessary MalformedURL exceptions). if (uri == null || uri.length() == 0) { return(EmptyIterator.getInstance()); } // Check if this DOM has already been added to the multiplexer int mask = multiplexer.getDocumentMask(uri); if (mask != -1) { DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri)) .getDOMImpl(); if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); } } // Check if we can get the DOM from a DOMCache DOMCache cache = translet.getDOMCache(); DOM newdom; mask = multiplexer.nextMask(); // peek if (cache != null) { newdom = cache.retrieveDocument(base, originalUri, translet); if (newdom == null) { final Exception e = new FileNotFoundException(originalUri); throw new TransletException(e); } } else { // Parse the input document and construct DOM object // Trust the DTMManager to pick the right parser and // set up the DOM correctly. XSLTCDTMManager dtmManager = (XSLTCDTMManager)multiplexer .getDTMManager(); DOMEnhancedForDTM enhancedDOM = (DOMEnhancedForDTM) dtmManager.getDTM(new StreamSource(uri), false, null, true, false, translet.hasIdCall(), cacheDOM); newdom = enhancedDOM; // Cache the stylesheet DOM in the Templates object if (cacheDOM) { TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); if (templates != null) { templates.setStylesheetDOM(enhancedDOM); } } translet.prepassDocument(enhancedDOM); enhancedDOM.setDocumentURI(uri); } // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); multiplexer.addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); } catch (Exception e) { throw e; } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(DTMAxisIterator arg1, String baseURI, AbstractTranslet translet, DOM dom) throws Exception { UnionIterator union = new UnionIterator(dom); int node = DTM.NULL; while ((node = arg1.next()) != DTM.NULL) { String uri = dom.getStringValueX(node); //document(node-set) if true; document(node-set,node-set) if false if (baseURI == null) { baseURI = dom.getDocumentURI(node); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } union.addIterator(document(uri, baseURI, translet, dom)); } return(union); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(DOM newdom, AbstractTranslet translet, DOM dom) throws Exception { DTMManager dtmManager = ((MultiDOM)dom).getDTMManager(); // Need to migrate the cached DTM to the new DTMManager if (dtmManager != null && newdom instanceof DTM) { ((DTM)newdom).migrateTo(dtmManager); } translet.prepassDocument(newdom); // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); ((MultiDOM)dom).addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transformIdentity(Source source, SerializationHandler handler) throws Exception { // Get systemId from source if (source != null) { _sourceSystemId = source.getSystemId(); } if (source instanceof StreamSource) { final StreamSource stream = (StreamSource) source; final InputStream streamInput = stream.getInputStream(); final Reader streamReader = stream.getReader(); final XMLReader reader = _readerManager.getXMLReader(); try { // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Create input source from source InputSource input; if (streamInput != null) { input = new InputSource(streamInput); input.setSystemId(_sourceSystemId); } else if (streamReader != null) { input = new InputSource(streamReader); input.setSystemId(_sourceSystemId); } else if (_sourceSystemId != null) { input = new InputSource(_sourceSystemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } // Start pushing SAX events reader.parse(input); } finally { _readerManager.releaseXMLReader(reader); } } else if (source instanceof SAXSource) { final SAXSource sax = (SAXSource) source; XMLReader reader = sax.getXMLReader(); final InputSource input = sax.getInputSource(); boolean userReader = true; try { // Create a reader if not set by user if (reader == null) { reader = _readerManager.getXMLReader(); userReader = false; } // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Start pushing SAX events reader.parse(input); } finally { if (!userReader) { _readerManager.releaseXMLReader(reader); } } } else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; new DOM2TO(domsrc.getNode(), handler).parse(); } else if (source instanceof XSLTCSource) { final DOM dom = ((XSLTCSource) source).getDOM(null, _translet); ((SAXImpl)dom).copy(handler); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } }
285
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (Exception e) { pw.println("line: logSourceLine unavailable due to: " + e.getMessage()); pw.println(); }
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e) { Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode("ERROR: Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xml/utils/Hashtree2Node.java
catch (Exception e2) { // Ooops, just bail (suggestions for a safe thing // to do in this case appreciated) e2.printStackTrace(); }
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception e) { // Fallback if this fails (implemented in createIncrementalSAXSource) is // to attempt Xerces-1 incremental setup. Can't do tail-call in // constructor, so create new, copy Xerces-1 initialization, // then throw it away... Ugh. IncrementalSAXSource_Xerces dummy=new IncrementalSAXSource_Xerces(new SAXParser()); this.fParseSomeSetup=dummy.fParseSomeSetup; this.fParseSome=dummy.fParseSome; this.fIncrementalParser=dummy.fIncrementalParser; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (Exception ex) { arg = new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch( Exception ex ) { ex.printStackTrace(); coParser=null; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) {}
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/res/XMLMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(FORMAT_FAILED); fmsg += " " + msg; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (Exception e) { //User may be using older JDK ( JDK <1.2 ). Allow him/her to use it. // But don't try to use doPrivileged }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception e) { /* even the message that the message is not in the bundle is * not there ... this is really bad */ msg = "The message key '" + msgKey + "' is not in the message class '" + m_resourceBundleName+"'"; }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception e) { throwex = true; try { // Get the message that the format failed. fmsg = java.text.MessageFormat.format( MsgKey.BAD_MSGFORMAT, new Object[] { msgKey, m_resourceBundleName }); fmsg += " " + msg; } catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (Exception e){}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception except) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (Exception e) { }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) {}
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception exc) { fgThrowableInitCauseMethod = null; fgThrowableMethodsAvailable = false; }
// in src/org/apache/xml/serializer/EncodingInfo.java
catch (Exception e) { isInEncoding = false; // If for some reason the encoding is null, e.g. // for a temporary result tree, we should just // say that every character is in the encoding. if (encoding == null) isInEncoding = true; }
// in src/org/apache/xml/serializer/EncodingInfo.java
catch (Exception e) { isInEncoding = false; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { this.showStatus("Could not prime the pump!"); System.out.println("Could not prime the pump!"); e.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception any_error) { any_error.printStackTrace(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { // what can you do? }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { ErrorMsg err = new ErrorMsg(ErrorMsg.INTERNAL_ERR, e.getMessage(), node); reportError(FATAL, err); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (Exception e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR, expression, parent)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { /*if (_debug)*/ e.printStackTrace(); _parser.reportError(Constants.FATAL, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Import.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/Include.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { _dom = null; }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { return(System.currentTimeMillis()); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SortingIterator.java
catch (Exception e) { return this; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { factory.setNamespaceAware(true); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (Exception e) { e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (Exception ex) { version = -1; }
// in src/org/apache/xalan/templates/ElemElement.java
catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
catch (Exception iae) { templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{ patternStr }); return XString.EMPTYSTRING; //throw new XSLProcessorException(iae); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception ioe){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { System.err.println("# WARNING: -out " + args[i] + " threw " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; logMsg("Reading-" + key + "= threw: " + e.toString()); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("item"); node.setAttribute("key", keyStr); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); hashNode.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { System.err.println("appendEnvironmentReport threw: " + e2.toString()); e2.printStackTrace(); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { errors = true; Element node = factory.createElement("foundJar"); node.appendChild(factory.createTextNode(ERROR + " Reading " + key + " threw: " + e.toString())); container.appendChild(node); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { /* no-op, don't add it */ }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { if (null != clazz) { // We must have found the class itself, just not the // method, so we (probably) have JAXP 1.0.1 h.put(ERROR + VERSION + "JAXP", "1.0.1"); h.put(ERROR, ERROR_FOUND); } else { // We couldn't even find the class, and don't have // any JAXP support at all, or only have the // transform half of it h.put(ERROR + VERSION + "JAXP", CLASS_NOTPRESENT); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e1) { h.put(VERSION + "xalan1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2x", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces1", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "xerces2", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "crimson", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(VERSION + "ant", CLASS_NOTPRESENT); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { try { // Check for the final draft version as well clazz = ObjectFactory.findProviderClass( DOM_LEVEL2FD_CLASS, ObjectFactory.findClassLoader(), true); method = clazz.getMethod(DOM_LEVEL2FD_METHOD, twoStringArgs); h.put(VERSION + "DOM.draftlevel", "2.0fd"); } catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { h.put(ERROR + VERSION + "DOM.draftlevel", "2.0unknown"); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { h.put(ERROR + VERSION + "DOM", "ERROR attempting to load DOM level 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e) { // If we didn't find the SAX 2.0 class, look for a 2.0beta2 h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION2_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION2_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 2.0beta2 or earlier; these might work but // you should really have the final SAX 2.0 h.put(VERSION + "SAX-backlevel", "2.0beta2-or-earlier"); } catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e2) { // If we didn't find the SAX 2.0beta2 class, look for a 1.0 one h.put(ERROR + VERSION + "SAX", "ERROR attempting to load SAX version 2 class: " + e.toString()); h.put(ERROR, ERROR_FOUND); try { Class clazz = ObjectFactory.findProviderClass( SAX_VERSION1_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(SAX_VERSION1_METHOD, oneStringArg); // If we succeeded, we have loaded interfaces from a // SAX version 1.0 somewhere; which won't work very // well for JAXP 1.1 or beyond! h.put(VERSION + "SAX-backlevel", "1.0"); } catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); } }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (Exception e3) { // If we didn't find the SAX 2.0 class, look for a 1.0 one // Note that either 1.0 or no SAX are both errors h.put(ERROR + VERSION + "SAX-backlevel", "ERROR attempting to load SAX version 1 class: " + e3.toString()); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/SQLQueryParser.java
catch (Exception tx) { // if ( ! parm.isOutput() ) throw new SQLException(tx.toString()); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { if (DEBUG) { System.out.println("Testing Connection, FAILED"); e.printStackTrace(); } return false; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addElement: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Error in addAttributeToNode: "+e.getMessage()); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Cloning attributes"); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(Exception e) { error("Getting String Value"); return null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { // OK We had an error building the document, let try and grab the // error information and clean up our connections. if (DEBUG) System.out.println("exception in query()"); if (doc != null) { if (doc.hasErrors()) { setError(e, doc, doc.checkWarnings()); } // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. doc.close(m_IsDefaultPool); doc = null; } }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception se ) {}
// in src/org/apache/xalan/lib/sql/XConnection.java
catch (Exception e) { XNodeSet xNS = (XNodeSet)dtmIter.getDTMIterator(); DTMIterator iter = (DTMIterator)xNS.getContainedIter(); DTM dtm = iter.getDTM(xNS.nextNode()); return (SQLDocument)dtm; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { setError(e, exprContext); return null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { eDoc = null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { //m_Error = null; }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(Exception e) { // Empty We are final Anyway }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception origEx) { // For now let's assume that the relative method is not supported. // So let's do it manually. try { for (int x=0; x<value; x++) { if (! m_ResultSet.next()) break; } } catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { // If we still fail, add in both exceptions m_XConnection.setError(origEx, this, checkWarnings()); m_XConnection.setError(e, this, checkWarnings()); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { m_XConnection.setError(e, this, checkWarnings()); //error("ERROR Extracting Metadata"); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_LABEL_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CATALOGUE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DISPLAY_SIZE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_COLUMN_TYPENAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_PRECISION_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCALE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_SCHEMA_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_TABLE_NAME_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_CASESENSITIVE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_DEFINITELYWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISNULLABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSIGNED_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISWRITEABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { addAttributeToNode( S_ATTRIB_NOT_SUPPORTED, m_ColAttrib_ISSEARCHABLE_TypeID, lastColHeaderIdx); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { if (DEBUG) { System.out.println( "SQL Error Fetching next row [" + e.getLocalizedMessage() + "]"); } m_XConnection.setError(e, this, checkWarnings()); m_HasErrors = true; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) {}
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(Exception e) { return false; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch(Exception e) { // Must not have been the right one }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/XPathException.java
catch (Exception e){}
// in src/org/apache/xpath/XPathException.java
catch (Exception e){}
// in src/org/apache/xpath/XPathException.java
catch (Exception e) { s.println("Could not print stack trace..."); }
// in src/org/apache/xpath/XPathContext.java
catch (Exception e) {}
// in src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
catch (Exception e) { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncExtElementAvailable.java
catch (Exception e) { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { return new XString(result); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { fXalanProperties = null; fLastModified = -1; // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { // assert(x instanceof FileNotFoundException // || x instanceof SecurityException) // In both cases, ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/res/XPATHMessages.java
catch (Exception e) { fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); fmsg += " " + msg; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { e.printStackTrace(); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { return false; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
124
            
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { throw new DTMException(e); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider for factory " + factoryId + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider "+factoryClassName+" could not be instantiated: "+x, x); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (Exception x) { throw new ConfigurationError( "Provider " + className + " could not be instantiated: " + x, x); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
51
unknown (Lib) FactoryConfigurationError 0 0 0 9
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
9
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
0
unknown (Lib) FileNotFoundException 0 0 38
            
// in src/org/apache/xml/utils/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xml/utils/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xml/dtm/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xml/dtm/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xml/serializer/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xml/serializer/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/xslt/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/lib/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/lib/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xalan/extensions/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
// in src/org/apache/xpath/functions/SecuritySupport.java
static FileInputStream getFileInputStream(final File file) throws FileNotFoundException { try { return (FileInputStream) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws FileNotFoundException { return new FileInputStream(file); } }); } catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); } }
// in src/org/apache/xpath/functions/SecuritySupport.java
public Object run() throws FileNotFoundException { return new FileInputStream(file); }
4
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (FileNotFoundException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (FileNotFoundException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (FileNotFoundException e) { continue; }
1
            
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
1
runtime (Domain) FoundIndex
public class FoundIndex extends RuntimeException
{
    static final long serialVersionUID = -4643975335243078270L;

  /**
   * Constructor FoundIndex
   *
   */
  public FoundIndex(){}
}
0 0 0 0 0 0
checked (Domain) GetOptsException
public class GetOptsException extends Exception{
    static final long serialVersionUID = 8736874967183039804L;
    public GetOptsException(String msg){
	super(msg);
    }
}
0 0 0 1
            
// in src/org/apache/xalan/xsltc/cmdline/Compile.java
catch (GetOptsException ex) { System.err.println(ex); printUsage(); // exits with code '-1' }
0 0
checked (Lib) IOException 6
            
// in src/org/apache/xml/serializer/ToStream.java
protected int writeUTF16Surrogate(char c, char ch[], int i, int end) throws IOException { int codePoint = 0; if (i + 1 >= end) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c)})); } final char high = c; final char low = ch[i+1]; if (!Encodings.isLowUTF16Surrogate(low)) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c) + " " + Integer.toHexString(low)})); } final java.io.Writer writer = m_writer; // If we make it to here we have a valid high, low surrogate pair if (m_encodingInfo.isInEncoding(c,low)) { // If the character formed by the surrogate pair // is in the encoding, so just write it out writer.write(ch,i,2); } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref final String encoding = getEncoding(); if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ codePoint = Encodings.toCodePoint(high, low); // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(codePoint)); writer.write(';'); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(ch, i, 2); } } // non-zero only if character reference was written out. return codePoint; }
// in src/org/apache/xml/serializer/ToStream.java
private int accumDefaultEscape( Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF); if (i == pos) { if (Encodings.isHighUTF16Surrogate(ch)) { // Should be the UTF-16 low surrogate of the hig/low pair. char next; // Unicode code point formed from the high/low pair. int codePoint = 0; if (i + 1 >= len) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = chars[++i]; if (!(Encodings.isLowUTF16Surrogate(next))) throw new IOException( Utils.messages.createMessage( MsgKey .ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch) + " " + Integer.toHexString(next)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); codePoint = Encodings.toCodePoint(ch,next); } writer.write("&#"); writer.write(Integer.toString(codePoint)); writer.write(';'); pos += 2; // count the two characters that went into writing out this entity } else { /* This if check is added to support control characters in XML 1.1. * If a character is a Control Character within C0 and C1 range, it is desirable * to write it out as Numeric Character Reference(NCR) regardless of XML Version * being used for output document. */ if (isCharacterInC0orC1Range(ch) || isNELorLSEPCharacter(ch)) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if ((!escapingNotNeeded(ch) || ( (fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))) && m_elemContext.m_currentElemDepth > 0) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else { writer.write(ch); } pos++; // count the single character that was processed } } return pos; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
0 107
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void serialize(Node node) throws IOException { }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
static private Properties loadPropertiesFile( final String resourceName, Properties defaults) throws IOException { // This static method should eventually be moved to a thread-specific class // so that we can cache the ContextClassLoader and bottleneck all properties file // loading throughout Xalan. Properties props = new Properties(defaults); InputStream is = null; BufferedInputStream bis = null; try { if (ACCESS_CONTROLLER_CLASS != null) { is = (InputStream) AccessController .doPrivileged(new PrivilegedAction() { public Object run() { return OutputPropertiesFactory.class .getResourceAsStream(resourceName); } }); } else { // User may be using older JDK ( JDK < 1.2 ) is = OutputPropertiesFactory.class .getResourceAsStream(resourceName); } bis = new BufferedInputStream(is); props.load(bis); }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final int c) throws IOException { /* If we are close to the end of the buffer then flush it. * Remember the buffer can hold a few more bytes than BYTES_MAX */ if (count >= BYTES_MAX) flushBuffer(); if (c < 0x80) { m_outputBytes[count++] = (byte) (c); } else if (c < 0x800) { m_outputBytes[count++] = (byte) (0xc0 + (c >> 6)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } else if (c < 0x10000) { m_outputBytes[count++] = (byte) (0xe0 + (c >> 12)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } else { m_outputBytes[count++] = (byte) (0xf0 + (c >> 18)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 12) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); m_outputBytes[count++] = (byte) (0x80 + (c & 0x3f)); } }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final char chars[], final int start, final int length) throws java.io.IOException { // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. int lengthx3 = 3*length; if (lengthx3 >= BYTES_MAX - count) { // The requested length is greater than the unused part of the buffer flushBuffer(); if (lengthx3 > BYTES_MAX) { /* * The requested length exceeds the size of the buffer. * Cut the buffer up into chunks, each of which will * not cause an overflow to the output buffer m_outputBytes, * and make multiple recursive calls. * Be careful about integer overflows in multiplication. */ int split = length/CHARS_MAX; final int chunks; if (length % CHARS_MAX > 0) chunks = split + 1; else chunks = split; int end_chunk = start; for (int chunk = 1; chunk <= chunks; chunk++) { int start_chunk = end_chunk; end_chunk = start + (int) ((((long) length) * chunk) / chunks); // Adjust the end of the chunk if it ends on a high char // of a Unicode surrogate pair and low char of the pair // is not going to be in the same chunk final char c = chars[end_chunk - 1]; int ic = chars[end_chunk - 1]; if (c >= 0xD800 && c <= 0xDBFF) { // The last Java char that we were going // to process is the first of a // Java surrogate char pair that // represent a Unicode character. if (end_chunk < start + length) { // Avoid spanning by including the low // char in the current chunk of chars. end_chunk++; } else { /* This is the last char of the last chunk, * and it is the high char of a high/low pair with * no low char provided. * TODO: error message needed. * The char array incorrectly ends in a high char * of a high/low surrogate pair, but there is * no corresponding low as the high is the last char */ end_chunk--; } } int len_chunk = (end_chunk - start_chunk); this.write(chars,start_chunk, len_chunk); } return; } } final int n = length+start; final byte[] buf_loc = m_outputBytes; // local reference for faster access int count_loc = count; // local integer for faster access int i = start; { /* This block could be omitted and the code would produce * the same result. But this block exists to give the JIT * a better chance of optimizing a tight and common loop which * occurs when writing out ASCII characters. */ char c; for(; i < n && (c = chars[i])< 0x80 ; i++ ) buf_loc[count_loc++] = (byte)c; } for (; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf_loc[count_loc++] = (byte) (c); else if (c < 0x800) { buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } /** * The following else if condition is added to support XML 1.1 Characters for * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]* * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate) * [1101 11yy] [yyxx xxxx] (low surrogate) * * uuuuu = wwww + 1 */ else if (c >= 0xD800 && c <= 0xDBFF) { char high, low; high = c; i++; low = chars[i]; buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0)); buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30)); buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f)); } else { buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12)); buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } } // Store the local integer back into the instance variable count = count_loc; }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void write(final String s) throws IOException { // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. final int length = s.length(); int lengthx3 = 3*length; if (lengthx3 >= BYTES_MAX - count) { // The requested length is greater than the unused part of the buffer flushBuffer(); if (lengthx3 > BYTES_MAX) { /* * The requested length exceeds the size of the buffer, * so break it up in chunks that don't exceed the buffer size. */ final int start = 0; int split = length/CHARS_MAX; final int chunks; if (length % CHARS_MAX > 0) chunks = split + 1; else chunks = split; int end_chunk = 0; for (int chunk = 1; chunk <= chunks; chunk++) { int start_chunk = end_chunk; end_chunk = start + (int) ((((long) length) * chunk) / chunks); s.getChars(start_chunk,end_chunk, m_inputChars,0); int len_chunk = (end_chunk - start_chunk); // Adjust the end of the chunk if it ends on a high char // of a Unicode surrogate pair and low char of the pair // is not going to be in the same chunk final char c = m_inputChars[len_chunk - 1]; if (c >= 0xD800 && c <= 0xDBFF) { // Exclude char in this chunk, // to avoid spanning a Unicode character // that is in two Java chars as a high/low surrogate end_chunk--; len_chunk--; if (chunk == chunks) { /* TODO: error message needed. * The String incorrectly ends in a high char * of a high/low surrogate pair, but there is * no corresponding low as the high is the last char * Recover by ignoring this last char. */ } } this.write(m_inputChars,0, len_chunk); } return; } } s.getChars(0, length , m_inputChars, 0); final char[] chars = m_inputChars; final int n = length; final byte[] buf_loc = m_outputBytes; // local reference for faster access int count_loc = count; // local integer for faster access int i = 0; { /* This block could be omitted and the code would produce * the same result. But this block exists to give the JIT * a better chance of optimizing a tight and common loop which * occurs when writing out ASCII characters. */ char c; for(; i < n && (c = chars[i])< 0x80 ; i++ ) buf_loc[count_loc++] = (byte)c; } for (; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf_loc[count_loc++] = (byte) (c); else if (c < 0x800) { buf_loc[count_loc++] = (byte) (0xc0 + (c >> 6)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } /** * The following else if condition is added to support XML 1.1 Characters for * UTF-8: [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]* * Unicode: [1101 10ww] [wwzz zzyy] (high surrogate) * [1101 11yy] [yyxx xxxx] (low surrogate) * * uuuuu = wwww + 1 */ else if (c >= 0xD800 && c <= 0xDBFF) { char high, low; high = c; i++; low = chars[i]; buf_loc[count_loc++] = (byte) (0xF0 | (((high + 0x40) >> 8) & 0xf0)); buf_loc[count_loc++] = (byte) (0x80 | (((high + 0x40) >> 2) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 | ((low >> 6) & 0x0f) + ((high << 4) & 0x30)); buf_loc[count_loc++] = (byte) (0x80 | (low & 0x3f)); } else { buf_loc[count_loc++] = (byte) (0xe0 + (c >> 12)); buf_loc[count_loc++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf_loc[count_loc++] = (byte) (0x80 + (c & 0x3f)); } } // Store the local integer back into the instance variable count = count_loc; }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void flushBuffer() throws IOException { if (count > 0) { m_os.write(m_outputBytes, 0, count); count = 0; } }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void flush() throws java.io.IOException { flushBuffer(); m_os.flush(); }
// in src/org/apache/xml/serializer/WriterToUTF8Buffered.java
public void close() throws java.io.IOException { flushBuffer(); m_os.close(); }
// in src/org/apache/xml/serializer/SerializerBase.java
public ContentHandler asContentHandler() throws IOException { return this; }
// in src/org/apache/xml/serializer/SerializerBase.java
public DOMSerializer asDOMSerializer() throws IOException { return this; }
// in src/org/apache/xml/serializer/SerializerBase.java
public Object asDOM3Serializer() throws IOException { return new org.apache.xml.serializer.dom3.DOM3SerializerImpl(this); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(char chars[], int start, int length) throws java.io.IOException { int n = length+start; for (int i = start; i < n; i++) { m_os.write(chars[i]); } }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(int c) throws IOException { m_os.write(c); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void write(String s) throws IOException { int n = s.length(); for (int i = 0; i < n; i++) { m_os.write(s.charAt(i)); } }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void flush() throws java.io.IOException { m_os.flush(); }
// in src/org/apache/xml/serializer/WriterToASCI.java
public void close() throws java.io.IOException { m_os.close(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
private void flushBuffer() throws IOException { // Just for tracing purposes if (count > 0) { char[] chars = new char[count]; for(int i=0; i<count; i++) chars[i] = (char) buf[i]; if (m_tracer != null) m_tracer.fireGenerateEvent( SerializerTrace.EVENTTYPE_OUTPUT_CHARACTERS, chars, 0, chars.length); count = 0; } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void flush() throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.flush(); // from here on just for tracing purposes flushBuffer(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void close() throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.close(); // from here on just for tracing purposes flushBuffer(); }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final int c) throws IOException { // send to the real writer if (m_writer != null) m_writer.write(c); // ---------- from here on just collect for tracing purposes /* If we are close to the end of the buffer then flush it. * Remember the buffer can hold a few more characters than buf_length */ if (count >= buf_length) flushBuffer(); if (c < 0x80) { buf[count++] = (byte) (c); } else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final char chars[], final int start, final int length) throws java.io.IOException { // send to the real writer if (m_writer != null) m_writer.write(chars, start, length); // from here on just collect for tracing purposes int lengthx3 = (length << 1) + length; if (lengthx3 >= buf_length) { /* If the request length exceeds the size of the output buffer, * flush the output buffer and make the buffer bigger to handle. */ flushBuffer(); setBufferSize(2 * lengthx3); } if (lengthx3 > buf_length - count) { flushBuffer(); } final int n = length + start; for (int i = start; i < n; i++) { final char c = chars[i]; if (c < 0x80) buf[count++] = (byte) (c); else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } } }
// in src/org/apache/xml/serializer/SerializerTraceWriter.java
public void write(final String s) throws IOException { // send to the real writer if (m_writer != null) m_writer.write(s); // from here on just collect for tracing purposes final int length = s.length(); // We multiply the length by three since this is the maximum length // of the characters that we can put into the buffer. It is possible // for each Unicode character to expand to three bytes. int lengthx3 = (length << 1) + length; if (lengthx3 >= buf_length) { /* If the request length exceeds the size of the output buffer, * flush the output buffer and make the buffer bigger to handle. */ flushBuffer(); setBufferSize(2 * lengthx3); } if (lengthx3 > buf_length - count) { flushBuffer(); } for (int i = 0; i < length; i++) { final char c = s.charAt(i); if (c < 0x80) buf[count++] = (byte) (c); else if (c < 0x800) { buf[count++] = (byte) (0xc0 + (c >> 6)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } else { buf[count++] = (byte) (0xe0 + (c >> 12)); buf[count++] = (byte) (0x80 + ((c >> 6) & 0x3f)); buf[count++] = (byte) (0x80 + (c & 0x3f)); } } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public ContentHandler asContentHandler() throws IOException { /* don't return the real handler ( m_handler ) because * that would expose the real handler to the outside. * Keep m_handler private so it can be internally swapped * to an HTML handler. */ return this; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void serialize(Node node) throws IOException { if (m_firstTagNotEmitted) { flush(); } m_handler.serialize(node); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public DOMSerializer asDOMSerializer() throws IOException { return m_handler.asDOMSerializer(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public Object asDOM3Serializer() throws IOException { return m_handler.asDOM3Serializer(); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void serialize(Node node) throws IOException { }
// in src/org/apache/xml/serializer/ToTextStream.java
void writeNormalizedChars( final char ch[], final int start, final int length, final boolean useLineSep) throws IOException, org.xml.sax.SAXException { final String encoding = getEncoding(); final java.io.Writer writer = m_writer; final int end = start + length; /* copy a few "constants" before the loop for performance */ final char S_LINEFEED = CharInfo.S_LINEFEED; // This for() loop always increments i by one at the end // of the loop. Additional increments of i adjust for when // two input characters (a high/low UTF16 surrogate pair) // are processed. for (int i = start; i < end; i++) { final char c = ch[i]; if (S_LINEFEED == c && useLineSep) { writer.write(m_lineSep, 0, m_lineSepLen); // one input char processed } else if (m_encodingInfo.isInEncoding(c)) { writer.write(c); // one input char processed } else if (Encodings.isHighUTF16Surrogate(c)) { final int codePoint = writeUTF16Surrogate(c, ch, i, end); if (codePoint != 0) { // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(codePoint); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } i++; // two input chars processed } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(c)); writer.write(';'); // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(c); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(c); } // one input char was processed } } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void processAttribute( java.io.Writer writer, String name, String value, ElemDesc elemDesc) throws IOException { writer.write(' '); if ( ((value.length() == 0) || value.equalsIgnoreCase(name)) && elemDesc != null && elemDesc.isAttrFlagSet(name, ElemDesc.ATTREMPTY)) { writer.write(name); } else { // %REVIEW% %OPT% // Two calls to single-char write may NOT // be more efficient than one to string-write... writer.write(name); writer.write("=\""); if ( elemDesc != null && elemDesc.isAttrFlagSet(name, ElemDesc.ATTRURL)) writeAttrURI(writer, value, m_specialEscapeURLs); else writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void writeAttrURI( final java.io.Writer writer, String string, boolean doURLEscaping) throws IOException { // http://www.ietf.org/rfc/rfc2396.txt says: // A URI is always in an "escaped" form, since escaping or unescaping a // completed URI might change its semantics. Normally, the only time // escape encodings can safely be made is when the URI is being created // from its component parts; each component may have its own set of // characters that are reserved, so only the mechanism responsible for // generating or interpreting that component can determine whether or // not escaping a character will change its semantics. Likewise, a URI // must be separated into its components before the escaped characters // within those components can be safely decoded. // // ...So we do our best to do limited escaping of the URL, without // causing damage. If the URL is already properly escaped, in theory, this // function should not change the string value. final int end = string.length(); if (end > m_attrBuff.length) { m_attrBuff = new char[end*2 + 1]; } string.getChars(0,end, m_attrBuff, 0); final char[] chars = m_attrBuff; int cleanStart = 0; int cleanLength = 0; char ch = 0; for (int i = 0; i < end; i++) { ch = chars[i]; if ((ch < 32) || (ch > 126)) { if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } if (doURLEscaping) { // Encode UTF16 to UTF8. // Reference is Unicode, A Primer, by Tony Graham. // Page 92. // Note that Kay doesn't escape 0x20... // if(ch == 0x20) // Not sure about this... -sb // { // writer.write(ch); // } // else if (ch <= 0x7F) { writer.write('%'); writer.write(makeHHString(ch)); } else if (ch <= 0x7FF) { // Clear low 6 bits before rotate, put high 4 bits in low byte, // and set two high bits. int high = (ch >> 6) | 0xC0; int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit writer.write('%'); writer.write(makeHHString(high)); writer.write('%'); writer.write(makeHHString(low)); } else if (Encodings.isHighUTF16Surrogate(ch)) // high surrogate { // I'm sure this can be done in 3 instructions, but I choose // to try and do it exactly like it is done in the book, at least // until we are sure this is totally clean. I don't think performance // is a big issue with this particular function, though I could be // wrong. Also, the stuff below clearly does more masking than // it needs to do. // Clear high 6 bits. int highSurrogate = ((int) ch) & 0x03FF; // Middle 4 bits (wwww) + 1 // "Note that the value of wwww from the high surrogate bit pattern // is incremented to make the uuuuu bit pattern in the scalar value // so the surrogate pair don't address the BMP." int wwww = ((highSurrogate & 0x03C0) >> 6); int uuuuu = wwww + 1; // next 4 bits int zzzz = (highSurrogate & 0x003C) >> 2; // low 2 bits int yyyyyy = ((highSurrogate & 0x0003) << 4) & 0x30; // Get low surrogate character. ch = chars[++i]; // Clear high 6 bits. int lowSurrogate = ((int) ch) & 0x03FF; // put the middle 4 bits into the bottom of yyyyyy (byte 3) yyyyyy = yyyyyy | ((lowSurrogate & 0x03C0) >> 6); // bottom 6 bits. int xxxxxx = (lowSurrogate & 0x003F); int byte1 = 0xF0 | (uuuuu >> 2); // top 3 bits of uuuuu int byte2 = 0x80 | (((uuuuu & 0x03) << 4) & 0x30) | zzzz; int byte3 = 0x80 | yyyyyy; int byte4 = 0x80 | xxxxxx; writer.write('%'); writer.write(makeHHString(byte1)); writer.write('%'); writer.write(makeHHString(byte2)); writer.write('%'); writer.write(makeHHString(byte3)); writer.write('%'); writer.write(makeHHString(byte4)); } else { int high = (ch >> 12) | 0xE0; // top 4 bits int middle = ((ch & 0x0FC0) >> 6) | 0x80; // middle 6 bits int low = (ch & 0x3F) | 0x80; // First 6 bits, + high bit writer.write('%'); writer.write(makeHHString(high)); writer.write('%'); writer.write(makeHHString(middle)); writer.write('%'); writer.write(makeHHString(low)); } } else if (escapingNotNeeded(ch)) { writer.write(ch); } else { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } // In this character range we have first written out any previously accumulated // "clean" characters, then processed the current more complicated character, // which may have incremented "i". // We now we reset the next possible clean character. cleanStart = i + 1; } // Since http://www.ietf.org/rfc/rfc2396.txt refers to the URI grammar as // not allowing quotes in the URI proper syntax, nor in the fragment // identifier, we believe that it's OK to double escape quotes. else if (ch == '"') { // If the character is a '%' number number, try to avoid double-escaping. // There is a question if this is legal behavior. // Dmitri Ilyin: to check if '%' number number is invalid. It must be checked if %xx is a sign, that would be encoded // The encoded signes are in Hex form. So %xx my be in form %3C that is "<" sign. I will try to change here a little. // if( ((i+2) < len) && isASCIIDigit(stringArray[i+1]) && isASCIIDigit(stringArray[i+2]) ) // We are no longer escaping '%' if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } // Mike Kay encodes this as &#34;, so he may know something I don't? if (doURLEscaping) writer.write("%22"); else writer.write("&quot;"); // we have to escape this, I guess. // We have written out any clean characters, then the escaped '%' and now we // We now we reset the next possible clean character. cleanStart = i + 1; } else if (ch == '&') { // HTML 4.01 reads, "Authors should use "&amp;" (ASCII decimal 38) // instead of "&" to avoid confusion with the beginning of a character // reference (entity reference open delimiter). if (cleanLength > 0) { writer.write(chars, cleanStart, cleanLength); cleanLength = 0; } writer.write("&amp;"); cleanStart = i + 1; } else { // no processing for this character, just count how // many characters in a row that we have that need no processing cleanLength++; } } // are there any clean characters at the end of the array // that we haven't processed yet? if (cleanLength > 1) { // if the whole string can be written out as-is do so // otherwise write out the clean chars at the end of the // array if (cleanStart == 0) writer.write(string); else writer.write(chars, cleanStart, cleanLength); } else if (cleanLength == 1) { // a little optimization for 1 clean character // (we could have let the previous if(...) handle them all) writer.write(ch); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void writeAttrString( final java.io.Writer writer, String string, String encoding) throws IOException { final int end = string.length(); if (end > m_attrBuff.length) { m_attrBuff = new char[end * 2 + 1]; } string.getChars(0, end, m_attrBuff, 0); final char[] chars = m_attrBuff; int cleanStart = 0; int cleanLength = 0; char ch = 0; for (int i = 0; i < end; i++) { ch = chars[i]; // System.out.println("SPECIALSSIZE: "+SPECIALSSIZE); // System.out.println("ch: "+(int)ch); // System.out.println("m_maxCharacter: "+(int)m_maxCharacter); // System.out.println("m_attrCharsMap[ch]: "+(int)m_attrCharsMap[ch]); if (escapingNotNeeded(ch) && (!m_charInfo.shouldMapAttrChar(ch))) { cleanLength++; } else if ('<' == ch || '>' == ch) { cleanLength++; // no escaping in this case, as specified in 15.2 } else if ( ('&' == ch) && ((i + 1) < end) && ('{' == chars[i + 1])) { cleanLength++; // no escaping in this case, as specified in 15.2 } else { if (cleanLength > 0) { writer.write(chars,cleanStart,cleanLength); cleanLength = 0; } int pos = accumDefaultEntity(writer, ch, i, chars, end, false, true); if (i != pos) { i = pos - 1; } else { if (Encodings.isHighUTF16Surrogate(ch)) { writeUTF16Surrogate(ch, chars, i, end); i++; // two input characters processed // this increments by one and the for() // loop itself increments by another one. } // The next is kind of a hack to keep from escaping in the case // of Shift_JIS and the like. /* else if ((ch < m_maxCharacter) && (m_maxCharacter == 0xFFFF) && (ch != 160)) { writer.write(ch); // no escaping in this case } else */ String outputStringForChar = m_charInfo.getOutputStringForChar(ch); if (null != outputStringForChar) { writer.write(outputStringForChar); } else if (escapingNotNeeded(ch)) { writer.write(ch); // no escaping in this case } else { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } } cleanStart = i + 1; } } // end of for() // are there any clean characters at the end of the array // that we haven't processed yet? if (cleanLength > 1) { // if the whole string can be written out as-is do so // otherwise write out the clean chars at the end of the // array if (cleanStart == 0) writer.write(string); else writer.write(chars, cleanStart, cleanLength); } else if (cleanLength == 1) { // a little optimization for 1 clean character // (we could have let the previous if(...) handle them all) writer.write(ch); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException,SAXException { /* * process the collected attributes */ for (int i = 0; i < nAttrs; i++) { processAttribute( writer, m_attributes.getQName(i), m_attributes.getValue(i), m_elemContext.m_elementDesc); } }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void serialize(Node node) throws IOException { return; }
// in src/org/apache/xml/serializer/ToStream.java
public void serialize(Node node) throws IOException { try { TreeWalker walker = new TreeWalker(this); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/ToStream.java
void outputEntityDecl(String name, String value) throws IOException { final java.io.Writer writer = m_writer; writer.write("<!ENTITY "); writer.write(name); writer.write(" \""); writer.write(value); writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); }
// in src/org/apache/xml/serializer/ToStream.java
protected final void outputLineSep() throws IOException { m_writer.write(m_lineSep, 0, m_lineSepLen); }
// in src/org/apache/xml/serializer/ToStream.java
protected void indent(int depth) throws IOException { if (m_startNewLine) outputLineSep(); /* For m_indentAmount > 0 this extra test might be slower * but Xalan's default value is 0, so this extra test * will run faster in that situation. */ if (m_indentAmount > 0) printSpace(depth * m_indentAmount); }
// in src/org/apache/xml/serializer/ToStream.java
protected void indent() throws IOException { indent(m_elemContext.m_currentElemDepth); }
// in src/org/apache/xml/serializer/ToStream.java
private void printSpace(int n) throws IOException { final java.io.Writer writer = m_writer; for (int i = 0; i < n; i++) { writer.write(' '); } }
// in src/org/apache/xml/serializer/ToStream.java
protected int writeUTF16Surrogate(char c, char ch[], int i, int end) throws IOException { int codePoint = 0; if (i + 1 >= end) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c)})); } final char high = c; final char low = ch[i+1]; if (!Encodings.isLowUTF16Surrogate(low)) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString((int) c) + " " + Integer.toHexString(low)})); } final java.io.Writer writer = m_writer; // If we make it to here we have a valid high, low surrogate pair if (m_encodingInfo.isInEncoding(c,low)) { // If the character formed by the surrogate pair // is in the encoding, so just write it out writer.write(ch,i,2); } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref final String encoding = getEncoding(); if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ codePoint = Encodings.toCodePoint(high, low); // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(codePoint)); writer.write(';'); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(ch, i, 2); } } // non-zero only if character reference was written out. return codePoint; }
// in src/org/apache/xml/serializer/ToStream.java
int accumDefaultEntity( java.io.Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { if (!escLF && CharInfo.S_LINEFEED == ch) { writer.write(m_lineSep, 0, m_lineSepLen); } else { // if this is text node character and a special one of those, // or if this is a character from attribute value and a special one of those if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch))) { String outputStringForChar = m_charInfo.getOutputStringForChar(ch); if (null != outputStringForChar) { writer.write(outputStringForChar); } else return i; } else return i; } return i + 1; }
// in src/org/apache/xml/serializer/ToStream.java
void writeNormalizedChars( char ch[], int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException { final java.io.Writer writer = m_writer; int end = start + length; for (int i = start; i < end; i++) { char c = ch[i]; if (CharInfo.S_LINEFEED == c && useSystemLineSeparator) { writer.write(m_lineSep, 0, m_lineSepLen); } else if (isCData && (!escapingNotNeeded(c))) { // if (i != 0) if (m_cdataTagOpen) closeCDATA(); // This needs to go into a function... if (Encodings.isHighUTF16Surrogate(c)) { writeUTF16Surrogate(c, ch, i, end); i++ ; // process two input characters } else { writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } // if ((i != 0) && (i < (end - 1))) // if (!m_cdataTagOpen && (i < (end - 1))) // { // writer.write(CDATA_DELIMITER_OPEN); // m_cdataTagOpen = true; // } } else if ( isCData && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1]) && ('>' == ch[i + 2]))) { writer.write(CDATA_CONTINUE); i += 2; } else { if (escapingNotNeeded(c)) { if (isCData && !m_cdataTagOpen) { writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } writer.write(c); } // This needs to go into a function... else if (Encodings.isHighUTF16Surrogate(c)) { if (m_cdataTagOpen) closeCDATA(); writeUTF16Surrogate(c, ch, i, end); i++; // process two input characters } else { if (m_cdataTagOpen) closeCDATA(); writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
private int processLineFeed(final char[] chars, int i, int lastProcessed, final Writer writer) throws IOException { if (!m_lineSepUse || (m_lineSepLen ==1 && m_lineSep[0] == CharInfo.S_LINEFEED)){ // We are leaving the new-line alone, and it is just // being added to the 'clean' characters, // so the last dirty character processed remains unchanged } else { writeOutCleanChars(chars, i, lastProcessed); writer.write(m_lineSep, 0, m_lineSepLen); lastProcessed = i; } return lastProcessed; }
// in src/org/apache/xml/serializer/ToStream.java
private void writeOutCleanChars(final char[] chars, int i, int lastProcessed) throws IOException { int startClean; startClean = lastProcessed + 1; if (startClean < i) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } }
// in src/org/apache/xml/serializer/ToStream.java
private int processDirty( char[] chars, int end, int i, char ch, int lastDirty, boolean fromTextNode) throws IOException { int startClean = lastDirty + 1; // if we have some clean characters accumulated // process them before the dirty one. if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // process the "dirty" character if (CharInfo.S_LINEFEED == ch && fromTextNode) { m_writer.write(m_lineSep, 0, m_lineSepLen); } else { startClean = accumDefaultEscape( m_writer, (char)ch, i, chars, end, fromTextNode, false); i = startClean - 1; } // Return the index of the last character that we just processed // which is a dirty character. return i; }
// in src/org/apache/xml/serializer/ToStream.java
private int accumDefaultEscape( Writer writer, char ch, int i, char[] chars, int len, boolean fromTextNode, boolean escLF) throws IOException { int pos = accumDefaultEntity(writer, ch, i, chars, len, fromTextNode, escLF); if (i == pos) { if (Encodings.isHighUTF16Surrogate(ch)) { // Should be the UTF-16 low surrogate of the hig/low pair. char next; // Unicode code point formed from the high/low pair. int codePoint = 0; if (i + 1 >= len) { throw new IOException( Utils.messages.createMessage( MsgKey.ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = chars[++i]; if (!(Encodings.isLowUTF16Surrogate(next))) throw new IOException( Utils.messages.createMessage( MsgKey .ER_INVALID_UTF16_SURROGATE, new Object[] { Integer.toHexString(ch) + " " + Integer.toHexString(next)})); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); codePoint = Encodings.toCodePoint(ch,next); } writer.write("&#"); writer.write(Integer.toString(codePoint)); writer.write(';'); pos += 2; // count the two characters that went into writing out this entity } else { /* This if check is added to support control characters in XML 1.1. * If a character is a Control Character within C0 and C1 range, it is desirable * to write it out as Numeric Character Reference(NCR) regardless of XML Version * being used for output document. */ if (isCharacterInC0orC1Range(ch) || isNELorLSEPCharacter(ch)) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if ((!escapingNotNeeded(ch) || ( (fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))) && m_elemContext.m_currentElemDepth > 0) { writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else { writer.write(ch); } pos++; // count the single character that was processed } } return pos; }
// in src/org/apache/xml/serializer/ToStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException { /* real SAX attributes are not passed in, so process the * attributes that were collected after the startElement call. * _attribVector is a "cheap" list for Stream serializer output * accumulated over a series of calls to attribute(name,value) */ String encoding = getEncoding(); for (int i = 0; i < nAttrs; i++) { // elementAt is JDK 1.1.8 final String name = m_attributes.getQName(i); final String value = m_attributes.getValue(i); writer.write(' '); writer.write(name); writer.write("=\""); writeAttrString(writer, value, encoding); writer.write('\"'); } }
// in src/org/apache/xml/serializer/ToStream.java
public void writeAttrString( Writer writer, String string, String encoding) throws IOException { final int len = string.length(); if (len > m_attrBuff.length) { m_attrBuff = new char[len*2 + 1]; } string.getChars(0,len, m_attrBuff, 0); final char[] stringChars = m_attrBuff; for (int i = 0; i < len; i++) { char ch = stringChars[i]; if (m_charInfo.shouldMapAttrChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" accumDefaultEscape(writer, ch, i, stringChars, len, false, true); } else { if (0x0 <= ch && ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: writer.write("&#9;"); break; case CharInfo.S_LINEFEED: writer.write("&#10;"); break; case CharInfo.S_CARRIAGERETURN: writer.write("&#13;"); break; default: writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars writer.write(ch); } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writer.write("&#8232;"); } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just write it out writer.write(ch); } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out a character ref writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void write(char[] arg0, int arg1, int arg2) throws IOException { m_stringbuf.append(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/ToStream.java
public void flush() throws IOException { }
// in src/org/apache/xml/serializer/ToStream.java
public void close() throws IOException { }
// in src/org/apache/xml/serializer/ToStream.java
private void DTDprolog() throws SAXException, IOException { final java.io.Writer writer = m_writer; if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } if (m_inDoctype) { writer.write(" ["); writer.write(m_lineSep, 0, m_lineSepLen); m_inDoctype = false; } }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
public void serializeDOM3(Node node) throws IOException { try { DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler, fErrorHandler, fSerializerFilter, fNewLine); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowIOException() throws IOException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public ContentHandler asContentHandler() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void serialize(Node node) throws IOException { couldThrowIOException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public DOMSerializer asDOMSerializer() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public Object asDOM3Serializer() throws IOException { couldThrowIOException(); return null; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String getTreeAsText(String treeURL) throws IOException { m_treeURL = treeURL; m_trustedAgent.m_getData = true; m_trustedAgent.m_getSource = true; m_callThread = Thread.currentThread(); try { synchronized (m_callThread) { m_callThread.wait(); } } catch (InterruptedException ie) { System.out.println(ie.getMessage()); } return m_sourceText; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private void readObject(java.io.ObjectInputStream inStream) throws IOException, ClassNotFoundException { inStream.defaultReadObject(); // Needed assignment of non-serialized fields // A TransformerFactory is not guaranteed to be serializable, // so we create one here m_tfactory = TransformerFactory.newInstance(); }
// in src/org/apache/xalan/xsltc/runtime/output/TransletOutputHandlerFactory.java
public SerializationHandler getSerializationHandler() throws IOException, ParserConfigurationException { SerializationHandler result = null; switch (_outputType) { case STREAM : if (_method == null) { result = new ToUnknownStream(); } else if (_method.equalsIgnoreCase("xml")) { result = new ToXMLStream(); } else if (_method.equalsIgnoreCase("html")) { result = new ToHTMLStream(); } else if (_method.equalsIgnoreCase("text")) { result = new ToTextStream(); } if (result != null && _indentNumber >= 0) { result.setIndentAmount(_indentNumber); } result.setEncoding(_encoding); if (_writer != null) { result.setWriter(_writer); } else { result.setOutputStream(_ostream); } return result; case DOM : _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling) : new SAX2DOM(); _lexHandler = (LexicalHandler) _handler; // falls through case SAX : if (_method == null) { _method = "xml"; // default case } if (_lexHandler == null) { result = new ToXMLSAXHandler(_handler, _encoding); } else { result = new ToXMLSAXHandler( _handler, _lexHandler, _encoding); } return result; } return null; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
private String entryName(File f) throws IOException { return f.getName().replace(File.separatorChar, '/'); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
public void outputToJar() throws IOException { // create the manifest final Manifest manifest = new Manifest(); final java.util.jar.Attributes atrs = manifest.getMainAttributes(); atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.2"); final Map map = manifest.getEntries(); // create manifest Enumeration classes = _bcelClasses.elements(); final String now = (new Date()).toString(); final java.util.jar.Attributes.Name dateAttr = new java.util.jar.Attributes.Name("Date"); while (classes.hasMoreElements()) { final JavaClass clazz = (JavaClass)classes.nextElement(); final String className = clazz.getClassName().replace('.','/'); final java.util.jar.Attributes attr = new java.util.jar.Attributes(); attr.put(dateAttr, now); map.put(className+".class", attr); } final File jarFile = new File(_destDir, _jarFileName); final JarOutputStream jos = new JarOutputStream(new FileOutputStream(jarFile), manifest); classes = _bcelClasses.elements(); while (classes.hasMoreElements()) { final JavaClass clazz = (JavaClass)classes.nextElement(); final String className = clazz.getClassName().replace('.','/'); jos.putNextEntry(new JarEntry(className+".class")); final ByteArrayOutputStream out = new ByteArrayOutputStream(2048); clazz.dump(out); // dump() closes it's output stream out.writeTo(jos); } jos.close(); }
// in src/org/apache/xalan/xsltc/compiler/util/MarkerInstruction.java
final public void dump(DataOutputStream out) throws IOException { }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(_bitSize); out.writeInt(_mask); out.writeObject(_bits); out.flush(); }
// in src/org/apache/xalan/xsltc/dom/BitArray.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { _bitSize = in.readInt(); _intSize = (_bitSize >>> 5) + 1; _mask = in.readInt(); _bits = (int[])in.readObject(); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _handler.startDocument(); parse(_dom); _handler.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
private void parse(Node node) throws IOException, SAXException { if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: _handler.startCDATA(); _handler.characters(node.getNodeValue()); _handler.endCDATA(); break; case Node.COMMENT_NODE: // should be handled!!! _handler.comment(node.getNodeValue()); break; case Node.DOCUMENT_NODE: _handler.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _handler.endDocument(); break; case Node.DOCUMENT_FRAGMENT_NODE: next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } break; case Node.ELEMENT_NODE: // Generate SAX event to start element final String qname = node.getNodeName(); _handler.startElement(null, null, qname); int colon; String prefix; final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace attributes first for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a namespace declaration? if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uriAttr); } } // Process all non-namespace attributes next NamespaceMappings nm = new NamespaceMappings(); for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a regular attribute? if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); // Uri may be implicitly declared if (uriAttr != null && !uriAttr.equals(EMPTYSTRING) ) { colon = qnameAttr.lastIndexOf(':'); // Fix for bug 26319 // For attributes not given an prefix explictly // but having a namespace uri we need // to explicitly generate the prefix String newPrefix = nm.lookupPrefix(uriAttr); if (newPrefix == null) newPrefix = nm.generateNextPrefix(); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : newPrefix; _handler.namespaceAfterStartElement(prefix, uriAttr); _handler.addAttribute((prefix + ":" + qnameAttr), attr.getNodeValue()); } else { _handler.addAttribute(qnameAttr, attr.getNodeValue()); } } } // Now element namespace and children final String uri = node.getNamespaceURI(); final String localName = node.getLocalName(); // Uri may be implicitly declared if (uri != null) { colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uri); }else { // Fix for bug 26319 // If an element foo is created using // createElementNS(null,locName) // then the element should be serialized // <foo xmlns=" "/> if (uri == null && localName != null) { prefix = EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, EMPTYSTRING); } } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _handler.endElement(qname); break; case Node.PROCESSING_INSTRUCTION_NODE: _handler.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: _handler.characters(node.getNodeValue()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _sax.startDocument(); parse(_dom); _sax.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void parse(Node node) throws IOException, SAXException { Node first = null; if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_FRAGMENT_NODE: case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: final String cdata = node.getNodeValue(); if (_lex != null) { _lex.startCDATA(); _sax.characters(cdata.toCharArray(), 0, cdata.length()); _lex.endCDATA(); } else { // in the case where there is no lex handler, we still // want the text of the cdate to make its way through. _sax.characters(cdata.toCharArray(), 0, cdata.length()); } break; case Node.COMMENT_NODE: // should be handled!!! if (_lex != null) { final String value = node.getNodeValue(); _lex.comment(value.toCharArray(), 0, value.length()); } break; case Node.DOCUMENT_NODE: _sax.setDocumentLocator(this); _sax.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _sax.endDocument(); break; case Node.ELEMENT_NODE: String prefix; List pushedPrefixes = new ArrayList(); final AttributesImpl attrs = new AttributesImpl(); final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace declarations for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore everything but NS declarations here if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } } // Process all other attributes for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore NS declarations here if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); final String localNameAttr = getLocalName(attr); // Uri may be implicitly declared if (uriAttr != null) { final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } // Add attribute to list attrs.addAttribute(attr.getNamespaceURI(), getLocalName(attr), qnameAttr, "CDATA", attr.getNodeValue()); } } // Now process the element itself final String qname = node.getNodeName(); final String uri = node.getNamespaceURI(); final String localName = getLocalName(node); // Uri may be implicitly declared if (uri != null) { final int colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uri)) { pushedPrefixes.add(prefix); } } // Generate SAX event to start element if (_saxImpl != null) { _saxImpl.startElement(uri, localName, qname, attrs, node); } else { _sax.startElement(uri, localName, qname, attrs); } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _sax.endElement(uri, localName, qname); // Generate endPrefixMapping() for all pushed prefixes final int nPushedPrefixes = pushedPrefixes.size(); for (int i = 0; i < nPushedPrefixes; i++) { endPrefixMapping((String) pushedPrefixes.get(i)); } break; case Node.PROCESSING_INSTRUCTION_NODE: _sax.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: final String data = node.getNodeValue(); _sax.characters(data.toCharArray(), 0, data.length()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException { is.defaultReadObject(); if (is.readBoolean()) { _uriResolver = (URIResolver) is.readObject(); } _tfactory = new TransformerFactoryImpl(); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void writeObject(ObjectOutputStream os) throws IOException, ClassNotFoundException { os.defaultWriteObject(); if (_uriResolver instanceof Serializable) { os.writeBoolean(true); os.writeObject((Serializable) _uriResolver); } else { os.writeBoolean(false); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
private void readFromInputStream(byte[] bytes, InputStream input, int size) throws IOException { int n = 0; int offset = 0; int length = size; while (length > 0 && (n = input.read(bytes, offset, length)) > 0) { offset = offset + n; length = length - n; } }
// in src/org/apache/xalan/templates/ElemForEach.java
private void readObject(ObjectInputStream os) throws IOException, ClassNotFoundException { os.defaultReadObject(); m_xpath = null; }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/Stylesheet.java
private void writeObject(ObjectOutputStream stream) throws IOException { // System.out.println("Writing Stylesheet"); stream.defaultWriteObject(); // System.out.println("Done writing Stylesheet"); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (String systemId) throws org.xml.sax.SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (m_entityResolver != null) { return m_entityResolver.resolveEntity(publicId, systemId); } else { return null; } }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public ContentHandler asContentHandler() throws IOException { return m_serializer.asContentHandler(); }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public DOMSerializer asDOMSerializer() throws IOException { if (m_old_DOMSerializer == null) { m_old_DOMSerializer = new DOMSerializerWrapper(m_serializer.asDOMSerializer()); } return m_old_DOMSerializer; }
// in src/org/apache/xalan/serialize/SerializerFactory.java
public void serialize(Node node) throws IOException { m_dom.serialize(node); }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/lib/Redirect.java
public SerializationHandler createSerializationHandler( TransformerImpl transformer, FileOutputStream ostream, File file, OutputProperties format) throws java.io.IOException, TransformerException { SerializationHandler serializer = transformer.createSerializationHandler( new StreamResult(ostream), format); return serializer; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException {}
// in src/org/apache/xpath/SourceTreeManager.java
public Source resolveURI( String base, String urlString, SourceLocator locator) throws TransformerException, IOException { Source source = null; if (null != m_uriResolver) { source = m_uriResolver.resolve(urlString, base); } if (null == source) { String uri = SystemIDResolver.getAbsoluteURI(urlString, base); source = new StreamSource(uri); } return source; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
139
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(IOException ex) { arg=ex; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (IOException ex) { arg = ex; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/SerializerBase.java
catch(IOException ioe) { }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch(IOException e) { // what? me worry? }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { // ignore ? }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (IOException e) { if (_xsltc.debug()) e.printStackTrace(); reportError(ERROR,new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/XSLTC.java
catch (IOException e) { _parser.reportError(Constants.FATAL, new ErrorMsg(e)); return false; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (java.io.IOException e) { }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { continue; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.io.IOException ioe){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(IOException ioe){}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/xslt/Process.java
catch(java.io.IOException ie) {}
// in src/org/apache/xalan/xslt/Process.java
catch (java.io.IOException e) { }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException x) { // No provider found return null; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (IOException exc) {}
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
58
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
8
unknown (Lib) IllegalAccessException 0 0 3
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
8
            
// in src/org/apache/xml/utils/ObjectPool.java
catch (IllegalAccessException ex){}
// in src/org/apache/xml/dtm/DTMException.java
catch (IllegalAccessException iae) { exception = null; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (IllegalAccessException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae); return false; }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
2
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
0
runtime (Domain) IllegalArgumentException
class IllegalArgumentException extends GetOptsException{
    static final long serialVersionUID = 8642122427294793651L;
    public IllegalArgumentException(String msg){
	super(msg);
    }
}
72
            
// in src/org/apache/xml/dtm/DTMException.java
public synchronized Throwable initCause(Throwable cause) { if ((this.containedException == null) && (cause != null)) { throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause"); } if (cause == this) { throw new IllegalArgumentException( XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted"); } this.containedException = cause; return this; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node) { if(null == node) throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!"); if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy) return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber(); else { // Find the DOM2DTMs wrapped around this Document (if any) // and check whether they contain the Node in question. // // NOTE that since a DOM2DTM may represent a subtree rather // than a full document, we have to be prepared to check more // than one -- and there is no guarantee that we will find // one that contains ancestors or siblings of the node we're // seeking. // // %REVIEW% We could search for the one which contains this // node at the deepest level, and thus covers the widest // subtree, but that's going to entail additional work // checking more DTMs... and getHandleOfNode is not a // cheap operation in most implementations. // // TODO: %REVIEW% If overflow addressing, we may recheck a DTM // already examined. Ouch. But with the increased number of DTMs, // scanning back to check this is painful. // POSSIBLE SOLUTIONS: // Generate a list of _unique_ DTM objects? // Have each DTM cache last DOM node search? int max = m_dtms.length; for(int i = 0; i < max; i++) { DTM thisDTM=m_dtms[i]; if((null != thisDTM) && thisDTM instanceof DOM2DTM) { int handle=((DOM2DTM)thisDTM).getHandleOfNode(node); if(handle!=DTM.NULL) return handle; } } // Not found; generate a new DTM. // // %REVIEW% Is this really desirable, or should we return null // and make folks explicitly instantiate from a DOMSource? The // latter is more work but gives the caller the opportunity to // explicitly add the DTM to a DTMManager... and thus to know when // it can be discarded again, which is something we need to pay much // more attention to. (Especially since only DTMs which are assigned // to a manager can use the overflow addressing scheme.) // // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode // and the DTM wasn't registered with this DTMManager, we will create // a new DTM and _still_ not be able to find the node (since it will // be resynthesized). Another reason to push hard on making all DTMs // be managed DTMs. // Since the real root of our tree may be a DocumentFragment, we need to // use getParent to find the root, instead of getOwnerDocument. Otherwise // DOM2DTM#getHandleOfNode will be very unhappy. Node root = node; Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode(); for (; p != null; p = p.getParentNode()) { root = p; } DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root), false, null, true, true); int handle; if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode) { // Can't return the same node since it's unique to a specific DTM, // but can return the equivalent node -- find the corresponding // Document Element, then ask it for the xml: namespace decl. handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement()); handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName()); } else handle = ((DOM2DTM)dtm).getHandleOfNode(node); if(DTM.NULL == handle) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!"); return handle; } }
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { _result = result; if (null == result) { ErrorMsg err = new ErrorMsg(ErrorMsg.ER_RESULT_NULL); throw new IllegalArgumentException(err.toString()); //"result should not be null"); } if (_isIdentity) { try { // Connect this object with output system directly SerializationHandler outputHandler = _transformer.getOutputHandler(result); _transformer.transferOutputProperties(outputHandler); _handler = outputHandler; _lexHandler = outputHandler; } catch (TransformerException e) { _result = null; } } else if (_done) { // Run the transformation now, if not already done try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "TransformerFactory"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // Return value for attribute 'translet-name' if (name.equals(TRANSLET_NAME)) { return _transletName; } else if (name.equals(GENERATE_TRANSLET)) { return _generateTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(AUTO_TRANSLET)) { return _autoTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(ENABLE_INLINING)) { if (_enableInlining) return Boolean.TRUE; else return Boolean.FALSE; } // Throw an exception for all other attributes ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // Set the default translet name (ie. class name), which will be used // for translets that cannot be given a name from their system-id. if (name.equals(TRANSLET_NAME) && value instanceof String) { _transletName = (String) value; return; } else if (name.equals(DESTINATION_DIRECTORY) && value instanceof String) { _destinationDirectory = (String) value; return; } else if (name.equals(PACKAGE_NAME) && value instanceof String) { _packageName = (String) value; return; } else if (name.equals(JAR_NAME) && value instanceof String) { _jarFileName = (String) value; return; } else if (name.equals(GENERATE_TRANSLET)) { if (value instanceof Boolean) { _generateTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _generateTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(AUTO_TRANSLET)) { if (value instanceof Boolean) { _autoTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _autoTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(USE_CLASSPATH)) { if (value instanceof Boolean) { _useClasspath = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _useClasspath = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(DEBUG)) { if (value instanceof Boolean) { _debug = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _debug = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(ENABLE_INLINING)) { if (value instanceof Boolean) { _enableInlining = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _enableInlining = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(INDENT_NUMBER)) { if (value instanceof String) { try { _indentNumber = Integer.parseInt((String) value); return; } catch (NumberFormatException e) { // Falls through } } else if (value instanceof Integer) { _indentNumber = ((Integer) value).intValue(); return; } } // Throw an exception for all other attributes final ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "Transformer"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; // Register a message handler to report xsl:messages if (_translet != null) _translet.setMessageHandler(new MessageHandler(_errorListener)); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } return _properties.getProperty(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperties(Properties properties) throws IllegalArgumentException { if (properties != null) { final Enumeration names = properties.propertyNames(); while (names.hasMoreElements()) { final String name = (String) names.nextElement(); // Ignore lower layer properties if (isDefaultProperty(name, properties)) continue; if (validOutputProperty(name)) { _properties.setProperty(name, properties.getProperty(name)); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } } } else { _properties = _propertiesClone; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } _properties.setProperty(name, value); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setParameter(String name, Object value) { if (value == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_SET_PARAM_VALUE, name); throw new IllegalArgumentException(err.toString()); } if (_isIdentity) { if (_parameters == null) { _parameters = new Hashtable(); } _parameters.put(name, value); } else { _translet.addParameter(name, value); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return m_incremental ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_OPTIMIZE)) { return m_optimize ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return m_source_location ? Boolean.TRUE : Boolean.FALSE; } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
// in src/org/apache/xalan/templates/ElemAttribute.java
public void setName(AVT v) { if (v.isSimple()) { if (v.getSimpleString().equals("xmlns")) { throw new IllegalArgumentException(); } } super.setName(v); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void copyFrom(Properties src, boolean shouldResetDefaults) { Enumeration keys = src.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (!isLegalPropertyKey(key)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{key})); //"output property not recognized: " Object oldValue = m_properties.get(key); if (null == oldValue) { String val = (String) src.get(key); if(shouldResetDefaults && key.equals(OutputKeys.METHOD)) { setMethodDefaults(val); } m_properties.put(key, val); } else if (key.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) { m_properties.put(key, (String) oldValue + " " + (String) src.get(key)); } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { if (null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null"); try { // ContentHandler handler = // m_transformer.createResultContentHandler(result); // m_transformer.setContentHandler(handler); SerializationHandler xoh = m_transformer.createSerializationHandler(result); m_transformer.setSerializationHandler(xoh); } catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); } m_result = result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputProperty(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = props.getProperty(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " //+ qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputPropertyNoDefault(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = (String) props.getProperties().get(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " // + qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { synchronized (m_reentryGuard) { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. if (null == m_outputFormat) { m_outputFormat = (OutputProperties) getStylesheet().getOutputComposed().clone(); } if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } StringTokenizer tokenizer = new StringTokenizer(name, "{}", false); try { // The first string might be the namespace, or it might be // the local name, if the namespace is null. String s1 = tokenizer.nextToken(); String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null; if (null == m_userParams) m_userParams = new Vector(); if (null == s2) { replaceOrPushUserParam(new QName(s1), XObject.create(value, getXPathContext())); setParameter(s1, null, value); } else { replaceOrPushUserParam(new QName(s1, s2), XObject.create(value, getXPathContext())); setParameter(s2, s1, value); } } catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setResult(Result result) throws IllegalArgumentException { if(null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null"); m_result = result; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setParameter(String name, Object value) { if (value == null) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_SET_PARAM_VALUE, new Object[]{name})); } if (null == m_params) { m_params = new Hashtable(); } m_params.put(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { String value = null; OutputProperties props = m_outputFormat; value = props.getProperty(name); if (null == value) { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " // + name); } return value; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); else m_errorListener = listener; }
// in src/org/apache/xalan/lib/sql/ConnectionPoolManager.java
public synchronized void registerPool( String name, ConnectionPool pool ) { if ( m_poolTable.containsKey(name) ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOL_EXISTS, null)); //"Pool already exists"); } m_poolTable.put(name, pool); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xalan/lib/sql/XConnection.java
public XBooleanStatic connect( ExpressionContext exprContext, String name ) { try { m_ConnectionPool = m_PoolMgr.getPool(name); if (m_ConnectionPool == null) { //Try to create a jndi source with the passed name ConnectionPool pool = new JNDIConnectionPool(name); if (pool.testConnection()) { //JNDIConnectionPool seems good, so register it with the pool manager. //Once registered, it will show up like other named ConnectionPool's, //so the m_PoolMgr.getPool(name) method (above) will find it. m_PoolMgr.registerPool(name, pool); m_ConnectionPool = pool; m_IsDefaultPool = false; return new XBooleanStatic(true); } else { throw new IllegalArgumentException( "Invalid ConnectionPool name or JNDI Datasource path: " + name); } } else { m_IsDefaultPool = false; return new XBooleanStatic(true); } } catch (Exception e) { setError(e, exprContext); return new XBooleanStatic(false); } }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
public XPathFunction resolveFunction(QName qname, int arity) { if (qname == null) throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NULL_QNAME, null)); if (arity < 0) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NEGATIVE_ARITY, null)); String uri = qname.getNamespaceURI(); if (uri == null || uri.length() == 0) return null; String className = null; String methodName = null; if (uri.startsWith("http://exslt.org")) { className = getEXSLTClassName(uri); methodName = qname.getLocalPart(); } else if (!uri.equals(ExtensionNamespaceContext.JAVA_EXT_URI)) { int lastSlash = className.lastIndexOf('/'); if (-1 != lastSlash) className = className.substring(lastSlash + 1); } String localPart = qname.getLocalPart(); int lastDotIndex = localPart.lastIndexOf('.'); if (lastDotIndex > 0) { if (className != null) className = className + "." + localPart.substring(0, lastDotIndex); else className = localPart.substring(0, lastDotIndex); methodName = localPart.substring(lastDotIndex + 1); } else methodName = localPart; if(null == className || className.trim().length() == 0 || null == methodName || methodName.trim().length() == 0) return null; ExtensionHandler handler = null; try { ExtensionHandler.getClassForName(className); handler = new ExtensionHandlerJavaClass(uri, "javaclass", className); } catch (ClassNotFoundException e) { return null; } return new XPathFunctionImpl(handler, methodName); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public String getNamespaceURI(String prefix) { if (prefix == null) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_NAMESPACE_CONTEXT_NULL_PREFIX, null)); if (prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) return XMLConstants.NULL_NS_URI; else if (prefix.equals(XMLConstants.XML_NS_PREFIX)) return XMLConstants.XML_NS_URI; else if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) return XMLConstants.XMLNS_ATTRIBUTE_NS_URI; else if (prefix.equals(EXSLT_PREFIX)) return EXSLT_URI; else if (prefix.equals(EXSLT_MATH_PREFIX)) return EXSLT_MATH_URI; else if (prefix.equals(EXSLT_SET_PREFIX)) return EXSLT_SET_URI; else if (prefix.equals(EXSLT_STRING_PREFIX)) return EXSLT_STRING_URI; else if (prefix.equals(EXSLT_DATETIME_PREFIX)) return EXSLT_DATETIME_URI; else if (prefix.equals(EXSLT_DYNAMIC_PREFIX)) return EXSLT_DYNAMIC_URI; else if (prefix.equals(JAVA_EXT_PREFIX)) return JAVA_EXT_URI; else return XMLConstants.NULL_NS_URI; }
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public String getPrefix(String namespace) { if (namespace == null) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_NAMESPACE_CONTEXT_NULL_NAMESPACE, null)); if (namespace.equals(XMLConstants.XML_NS_URI)) return XMLConstants.XML_NS_PREFIX; else if (namespace.equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) return XMLConstants.XMLNS_ATTRIBUTE; else if (namespace.equals(EXSLT_URI)) return EXSLT_PREFIX; else if (namespace.equals(EXSLT_MATH_URI)) return EXSLT_MATH_PREFIX; else if (namespace.equals(EXSLT_SET_URI)) return EXSLT_SET_PREFIX; else if (namespace.equals(EXSLT_STRING_URI)) return EXSLT_STRING_PREFIX; else if (namespace.equals(EXSLT_DATETIME_URI)) return EXSLT_DATETIME_PREFIX; else if (namespace.equals(EXSLT_DYNAMIC_URI)) return EXSLT_DYNAMIC_PREFIX; else if (namespace.equals(JAVA_EXT_URI)) return JAVA_EXT_PREFIX; else return null; }
// in src/org/apache/xpath/XPathContext.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorListener = listener; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } // If isSupported check is already done then the execution path // shouldn't come here. Being defensive String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException ( fmsg ); }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean isObjectModelSupported(String objectModel) { if (objectModel == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_NULL, new Object[] { this.getClass().getName() } ); throw new NullPointerException( fmsg ); } if (objectModel.length() == 0) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_EMPTY, new Object[] { this.getClass().getName() } ); throw new IllegalArgumentException( fmsg ); } // know how to support default object model, W3C DOM if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) { return true; } // don't know how to support anything else return false; }
4
            
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); }
31
            
// in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
public int getNextOption() throws IllegalArgumentException, MissingOptArgException { int retval = -1; if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR, new Character(c)); throw (new IllegalArgumentException(msg.toString())); } else if(shouldHaveArg && (arg == null)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR, new Character(c)); throw (new MissingOptArgException(msg.toString())); } retval = c; } return retval; }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { _result = result; if (null == result) { ErrorMsg err = new ErrorMsg(ErrorMsg.ER_RESULT_NULL); throw new IllegalArgumentException(err.toString()); //"result should not be null"); } if (_isIdentity) { try { // Connect this object with output system directly SerializationHandler outputHandler = _transformer.getOutputHandler(result); _transformer.transferOutputProperties(outputHandler); _handler = outputHandler; _lexHandler = outputHandler; } catch (TransformerException e) { _result = null; } } else if (_done) { // Run the transformation now, if not already done try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "TransformerFactory"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // Return value for attribute 'translet-name' if (name.equals(TRANSLET_NAME)) { return _transletName; } else if (name.equals(GENERATE_TRANSLET)) { return _generateTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(AUTO_TRANSLET)) { return _autoTranslet ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(ENABLE_INLINING)) { if (_enableInlining) return Boolean.TRUE; else return Boolean.FALSE; } // Throw an exception for all other attributes ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // Set the default translet name (ie. class name), which will be used // for translets that cannot be given a name from their system-id. if (name.equals(TRANSLET_NAME) && value instanceof String) { _transletName = (String) value; return; } else if (name.equals(DESTINATION_DIRECTORY) && value instanceof String) { _destinationDirectory = (String) value; return; } else if (name.equals(PACKAGE_NAME) && value instanceof String) { _packageName = (String) value; return; } else if (name.equals(JAR_NAME) && value instanceof String) { _jarFileName = (String) value; return; } else if (name.equals(GENERATE_TRANSLET)) { if (value instanceof Boolean) { _generateTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _generateTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(AUTO_TRANSLET)) { if (value instanceof Boolean) { _autoTranslet = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _autoTranslet = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(USE_CLASSPATH)) { if (value instanceof Boolean) { _useClasspath = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _useClasspath = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(DEBUG)) { if (value instanceof Boolean) { _debug = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _debug = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(ENABLE_INLINING)) { if (value instanceof Boolean) { _enableInlining = ((Boolean) value).booleanValue(); return; } else if (value instanceof String) { _enableInlining = ((String) value).equalsIgnoreCase("true"); return; } } else if (name.equals(INDENT_NUMBER)) { if (value instanceof String) { try { _indentNumber = Integer.parseInt((String) value); return; } catch (NumberFormatException e) { // Falls through } } else if (value instanceof Integer) { _indentNumber = ((Integer) value).intValue(); return; } } // Throw an exception for all other attributes final ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); throw new IllegalArgumentException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR, "Transformer"); throw new IllegalArgumentException(err.toString()); } _errorListener = listener; // Register a message handler to report xsl:messages if (_translet != null) _translet.setMessageHandler(new MessageHandler(_errorListener)); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } return _properties.getProperty(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperties(Properties properties) throws IllegalArgumentException { if (properties != null) { final Enumeration names = properties.propertyNames(); while (names.hasMoreElements()) { final String name = (String) names.nextElement(); // Ignore lower layer properties if (isDefaultProperty(name, properties)) continue; if (validOutputProperty(name)) { _properties.setProperty(name, properties.getProperty(name)); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } } } else { _properties = _propertiesClone; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!validOutputProperty(name)) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name); throw new IllegalArgumentException(err.toString()); } _properties.setProperty(name, value); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { _errorlistener = listener; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { // GTM: NB: 'debug' should change to something more unique... if ((name.equals("translet-name")) || (name.equals("debug"))) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } return _xsltcFactory.getAttribute(name); } else { if (_xalanFactory == null) { createXalanTransformerFactory(); } return _xalanFactory.getAttribute(name); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { // GTM: NB: 'debug' should change to something more unique... if ((name.equals("translet-name")) || (name.equals("debug"))) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } _xsltcFactory.setAttribute(name, value); } else { if (_xalanFactory == null) { createXalanTransformerFactory(); } _xalanFactory.setAttribute(name, value); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setAttribute(String name, Object value) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_incremental = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_incremental = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else if (name.equals(FEATURE_OPTIMIZE)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_optimize = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_optimize = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } // Custom Xalan feature: annotate DTM with SAX source locator fields. // This gets used during SAX2DTM instantiation. // // %REVIEW% Should the name of this field really be in XalanProperties? // %REVIEW% I hate that it's a global static, but didn't want to change APIs yet. else if(name.equals(FEATURE_SOURCE_LOCATION)) { if(value instanceof Boolean) { // Accept a Boolean object.. m_source_location = ((Boolean)value).booleanValue(); } else if(value instanceof String) { // .. or a String object m_source_location = (new Boolean((String)value)).booleanValue(); } else { // Give a more meaningful error message throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_BAD_VALUE, new Object[]{name, value})); //name + " bad value " + value); } } else { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUPPORTED, new Object[]{name})); //name + "not supported"); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Object getAttribute(String name) throws IllegalArgumentException { if (name.equals(FEATURE_INCREMENTAL)) { return m_incremental ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_OPTIMIZE)) { return m_optimize ? Boolean.TRUE : Boolean.FALSE; } else if (name.equals(FEATURE_SOURCE_LOCATION)) { return m_source_location ? Boolean.TRUE : Boolean.FALSE; } else throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ATTRIB_VALUE_NOT_RECOGNIZED, new Object[]{name})); //name + " attribute not recognized"); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (null == listener) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_ERRORLISTENER, null)); // "ErrorListener"); m_errorListener = listener; }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
private static String getOutputPropertyNoDefault(String qnameString, Properties props) throws IllegalArgumentException { String value = (String)props.get(qnameString); return value; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void setResult(Result result) throws IllegalArgumentException { if (null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null"); try { // ContentHandler handler = // m_transformer.createResultContentHandler(result); // m_transformer.setContentHandler(handler); SerializationHandler xoh = m_transformer.createSerializationHandler(result); m_transformer.setSerializationHandler(xoh); } catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); } m_result = result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputProperty(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = props.getProperty(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " //+ qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String getOutputPropertyNoDefault(String qnameString) throws IllegalArgumentException { String value = null; OutputProperties props = getOutputFormat(); value = (String) props.getProperties().get(qnameString); if (null == value) { if (!OutputProperties.isLegalPropertyKey(qnameString)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{qnameString})); //"output property not recognized: " // + qnameString); } return value; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { synchronized (m_reentryGuard) { // Get the output format that was set by the user, otherwise get the // output format from the stylesheet. if (null == m_outputFormat) { m_outputFormat = (OutputProperties) getStylesheet().getOutputComposed().clone(); } if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setOutputProperties(Properties oformat) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (null != oformat) { // See if an *explicit* method was set. String method = (String) oformat.get(OutputKeys.METHOD); if (null != method) m_outputFormat = new OutputProperties(method); else if(m_outputFormat==null) m_outputFormat = new OutputProperties(); m_outputFormat.copyFrom(oformat); // copyFrom does not set properties that have been already set, so // this must be called after, which is a bit in the reverse from // what one might think. m_outputFormat.copyFrom(m_stylesheetRoot.getOutputProperties()); } else { // if oformat is null JAXP says that any props previously set are removed // and we are to revert back to those in the templates object (i.e. Stylesheet). m_outputFormat = null; } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { synchronized (m_reentryGuard) { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorHandler = listener; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setResult(Result result) throws IllegalArgumentException { if(null == result) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null"); m_result = result; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperties(Properties oformat) throws IllegalArgumentException { if (null != oformat) { // See if an *explicit* method was set. String method = (String) oformat.get(OutputKeys.METHOD); if (null != method) m_outputFormat = new OutputProperties(method); else m_outputFormat = new OutputProperties(); m_outputFormat.copyFrom(oformat); } else { // if oformat is null JAXP says that any props previously set are removed // and we are to revert back to those in the templates object (i.e. Stylesheet). m_outputFormat = null; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setOutputProperty(String name, String value) throws IllegalArgumentException { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " //+ name); m_outputFormat.setProperty(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public String getOutputProperty(String name) throws IllegalArgumentException { String value = null; OutputProperties props = m_outputFormat; value = props.getProperty(name); if (null == value) { if (!OutputProperties.isLegalPropertyKey(name)) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_OUTPUT_PROPERTY_NOT_RECOGNIZED, new Object[]{name})); //"output property not recognized: " // + name); } return value; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_ERROR_HANDLER, null)); else m_errorListener = listener; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized Connection getConnection( )throws IllegalArgumentException, SQLException { PooledConnection pcon = null; // We will fill up the pool any time it is less than the // Minimum. THis could be cause by the enableing and disabling // or the pool. // if ( m_pool.size() < m_PoolMinSize ) { initializePool(); } // find a connection not in use for ( int x = 0; x < m_pool.size(); x++ ) { pcon = (PooledConnection) m_pool.elementAt(x); // Check to see if the Connection is in use if ( pcon.inUse() == false ) { // Mark it as in use pcon.setInUse(true); // return the JDBC Connection stored in the // PooledConnection object return pcon.getConnection(); } } // Could not find a free connection, // create and add a new one // Create a new JDBC Connection Connection con = createConnection(); // Create a new PooledConnection, passing it the JDBC // Connection pcon = new PooledConnection(con); // Mark the connection as in use pcon.setInUse(true); // Add the new PooledConnection object to the pool m_pool.addElement(pcon); // return the new Connection return pcon.getConnection(); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xpath/XPathContext.java
public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { if (listener == null) throw new IllegalArgumentException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, null)); //"Null error handler"); m_errorListener = listener; }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
6
            
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { runTimeError(FORMAT_NUMBER_ERR, Double.toString(number), pattern); return(EMPTYSTRING); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IllegalArgumentException e) { final String className = obj.getClass().getName(); runTimeError(DATA_CONVERSION_ERR, "reference", className); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (IllegalArgumentException ie) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie); return null; }
1
            
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
0
checked (Domain) IllegalCharException
class IllegalCharException extends Exception {
    static final long serialVersionUID = -667236676706226266L;
    public IllegalCharException(String s) {
	super(s);
    }
}
0 0 0 0 0 0
runtime (Lib) IllegalStateException 1
            
// in src/org/apache/xml/dtm/DTMException.java
public synchronized Throwable initCause(Throwable cause) { if ((this.containedException == null) && (cause != null)) { throw new IllegalStateException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_OVERWRITE_CAUSE, null)); //"Can't overwrite cause"); } if (cause == this) { throw new IllegalArgumentException( XMLMessages.createXMLMessage(XMLErrorResources.ER_SELF_CAUSATION_NOT_PERMITTED, null)); //"Self-causation not permitted"); } this.containedException = cause; return this; }
0 0 0 0 0
unknown (Lib) IndexOutOfBoundsException 0 0 0 2
            
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (IndexOutOfBoundsException e) { runTimeError(RUN_TIME_INTERNAL_ERR, "substring()"); return null; }
0 0
unknown (Lib) InstantiationException 0 0 2
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
6
            
// in src/org/apache/xml/utils/ObjectPool.java
catch (InstantiationException ex){}
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch (InstantiationException e) { System.err.println(xalanMessage); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
2
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
0
runtime (Domain) InternalError
public class InternalError extends Error {
    /**
     * Construct an <code>InternalError</code> with the specified error message.
     * @param msg the error message
     */
    public InternalError(String msg) {
        super(msg);
    }
}
5
            
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
private ArrayList getCandidateChunks(ClassGenerator classGen, int totalMethodSize) { Iterator instructions = getInstructionList().iterator(); ArrayList candidateChunks = new ArrayList(); ArrayList currLevelChunks = new ArrayList(); Stack subChunkStack = new Stack(); boolean openChunkAtCurrLevel = false; boolean firstInstruction = true; InstructionHandle currentHandle; if (m_openChunks != 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS)) .toString(); throw new InternalError(msg); } // Scan instructions in the method, keeping track of the nesting level // of outlineable chunks. // // currLevelChunks // keeps track of the child chunks of a chunk. For each chunk, // there will be a pair of entries: the InstructionHandles for the // start and for the end of the chunk // subChunkStack // a stack containing the partially accumulated currLevelChunks for // each chunk that's still open at the current position in the // InstructionList. // candidateChunks // the list of chunks which have been accepted as candidates chunks // for outlining do { // Get the next instruction. The loop will perform one extra // iteration after it reaches the end of the InstructionList, with // currentHandle set to null. currentHandle = instructions.hasNext() ? (InstructionHandle) instructions.next() : null; Instruction inst = (currentHandle != null) ? currentHandle.getInstruction() : null; // At the first iteration, create a chunk representing all the // code in the method. This is done just to simplify the logic - // this chunk can never be outlined because it will be too big. if (firstInstruction) { openChunkAtCurrLevel = true; currLevelChunks.add(currentHandle); firstInstruction = false; } // Found a new chunk if (inst instanceof OutlineableChunkStart) { // If last MarkerInstruction encountered was an // OutlineableChunkStart, this represents the first chunk // nested within that previous chunk - push the list of chunks // from the outer level onto the stack if (openChunkAtCurrLevel) { subChunkStack.push(currLevelChunks); currLevelChunks = new ArrayList(); } openChunkAtCurrLevel = true; currLevelChunks.add(currentHandle); // Close off an open chunk } else if (currentHandle == null || inst instanceof OutlineableChunkEnd) { ArrayList nestedSubChunks = null; // If the last MarkerInstruction encountered was an // OutlineableChunkEnd, it means that the current instruction // marks the end of a chunk that contained child chunks. // Those children might need to be examined below in case they // are better candidates for outlining than the current chunk. if (!openChunkAtCurrLevel) { nestedSubChunks = currLevelChunks; currLevelChunks = (ArrayList)subChunkStack.pop(); } // Get the handle for the start of this chunk (the last entry // in currLevelChunks) InstructionHandle chunkStart = (InstructionHandle) currLevelChunks.get( currLevelChunks.size()-1); int chunkEndPosition = (currentHandle != null) ? currentHandle.getPosition() : totalMethodSize; int chunkSize = chunkEndPosition - chunkStart.getPosition(); // Two ranges of chunk size to consider: // // 1. [0,TARGET_METHOD_SIZE] // Keep this chunk in consideration as a candidate, // and ignore its subchunks, if any - there's nothing to be // gained by outlining both the current chunk and its // children! // // 2. (TARGET_METHOD_SIZE,+infinity) // Ignore this chunk - it's too big. Add its subchunks // as candidates, after merging adjacent chunks to produce // chunks that are as large as possible if (chunkSize <= TARGET_METHOD_SIZE) { currLevelChunks.add(currentHandle); } else { if (!openChunkAtCurrLevel) { int childChunkCount = nestedSubChunks.size() / 2; if (childChunkCount > 0) { Chunk[] childChunks = new Chunk[childChunkCount]; // Gather all the child chunks of the current chunk for (int i = 0; i < childChunkCount; i++) { InstructionHandle start = (InstructionHandle) nestedSubChunks .get(i*2); InstructionHandle end = (InstructionHandle) nestedSubChunks .get(i*2+1); childChunks[i] = new Chunk(start, end); } // Merge adjacent siblings ArrayList mergedChildChunks = mergeAdjacentChunks(childChunks); // Add chunks that mean minimum size requirements // to the list of candidate chunks for outlining for (int i = 0; i < mergedChildChunks.size(); i++) { Chunk mergedChunk = (Chunk)mergedChildChunks.get(i); int mergedSize = mergedChunk.getChunkSize(); if (mergedSize >= MINIMUM_OUTLINEABLE_CHUNK_SIZE && mergedSize <= TARGET_METHOD_SIZE) { candidateChunks.add(mergedChunk); } } } } // Drop the chunk which was too big currLevelChunks.remove(currLevelChunks.size() - 1); } // currLevelChunks contains pairs of InstructionHandles. If // its size is an odd number, the loop has encountered the // start of a chunk at this level, but not its end. openChunkAtCurrLevel = ((currLevelChunks.size() & 0x1) == 1); } } while (currentHandle != null); return candidateChunks; }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
public Method[] outlineChunks(ClassGenerator classGen, int originalMethodSize) { ArrayList methodsOutlined = new ArrayList(); int currentMethodSize = originalMethodSize; int outlinedCount = 0; boolean moreMethodsOutlined; String originalMethodName = getName(); // Special handling for initialization methods. No other methods can // include the less than and greater than characters in their names, // so we munge the names here. if (originalMethodName.equals("<init>")) { originalMethodName = "$lt$init$gt$"; } else if (originalMethodName.equals("<clinit>")) { originalMethodName = "$lt$clinit$gt$"; } // Loop until the original method comes in under the JVM limit or // the loop was unable to outline any more methods do { // Get all the best candidates for outlining, and sort them in // ascending order of size ArrayList candidateChunks = getCandidateChunks(classGen, currentMethodSize); Collections.sort(candidateChunks); moreMethodsOutlined = false; // Loop over the candidates for outlining, from the largest to the // smallest and outline them one at a time, until the loop has // outlined all or the original method comes in under the JVM // limit on the size of a method. for (int i = candidateChunks.size()-1; i >= 0 && currentMethodSize > TARGET_METHOD_SIZE; i--) { Chunk chunkToOutline = (Chunk)candidateChunks.get(i); methodsOutlined.add(outline(chunkToOutline.getChunkStart(), chunkToOutline.getChunkEnd(), originalMethodName + "$outline$" + outlinedCount, classGen)); outlinedCount++; moreMethodsOutlined = true; InstructionList il = getInstructionList(); InstructionHandle lastInst = il.getEnd(); il.setPositions(); // Check the size of the method now currentMethodSize = lastInst.getPosition() + lastInst.getInstruction().getLength(); } } while (moreMethodsOutlined && currentMethodSize > TARGET_METHOD_SIZE); // Outlining failed to reduce the size of the current method // sufficiently. Throw an internal error. if (currentMethodSize > MAX_METHOD_SIZE) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_METHOD_TOO_BIG)) .toString(); throw new InternalError(msg); } Method[] methodsArr = new Method[methodsOutlined.size() + 1]; methodsOutlined.toArray(methodsArr); methodsArr[methodsOutlined.size()] = getThisMethod(); return methodsArr; }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
private Method outline(InstructionHandle first, InstructionHandle last, String outlinedMethodName, ClassGenerator classGen) { // We're not equipped to deal with exception handlers yet. Bail out! if (getExceptionHandlers().length != 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_TRY_CATCH)) .toString(); throw new InternalError(msg); } int outlineChunkStartOffset = first.getPosition(); int outlineChunkEndOffset = last.getPosition() + last.getInstruction().getLength(); ConstantPoolGen cpg = getConstantPool(); // Create new outlined method with signature: // // private final outlinedMethodName(CopyLocals copyLocals); // // CopyLocals is an object that is used to copy-in/copy-out local // variables that are used by the outlined method. Only locals whose // value is potentially set or referenced outside the range of the // chunk that is being outlined will be represented in CopyLocals. The // type of the variable for copying local variables is actually // generated to be unique - it is not named CopyLocals. // // The outlined method never needs to be referenced outside of this // class, and will never be overridden, so we mark it private final. final InstructionList newIL = new InstructionList(); final XSLTC xsltc = classGen.getParser().getXSLTC(); final String argTypeName = xsltc.getHelperClassName(); final Type[] argTypes = new Type[] {(new ObjectType(argTypeName)).toJCType()}; final String argName = "copyLocals"; final String[] argNames = new String[] {argName}; int methodAttributes = ACC_PRIVATE | ACC_FINAL; final boolean isStaticMethod = (getAccessFlags() & ACC_STATIC) != 0; if (isStaticMethod) { methodAttributes = methodAttributes | ACC_STATIC; } final MethodGenerator outlinedMethodGen = new MethodGenerator(methodAttributes, org.apache.bcel.generic.Type.VOID, argTypes, argNames, outlinedMethodName, getClassName(), newIL, cpg); // Create class for copying local variables to the outlined method. // The fields the class will need to contain will be determined as the // code in the outlineable chunk is examined. ClassGenerator copyAreaCG = new ClassGenerator(argTypeName, OBJECT_CLASS, argTypeName+".java", ACC_FINAL | ACC_PUBLIC | ACC_SUPER, null, classGen.getStylesheet()) { public boolean isExternal() { return true; } }; ConstantPoolGen copyAreaCPG = copyAreaCG.getConstantPool(); copyAreaCG.addEmptyConstructor(ACC_PUBLIC); // Number of fields in the copy class int copyAreaFieldCount = 0; // The handle for the instruction after the last one to be outlined. // Note that this should never end up being null. An outlineable chunk // won't contain a RETURN instruction or other branch out of the chunk, // and the JVM specification prohibits code in a method from just // "falling off the end" so this should always point to a valid handle. InstructionHandle limit = last.getNext(); // InstructionLists for copying values into and out of an instance of // CopyLocals: // oldMethCoypInIL - from locals in old method into an instance // of the CopyLocals class (oldMethCopyInIL) // oldMethCopyOutIL - from CopyLocals back into locals in the old // method // newMethCopyInIL - from CopyLocals into locals in the new // method // newMethCopyOutIL - from locals in new method into the instance // of the CopyLocals class InstructionList oldMethCopyInIL = new InstructionList(); InstructionList oldMethCopyOutIL = new InstructionList(); InstructionList newMethCopyInIL = new InstructionList(); InstructionList newMethCopyOutIL = new InstructionList(); // Allocate instance of class in which we'll copy in or copy out locals // and make two copies: last copy is used to invoke constructor; // other two are used for references to fields in the CopyLocals object InstructionHandle outlinedMethodCallSetup = oldMethCopyInIL.append(new NEW(cpg.addClass(argTypeName))); oldMethCopyInIL.append(InstructionConstants.DUP); oldMethCopyInIL.append(InstructionConstants.DUP); oldMethCopyInIL.append( new INVOKESPECIAL(cpg.addMethodref(argTypeName, "<init>", "()V"))); // Generate code to invoke the new outlined method, and place the code // on oldMethCopyOutIL InstructionHandle outlinedMethodRef; if (isStaticMethod) { outlinedMethodRef = oldMethCopyOutIL.append( new INVOKESTATIC(cpg.addMethodref( classGen.getClassName(), outlinedMethodName, outlinedMethodGen.getSignature()))); } else { oldMethCopyOutIL.append(InstructionConstants.THIS); oldMethCopyOutIL.append(InstructionConstants.SWAP); outlinedMethodRef = oldMethCopyOutIL.append( new INVOKEVIRTUAL(cpg.addMethodref( classGen.getClassName(), outlinedMethodName, outlinedMethodGen.getSignature()))); } // Used to keep track of the first in a sequence of // OutlineableChunkStart instructions boolean chunkStartTargetMappingsPending = false; InstructionHandle pendingTargetMappingHandle = null; // Used to keep track of the last instruction that was copied InstructionHandle lastCopyHandle = null; // Keeps track of the mapping from instruction handles in the old // method to instruction handles in the outlined method. Only need // to track instructions that are targeted by something else in the // generated BCEL HashMap targetMap = new HashMap(); // Keeps track of the mapping from local variables in the old method // to local variables in the outlined method. HashMap localVarMap = new HashMap(); HashMap revisedLocalVarStart = new HashMap(); HashMap revisedLocalVarEnd = new HashMap(); // Pass 1: Make copies of all instructions, append them to the new list // and associate old instruction references with the new ones, i.e., // a 1:1 mapping. The special marker instructions are not copied. // Also, identify local variables whose values need to be copied into or // out of the new outlined method, and builds up targetMap and // localVarMap as described above. The code identifies those local // variables first so that they can have fixed slots in the stack // frame for the outlined method assigned them ahead of all those // variables that don't need to exist for the entirety of the outlined // method invocation. for (InstructionHandle ih = first; ih != limit; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); // MarkerInstructions are not copied, so if something else targets // one, the targetMap will point to the nearest copied sibling // InstructionHandle: for an OutlineableChunkEnd, the nearest // preceding sibling; for an OutlineableChunkStart, the nearest // following sibling. if (inst instanceof MarkerInstruction) { if (ih.hasTargeters()) { if (inst instanceof OutlineableChunkEnd) { targetMap.put(ih, lastCopyHandle); } else { if (!chunkStartTargetMappingsPending) { chunkStartTargetMappingsPending = true; pendingTargetMappingHandle = ih; } } } } else { // Copy the instruction and append it to the outlined method's // InstructionList. Instruction c = inst.copy(); // Use clone for shallow copy if (c instanceof BranchInstruction) { lastCopyHandle = newIL.append((BranchInstruction)c); } else { lastCopyHandle = newIL.append(c); } if (c instanceof LocalVariableInstruction || c instanceof RET) { // For any instruction that touches a local variable, // check whether the local variable's value needs to be // copied into or out of the outlined method. If so, // generate the code to perform the necessary copying, and // use localVarMap to map the variable in the original // method to the variable in the new method. IndexedInstruction lvi = (IndexedInstruction)c; int oldLocalVarIndex = lvi.getIndex(); LocalVariableGen oldLVG = getLocalVariableRegistry() .lookupRegisteredLocalVariable(oldLocalVarIndex, ih.getPosition()); LocalVariableGen newLVG = (LocalVariableGen)localVarMap.get(oldLVG); // Has the code already mapped this local variable to a // local in the new method? if (localVarMap.get(oldLVG) == null) { // Determine whether the local variable needs to be // copied into or out of the outlined by checking // whether the range of instructions in which the // variable is accessible is outside the range of // instructions in the outlineable chunk. // Special case a chunk start offset of zero: a local // variable live at that position must be a method // parameter, so the code doesn't need to check whether // the variable is live before that point; being live // at offset zero is sufficient to know that the value // must be copied in to the outlined method. boolean copyInLocalValue = offsetInLocalVariableGenRange(oldLVG, (outlineChunkStartOffset != 0) ? outlineChunkStartOffset-1 : 0); boolean copyOutLocalValue = offsetInLocalVariableGenRange(oldLVG, outlineChunkEndOffset+1); // For any variable that needs to be copied into or out // of the outlined method, create a field in the // CopyLocals class, and generate the necessary code for // copying the value. if (copyInLocalValue || copyOutLocalValue) { String varName = oldLVG.getName(); Type varType = oldLVG.getType(); newLVG = outlinedMethodGen.addLocalVariable(varName, varType, null, null); int newLocalVarIndex = newLVG.getIndex(); String varSignature = varType.getSignature(); // Record the mapping from the old local to the new localVarMap.put(oldLVG, newLVG); copyAreaFieldCount++; String copyAreaFieldName = "field" + copyAreaFieldCount; copyAreaCG.addField( new Field(ACC_PUBLIC, copyAreaCPG.addUtf8(copyAreaFieldName), copyAreaCPG.addUtf8(varSignature), null, copyAreaCPG.getConstantPool())); int fieldRef = cpg.addFieldref(argTypeName, copyAreaFieldName, varSignature); if (copyInLocalValue) { // Generate code for the old method to store the // value of the local into the correct field in // CopyLocals prior to invocation of the // outlined method. oldMethCopyInIL.append( InstructionConstants.DUP); InstructionHandle copyInLoad = oldMethCopyInIL.append( loadLocal(oldLocalVarIndex, varType)); oldMethCopyInIL.append(new PUTFIELD(fieldRef)); // If the end of the live range of the old // variable was in the middle of the outlined // chunk. Make the load of its value the new // end of its range. if (!copyOutLocalValue) { revisedLocalVarEnd.put(oldLVG, copyInLoad); } // Generate code for start of the outlined // method to copy the value from a field in // CopyLocals to the new local in the outlined // method newMethCopyInIL.append( InstructionConstants.ALOAD_1); newMethCopyInIL.append(new GETFIELD(fieldRef)); newMethCopyInIL.append( storeLocal(newLocalVarIndex, varType)); } if (copyOutLocalValue) { // Generate code for the end of the outlined // method to copy the value from the new local // variable into a field in CopyLocals // method newMethCopyOutIL.append( InstructionConstants.ALOAD_1); newMethCopyOutIL.append( loadLocal(newLocalVarIndex, varType)); newMethCopyOutIL.append(new PUTFIELD(fieldRef)); // Generate code to copy the value from a field // in CopyLocals into a local in the original // method following invocation of the outlined // method. oldMethCopyOutIL.append( InstructionConstants.DUP); oldMethCopyOutIL.append(new GETFIELD(fieldRef)); InstructionHandle copyOutStore = oldMethCopyOutIL.append( storeLocal(oldLocalVarIndex, varType)); // If the start of the live range of the old // variable was in the middle of the outlined // chunk. Make this store into it the new start // of its range. if (!copyInLocalValue) { revisedLocalVarStart.put(oldLVG, copyOutStore); } } } } } if (ih.hasTargeters()) { targetMap.put(ih, lastCopyHandle); } // If this is the first instruction copied following a sequence // of OutlineableChunkStart instructions, indicate that the // sequence of old instruction all map to this newly created // instruction if (chunkStartTargetMappingsPending) { do { targetMap.put(pendingTargetMappingHandle, lastCopyHandle); pendingTargetMappingHandle = pendingTargetMappingHandle.getNext(); } while(pendingTargetMappingHandle != ih); chunkStartTargetMappingsPending = false; } } } // Pass 2: Walk old and new instruction lists, updating branch targets // and local variable references in the new list InstructionHandle ih = first; InstructionHandle ch = newIL.getStart(); while (ch != null) { // i == old instruction; c == copied instruction Instruction i = ih.getInstruction(); Instruction c = ch.getInstruction(); if (i instanceof BranchInstruction) { BranchInstruction bc = (BranchInstruction)c; BranchInstruction bi = (BranchInstruction)i; InstructionHandle itarget = bi.getTarget(); // old target // New target must be in targetMap InstructionHandle newTarget = (InstructionHandle)targetMap.get(itarget); bc.setTarget(newTarget); // Handle LOOKUPSWITCH or TABLESWITCH which may have many // target instructions if (bi instanceof Select) { InstructionHandle[] itargets = ((Select)bi).getTargets(); InstructionHandle[] ctargets = ((Select)bc).getTargets(); // Update all targets for (int j=0; j < itargets.length; j++) { ctargets[j] = (InstructionHandle)targetMap.get(itargets[j]); } } } else if (i instanceof LocalVariableInstruction || i instanceof RET) { // For any instruction that touches a local variable, // map the location of the variable in the original // method to its location in the new method. IndexedInstruction lvi = (IndexedInstruction)c; int oldLocalVarIndex = lvi.getIndex(); LocalVariableGen oldLVG = getLocalVariableRegistry() .lookupRegisteredLocalVariable(oldLocalVarIndex, ih.getPosition()); LocalVariableGen newLVG = (LocalVariableGen)localVarMap.get(oldLVG); int newLocalVarIndex; if (newLVG == null) { // Create new variable based on old variable - use same // name and type, but we will let the variable be active // for the entire outlined method. // LocalVariableGen oldLocal = oldLocals[oldLocalVarIndex]; String varName = oldLVG.getName(); Type varType = oldLVG.getType(); newLVG = outlinedMethodGen.addLocalVariable(varName, varType, null, null); newLocalVarIndex = newLVG.getIndex(); localVarMap.put(oldLVG, newLVG); // The old variable's live range was wholly contained in // the outlined chunk. There should no longer be stores // of values into it or loads of its value, so we can just // mark its live range as the reference to the outlined // method. revisedLocalVarStart.put(oldLVG, outlinedMethodRef); revisedLocalVarEnd.put(oldLVG, outlinedMethodRef); } else { newLocalVarIndex = newLVG.getIndex(); } lvi.setIndex(newLocalVarIndex); } // If the old instruction marks the end of the range of a local // variable, make sure that any slots on the stack reserved for // local variables are made available for reuse by calling // MethodGenerator.removeLocalVariable if (ih.hasTargeters()) { InstructionTargeter[] targeters = ih.getTargeters(); for (int idx = 0; idx < targeters.length; idx++) { InstructionTargeter targeter = targeters[idx]; if (targeter instanceof LocalVariableGen && ((LocalVariableGen)targeter).getEnd()==ih) { Object newLVG = localVarMap.get(targeter); if (newLVG != null) { outlinedMethodGen.removeLocalVariable( (LocalVariableGen)newLVG); } } } } // If the current instruction in the original list was a marker, // it wasn't copied, so don't advance through the list of copied // instructions yet. if (!(i instanceof MarkerInstruction)) { ch = ch.getNext(); } ih = ih.getNext(); } // POP the reference to the CopyLocals object from the stack oldMethCopyOutIL.append(InstructionConstants.POP); // Now that the generation of the outlined code is complete, update // the old local variables with new start and end ranges, as required. Iterator revisedLocalVarStartPairIter = revisedLocalVarStart.entrySet() .iterator(); while (revisedLocalVarStartPairIter.hasNext()) { Map.Entry lvgRangeStartPair = (Map.Entry)revisedLocalVarStartPairIter.next(); LocalVariableGen lvg = (LocalVariableGen)lvgRangeStartPair.getKey(); InstructionHandle startInst = (InstructionHandle)lvgRangeStartPair.getValue(); lvg.setStart(startInst); } Iterator revisedLocalVarEndPairIter = revisedLocalVarEnd.entrySet() .iterator(); while (revisedLocalVarEndPairIter.hasNext()) { Map.Entry lvgRangeEndPair = (Map.Entry)revisedLocalVarEndPairIter.next(); LocalVariableGen lvg = (LocalVariableGen)lvgRangeEndPair.getKey(); InstructionHandle endInst = (InstructionHandle)lvgRangeEndPair.getValue(); lvg.setEnd(endInst); } xsltc.dumpClass(copyAreaCG.getJavaClass()); // Assemble the instruction lists so that the old method invokes the // new outlined method InstructionList oldMethodIL = getInstructionList(); oldMethodIL.insert(first, oldMethCopyInIL); oldMethodIL.insert(first, oldMethCopyOutIL); // Insert the copying code into the outlined method newIL.insert(newMethCopyInIL); newIL.append(newMethCopyOutIL); newIL.append(InstructionConstants.RETURN); // Discard instructions in outlineable chunk from old method try { oldMethodIL.delete(first, last); } catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } } // Make a copy for the new method of all exceptions that might be thrown String[] exceptions = getExceptions(); for (int i = 0; i < exceptions.length; i++) { outlinedMethodGen.addException(exceptions[i]); } return outlinedMethodGen.getThisMethod(); }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
public void markChunkEnd() { // m_chunkTree.markChunkEnd(); getInstructionList() .append(OutlineableChunkEnd.OUTLINEABLECHUNKEND); m_openChunks--; if (m_openChunks < 0) { String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS)) .toString(); throw new InternalError(msg); } }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
boolean widenConditionalBranchTargetOffsets() { boolean ilChanged = false; int maxOffsetChange = 0; InstructionList il = getInstructionList(); // Loop through all the instructions, finding those that would be // affected by inserting new instructions in the InstructionList, and // calculating the maximum amount by which the relative offset between // two instructions could possibly change. // In part this loop duplicates code in // org.apache.bcel.generic.InstructionList.setPosition(), which does // this to determine whether to use 16-bit or 32-bit offsets for GOTO // and JSR instructions. Ideally, that method would do the same for // conditional branch instructions, but it doesn't, so we duplicate the // processing here. for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); switch (inst.getOpcode()) { // Instructions that may have 16-bit or 32-bit branch targets. // The size of the branch offset might increase by two bytes. case Constants.GOTO: case Constants.JSR: maxOffsetChange = maxOffsetChange + 2; break; // Instructions that contain padding for alignment purposes // Up to three bytes of padding might be needed. For greater // accuracy, we should be able to discount any padding already // added to these instructions by InstructionList.setPosition(), // their APIs do not expose that information. case Constants.TABLESWITCH: case Constants.LOOKUPSWITCH: maxOffsetChange = maxOffsetChange + 3; break; // Instructions that might be rewritten by this method as a // conditional branch followed by an unconditional branch. // The unconditional branch would require five bytes. case Constants.IF_ACMPEQ: case Constants.IF_ACMPNE: case Constants.IF_ICMPEQ: case Constants.IF_ICMPGE: case Constants.IF_ICMPGT: case Constants.IF_ICMPLE: case Constants.IF_ICMPLT: case Constants.IF_ICMPNE: case Constants.IFEQ: case Constants.IFGE: case Constants.IFGT: case Constants.IFLE: case Constants.IFLT: case Constants.IFNE: case Constants.IFNONNULL: case Constants.IFNULL: maxOffsetChange = maxOffsetChange + 5; break; } } // Now that the maximum number of bytes by which the method might grow // has been determined, look for conditional branches to see which // might possibly exceed the 16-bit relative offset. for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) { Instruction inst = ih.getInstruction(); if (inst instanceof IfInstruction) { IfInstruction oldIfInst = (IfInstruction)inst; BranchHandle oldIfHandle = (BranchHandle)ih; InstructionHandle target = oldIfInst.getTarget(); int relativeTargetOffset = target.getPosition() - oldIfHandle.getPosition(); // Consider the worst case scenario in which the conditional // branch and its target are separated by all the instructions // in the method that might increase in size. If that results // in a relative offset that cannot be represented as a 32-bit // signed quantity, rewrite the instruction as described above. if ((relativeTargetOffset - maxOffsetChange < MIN_BRANCH_TARGET_OFFSET) || (relativeTargetOffset + maxOffsetChange > MAX_BRANCH_TARGET_OFFSET)) { // Invert the logic of the IF instruction, and append // that to the InstructionList following the original IF // instruction InstructionHandle nextHandle = oldIfHandle.getNext(); IfInstruction invertedIfInst = oldIfInst.negate(); BranchHandle invertedIfHandle = il.append(oldIfHandle, invertedIfInst); // Append an unconditional branch to the target of the // original IF instruction after the new IF instruction BranchHandle gotoHandle = il.append(invertedIfHandle, new GOTO(target)); // If the original IF was the last instruction in // InstructionList, add a new no-op to act as the target // of the new IF if (nextHandle == null) { nextHandle = il.append(gotoHandle, NOP); } // Make the new IF instruction branch around the GOTO invertedIfHandle.updateTarget(target, nextHandle); // If anything still "points" to the old IF instruction, // make adjustments to refer to either the new IF or GOTO // instruction if (oldIfHandle.hasTargeters()) { InstructionTargeter[] targeters = oldIfHandle.getTargeters(); for (int i = 0; i < targeters.length; i++) { InstructionTargeter targeter = targeters[i]; // Ideally, one should simply be able to use // InstructionTargeter.updateTarget to change // references to the old IF instruction to the new // IF instruction. However, if a LocalVariableGen // indicated the old IF marked the end of the range // in which the IF variable is in use, the live // range of the variable must extend to include the // newly created GOTO instruction. The need for // this sort of specific knowledge of an // implementor of the InstructionTargeter interface // makes the code more fragile. Future implementors // of the interface might have similar requirements // which wouldn't be accommodated seemlessly. if (targeter instanceof LocalVariableGen) { LocalVariableGen lvg = (LocalVariableGen) targeter; if (lvg.getStart() == oldIfHandle) { lvg.setStart(invertedIfHandle); } else if (lvg.getEnd() == oldIfHandle) { lvg.setEnd(gotoHandle); } } else { targeter.updateTarget(oldIfHandle, invertedIfHandle); } } } try { il.delete(oldIfHandle); } catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); } // Adjust the pointer in the InstructionList to point after // the newly inserted IF instruction ih = gotoHandle; // Indicate that this method rewrote at least one IF ilChanged = true; } } } // Did this method rewrite any IF instructions? return ilChanged; }
1
            
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
0 0 0 0
runtime (Domain) InternalRuntimeError
public class InternalRuntimeError extends Error {

    public InternalRuntimeError(String message) {
        super(message);
    }

}
4
            
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static DTMAxisIterator nodeList2Iterator( org.w3c.dom.NodeList nodeList, Translet translet, DOM dom) { // First pass: build w3c DOM for all nodes not proxied from our DOM. // // Notice: this looses some (esp. parent) context for these nodes, // so some way to wrap the original nodes inside a DTMAxisIterator // might be preferable in the long run. int n = 0; // allow for change in list length, just in case. Document doc = null; DTMManager dtmManager = null; int[] proxyNodes = new int[nodeList.getLength()]; if (dom instanceof MultiDOM) dtmManager = ((MultiDOM) dom).getDTMManager(); for (int i = 0; i < nodeList.getLength(); ++i) { org.w3c.dom.Node node = nodeList.item(i); if (node instanceof DTMNodeProxy) { DTMNodeProxy proxy = (DTMNodeProxy)node; DTM nodeDTM = proxy.getDTM(); int handle = proxy.getDTMNodeNumber(); boolean isOurDOM = (nodeDTM == dom); if (!isOurDOM && dtmManager != null) { try { isOurDOM = (nodeDTM == dtmManager.getDTM(handle)); } catch (ArrayIndexOutOfBoundsException e) { // invalid node handle, so definitely not our doc } } if (isOurDOM) { proxyNodes[i] = handle; ++n; continue; } } proxyNodes[i] = DTM.NULL; int nodeType = node.getNodeType(); if (doc == null) { if (dom instanceof MultiDOM == false) { runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM"); return null; } try { AbstractTranslet at = (AbstractTranslet) translet; doc = at.newDocument("", "__top__"); } catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; } } // Use one dummy element as container for each node of the // list. That way, it is easier to detect resp. avoid // funny things which change the number of nodes, // e.g. auto-concatenation of text nodes. Element mid; switch (nodeType) { case org.w3c.dom.Node.ELEMENT_NODE: case org.w3c.dom.Node.TEXT_NODE: case org.w3c.dom.Node.CDATA_SECTION_NODE: case org.w3c.dom.Node.COMMENT_NODE: case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: mid = doc.createElementNS(null, "__dummy__"); mid.appendChild(doc.importNode(node, true)); doc.getDocumentElement().appendChild(mid); ++n; break; case org.w3c.dom.Node.ATTRIBUTE_NODE: // The mid element also serves as a container for // attributes, avoiding problems with conflicting // attributes or node order. mid = doc.createElementNS(null, "__dummy__"); mid.setAttributeNodeNS((Attr)doc.importNode(node, true)); doc.getDocumentElement().appendChild(mid); ++n; break; default: // Better play it safe for all types we aren't sure we know // how to deal with. runTimeError(RUN_TIME_INTERNAL_ERR, "Don't know how to convert node type " + nodeType); } } // w3cDOM -> DTM -> DOMImpl DTMAxisIterator iter = null, childIter = null, attrIter = null; if (doc != null) { final MultiDOM multiDOM = (MultiDOM) dom; DOM idom = (DOM)dtmManager.getDTM(new DOMSource(doc), false, null, true, false); // Create DOMAdapter and register with MultiDOM DOMAdapter domAdapter = new DOMAdapter(idom, translet.getNamesArray(), translet.getUrisArray(), translet.getTypesArray(), translet.getNamespaceArray()); multiDOM.addDOMAdapter(domAdapter); DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD); DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD); iter = new AbsoluteIterator( new StepIterator(iter1, iter2)); iter.setStartNode(DTMDefaultBase.ROOTNODE); childIter = idom.getAxisIterator(Axis.CHILD); attrIter = idom.getAxisIterator(Axis.ATTRIBUTE); } // Second pass: find DTM handles for every node in the list. int[] dtmHandles = new int[n]; n = 0; for (int i = 0; i < nodeList.getLength(); ++i) { if (proxyNodes[i] != DTM.NULL) { dtmHandles[n++] = proxyNodes[i]; continue; } org.w3c.dom.Node node = nodeList.item(i); DTMAxisIterator iter3 = null; int nodeType = node.getNodeType(); switch (nodeType) { case org.w3c.dom.Node.ELEMENT_NODE: case org.w3c.dom.Node.TEXT_NODE: case org.w3c.dom.Node.CDATA_SECTION_NODE: case org.w3c.dom.Node.COMMENT_NODE: case org.w3c.dom.Node.ENTITY_REFERENCE_NODE: case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: iter3 = childIter; break; case org.w3c.dom.Node.ATTRIBUTE_NODE: iter3 = attrIter; break; default: // Should not happen, as first run should have got all these throw new InternalRuntimeError("Mismatched cases"); } if (iter3 != null) { iter3.setStartNode(iter.next()); dtmHandles[n] = iter3.next(); // For now, play it self and perform extra checks: if (dtmHandles[n] == DTMAxisIterator.END) throw new InternalRuntimeError("Expected element missing at " + i); if (iter3.next() != DTMAxisIterator.END) throw new InternalRuntimeError("Too many elements at " + i); ++n; } } if (n != dtmHandles.length) throw new InternalRuntimeError("Nodes lost in second pass"); return new ArrayNodeListIterator(dtmHandles); }
0 0 0 0 0
unknown (Lib) InterruptedException 0 0 2
            
// in src/org/apache/xml/utils/ThreadControllerWrapper.java
public static void waitThread(Thread worker, Runnable task) throws InterruptedException { m_tpool.waitThread(worker, task); }
// in src/org/apache/xml/utils/ThreadControllerWrapper.java
public void waitThread(Thread worker, Runnable task) throws InterruptedException { // This should wait until the transformThread is considered not alive. worker.join(); }
7
            
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { System.out.println(ie.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (InterruptedException ie) { ie.printStackTrace(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (InterruptedException ie){}
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
catch (InterruptedException ie) { if (DEBUG) System.err.println(ie.getMessage()); }
0 0
unknown (Lib) InvocationTargetException 0 0 2
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
11
            
// in src/org/apache/xml/dtm/DTMException.java
catch (InvocationTargetException ite) { exception = null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
14
            
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { throw ite; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
0
unknown (Lib) LSException 4
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean write(Node nodeArg, LSOutput destination) throws LSException { // If the destination is null if (destination == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use // Serializer serializer = getXMLSerializer(xmlVersion); Serializer serializer = fXMLSerializer; serializer.reset(); // If the node has not been seen if ( nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = destination.getEncoding(); if (fEncoding == null ) { fEncoding = getInputEncoding(nodeArg); fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } // If the encoding is not recognized throw an exception. // Note: The serializer defaults to UTF-8 when created if (!Encodings.isRecognizedEncoding(fEncoding)) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // The LSSerializer will use the LSOutput object to determine // where to serialize the output to in the following order the // first one that is not null and not an empty string will be // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, // 3. LSOutput.systemId // 1.LSOutput.characterStream Writer writer = destination.getCharacterStream(); if (writer == null ) { // 2.LSOutput.byteStream OutputStream outputStream = destination.getByteStream(); if ( outputStream == null) { // 3. LSOutput.systemId String uri = destination.getSystemId(); if (uri == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // Expand the System Id and obtain an absolute URI for it. String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower case // letters "a"--"z", digits, and the characters plus ("+"), period // ("."), and hyphen ("-") are allowed. For resiliency, programs // interpreting URLs should treat upper case letters as equivalent to // lower case in scheme names (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host.equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } } else { // 2.LSOutput.byteStream serializer.setOutputStream(outputStream); } } else { // 1.LSOutput.characterStream serializer.setWriter(writer); } // The associated media type by default is set to text/xml on // org.apache.xml.serializer.SerializerBase. // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM node fDOMSerializer.serializeDOM3(nodeArg); } catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean writeToURI(Node nodeArg, String uri) throws LSException { // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, // 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = getInputEncoding(nodeArg); if (fEncoding == null ) { fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // If the specified encoding is not supported an // "unsupported-encoding" fatal error is raised. ?? if (uri == null) { String msg = Utils.messages.createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // REVISIT: Can this be used to get an absolute expanded URI String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower // case letters "a"--"z", digits, and the characters plus ("+"), // period ("."), and hyphen ("-") are allowed. For resiliency, // programs interpreting URLs should treat upper case letters as // equivalent to lower case in scheme names // (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host .equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM // node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
0 3
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean write(Node nodeArg, LSOutput destination) throws LSException { // If the destination is null if (destination == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use // Serializer serializer = getXMLSerializer(xmlVersion); Serializer serializer = fXMLSerializer; serializer.reset(); // If the node has not been seen if ( nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = destination.getEncoding(); if (fEncoding == null ) { fEncoding = getInputEncoding(nodeArg); fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } // If the encoding is not recognized throw an exception. // Note: The serializer defaults to UTF-8 when created if (!Encodings.isRecognizedEncoding(fEncoding)) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // The LSSerializer will use the LSOutput object to determine // where to serialize the output to in the following order the // first one that is not null and not an empty string will be // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, // 3. LSOutput.systemId // 1.LSOutput.characterStream Writer writer = destination.getCharacterStream(); if (writer == null ) { // 2.LSOutput.byteStream OutputStream outputStream = destination.getByteStream(); if ( outputStream == null) { // 3. LSOutput.systemId String uri = destination.getSystemId(); if (uri == null) { String msg = Utils.messages .createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // Expand the System Id and obtain an absolute URI for it. String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower case // letters "a"--"z", digits, and the characters plus ("+"), period // ("."), and hyphen ("-") are allowed. For resiliency, programs // interpreting URLs should treat upper case letters as equivalent to // lower case in scheme names (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host.equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } } else { // 2.LSOutput.byteStream serializer.setOutputStream(outputStream); } } else { // 1.LSOutput.characterStream serializer.setWriter(writer); } // The associated media type by default is set to text/xml on // org.apache.xml.serializer.SerializerBase. // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM node fDOMSerializer.serializeDOM3(nodeArg); } catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public String writeToString(Node nodeArg) throws DOMException, LSException { // return null is nodeArg is null. Should an Exception be thrown instead? if (nodeArg == null) { return null; } // Should we reset the serializer configuration before each write operation? // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode){ // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // StringWriter to Output to StringWriter output = new StringWriter(); // try { // Set the Serializer's Writer to a StringWriter serializer.setWriter(output); // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } // return the serialized string return output.toString(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
public boolean writeToURI(Node nodeArg, String uri) throws LSException { // If nodeArg is null, return false. Should we throw and LSException instead? if (nodeArg == null ) { return false; } // Obtain a reference to the serializer to use Serializer serializer = fXMLSerializer; serializer.reset(); if (nodeArg != fVisitedNode) { // Determine the XML Document version of the Node String xmlVersion = getXMLVersion(nodeArg); // Determine the encoding: 1.LSOutput.encoding, // 2.Document.inputEncoding, 3.Document.xmlEncoding. fEncoding = getInputEncoding(nodeArg); if (fEncoding == null ) { fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); } serializer.getOutputFormat().setProperty("version", xmlVersion); // Set the output encoding and xml version properties fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); // If the node to be serialized is not a Document, Element, or Entity // node // then the XML declaration, or text declaration, should be never be // serialized. if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE || nodeArg.getNodeType() != Node.ELEMENT_NODE || nodeArg.getNodeType() != Node.ENTITY_NODE) && ((fFeatures & XMLDECL) != 0)) { fDOMConfigProperties.setProperty( DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, DOMConstants.DOM3_DEFAULT_FALSE); } fVisitedNode = nodeArg; } // Update the serializer properties fXMLSerializer.setOutputFormat(fDOMConfigProperties); // try { // If the specified encoding is not supported an // "unsupported-encoding" fatal error is raised. ?? if (uri == null) { String msg = Utils.messages.createMessage( MsgKey.ER_NO_OUTPUT_SPECIFIED, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_NO_OUTPUT_SPECIFIED)); } throw new LSException(LSException.SERIALIZE_ERR, msg); } else { // REVISIT: Can this be used to get an absolute expanded URI String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); URL url = new URL(absoluteURI); OutputStream urlOutStream = null; String protocol = url.getProtocol(); String host = url.getHost(); // For file protocols, there is no need to use a URL to get its // corresponding OutputStream // Scheme names consist of a sequence of characters. The lower // case letters "a"--"z", digits, and the characters plus ("+"), // period ("."), and hyphen ("-") are allowed. For resiliency, // programs interpreting URLs should treat upper case letters as // equivalent to lower case in scheme names // (e.g., allow "HTTP" as well as "http"). if (protocol.equalsIgnoreCase("file") && (host == null || host.length() == 0 || host .equals("localhost"))) { // do we also need to check for host.equals(hostname) urlOutStream = new FileOutputStream(getPathWithoutEscapes(url.getPath())); } else { // This should support URL's whose schemes are mentioned in // RFC1738 other than file URLConnection urlCon = url.openConnection(); urlCon.setDoInput(false); urlCon.setDoOutput(true); urlCon.setUseCaches(false); urlCon.setAllowUserInteraction(false); // When writing to a HTTP URI, a HTTP PUT is performed. if (urlCon instanceof HttpURLConnection) { HttpURLConnection httpCon = (HttpURLConnection) urlCon; httpCon.setRequestMethod("PUT"); } urlOutStream = urlCon.getOutputStream(); } // set the OutputStream to that obtained from the systemId serializer.setOutputStream(urlOutStream); } // Get a reference to the serializer then lets you serilize a DOM // Use this hack till Xalan support JAXP1.3 if (fDOMSerializer == null) { fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); } // Set the error handler on the DOM3Serializer interface implementation if (fDOMErrorHandler != null) { fDOMSerializer.setErrorHandler(fDOMErrorHandler); } // Set the filter on the DOM3Serializer interface implementation if (fSerializerFilter != null) { fDOMSerializer.setNodeFilter(fSerializerFilter); } // Set the NewLine character to be used fDOMSerializer.setNewLine(fEndOfLine.toCharArray()); // Serializer your DOM, where node is an org.w3c.dom.Node // Assuming that Xalan's serializer can serialize any type of DOM // node fDOMSerializer.serializeDOM3(nodeArg); } catch (LSException lse) { // Rethrow LSException. throw lse; } catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } catch (Exception e) { if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), null, e)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); } return true; }
3
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
3
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (LSException lse) { // Rethrow LSException. throw lse; }
0
unknown (Lib) LinkageError 0 0 1
            
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
1
            
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
0
checked (Domain) MalformedURIException
public static class MalformedURIException extends IOException
  {

    /**
     * Constructs a <code>MalformedURIException</code> with no specified
     * detail message.
     */
    public MalformedURIException()
    {
      super();
    }

    /**
     * Constructs a <code>MalformedURIException</code> with the
     * specified detail message.
     *
     * @param p_msg the detail message.
     */
    public MalformedURIException(String p_msg)
    {
      super(p_msg);
    }
  }public static class MalformedURIException extends IOException
  {

    /**
     * Constructs a <code>MalformedURIException</code> with no specified
     * detail message.
     */
    public MalformedURIException()
    {
      super();
    }

    /**
     * Constructs a <code>MalformedURIException</code> with the
     * specified detail message.
     *
     * @param p_msg the detail message.
     */
    public MalformedURIException(String p_msg)
    {
      super(p_msg);
    }
  }
66
            
// in src/org/apache/xml/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); // This is a fix for XALANJ-2059. if(m_scheme != null && p_base != null) { // a) If <uriSpec> starts with a slash (/), it means <uriSpec> is absolute // and p_base can be ignored. // For example, // uriSpec = file:/myDIR/myXSLFile.xsl // p_base = file:/myWork/ // // Here, uriSpec has absolute path after scheme file and : // Hence p_base can be ignored. // // b) Similarily, according to RFC 2396, uri is resolved for <uriSpec> relative to <p_base> // if scheme in <uriSpec> is same as scheme in <p_base>, else p_base can be ignored. // // c) if <p_base> is not hierarchical, it can be ignored. // if(uriSpec.startsWith("/") || !m_scheme.equals(p_base.m_scheme) || !p_base.getSchemeSpecificPart().startsWith("/")) { p_base = null; } } // Fix for XALANJ-2059 uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/serializer/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/serializer/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
0 34
            
// in src/org/apache/xml/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); // This is a fix for XALANJ-2059. if(m_scheme != null && p_base != null) { // a) If <uriSpec> starts with a slash (/), it means <uriSpec> is absolute // and p_base can be ignored. // For example, // uriSpec = file:/myDIR/myXSLFile.xsl // p_base = file:/myWork/ // // Here, uriSpec has absolute path after scheme file and : // Hence p_base can be ignored. // // b) Similarily, according to RFC 2396, uri is resolved for <uriSpec> relative to <p_base> // if scheme in <uriSpec> is same as scheme in <p_base>, else p_base can be ignored. // // c) if <p_base> is not hierarchical, it can be ignored. // if(uriSpec.startsWith("/") || !m_scheme.equals(p_base.m_scheme) || !p_base.getSchemeSpecificPart().startsWith("/")) { p_base = null; } } // Fix for XALANJ-2059 uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/utils/URI.java
public void setPath(String p_path) throws MalformedURIException { if (p_path == null) { m_path = null; m_queryString = null; m_fragment = null; } else { initializePath(p_path); } }
// in src/org/apache/xml/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initialize(URI p_base, String p_uriSpec) throws MalformedURIException { if (p_base == null && (p_uriSpec == null || p_uriSpec.trim().length() == 0)) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS, null)); //"Cannot initialize URI with empty parameters."); } // just make a copy of the base if spec is empty if (p_uriSpec == null || p_uriSpec.trim().length() == 0) { initialize(p_base); return; } String uriSpec = p_uriSpec.trim(); int uriSpecLen = uriSpec.length(); int index = 0; // check for scheme int colonIndex = uriSpec.indexOf(':'); if (colonIndex < 0) { if (p_base == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_IN_URI, new Object[]{uriSpec})); //"No scheme found in URI: "+uriSpec); } } else { initializeScheme(uriSpec); uriSpec = uriSpec.substring(colonIndex+1); uriSpecLen = uriSpec.length(); } // two slashes means generic URI syntax, so we get the authority if (uriSpec.startsWith("//")) { index += 2; int startPos = index; // get authority - everything up to path, query or fragment char testChar = '\0'; while (index < uriSpecLen) { testChar = uriSpec.charAt(index); if (testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } // if we found authority, parse it out, otherwise we set the // host to empty string if (index > startPos) { initializeAuthority(uriSpec.substring(startPos, index)); } else { m_host = ""; } } initializePath(uriSpec.substring(index)); // Resolve relative URI to base URI - see RFC 2396 Section 5.2 // In some cases, it might make more sense to throw an exception // (when scheme is specified is the string spec and the base URI // is also specified, for example), but we're just following the // RFC specifications if (p_base != null) { // check to see if this is the current doc - RFC 2396 5.2 #2 // note that this is slightly different from the RFC spec in that // we don't include the check for query string being null // - this handles cases where the urispec is just a query // string or a fragment (e.g. "?y" or "#s") - // see <http://www.ics.uci.edu/~fielding/url/test1.html> which // identified this as a bug in the RFC if (m_path.length() == 0 && m_scheme == null && m_host == null) { m_scheme = p_base.getScheme(); m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); m_path = p_base.getPath(); if (m_queryString == null) { m_queryString = p_base.getQueryString(); } return; } // check for scheme - RFC 2396 5.2 #3 // if we found a scheme, it means absolute URI, so we're done if (m_scheme == null) { m_scheme = p_base.getScheme(); } // check for authority - RFC 2396 5.2 #4 // if we found a host, then we've got a network path, so we're done if (m_host == null) { m_userinfo = p_base.getUserinfo(); m_host = p_base.getHost(); m_port = p_base.getPort(); } else { return; } // check for absolute path - RFC 2396 5.2 #5 if (m_path.length() > 0 && m_path.startsWith("/")) { return; } // if we get to this point, we need to resolve relative path // RFC 2396 5.2 #6 String path = new String(); String basePath = p_base.getPath(); // 6a - get all but the last segment of the base URI path if (basePath != null) { int lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { path = basePath.substring(0, lastSlash + 1); } } // 6b - append the relative URI path path = path.concat(m_path); // 6c - remove all "./" where "." is a complete path segment index = -1; while ((index = path.indexOf("/./")) != -1) { path = path.substring(0, index + 1).concat(path.substring(index + 3)); } // 6d - remove "." if path ends with "." as a complete path segment if (path.endsWith("/.")) { path = path.substring(0, path.length() - 1); } // 6e - remove all "<segment>/../" where "<segment>" is a complete // path segment not equal to ".." index = -1; int segIndex = -1; String tempString = null; while ((index = path.indexOf("/../")) > 0) { tempString = path.substring(0, path.indexOf("/../")); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { if (!tempString.substring(segIndex++).equals("..")) { path = path.substring(0, segIndex).concat(path.substring(index + 4)); } } } // 6f - remove ending "<segment>/.." where "<segment>" is a // complete path segment if (path.endsWith("/..")) { tempString = path.substring(0, path.length() - 3); segIndex = tempString.lastIndexOf('/'); if (segIndex != -1) { path = path.substring(0, segIndex + 1); } } m_path = path; } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeScheme(String p_uriSpec) throws MalformedURIException { int uriSpecLen = p_uriSpec.length(); int index = 0; String scheme = null; char testChar = '\0'; while (index < uriSpecLen) { testChar = p_uriSpec.charAt(index); if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') { break; } index++; } scheme = p_uriSpec.substring(0, index); if (scheme.length() == 0) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI."); } else { setScheme(scheme); } }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializeAuthority(String p_uriSpec) throws MalformedURIException { int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; String userinfo = null; // userinfo is everything up @ if (p_uriSpec.indexOf('@', start) != -1) { while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '@') { break; } index++; } userinfo = p_uriSpec.substring(start, index); index++; } // host is everything up to ':' String host = null; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == ':') { break; } index++; } host = p_uriSpec.substring(start, index); int port = -1; if (host.length() > 0) { // port if (testChar == ':') { index++; start = index; while (index < end) { index++; } String portStr = p_uriSpec.substring(start, index); if (portStr.length() > 0) { for (int i = 0; i < portStr.length(); i++) { if (!isDigit(portStr.charAt(i))) { throw new MalformedURIException( portStr + " is invalid. Port should only contain digits!"); } } try { port = Integer.parseInt(portStr); } catch (NumberFormatException nfe) { // can't happen } } } } setHost(host); setPort(port); setUserinfo(userinfo); }
// in src/org/apache/xml/serializer/utils/URI.java
private void initializePath(String p_uriSpec) throws MalformedURIException { if (p_uriSpec == null) { throw new MalformedURIException( "Cannot initialize path from null string!"); } int index = 0; int start = 0; int end = p_uriSpec.length(); char testChar = '\0'; // path - everything up to query string or fragment while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '?' || testChar == '#') { break; } // check for valid escape sequence if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE, null)); //"Path contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { if ('\\' != testChar) throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{String.valueOf(testChar)})); //"Path contains invalid character: " //+ testChar); } index++; } m_path = p_uriSpec.substring(start, index); // query - starts with ? and up to fragment or end if (testChar == '?') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '#') { break; } if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Query string contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Query string contains invalid character:" + testChar); } index++; } m_queryString = p_uriSpec.substring(start, index); } // fragment - starts with # if (testChar == '#') { index++; start = index; while (index < end) { testChar = p_uriSpec.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_uriSpec.charAt(index + 1)) ||!isHex(p_uriSpec.charAt(index + 2))) { throw new MalformedURIException( "Fragment contains invalid escape sequence!"); } } else if (!isReservedCharacter(testChar) &&!isUnreservedCharacter(testChar)) { throw new MalformedURIException( "Fragment contains invalid character:" + testChar); } index++; } m_fragment = p_uriSpec.substring(start, index); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setScheme(String p_scheme) throws MalformedURIException { if (p_scheme == null) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!"); } if (!isConformantSchemeName(p_scheme)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant."); } m_scheme = p_scheme.toLowerCase(); }
// in src/org/apache/xml/serializer/utils/URI.java
public void setUserinfo(String p_userinfo) throws MalformedURIException { if (p_userinfo == null) { m_userinfo = null; } else { if (m_host == null) { throw new MalformedURIException( "Userinfo cannot be set when host is null!"); } // userinfo can contain alphanumerics, mark characters, escaped // and ';',':','&','=','+','$',',' int index = 0; int end = p_userinfo.length(); char testChar = '\0'; while (index < end) { testChar = p_userinfo.charAt(index); if (testChar == '%') { if (index + 2 >= end ||!isHex(p_userinfo.charAt(index + 1)) ||!isHex(p_userinfo.charAt(index + 2))) { throw new MalformedURIException( "Userinfo contains invalid escape sequence!"); } } else if (!isUnreservedCharacter(testChar) && USERINFO_CHARACTERS.indexOf(testChar) == -1) { throw new MalformedURIException( "Userinfo contains invalid character:" + testChar); } index++; } } m_userinfo = p_userinfo; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setHost(String p_host) throws MalformedURIException { if (p_host == null || p_host.trim().length() == 0) { m_host = p_host; m_userinfo = null; m_port = -1; } else if (!isWellFormedAddress(p_host)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!"); } m_host = p_host; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPort(int p_port) throws MalformedURIException { if (p_port >= 0 && p_port <= 65535) { if (m_host == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!"); } } else if (p_port != -1) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_INVALID_PORT, null)); //"Invalid port number!"); } m_port = p_port; }
// in src/org/apache/xml/serializer/utils/URI.java
public void setPath(String p_path) throws MalformedURIException { if (p_path == null) { m_path = null; m_queryString = null; m_fragment = null; } else { initializePath(p_path); } }
// in src/org/apache/xml/serializer/utils/URI.java
public void appendPath(String p_addToPath) throws MalformedURIException { if (p_addToPath == null || p_addToPath.trim().length() == 0) { return; } if (!isURIString(p_addToPath)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_PATH_INVALID_CHAR, new Object[]{p_addToPath})); //"Path contains invalid character!"); } if (m_path == null || m_path.trim().length() == 0) { if (p_addToPath.startsWith("/")) { m_path = p_addToPath; } else { m_path = "/" + p_addToPath; } } else if (m_path.endsWith("/")) { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath.substring(1)); } else { m_path = m_path.concat(p_addToPath); } } else { if (p_addToPath.startsWith("/")) { m_path = m_path.concat(p_addToPath); } else { m_path = m_path.concat("/" + p_addToPath); } } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setQueryString(String p_queryString) throws MalformedURIException { if (p_queryString == null) { m_queryString = null; } else if (!isGenericURI()) { throw new MalformedURIException( "Query string can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( "Query string cannot be set when path is null!"); } else if (!isURIString(p_queryString)) { throw new MalformedURIException( "Query string contains invalid character!"); } else { m_queryString = p_queryString; } }
// in src/org/apache/xml/serializer/utils/URI.java
public void setFragment(String p_fragment) throws MalformedURIException { if (p_fragment == null) { m_fragment = null; } else if (!isGenericURI()) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!"); } else if (getPath() == null) { throw new MalformedURIException( Utils.messages.createMessage(MsgKey.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!"); } else if (!isURIString(p_fragment)) { throw new MalformedURIException(Utils.messages.createMessage(MsgKey.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!"); } else { m_fragment = p_fragment; } }
2
            
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
2
            
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
0
unknown (Lib) MalformedURLException 0 0 6
            
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
8
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (MalformedURLException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (MalformedURLException e) { return null; }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
6
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
catch (java.net.MalformedURLException mue) { int indexOfColon = sourceUrl.indexOf(':'); int indexOfSlash = sourceUrl.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is already absolute, but we could not get // the system to form it, so bail throw mue; } else { // The url is relative, so attempt to get absolute url = new URL(SystemIDResolver.getAbsoluteURI(sourceUrl)); // If this fails, allow the exception to propagate } }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
2
checked (Domain) MissingOptArgException
class MissingOptArgException extends GetOptsException{
    static final long serialVersionUID = -1972471465394544822L;
    public MissingOptArgException(String msg){
	super(msg);
    }
}
0 0 1
            
// in src/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.java
public int getNextOption() throws IllegalArgumentException, MissingOptArgException { int retval = -1; if(theOptionsIterator.hasNext()){ theCurrentOption = (Option)theOptionsIterator.next(); char c = theCurrentOption.getArgLetter(); boolean shouldHaveArg = theOptionMatcher.hasArg(c); String arg = theCurrentOption.getArgument(); if(!theOptionMatcher.match(c)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_CMDLINE_OPTION_ERR, new Character(c)); throw (new IllegalArgumentException(msg.toString())); } else if(shouldHaveArg && (arg == null)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.CMDLINE_OPT_MISSING_ARG_ERR, new Character(c)); throw (new MissingOptArgException(msg.toString())); } retval = c; } return retval; }
0 0 0
unknown (Lib) MissingResourceException 57
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
public static final XResourceBundle loadResourceBundle( String className, Locale locale) throws MissingResourceException { String suffix = getResourceSuffix(locale); //System.out.println("resource " + className + suffix); try { // first try with the given locale String resourceName = className + suffix; return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLMessages.java
public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); try { return (ListResourceBundle)ResourceBundle.getBundle(className, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/serializer/utils/Messages.java
private ListResourceBundle loadResourceBundle(String resourceBundle) throws MissingResourceException { m_resourceBundleName = resourceBundle; Locale locale = getLocale(); ListResourceBundle lrb; try { ResourceBundle rb = ResourceBundle.getBundle(m_resourceBundleName, locale); lrb = (ListResourceBundle) rb; } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } } m_resourceBundle = lrb; return lrb; }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
57
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
57
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
public static final XResourceBundle loadResourceBundle( String className, Locale locale) throws MissingResourceException { String suffix = getResourceSuffix(locale); //System.out.println("resource " + className + suffix); try { // first try with the given locale String resourceName = className + suffix; return (XResourceBundle) ResourceBundle.getBundle(resourceName, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLMessages.java
public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); try { return (ListResourceBundle)ResourceBundle.getBundle(className, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
public static final XMLErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XMLErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xml/serializer/utils/Messages.java
private ListResourceBundle loadResourceBundle(String resourceBundle) throws MissingResourceException { m_resourceBundleName = resourceBundle; Locale locale = getLocale(); ListResourceBundle lrb; try { ResourceBundle rb = ResourceBundle.getBundle(m_resourceBundleName, locale); lrb = (ListResourceBundle) rb; } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } } m_resourceBundle = lrb; return lrb; }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
public static final XSLTErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XSLTErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) ResourceBundle.getBundle(className + suffix, locale); } catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } } }
114
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
57
            
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XResourceBundle) ResourceBundle.getBundle( XSLT_RESOURCE, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/utils/res/XResourceBundle.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (ListResourceBundle)ResourceBundle.getBundle( className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); } }
// in src/org/apache/xml/res/XMLMessages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + className, className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XMLErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xml/res/XMLErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. lrb = (ListResourceBundle) ResourceBundle.getBundle( m_resourceBundleName, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); } }
// in src/org/apache/xml/serializer/utils/Messages.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles." + m_resourceBundleName, m_resourceBundleName, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XSLTErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xalan/res/XSLTErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("hu", "HU")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_hu.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pl", "PL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sk.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("cs", "CZ")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_cs.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_fr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("it", "IT")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_it.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ca", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ca.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("tr", "TR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_tr.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "TW")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh_TW.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_de.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("pt", "BR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_pt_BR.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("sl", "SL")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_sl.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("zh", "CN")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_zh.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("ko", "KR")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ko.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ja.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("es", "ES")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_es.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e) { try // try to fall back to en_US if we can't load { // Since we can't find the localized property file, // fall back to en_US. return (XPATHErrorResources) ResourceBundle.getBundle(className, new Locale("en", "US")); } catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); } }
// in src/org/apache/xpath/res/XPATHErrorResources_ru.java
catch (MissingResourceException e2) { // Now we are really in trouble. // very bad, definitely very bad...not going to get very far throw new MissingResourceException( "Could not load any resource bundles.", className, ""); }
0
unknown (Lib) NamingException 1
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
protected void findDatasource() throws NamingException { try { InitialContext context = new InitialContext(); jdbcSource = context.lookup(jndiPath); Class withArgs[] = { String.class, String.class }; getConnectionWithArgs = jdbcSource.getClass().getDeclaredMethod("getConnection", withArgs); Class noArgs[] = { }; getConnection = jdbcSource.getClass().getDeclaredMethod("getConnection", noArgs); } catch (NamingException e) { throw e; } catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); } }
1
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
1
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
protected void findDatasource() throws NamingException { try { InitialContext context = new InitialContext(); jdbcSource = context.lookup(jndiPath); Class withArgs[] = { String.class, String.class }; getConnectionWithArgs = jdbcSource.getClass().getDeclaredMethod("getConnection", withArgs); Class noArgs[] = { }; getConnection = jdbcSource.getClass().getDeclaredMethod("getConnection", noArgs); } catch (NamingException e) { throw e; } catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); } }
3
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException e) { throw e; }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { return false; }
2
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException e) { throw e; }
0
unknown (Lib) NoSuchElementException 4
            
// in src/org/apache/xml/utils/NamespaceSupport2.java
public Object nextElement() { if(hasMoreElements()) { String tmp=lookahead; lookahead=null; return tmp; } else throw new java.util.NoSuchElementException(); }
// in src/org/apache/xml/serializer/dom3/NamespaceSupport.java
public Object nextElement() { if (counter< size){ return fPrefixes[counter++]; } throw new NoSuchElementException("Illegal access to Namespace prefixes enumeration."); }
// in src/org/apache/xalan/templates/ElemNumber.java
public String nextToken() { if (currentPosition >= maxPosition) { throw new NoSuchElementException(); } int start = currentPosition; while ((currentPosition < maxPosition) && Character.isLetterOrDigit(str.charAt(currentPosition))) { currentPosition++; } if ((start == currentPosition) && (!Character.isLetterOrDigit(str.charAt(currentPosition)))) { currentPosition++; } return str.substring(start, currentPosition); }
// in src/org/apache/xalan/transformer/NumeratorFormatter.java
String nextToken() { if (currentPosition >= maxPosition) { throw new NoSuchElementException(); } int start = currentPosition; while ((currentPosition < maxPosition) && Character.isLetterOrDigit(str.charAt(currentPosition))) { currentPosition++; } if ((start == currentPosition) && (!Character.isLetterOrDigit(str.charAt(currentPosition)))) { currentPosition++; } return str.substring(start, currentPosition); }
0 0 6
            
// in src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
catch (NoSuchElementException e) { reportError(parent, parser, ErrorMsg.ATTR_VAL_TEMPLATE_ERR, value); }
// in src/org/apache/xalan/templates/AVT.java
catch (java.util.NoSuchElementException ex) { error = XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ name, stringedValue }); break; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (java.util.NoSuchElementException nsee) { // Should throw some sort of an error. }
0 0
unknown (Lib) NoSuchMethodError 0 0 0 8
            
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (NoSuchMethodError ex2) { }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( NoSuchMethodError ex2 ) { }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( NoSuchMethodError ex2 ) { }
// in src/org/apache/xalan/xslt/Process.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xalan/xslt/Process.java
catch (NoSuchMethodError ex2){}
// in src/org/apache/xpath/SourceTreeManager.java
catch( NoSuchMethodError ex2 ) { }
0 0
unknown (Lib) NoSuchMethodException 7
            
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(thisCoroutine)) throw new java.lang.NoSuchMethodException(); while(m_nextCoroutine != thisCoroutine) { try { wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? } } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; notify(); while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY) { try { // System.out.println("waiting..."); wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? } } if(m_nextCoroutine==NOBODY) { // Pass it along co_exit(thisCoroutine); // And inform this coroutine that its partners are Going Away // %REVIEW% Should this throw/return something more useful? throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request"); } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; m_activeIDs.clear(thisCoroutine); notify(); }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
0 8
            
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_entry_pause(int thisCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(thisCoroutine)) throw new java.lang.NoSuchMethodException(); while(m_nextCoroutine != thisCoroutine) { try { wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance widdershins about the instruction cache? } } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; notify(); while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY) { try { // System.out.println("waiting..."); wait(); } catch(java.lang.InterruptedException e) { // %TBD% -- Declare? Encapsulate? Ignore? Or // dance deasil about the program counter? } } if(m_nextCoroutine==NOBODY) { // Pass it along co_exit(thisCoroutine); // And inform this coroutine that its partners are Going Away // %REVIEW% Should this throw/return something more useful? throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request"); } return m_yield; }
// in src/org/apache/xml/dtm/ref/CoroutineManager.java
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException { if(!m_activeIDs.get(toCoroutine)) throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine); // We expect these values to be overwritten during the notify()/wait() // periods, as other coroutines in this set get their opportunity to run. m_yield=arg_object; m_nextCoroutine=toCoroutine; m_activeIDs.clear(thisCoroutine); notify(); }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
13
            
// in src/org/apache/xml/dtm/DTMException.java
catch (NoSuchMethodException nsme) { // do nothing }
// in src/org/apache/xml/dtm/DTMException.java
catch (NoSuchMethodException nsme) { exception = null; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(java.lang.NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "CPO, shut down the garbage smashers on the detention level!" e.printStackTrace(System.err); fCoroutineManager.co_exit(fSourceCoroutineID); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { return e; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(new SAXParser()); return iss; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(NoSuchMethodException e) { // Xerces version mismatch; neither Xerces1 nor Xerces2 succeeded. // Fall back on filtering solution. IncrementalSAXSource_Filter iss=new IncrementalSAXSource_Filter(); iss.setXMLReader(parser); return iss; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
// in src/org/apache/xpath/XPathException.java
catch (NoSuchMethodException nsme) { // do nothing }
// in src/org/apache/xpath/XPathContext.java
catch (NoSuchMethodException nsme) {}
3
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NoSuchMethodException e) { // For simpleification, we will just throw a NamingException. We will only // use the message part of the exception anyway. throw new NamingException("Unable to resolve JNDI DataSource - " + e); }
0
runtime (Lib) NullPointerException 31
            
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void pushRewindMark() { if(m_indexing || m_elemIndexes!=null) throw new java.lang.NullPointerException("Coding error; Don't try to mark/rewind an indexed DTM"); // Values from DTMDefaultBase // %REVIEW% Can the namespace stack sizes ever differ? If not, save space! mark_size.push(m_size); mark_nsdeclset_size.push((m_namespaceDeclSets==null) ? 0 : m_namespaceDeclSets.size()); mark_nsdeclelem_size.push((m_namespaceDeclSetElements==null) ? 0 : m_namespaceDeclSetElements.size()); // Values from SAX2DTM mark_data_size.push(m_data.size()); mark_char_size.push(m_chars.size()); mark_doq_size.push(m_dataOrQName.size()); }
// in src/org/apache/xalan/xsltc/runtime/Hashtable.java
public boolean contains(Object value) { if (value == null) throw new NullPointerException(); int i; HashtableEntry e; HashtableEntry tab[] = table; for (i = tab.length ; i-- > 0 ;) { for (e = tab[i] ; e != null ; e = e.next) { if (e.value.equals(value)) { return true; } } } return false; }
// in src/org/apache/xalan/xsltc/runtime/Hashtable.java
public Object put(Object key, Object value) { // Make sure the value is not null if (value == null) throw new NullPointerException(); // Makes sure the key is not already in the hashtable. HashtableEntry e; HashtableEntry tab[] = table; int hash = key.hashCode(); int index = (hash & 0x7FFFFFFF) % tab.length; for (e = tab[index] ; e != null ; e = e.next) { if ((e.hash == hash) && e.key.equals(key)) { Object old = e.value; e.value = value; return old; } } // Rehash the table if the threshold is exceeded if (count >= threshold) { rehash(); return put(key, value); } // Creates the new entry. e = new HashtableEntry(); e.hash = hash; e.key = key; e.value = value; e.next = tab[index]; tab[index] = e; count++; return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public boolean getFeature(String name) { // All supported features should be listed here String[] features = { DOMSource.FEATURE, DOMResult.FEATURE, SAXSource.FEATURE, SAXResult.FEATURE, StreamSource.FEATURE, StreamResult.FEATURE, SAXTransformerFactory.FEATURE, SAXTransformerFactory.FEATURE_XMLFILTER }; // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but array is small for (int i =0; i < features.length; i++) { if (name.equals(features[i])) { return true; } } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return _isSecureProcessing; } // Feature not supported return false; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public boolean getFeature(String name) { // All supported features should be listed here String[] features = { DOMSource.FEATURE, DOMResult.FEATURE, SAXSource.FEATURE, SAXResult.FEATURE, StreamSource.FEATURE, StreamResult.FEATURE }; // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but it really does not matter in a function like this for (int i = 0; i < features.length; i++) { if (name.equals(features[i])) return true; } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature return false; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public boolean getFeature(String name) { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_GET_FEATURE_NULL_NAME, null)); } // Try first with identity comparison, which // will be faster. if ((DOMResult.FEATURE == name) || (DOMSource.FEATURE == name) || (SAXResult.FEATURE == name) || (SAXSource.FEATURE == name) || (StreamResult.FEATURE == name) || (StreamSource.FEATURE == name) || (SAXTransformerFactory.FEATURE == name) || (SAXTransformerFactory.FEATURE_XMLFILTER == name)) return true; else if ((DOMResult.FEATURE.equals(name)) || (DOMSource.FEATURE.equals(name)) || (SAXResult.FEATURE.equals(name)) || (SAXSource.FEATURE.equals(name)) || (StreamResult.FEATURE.equals(name)) || (StreamSource.FEATURE.equals(name)) || (SAXTransformerFactory.FEATURE.equals(name)) || (SAXTransformerFactory.FEATURE_XMLFILTER.equals(name))) return true; // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) return m_isSecureProcessing; else // unknown feature return false; }
// in src/org/apache/xalan/transformer/TrAXFilter.java
private void setupParse () { XMLReader p = getParent(); if (p == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_PARENT_FOR_FILTER, null)); //"No parent for filter"); } ContentHandler ch = m_transformer.getInputContentHandler(); // if(ch instanceof SourceTreeHandler) // ((SourceTreeHandler)ch).setUseMultiThreading(true); p.setContentHandler(ch); p.setEntityResolver(this); p.setDTDHandler(this); p.setErrorHandler(this); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void setContentHandler(ContentHandler handler) { if (handler == null) { throw new NullPointerException(XSLMessages.createMessage(XSLTErrorResources.ER_NULL_CONTENT_HANDLER, null)); //"Null content handler"); } else { m_outputContentHandler = handler; if (null == m_serializationHandler) { ToXMLSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(handler); h.setTransformer(this); m_serializationHandler = h; } else m_serializationHandler.setContentHandler(handler); } }
// in src/org/apache/xalan/extensions/XPathFunctionResolverImpl.java
public XPathFunction resolveFunction(QName qname, int arity) { if (qname == null) throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NULL_QNAME, null)); if (arity < 0) throw new IllegalArgumentException( XSLMessages.createMessage( XSLTErrorResources.ER_XPATH_RESOLVER_NEGATIVE_ARITY, null)); String uri = qname.getNamespaceURI(); if (uri == null || uri.length() == 0) return null; String className = null; String methodName = null; if (uri.startsWith("http://exslt.org")) { className = getEXSLTClassName(uri); methodName = qname.getLocalPart(); } else if (!uri.equals(ExtensionNamespaceContext.JAVA_EXT_URI)) { int lastSlash = className.lastIndexOf('/'); if (-1 != lastSlash) className = className.substring(lastSlash + 1); } String localPart = qname.getLocalPart(); int lastDotIndex = localPart.lastIndexOf('.'); if (lastDotIndex > 0) { if (className != null) className = className + "." + localPart.substring(0, lastDotIndex); else className = localPart.substring(0, lastDotIndex); methodName = localPart.substring(lastDotIndex + 1); } else methodName = localPart; if(null == className || className.trim().length() == 0 || null == methodName || methodName.trim().length() == 0) return null; ExtensionHandler handler = null; try { ExtensionHandler.getClassForName(className); handler = new ExtensionHandlerJavaClass(uri, "javaclass", className); } catch (ClassNotFoundException e) { return null; } return new XPathFunctionImpl(handler, methodName); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, 0 ); if ( xpathFunction == null ) { return false; } return true; } catch ( Exception e ) { return false; } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setXPathVariableResolver(XPathVariableResolver resolver) { if ( resolver == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPathVariableResolver"} ); throw new NullPointerException( fmsg ); } this.variableResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setXPathFunctionResolver(XPathFunctionResolver resolver) { if ( resolver == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPathFunctionResolver"} ); throw new NullPointerException( fmsg ); } this.functionResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public void setNamespaceContext(NamespaceContext nsContext) { if ( nsContext == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"NamespaceContext"} ); throw new NullPointerException( fmsg ); } this.namespaceContext = nsContext; this.prefixResolver = new JAXPPrefixResolver ( nsContext ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean isObjectModelSupported(String objectModel) { if (objectModel == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_NULL, new Object[] { this.getClass().getName() } ); throw new NullPointerException( fmsg ); } if (objectModel.length() == 0) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_OBJECT_MODEL_EMPTY, new Object[] { this.getClass().getName() } ); throw new IllegalArgumentException( fmsg ); } // know how to support default object model, W3C DOM if (objectModel.equals(XPathFactory.DEFAULT_OBJECT_MODEL_URI)) { return true; } // don't know how to support anything else return false; }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setXPathFunctionResolver(XPathFunctionResolver resolver) { // resolver cannot be null if (resolver == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_NULL_XPATH_FUNCTION_RESOLVER, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } xPathFunctionResolver = resolver; }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setXPathVariableResolver(XPathVariableResolver resolver) { // resolver cannot be null if (resolver == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_NULL_XPATH_VARIABLE_RESOLVER, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } xPathVariableResolver = resolver; }
0 7
            
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setDTDHandler(DTDHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setEntityResolver(EntityResolver resolver) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setErrorHandler(ErrorHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setContentHandler(ContentHandler handler) throws NullPointerException { _sax = handler; if (handler instanceof LexicalHandler) { _lex = (LexicalHandler) handler; } if (handler instanceof SAXImpl) { _saxImpl = (SAXImpl)handler; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setDTDHandler(DTDHandler handler) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setEntityResolver(EntityResolver resolver) throws NullPointerException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setErrorHandler(ErrorHandler handler) throws NullPointerException { }
6
            
// in src/org/apache/xml/dtm/ref/ExtendedType.java
catch(NullPointerException e) { return false; }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (NullPointerException npe) { tok = -1; }
// in src/org/apache/xpath/compiler/Lexer.java
catch (NullPointerException npe) { tok = 0; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
3
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
0
unknown (Lib) NumberFormatException 1
            
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Number() throws javax.xml.transform.TransformerException { if (null != m_token) { // Mutate the token to remove the quotes and have the XNumber object // already made. double num; try { // XPath 1.0 does not support number in exp notation if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1)) throw new NumberFormatException(); num = Double.valueOf(m_token).doubleValue(); } catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); } m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
0 0 21
            
// in src/org/apache/xml/utils/XMLStringDefault.java
catch (NumberFormatException nfe) { return Double.NaN; }
// in src/org/apache/xml/utils/URI.java
catch (NumberFormatException nfe) { // can't happen }
// in src/org/apache/xml/serializer/Version.java
catch (NumberFormatException nfe) { return 0; }
// in src/org/apache/xml/serializer/utils/URI.java
catch (NumberFormatException nfe) { // can't happen }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (NumberFormatException e) { sign = false; }
// in src/org/apache/xml/serializer/Encodings.java
catch( NumberFormatException e) { highChar = 0; }
// in src/org/apache/xalan/Version.java
catch (NumberFormatException nfe) { return 0; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return Double.NaN; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return Double.NaN; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (NumberFormatException e) { return(-1); // ??? }
// in src/org/apache/xalan/xsltc/dom/NodeCounter.java
catch (NumberFormatException e) { _groupSize = 0; }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (NumberFormatException e) { num = new Double(Double.NEGATIVE_INFINITY); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (NumberFormatException e) { // ignore }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (NumberFormatException e) { // Falls through }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; }
// in src/org/apache/xalan/templates/ElemNumber.java
catch (NumberFormatException ex) { formatter.setGroupingUsed(false); }
// in src/org/apache/xalan/lib/ExsltBase.java
catch (NumberFormatException e) { d= Double.NaN; }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); }
// in src/org/apache/xpath/objects/XStringForFSB.java
catch (NumberFormatException nfe) { // This should catch double periods, empty strings. return Double.NaN; }
// in src/org/apache/xpath/objects/XString.java
catch (NumberFormatException e){}
0 0
unknown (Lib) ParseException 0 0 20
            
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String date(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String leader = edz[0]; String datetime = edz[1]; String zone = edz[2]; if (datetime == null || zone == null) return EMPTY_STR; String[] formatsIn = {dt, d}; String formatOut = d; Date date = testFormats(datetime, formatsIn); if (date == null) return EMPTY_STR; SimpleDateFormat dateFormat = new SimpleDateFormat(formatOut); dateFormat.setLenient(false); String dateOut = dateFormat.format(date); if (dateOut.length() == 0) return EMPTY_STR; else return (leader + dateOut + zone); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String time(String timeIn) throws ParseException { String[] edz = getEraDatetimeZone(timeIn); String time = edz[1]; String zone = edz[2]; if (time == null || zone == null) return EMPTY_STR; String[] formatsIn = {dt, d, t}; String formatOut = t; Date date = testFormats(time, formatsIn); if (date == null) return EMPTY_STR; SimpleDateFormat dateFormat = new SimpleDateFormat(formatOut); String out = dateFormat.format(date); return (out + zone); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double year(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); boolean ad = edz[0].length() == 0; // AD (Common Era -- empty leader) String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d, gym, gy}; double yr = getNumber(datetime, formats, Calendar.YEAR); if (ad || yr == Double.NaN) return yr; else return -yr; }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double monthInYear(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d, gym, gm, gmd}; return getNumber(datetime, formats, Calendar.MONTH) + 1; }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double weekInYear(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d}; return getNumber(datetime, formats, Calendar.WEEK_OF_YEAR); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double dayInYear(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d}; return getNumber(datetime, formats, Calendar.DAY_OF_YEAR); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double dayInMonth(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; String[] formats = {dt, d, gmd, gd}; double day = getNumber(datetime, formats, Calendar.DAY_OF_MONTH); return day; }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double dayOfWeekInMonth(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d}; return getNumber(datetime, formats, Calendar.DAY_OF_WEEK_IN_MONTH); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double dayInWeek(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, d}; return getNumber(datetime, formats, Calendar.DAY_OF_WEEK); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double hourInDay(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, t}; return getNumber(datetime, formats, Calendar.HOUR_OF_DAY); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double minuteInHour(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt,t}; return getNumber(datetime, formats, Calendar.MINUTE); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static double secondInMinute(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return Double.NaN; String[] formats = {dt, t}; return getNumber(datetime, formats, Calendar.SECOND); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static XObject leapYear(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return new XNumber(Double.NaN); String[] formats = {dt, d, gym, gy}; double dbl = getNumber(datetime, formats, Calendar.YEAR); if (dbl == Double.NaN) return new XNumber(Double.NaN); int yr = (int)dbl; return new XBoolean(yr % 400 == 0 || (yr % 100 != 0 && yr % 4 == 0)); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String monthName(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return EMPTY_STR; String[] formatsIn = {dt, d, gym, gm}; String formatOut = "MMMM"; return getNameOrAbbrev(datetimeIn, formatsIn, formatOut); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String monthAbbreviation(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return EMPTY_STR; String[] formatsIn = {dt, d, gym, gm}; String formatOut = "MMM"; return getNameOrAbbrev(datetimeIn, formatsIn, formatOut); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String dayName(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return EMPTY_STR; String[] formatsIn = {dt, d}; String formatOut = "EEEE"; return getNameOrAbbrev(datetimeIn, formatsIn, formatOut); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
public static String dayAbbreviation(String datetimeIn) throws ParseException { String[] edz = getEraDatetimeZone(datetimeIn); String datetime = edz[1]; if (datetime == null) return EMPTY_STR; String[] formatsIn = {dt, d}; String formatOut = "EEE"; return getNameOrAbbrev(datetimeIn, formatsIn, formatOut); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
private static Date testFormats (String in, String[] formats) throws ParseException { for (int i = 0; i <formats.length; i++) { try { SimpleDateFormat dateFormat = new SimpleDateFormat(formats[i]); dateFormat.setLenient(false); return dateFormat.parse(in); } catch (ParseException pe) { } } return null; }
// in src/org/apache/xalan/lib/ExsltDatetime.java
private static double getNumber(String in, String[] formats, int calField) throws ParseException { Calendar cal = Calendar.getInstance(); cal.setLenient(false); // Try the allowed formats, from longest to shortest. Date date = testFormats(in, formats); if (date == null) return Double.NaN; cal.setTime(date); return cal.get(calField); }
// in src/org/apache/xalan/lib/ExsltDatetime.java
private static String getNameOrAbbrev(String in, String[] formatsIn, String formatOut) throws ParseException { for (int i = 0; i <formatsIn.length; i++) // from longest to shortest. { try { SimpleDateFormat dateFormat = new SimpleDateFormat(formatsIn[i], Locale.ENGLISH); dateFormat.setLenient(false); Date dt = dateFormat.parse(in); dateFormat.applyPattern(formatOut); return dateFormat.format(dt); } catch (ParseException pe) { } } return ""; }
8
            
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { System.out.println("ParseException " + pe.getErrorOffset()); return -2; // Invalid. }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
// in src/org/apache/xalan/lib/ExsltDatetime.java
catch (ParseException pe) { }
0 0
unknown (Lib) ParserConfigurationException 0 0 5
            
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public Document newDocument(String uri, String qname) throws ParserConfigurationException { if (_domImplementation == null) { _domImplementation = DocumentBuilderFactory.newInstance() .newDocumentBuilder().getDOMImplementation(); } return _domImplementation.createDocument(uri, qname, null); }
// in src/org/apache/xalan/xsltc/runtime/output/TransletOutputHandlerFactory.java
public SerializationHandler getSerializationHandler() throws IOException, ParserConfigurationException { SerializationHandler result = null; switch (_outputType) { case STREAM : if (_method == null) { result = new ToUnknownStream(); } else if (_method.equalsIgnoreCase("xml")) { result = new ToXMLStream(); } else if (_method.equalsIgnoreCase("html")) { result = new ToHTMLStream(); } else if (_method.equalsIgnoreCase("text")) { result = new ToTextStream(); } if (result != null && _indentNumber >= 0) { result.setIndentAmount(_indentNumber); } result.setEncoding(_encoding); if (_writer != null) { result.setWriter(_writer); } else { result.setOutputStream(_ostream); } return result; case DOM : _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling) : new SAX2DOM(); _lexHandler = (LexicalHandler) _handler; // falls through case SAX : if (_method == null) { _method = "xml"; // default case } if (_lexHandler == null) { result = new ToXMLSAXHandler(_handler, _encoding); } else { result = new ToXMLSAXHandler( _handler, _lexHandler, _encoding); } return result; } return null; }
30
            
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException pce) { throw pce; // pass along pce }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (javax.xml.parsers.ParserConfigurationException e) { runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage()); return null; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (ParserConfigurationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.SAX_PARSER_CONFIG_ERR); reportError(ERROR, err); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (ParserConfigurationException e) { BasisLibrary.runTimeError(BasisLibrary.NAMESPACES_SUPPORT_ERR); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (ParserConfigurationException e) { fatalError(e); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/xslt/Process.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/xslt/Process.java
catch (ParserConfigurationException pce) {}
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
22
            
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException pce) { throw pce; // pass along pce }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch (ParserConfigurationException e) { // this should never happen with a well-behaving JAXP implementation. throw new Error(e.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
2
unknown (Lib) PrivilegedActionException 0 0 0 15
            
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
15
            
// in src/org/apache/xml/utils/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (PrivilegedActionException e) { throw (FileNotFoundException)e.getException(); }
0
runtime (Lib) RuntimeException 121
            
// in src/org/apache/xml/utils/DOMHelper.java
public static Document createDocument(boolean isSecureProcessing) { try { // Use an implementation of the JAVA API for XML Parsing 1.0 to // create a DOM Document node to contain the result. DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); dfactory.setValidating(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Document outNode = docBuilder.newDocument(); return outNode; } catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; } }
// in src/org/apache/xml/utils/DOMHelper.java
public static Node getParentOfNode(Node node) throws RuntimeException { Node parent; short nodeType = node.getNodeType(); if (Node.ATTRIBUTE_NODE == nodeType) { Document doc = node.getOwnerDocument(); /* TBD: if(null == doc) { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!"); } */ // Given how expensive the tree walk may be, we should first ask // whether this DOM can answer the question for us. The additional // test does slow down Level 1 DOMs slightly. DOMHelper2, which // is currently specialized for Xerces, assumes it can use the // Level 2 solution. We might want to have an intermediate stage, // which would assume DOM Level 2 but not assume Xerces. // // (Shouldn't have to check whether impl is null in a compliant DOM, // but let's be paranoid for a moment...) DOMImplementation impl=doc.getImplementation(); if(impl!=null && impl.hasFeature("Core","2.0")) { parent=((Attr)node).getOwnerElement(); return parent; } // DOM Level 1 solution, as fallback. Hugely expensive. Element rootElem = doc.getDocumentElement(); if (null == rootElem) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT, null)); //"Attribute child does not have an owner document element!"); } parent = locateAttrParent(rootElem, node); } else { parent = node.getParentNode(); // if((Node.DOCUMENT_NODE != nodeType) && (null == parent)) // { // throw new RuntimeException("Child does not have parent!"); // } } return parent; }
// in src/org/apache/xml/utils/ObjectPool.java
public synchronized Object getInstance() { // Check if the pool is empty. if (freeStack.isEmpty()) { // Create a new object if so. try { return objectType.newInstance(); } catch (InstantiationException ex){} catch (IllegalAccessException ex){} // Throw unchecked exception for error in pool configuration. throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool"); } else { // Remove object from end of free pool. Object result = freeStack.remove(freeStack.size() - 1); return result; } }
// in src/org/apache/xml/utils/UnImplNode.java
public void error(String msg) { System.out.println("DOM ERROR! class: " + this.getClass().getName()); throw new RuntimeException(XMLMessages.createXMLMessage(msg, null)); }
// in src/org/apache/xml/utils/UnImplNode.java
public void error(String msg, Object[] args) { System.out.println("DOM ERROR! class: " + this.getClass().getName()); throw new RuntimeException(XMLMessages.createXMLMessage(msg, args)); //"UnImplNode error: "+msg); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void init( CoroutineManager co, int controllerCoroutineID, int sourceCoroutineID) { if(co==null) co = new CoroutineManager(); fCoroutineManager = co; fControllerCoroutineID = co.co_joinCoroutineSet(controllerCoroutineID); fSourceCoroutineID = co.co_joinCoroutineSet(sourceCoroutineID); if (fControllerCoroutineID == -1 || fSourceCoroutineID == -1) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed"); fNoMoreEvents=false; eventcounter=frequency; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public int getDTMHandleFromNode(org.w3c.dom.Node node) { if(null == node) throw new IllegalArgumentException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NODE_NON_NULL, null)); //"node must be non-null for getDTMHandleFromNode!"); if (node instanceof org.apache.xml.dtm.ref.DTMNodeProxy) return ((org.apache.xml.dtm.ref.DTMNodeProxy) node).getDTMNodeNumber(); else { // Find the DOM2DTMs wrapped around this Document (if any) // and check whether they contain the Node in question. // // NOTE that since a DOM2DTM may represent a subtree rather // than a full document, we have to be prepared to check more // than one -- and there is no guarantee that we will find // one that contains ancestors or siblings of the node we're // seeking. // // %REVIEW% We could search for the one which contains this // node at the deepest level, and thus covers the widest // subtree, but that's going to entail additional work // checking more DTMs... and getHandleOfNode is not a // cheap operation in most implementations. // // TODO: %REVIEW% If overflow addressing, we may recheck a DTM // already examined. Ouch. But with the increased number of DTMs, // scanning back to check this is painful. // POSSIBLE SOLUTIONS: // Generate a list of _unique_ DTM objects? // Have each DTM cache last DOM node search? int max = m_dtms.length; for(int i = 0; i < max; i++) { DTM thisDTM=m_dtms[i]; if((null != thisDTM) && thisDTM instanceof DOM2DTM) { int handle=((DOM2DTM)thisDTM).getHandleOfNode(node); if(handle!=DTM.NULL) return handle; } } // Not found; generate a new DTM. // // %REVIEW% Is this really desirable, or should we return null // and make folks explicitly instantiate from a DOMSource? The // latter is more work but gives the caller the opportunity to // explicitly add the DTM to a DTMManager... and thus to know when // it can be discarded again, which is something we need to pay much // more attention to. (Especially since only DTMs which are assigned // to a manager can use the overflow addressing scheme.) // // %BUG% If the source node was a DOM2DTM$defaultNamespaceDeclarationNode // and the DTM wasn't registered with this DTMManager, we will create // a new DTM and _still_ not be able to find the node (since it will // be resynthesized). Another reason to push hard on making all DTMs // be managed DTMs. // Since the real root of our tree may be a DocumentFragment, we need to // use getParent to find the root, instead of getOwnerDocument. Otherwise // DOM2DTM#getHandleOfNode will be very unhappy. Node root = node; Node p = (root.getNodeType() == Node.ATTRIBUTE_NODE) ? ((org.w3c.dom.Attr)root).getOwnerElement() : root.getParentNode(); for (; p != null; p = p.getParentNode()) { root = p; } DOM2DTM dtm = (DOM2DTM) getDTM(new javax.xml.transform.dom.DOMSource(root), false, null, true, true); int handle; if(node instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode) { // Can't return the same node since it's unique to a specific DTM, // but can return the equivalent node -- find the corresponding // Document Element, then ask it for the xml: namespace decl. handle=dtm.getHandleOfNode(((org.w3c.dom.Attr)node).getOwnerElement()); handle=dtm.getAttributeNode(handle,node.getNamespaceURI(),node.getLocalName()); } else handle = ((DOM2DTM)dtm).getHandleOfNode(node); if(DTM.NULL == handle) throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_RESOLVE_NODE, null)); //"Could not resolve the node to a handle!"); return handle; } }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
public void dumpDTM(OutputStream os) { try { if(os==null) { File f = new File("DTMDump"+((Object)this).hashCode()+".txt"); System.err.println("Dumping... "+f.getAbsolutePath()); os=new FileOutputStream(f); } PrintStream ps = new PrintStream(os); while (nextNode()){} int nRecords = m_size; ps.println("Total nodes: " + nRecords); for (int index = 0; index < nRecords; ++index) { int i=makeNodeHandle(index); ps.println("=========== index=" + index + " handle=" + i + " ==========="); ps.println("NodeName: " + getNodeName(i)); ps.println("NodeNameX: " + getNodeNameX(i)); ps.println("LocalName: " + getLocalName(i)); ps.println("NamespaceURI: " + getNamespaceURI(i)); ps.println("Prefix: " + getPrefix(i)); int exTypeID = _exptype(index); ps.println("Expanded Type ID: " + Integer.toHexString(exTypeID)); int type = _type(index); String typestring; switch (type) { case DTM.ATTRIBUTE_NODE : typestring = "ATTRIBUTE_NODE"; break; case DTM.CDATA_SECTION_NODE : typestring = "CDATA_SECTION_NODE"; break; case DTM.COMMENT_NODE : typestring = "COMMENT_NODE"; break; case DTM.DOCUMENT_FRAGMENT_NODE : typestring = "DOCUMENT_FRAGMENT_NODE"; break; case DTM.DOCUMENT_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.DOCUMENT_TYPE_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.ELEMENT_NODE : typestring = "ELEMENT_NODE"; break; case DTM.ENTITY_NODE : typestring = "ENTITY_NODE"; break; case DTM.ENTITY_REFERENCE_NODE : typestring = "ENTITY_REFERENCE_NODE"; break; case DTM.NAMESPACE_NODE : typestring = "NAMESPACE_NODE"; break; case DTM.NOTATION_NODE : typestring = "NOTATION_NODE"; break; case DTM.NULL : typestring = "NULL"; break; case DTM.PROCESSING_INSTRUCTION_NODE : typestring = "PROCESSING_INSTRUCTION_NODE"; break; case DTM.TEXT_NODE : typestring = "TEXT_NODE"; break; default : typestring = "Unknown!"; break; } ps.println("Type: " + typestring); int firstChild = _firstch(index); if (DTM.NULL == firstChild) ps.println("First child: DTM.NULL"); else if (NOTPROCESSED == firstChild) ps.println("First child: NOTPROCESSED"); else ps.println("First child: " + firstChild); if (m_prevsib != null) { int prevSibling = _prevsib(index); if (DTM.NULL == prevSibling) ps.println("Prev sibling: DTM.NULL"); else if (NOTPROCESSED == prevSibling) ps.println("Prev sibling: NOTPROCESSED"); else ps.println("Prev sibling: " + prevSibling); } int nextSibling = _nextsib(index); if (DTM.NULL == nextSibling) ps.println("Next sibling: DTM.NULL"); else if (NOTPROCESSED == nextSibling) ps.println("Next sibling: NOTPROCESSED"); else ps.println("Next sibling: " + nextSibling); int parent = _parent(index); if (DTM.NULL == parent) ps.println("Parent: DTM.NULL"); else if (NOTPROCESSED == parent) ps.println("Parent: NOTPROCESSED"); else ps.println("Parent: " + parent); int level = _level(index); ps.println("Level: " + level); ps.println("Node Value: " + getNodeValue(i)); ps.println("String Value: " + getStringValue(i)); } } catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
// in src/org/apache/xml/res/XMLMessages.java
public static final String createMsg(ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); if (msg == null) { msg = fResourceBundle.getString(BAD_CODE); throwex = true; } if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); } catch (Exception e) { fmsg = fResourceBundle.getString(FORMAT_FAILED); fmsg += " " + msg; } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xml/serializer/utils/Messages.java
private final String createMsg( ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); else msgKey = ""; if (msg == null) { throwex = true; /* The message is not in the bundle . . . this is bad, * so try to get the message that the message is not in the bundle */ try { msg = java.text.MessageFormat.format( MsgKey.BAD_MSGKEY, new Object[] { msgKey, m_resourceBundleName }); } catch (Exception e) { /* even the message that the message is not in the bundle is * not there ... this is really bad */ msg = "The message key '" + msgKey + "' is not in the message class '" + m_resourceBundleName+"'"; } } else if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); // if we get past the line above we have create the message ... hurray! } catch (Exception e) { throwex = true; try { // Get the message that the format failed. fmsg = java.text.MessageFormat.format( MsgKey.BAD_MSGFORMAT, new Object[] { msgKey, m_resourceBundleName }); fmsg += " " + msg; } catch (Exception formatfailed) { // We couldn't even get the message that the format of // the message failed ... so fall back to English. fmsg = "The format of message '" + msgKey + "' in message class '" + m_resourceBundleName + "' failed."; } } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xml/serializer/SerializerBase.java
public String getNamespaceURI(String qname, boolean isElement) { String uri = EMPTYSTRING; int col = qname.lastIndexOf(':'); final String prefix = (col > 0) ? qname.substring(0, col) : EMPTYSTRING; if (!EMPTYSTRING.equals(prefix) || isElement) { if (m_prefixMap != null) { uri = m_prefixMap.lookupNamespace(prefix); if (uri == null && !prefix.equals(XMLNS_PREFIX)) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_NAMESPACE_PREFIX, new Object[] { qname.substring(0, col) } )); } } } return uri; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void flush() { try { if (m_firstTagNotEmitted) { emitFirstTag(); } if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } } catch(SAXException e) { throw new RuntimeException(e.toString()); } }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
public String escapeString(String s) { StringBuffer sb = new StringBuffer(); int length = s.length(); for (int i = 0; i < length; i++) { char ch = s.charAt(i); if ('<' == ch) { sb.append("&lt;"); } else if ('>' == ch) { sb.append("&gt;"); } else if ('&' == ch) { sb.append("&amp;"); } else if (0xd800 <= ch && ch < 0xdc00) { // UTF-16 surrogate int next; if (i + 1 >= length) { throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_UTF16_SURROGATE, new Object[]{ Integer.toHexString(ch) })); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+ " ?"); } else { next = s.charAt(++i); if (!(0xdc00 <= next && next < 0xe000)) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_UTF16_SURROGATE, new Object[]{ Integer.toHexString(ch) + " " + Integer.toHexString(next) })); //"Invalid UTF-16 surrogate detected: " //+Integer.toHexString(ch)+" "+Integer.toHexString(next)); next = ((ch - 0xd800) << 10) + next - 0xdc00 + 0x00010000; } sb.append("&#x"); sb.append(Integer.toHexString(next)); sb.append(";"); } else { sb.append(ch); } } return sb.toString(); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String getSource() throws TransformerException { StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); String text = ""; try { URL docURL = new URL(m_documentBase, m_treeURL); synchronized (m_tfactory) { Transformer transformer = m_tfactory.newTransformer(); StreamSource source = new StreamSource(docURL.toString()); StreamResult result = new StreamResult(pw); transformer.transform(source, result); text = osw.toString(); } } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } catch (Exception any_error) { any_error.printStackTrace(); } return text; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String processTransformation() throws TransformerException { String htmlData = null; this.showStatus("Waiting for Transformer and Parser to finish loading and JITing..."); synchronized (m_tfactory) { URL documentURL = null; URL styleURL = null; StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); StreamResult result = new StreamResult(pw); this.showStatus("Begin Transformation..."); try { documentURL = new URL(m_codeBase, m_documentURL); StreamSource xmlSource = new StreamSource(documentURL.toString()); styleURL = new URL(m_codeBase, m_styleURL); StreamSource xslSource = new StreamSource(styleURL.toString()); Transformer transformer = m_tfactory.newTransformer(xslSource); Iterator m_entries = m_parameters.entrySet().iterator(); while (m_entries.hasNext()) { Map.Entry entry = (Map.Entry) m_entries.next(); Object key = entry.getKey(); Object expression = entry.getValue(); transformer.setParameter((String) key, expression); } transformer.transform(xmlSource, result); } catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } this.showStatus("Transformation Done!"); htmlData = osw.toString(); } return htmlData; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static String startXslElement(String qname, String namespace, SerializationHandler handler, DOM dom, int node) { try { // Get prefix from qname String prefix; final int index = qname.indexOf(':'); if (index > 0) { prefix = qname.substring(0, index); // Handle case when prefix is not known at compile time if (namespace == null || namespace.length() == 0) { runTimeError(NAMESPACE_PREFIX_ERR,prefix); } handler.startElement(namespace, qname.substring(index+1), qname); handler.namespaceAfterStartElement(prefix, namespace); } else { // Need to generate a prefix? if (namespace != null && namespace.length() > 0) { prefix = generatePrefix(); qname = prefix + ':' + qname; handler.startElement(namespace, qname, qname); handler.namespaceAfterStartElement(prefix, namespace); } else { handler.startElement(null, null, qname); } } } catch (SAXException e) { throw new RuntimeException(e.getMessage()); } return qname; }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static void runTimeError(String code) { throw new RuntimeException(m_bundle.getString(code)); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
public static void runTimeError(String code, Object[] args) { final String message = MessageFormat.format(m_bundle.getString(code), args); throw new RuntimeException(message); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public String close() { try { _writer.flush(); } catch (IOException e) { throw new RuntimeException(e.toString()); } return ""; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(String s) { try { _writer.write(s); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(char[] s, int from, int to) { try { _writer.write(s, from, to); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
public OutputBuffer append(char ch) { try { _writer.write(ch); } catch (IOException e) { throw new RuntimeException(e.toString()); } return this; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
public static void main (String args[]) { // If we should call System.exit or not //@todo make this settable for use inside other java progs boolean systemExitOK = true; // This is the stream we'll set as our System.in InputStream input = null; // The number of arguments final int argc = args.length; // The arguments we'll pass to the real 'main()' String[] new_args = new String[argc - 2]; int new_argc = 0; // Parse all parameters passed to this class for (int i = 0; i < argc; i++) { // Parse option '-stdin <filename>' if (args[i].equals("-stdin")) { // This option must have an argument if ((++i >= argc) || (args[i].startsWith("-"))) { System.err.println(ERRMSG); throw new RuntimeException(ERRMSG); } try { input = new FileInputStream(args[i]); } catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); } catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); } } else { if (new_argc == new_args.length) { System.err.println("Missing -stdin option!"); throw new RuntimeException(); } new_args[new_argc++] = args[i]; } } System.setIn(input); try { java_cup.Main.main(new_args); } catch (Exception e) { System.err.println("Error running JavaCUP:"); e.printStackTrace(); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void assertion(boolean condition, String msg) throws RuntimeException { if (!condition) throw new RuntimeException(msg); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected ElemTemplateElement getElemFromExpression(Expression expr) { ExpressionNode parent = expr.exprGetParent(); while(null != parent) { if(parent instanceof ElemTemplateElement) return (ElemTemplateElement)parent; parent = parent.exprGetParent(); } throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_NO_TEMPLATE_PARENT, null)); // "Programmer's error! expr has no ElemTemplateElement parent!"); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private final void assertIsLocPathIterator(Expression expr1, ExpressionOwner eo) throws RuntimeException { if(!(expr1 instanceof LocPathIterator)) { String errMsg; if(expr1 instanceof Variable) { errMsg = "Programmer's assertion: expr1 not an iterator: "+ ((Variable)expr1).getQName(); } else { errMsg = "Programmer's assertion: expr1 not an iterator: "+ expr1.getClass().getName(); } throw new RuntimeException(errMsg + ", "+ eo.getClass().getName()+" "+ expr1.exprGetParent()); } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected static void assertion(boolean b, String msg) { if(!b) { throw new RuntimeException(XSLMessages.createMessage(XSLTErrorResources.ER_ASSERT_REDUNDENT_EXPR_ELIMINATOR, new Object[]{msg})); // "Programmer's assertion in RundundentExprEliminator: "+msg); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void error(String msg, Object[] args) { String themsg = XSLMessages.createMessage(msg, args); throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[]{ themsg })); }
// in src/org/apache/xalan/transformer/KeyIterator.java
public short acceptNode(int testNode) { boolean foundKey = false; KeyIterator ki = (KeyIterator) m_lpi; org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); Vector keys = ki.getKeyDeclarations(); QName name = ki.getName(); try { // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // See if our node matches the given key declaration according to // the match attribute on xsl:key. XPath matchExpr = kd.getMatch(); double score = matchExpr.getMatchScore(xctxt, testNode); if (score == kd.getMatch().MATCH_SCORE_NONE) continue; return DTMIterator.FILTER_ACCEPT; } // end for(int i = 0; i < nDeclarations; i++) } catch (TransformerException se) { // TODO: What to do? } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void run() { m_hasBeenReset = false; try { // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot(); // transformNode(n); try { m_isTransformDone = false; // Should no longer be needed... // if(m_inputContentHandler instanceof TransformerHandlerImpl) // { // TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler; // thi.waitForInitialEvents(); // } transformNode(m_doc); } catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); } finally { m_isTransformDone = true; if (m_inputContentHandler instanceof TransformerHandlerImpl) { ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine(); } // synchronized (this) // { // notifyAll(); // } } } catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. } }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
public short filterNode(int testNode) { boolean foundKey = false; Vector keys = m_keyDeclarations; QName name = m_name; KeyIterator ki = (KeyIterator)(((XNodeSet)m_keysNodes).getContainedIter()); org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); if(null == xctxt) assertion(false, "xctxt can not be null here!"); try { XMLString lookupKey = m_ref; // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // Query from the node, according the the select pattern in the // use attribute in xsl:key. XObject xuse = kd.getUse().execute(xctxt, testNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); if (lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } else { DTMIterator nl = ((XNodeSet)xuse).iterRaw(); int useNode; while (DTM.NULL != (useNode = nl.nextNode())) { DTM dtm = getDTM(useNode); XMLString exprResult = dtm.getStringValue(useNode); if ((null != exprResult) && lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } } } // end for(int i = 0; i < nDeclarations; i++) } catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/xslt/Process.java
static void doExit(String msg) { throw new RuntimeException(msg); }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dumpDTM( ) { try { // File f = new File("DTMDump"+((Object)this).hashCode()+".txt"); File f = new File("DTMDump.txt"); System.err.println("Dumping... "+f.getAbsolutePath()); PrintStream ps = new PrintStream(new FileOutputStream(f)); while (nextNode()){} int nRecords = m_size; ps.println("Total nodes: " + nRecords); for (int i = 0; i < nRecords; i++) { ps.println("=========== " + i + " ==========="); ps.println("NodeName: " + getNodeName(makeNodeHandle(i))); ps.println("NodeNameX: " + getNodeNameX(makeNodeHandle(i))); ps.println("LocalName: " + getLocalName(makeNodeHandle(i))); ps.println("NamespaceURI: " + getNamespaceURI(makeNodeHandle(i))); ps.println("Prefix: " + getPrefix(makeNodeHandle(i))); int exTypeID = getExpandedTypeID(makeNodeHandle(i)); ps.println("Expanded Type ID: " + Integer.toHexString(exTypeID)); int type = getNodeType(makeNodeHandle(i)); String typestring; switch (type) { case DTM.ATTRIBUTE_NODE : typestring = "ATTRIBUTE_NODE"; break; case DTM.CDATA_SECTION_NODE : typestring = "CDATA_SECTION_NODE"; break; case DTM.COMMENT_NODE : typestring = "COMMENT_NODE"; break; case DTM.DOCUMENT_FRAGMENT_NODE : typestring = "DOCUMENT_FRAGMENT_NODE"; break; case DTM.DOCUMENT_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.DOCUMENT_TYPE_NODE : typestring = "DOCUMENT_NODE"; break; case DTM.ELEMENT_NODE : typestring = "ELEMENT_NODE"; break; case DTM.ENTITY_NODE : typestring = "ENTITY_NODE"; break; case DTM.ENTITY_REFERENCE_NODE : typestring = "ENTITY_REFERENCE_NODE"; break; case DTM.NAMESPACE_NODE : typestring = "NAMESPACE_NODE"; break; case DTM.NOTATION_NODE : typestring = "NOTATION_NODE"; break; case DTM.NULL : typestring = "NULL"; break; case DTM.PROCESSING_INSTRUCTION_NODE : typestring = "PROCESSING_INSTRUCTION_NODE"; break; case DTM.TEXT_NODE : typestring = "TEXT_NODE"; break; default : typestring = "Unknown!"; break; } ps.println("Type: " + typestring); int firstChild = _firstch(i); if (DTM.NULL == firstChild) ps.println("First child: DTM.NULL"); else if (NOTPROCESSED == firstChild) ps.println("First child: NOTPROCESSED"); else ps.println("First child: " + firstChild); int prevSibling = _prevsib(i); if (DTM.NULL == prevSibling) ps.println("Prev sibling: DTM.NULL"); else if (NOTPROCESSED == prevSibling) ps.println("Prev sibling: NOTPROCESSED"); else ps.println("Prev sibling: " + prevSibling); int nextSibling = _nextsib(i); if (DTM.NULL == nextSibling) ps.println("Next sibling: DTM.NULL"); else if (NOTPROCESSED == nextSibling) ps.println("Next sibling: NOTPROCESSED"); else ps.println("Next sibling: " + nextSibling); int parent = _parent(i); if (DTM.NULL == parent) ps.println("Parent: DTM.NULL"); else if (NOTPROCESSED == parent) ps.println("Parent: NOTPROCESSED"); else ps.println("Parent: " + parent); int level = _level(i); ps.println("Level: " + level); ps.println("Node Value: " + getNodeValue(i)); ps.println("String Value: " + getStringValue(i)); ps.println("First Attribute Node: " + m_attribute.elementAt(i)); } } catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); } }
// in src/org/apache/xpath/XPath.java
public void assertion(boolean b, String msg) { if (!b) { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/Compiler.java
public void assertion(boolean b, java.lang.String msg) { if (!b) { java.lang.String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private void assertion(boolean b, String msg) { if (!b) { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
// in src/org/apache/xpath/compiler/OpMap.java
public int getNextStepPos(int opPos) { int stepType = getOp(opPos); if ((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES)) { return getNextOpPos(opPos); } else if ((stepType >= OpCodes.FIRST_NODESET_OP) && (stepType <= OpCodes.LAST_NODESET_OP)) { int newOpPos = getNextOpPos(opPos); while (OpCodes.OP_PREDICATE == getOp(newOpPos)) { newOpPos = getNextOpPos(newOpPos); } stepType = getOp(newOpPos); if (!((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES))) { return OpCodes.ENDOP; } return newOpPos; } else { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{String.valueOf(stepType)})); //"Programmer's assertion in getNextStepPos: unknown stepType: " + stepType); } }
// in src/org/apache/xpath/NodeSetDTM.java
public int previousNode() { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return DTM.NULL; }
// in src/org/apache/xpath/NodeSetDTM.java
public void runTo(int index) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!"); if ((index >= 0) && (m_next < m_firstFree)) m_next = index; else m_next = m_firstFree - 1; }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNode(int n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); this.addElement(n); }
// in src/org/apache/xpath/NodeSetDTM.java
public void insertNode(int n, int pos) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); insertElementAt(n, pos); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeNode(int n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); this.removeElement(n); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNodes(DTMIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { int obj; while (DTM.NULL != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addNodesInDocOrder(DTMIterator iterator, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); int node; while (DTM.NULL != (node = iterator.nextNode())) { addNodeInDocOrder(node, support); } }
// in src/org/apache/xpath/NodeSetDTM.java
public int addNodeInDocOrder(int node, boolean test, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); int insertIndex = -1; if (test) { // This needs to do a binary search, but a binary search // is somewhat tough because the sequence test involves // two nodes. int size = size(), i; for (i = size - 1; i >= 0; i--) { int child = elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } DTM dtm = support.getDTM(node); if (!dtm.isNodeAfter(node, child)) { break; } } if (i != -2) { insertIndex = i + 1; insertElementAt(node, insertIndex); } } else { insertIndex = this.size(); boolean foundit = false; for (int i = 0; i < insertIndex; i++) { if (i == node) { foundit = true; break; } } if (!foundit) addElement(node); } // checkDups(); return insertIndex; }
// in src/org/apache/xpath/NodeSetDTM.java
public int addNodeInDocOrder(int node, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); return addNodeInDocOrder(node, true, support); }
// in src/org/apache/xpath/NodeSetDTM.java
public void addElement(int value) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.addElement(value); }
// in src/org/apache/xpath/NodeSetDTM.java
public void insertElementAt(int value, int at) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.insertElementAt(value, at); }
// in src/org/apache/xpath/NodeSetDTM.java
public void appendNodes(NodeVector nodes) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.appendNodes(nodes); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeAllElements() { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.removeAllElements(); }
// in src/org/apache/xpath/NodeSetDTM.java
public boolean removeElement(int s) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); return super.removeElement(s); }
// in src/org/apache/xpath/NodeSetDTM.java
public void removeElementAt(int i) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.removeElementAt(i); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setElementAt(int node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.setElementAt(node, index); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setItem(int node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!"); super.setElementAt(node, index); }
// in src/org/apache/xpath/NodeSetDTM.java
public void setCurrentPos(int i) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_INDEX, null)); //"This NodeSetDTM can not do indexing or counting functions!"); m_next = i; }
// in src/org/apache/xpath/NodeSetDTM.java
public int getCurrentNode() { if (!m_cacheNodes) throw new RuntimeException( "This NodeSetDTM can not do indexing or counting functions!"); int saved = m_next; // because nextNode always increments // But watch out for copy29, where the root iterator didn't // have nextNode called on it. int current = (m_next > 0) ? m_next-1 : m_next; int n = (current < m_firstFree) ? elementAt(current) : DTM.NULL; m_next = saved; // HACK: I think this is a bit of a hack. -sb return n; }
// in src/org/apache/xpath/NodeSetDTM.java
public void setShouldCacheNodes(boolean b) { if (!isFresh()) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!"); m_cacheNodes = b; m_mutable = true; }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public void detach() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_DETACH_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"detach() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public double num() throws javax.xml.transform.TransformerException { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public XMLString xstr() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XSTR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"xstr() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public String str() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_STR_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"str() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public int rtf() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"rtf() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public DTMIterator asNodeIterator() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_RTF_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"asNodeIterator() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XStringForChars.java
public FastStringBuffer fsb() { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_FSB_NOT_SUPPORTED_XSTRINGFORCHARS, null)); //"fsb() not supported for XStringForChars!"); }
// in src/org/apache/xpath/objects/XNodeSet.java
public DTMIterator iter() { try { if(hasCache()) return cloneWithReset(); else return this; // don't bother to clone... won't do any good! } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); } }
// in src/org/apache/xpath/objects/XNodeSet.java
public XObject getFresh() { try { if(hasCache()) return (XObject)cloneWithReset(); else return this; // don't bother to clone... won't do any good! } catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); } }
// in src/org/apache/xpath/NodeSet.java
public Node previousNode() throws DOMException { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_ITERATE, null)); //"This NodeSet can not iterate to a previous node!"); if ((m_next - 1) > 0) { m_next--; return this.elementAt(m_next); } else return null; }
// in src/org/apache/xpath/NodeSet.java
public void runTo(int index) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); if ((index >= 0) && (m_next < m_firstFree)) m_next = index; else m_next = m_firstFree - 1; }
// in src/org/apache/xpath/NodeSet.java
public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
// in src/org/apache/xpath/NodeSet.java
public void insertNode(Node n, int pos) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); insertElementAt(n, pos); }
// in src/org/apache/xpath/NodeSet.java
public void removeNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.removeElement(n); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeList nodelist) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != nodelist) // defensive to fix a bug that Sanjiva reported. { int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node obj = nodelist.item(i); if (null != obj) { addElement(obj); } } } // checkDups(); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeSet ns) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); addNodes((NodeIterator) ns); }
// in src/org/apache/xpath/NodeSet.java
public void addNodes(NodeIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { Node obj; while (null != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
// in src/org/apache/xpath/NodeSet.java
public void addNodesInDocOrder(NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node node = nodelist.item(i); if (null != node) { addNodeInDocOrder(node, support); } } }
// in src/org/apache/xpath/NodeSet.java
public void addNodesInDocOrder(NodeIterator iterator, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); Node node; while (null != (node = iterator.nextNode())) { addNodeInDocOrder(node, support); } }
// in src/org/apache/xpath/NodeSet.java
private boolean addNodesInDocOrder(int start, int end, int testIndex, NodeList nodelist, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); boolean foundit = false; int i; Node node = nodelist.item(testIndex); for (i = end; i >= start; i--) { Node child = (Node) elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } if (!DOM2Helper.isNodeAfter(node, child)) { insertElementAt(node, i + 1); testIndex--; if (testIndex > 0) { boolean foundPrev = addNodesInDocOrder(0, i, testIndex, nodelist, support); if (!foundPrev) { addNodesInDocOrder(i, size() - 1, testIndex, nodelist, support); } } break; } } if (i == -1) { insertElementAt(node, 0); } return foundit; }
// in src/org/apache/xpath/NodeSet.java
public int addNodeInDocOrder(Node node, boolean test, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); int insertIndex = -1; if (test) { // This needs to do a binary search, but a binary search // is somewhat tough because the sequence test involves // two nodes. int size = size(), i; for (i = size - 1; i >= 0; i--) { Node child = (Node) elementAt(i); if (child == node) { i = -2; // Duplicate, suppress insert break; } if (!DOM2Helper.isNodeAfter(node, child)) { break; } } if (i != -2) { insertIndex = i + 1; insertElementAt(node, insertIndex); } } else { insertIndex = this.size(); boolean foundit = false; for (int i = 0; i < insertIndex; i++) { if (this.item(i).equals(node)) { foundit = true; break; } } if (!foundit) addElement(node); } // checkDups(); return insertIndex; }
// in src/org/apache/xpath/NodeSet.java
public int addNodeInDocOrder(Node node, XPathContext support) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); return addNodeInDocOrder(node, true, support); }
// in src/org/apache/xpath/NodeSet.java
public void setCurrentPos(int i) { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); m_next = i; }
// in src/org/apache/xpath/NodeSet.java
public Node getCurrentNode() { if (!m_cacheNodes) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_CANNOT_INDEX, null)); //"This NodeSet can not do indexing or counting functions!"); int saved = m_next; Node n = (m_next < m_firstFree) ? elementAt(m_next) : null; m_next = saved; // HACK: I think this is a bit of a hack. -sb return n; }
// in src/org/apache/xpath/NodeSet.java
public void setShouldCacheNodes(boolean b) { if (!isFresh()) throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_CALL_SETSHOULDCACHENODE, null)); //"Can not call setShouldCacheNodes after nextNode has been called!"); m_cacheNodes = b; m_mutable = true; }
// in src/org/apache/xpath/NodeSet.java
public void addElement(Node value) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if ((m_firstFree + 1) >= m_mapSize) { if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } else { m_mapSize += m_blocksize; Node newMap[] = new Node[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } } m_map[m_firstFree] = value; m_firstFree++; }
// in src/org/apache/xpath/NodeSet.java
public void insertElementAt(Node value, int at) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } else if ((m_firstFree + 1) >= m_mapSize) { m_mapSize += m_blocksize; Node newMap[] = new Node[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree + 1); m_map = newMap; } if (at <= (m_firstFree - 1)) { System.arraycopy(m_map, at, m_map, at + 1, m_firstFree - at); } m_map[at] = value; m_firstFree++; }
// in src/org/apache/xpath/NodeSet.java
public boolean removeElement(Node s) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) return false; for (int i = 0; i < m_firstFree; i++) { Node node = m_map[i]; if ((null != node) && node.equals(s)) { if (i < m_firstFree - 1) System.arraycopy(m_map, i + 1, m_map, i, m_firstFree - i - 1); m_firstFree--; m_map[m_firstFree] = null; return true; } } return false; }
// in src/org/apache/xpath/NodeSet.java
public void setElementAt(Node node, int index) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } m_map[index] = node; }
// in src/org/apache/xpath/functions/FuncCurrent.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/res/XPATHMessages.java
public static final String createXPATHMsg(ListResourceBundle fResourceBundle, String msgKey, Object args[]) //throws Exception { String fmsg = null; boolean throwex = false; String msg = null; if (msgKey != null) msg = fResourceBundle.getString(msgKey); if (msg == null) { msg = fResourceBundle.getString(XPATHErrorResources.BAD_CODE); throwex = true; } if (args != null) { try { // Do this to keep format from crying. // This is better than making a bunch of conditional // code all over the place. int n = args.length; for (int i = 0; i < n; i++) { if (null == args[i]) args[i] = ""; } fmsg = java.text.MessageFormat.format(msg, args); } catch (Exception e) { fmsg = fResourceBundle.getString(XPATHErrorResources.FORMAT_FAILED); fmsg += " " + msg; } } else fmsg = msg; if (throwex) { throw new RuntimeException(fmsg); } return fmsg; }
// in src/org/apache/xpath/SourceTreeManager.java
public void putDocumentInCache(int n, Source source) { int cachedNode = getNode(source); if (DTM.NULL != cachedNode) { if (!(cachedNode == n)) throw new RuntimeException( "Programmer's Error! " + "putDocumentInCache found reparse of doc: " + source.getSystemId()); return; } if (null != source.getSystemId()) { m_sourceTree.addElement(new SourceTree(n, source.getSystemId())); } }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
public short acceptNode(int n, XPathContext xctxt) { try { xctxt.pushCurrentNode(n); xctxt.pushIteratorRoot(m_context); if(DEBUG) { System.out.println("traverser: "+m_traverser); System.out.print("node: "+n); System.out.println(", "+m_cdtm.getNodeName(n)); // if(m_cdtm.getNodeName(n).equals("near-east")) System.out.println("pattern: "+m_pattern.toString()); m_pattern.debugWhatToShow(m_pattern.getWhatToShow()); } XObject score = m_pattern.execute(xctxt); if(DEBUG) { // System.out.println("analysis: "+Integer.toBinaryString(m_analysis)); System.out.println("score: "+score); System.out.println("skip: "+(score == NodeTest.SCORE_NONE)); } // System.out.println("\n::acceptNode - score: "+score.num()+"::"); return (score == NodeTest.SCORE_NONE) ? DTMIterator.FILTER_SKIP : DTMIterator.FILTER_ACCEPT; } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); xctxt.popIteratorRoot(); } }
// in src/org/apache/xpath/axes/FilterExprWalker.java
public short acceptNode(int n) { try { if (getPredicateCount() > 0) { countProximityPosition(0); if (!executePredicates(n, m_lpi.getXPathContext())) return DTMIterator.FILTER_SKIP; } return DTMIterator.FILTER_ACCEPT; } catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); } }
// in src/org/apache/xpath/axes/AxesWalker.java
public void setRoot(int root) { // %OPT% Get this directly from the lpi. XPathContext xctxt = wi().getXPathContext(); m_dtm = xctxt.getDTM(root); m_traverser = m_dtm.getAxisTraverser(m_axis); m_isFresh = true; m_foundLast = false; m_root = root; m_currentNode = root; if (DTM.NULL == root) { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!"); } resetProximityPositions(); }
// in src/org/apache/xpath/axes/LocPathIterator.java
public int previousNode() { throw new RuntimeException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_CANNOT_ITERATE, null)); //"This NodeSetDTM can not iterate to a previous node!"); }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static int getAxisFromStep( Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(stepOpCodePos); switch (stepType) { case OpCodes.FROM_FOLLOWING : return Axis.FOLLOWING; case OpCodes.FROM_FOLLOWING_SIBLINGS : return Axis.FOLLOWINGSIBLING; case OpCodes.FROM_PRECEDING : return Axis.PRECEDING; case OpCodes.FROM_PRECEDING_SIBLINGS : return Axis.PRECEDINGSIBLING; case OpCodes.FROM_PARENT : return Axis.PARENT; case OpCodes.FROM_NAMESPACE : return Axis.NAMESPACE; case OpCodes.FROM_ANCESTORS : return Axis.ANCESTOR; case OpCodes.FROM_ANCESTORS_OR_SELF : return Axis.ANCESTORORSELF; case OpCodes.FROM_ATTRIBUTES : return Axis.ATTRIBUTE; case OpCodes.FROM_ROOT : return Axis.ROOT; case OpCodes.FROM_CHILDREN : return Axis.CHILD; case OpCodes.FROM_DESCENDANTS_OR_SELF : return Axis.DESCENDANTORSELF; case OpCodes.FROM_DESCENDANTS : return Axis.DESCENDANT; case OpCodes.FROM_SELF : return Axis.SELF; case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : return Axis.FILTEREDLIST; } throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isOptimizableForDescendantIterator( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; boolean foundDorDS = false; boolean foundSelf = false; boolean foundDS = false; int nodeTestType = OpCodes.NODETYPE_NODE; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { // The DescendantIterator can only do one node test. If there's more // than one, use another iterator. if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT) return false; stepCount++; if(stepCount > 3) return false; boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType); if(mightBeProximate) return false; switch (stepType) { case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : return false; case OpCodes.FROM_ROOT : if(1 != stepCount) return false; break; case OpCodes.FROM_CHILDREN : if(!foundDS && !(foundDorDS && foundSelf)) return false; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : foundDS = true; case OpCodes.FROM_DESCENDANTS : if(3 == stepCount) return false; foundDorDS = true; break; case OpCodes.FROM_SELF : if(1 != stepCount) return false; foundSelf = true; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } nodeTestType = compiler.getStepTestType(stepOpCodePos); int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; if(OpCodes.ENDOP != compiler.getOp(nextStepOpCodePos)) { if(compiler.countPredicates(stepOpCodePos) > 0) { return false; } } stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static int analyze( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; int analysisResult = 0x00000000; // 32 bits of analysis while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; // String namespace = compiler.getStepNS(stepOpCodePos); // boolean isNSWild = (null != namespace) // ? namespace.equals(NodeTest.WILD) : false; // String localname = compiler.getStepLocalName(stepOpCodePos); // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false; boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos, stepType); if (predAnalysis) analysisResult |= BIT_PREDICATE; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : analysisResult |= BIT_FILTER; break; case OpCodes.FROM_ROOT : analysisResult |= BIT_ROOT; break; case OpCodes.FROM_ANCESTORS : analysisResult |= BIT_ANCESTOR; break; case OpCodes.FROM_ANCESTORS_OR_SELF : analysisResult |= BIT_ANCESTOR_OR_SELF; break; case OpCodes.FROM_ATTRIBUTES : analysisResult |= BIT_ATTRIBUTE; break; case OpCodes.FROM_NAMESPACE : analysisResult |= BIT_NAMESPACE; break; case OpCodes.FROM_CHILDREN : analysisResult |= BIT_CHILD; break; case OpCodes.FROM_DESCENDANTS : analysisResult |= BIT_DESCENDANT; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : // Use a special bit to to make sure we get the right analysis of "//foo". if (2 == stepCount && BIT_ROOT == analysisResult) { analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT; } analysisResult |= BIT_DESCENDANT_OR_SELF; break; case OpCodes.FROM_FOLLOWING : analysisResult |= BIT_FOLLOWING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : analysisResult |= BIT_FOLLOWING_SIBLING; break; case OpCodes.FROM_PRECEDING : analysisResult |= BIT_PRECEDING; break; case OpCodes.FROM_PRECEDING_SIBLINGS : analysisResult |= BIT_PRECEDING_SIBLING; break; case OpCodes.FROM_PARENT : analysisResult |= BIT_PARENT; break; case OpCodes.FROM_SELF : analysisResult |= BIT_SELF; break; case OpCodes.MATCH_ATTRIBUTE : analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node() { analysisResult |= BIT_NODETEST_ANY; } stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } analysisResult |= (stepCount & BITS_COUNT); return analysisResult; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static StepPattern createDefaultStepPattern( Compiler compiler, int opPos, MatchPatternIterator mpi, int analysis, StepPattern tail, StepPattern head) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(opPos); boolean simpleInit = false; boolean prevIsOneStepDown = true; int whatToShow = compiler.getWhatToShow(opPos); StepPattern ai = null; int axis, predicateAxis; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; Expression expr; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : expr = compiler.compile(opPos); break; default : expr = compiler.compile(opPos + 2); } axis = Axis.FILTEREDLIST; predicateAxis = Axis.FILTEREDLIST; ai = new FunctionPattern(expr, axis, predicateAxis); simpleInit = true; break; case OpCodes.FROM_ROOT : whatToShow = DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT; axis = Axis.ROOT; predicateAxis = Axis.ROOT; ai = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, axis, predicateAxis); break; case OpCodes.FROM_ATTRIBUTES : whatToShow = DTMFilter.SHOW_ATTRIBUTE; axis = Axis.PARENT; predicateAxis = Axis.ATTRIBUTE; // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF); break; case OpCodes.FROM_NAMESPACE : whatToShow = DTMFilter.SHOW_NAMESPACE; axis = Axis.PARENT; predicateAxis = Axis.NAMESPACE; // ai = new StepPattern(whatToShow, axis, predicateAxis); break; case OpCodes.FROM_ANCESTORS : axis = Axis.DESCENDANT; predicateAxis = Axis.ANCESTOR; break; case OpCodes.FROM_CHILDREN : axis = Axis.PARENT; predicateAxis = Axis.CHILD; break; case OpCodes.FROM_ANCESTORS_OR_SELF : axis = Axis.DESCENDANTORSELF; predicateAxis = Axis.ANCESTORORSELF; break; case OpCodes.FROM_SELF : axis = Axis.SELF; predicateAxis = Axis.SELF; break; case OpCodes.FROM_PARENT : axis = Axis.CHILD; predicateAxis = Axis.PARENT; break; case OpCodes.FROM_PRECEDING_SIBLINGS : axis = Axis.FOLLOWINGSIBLING; predicateAxis = Axis.PRECEDINGSIBLING; break; case OpCodes.FROM_PRECEDING : axis = Axis.FOLLOWING; predicateAxis = Axis.PRECEDING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : axis = Axis.PRECEDINGSIBLING; predicateAxis = Axis.FOLLOWINGSIBLING; break; case OpCodes.FROM_FOLLOWING : axis = Axis.PRECEDING; predicateAxis = Axis.FOLLOWING; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : axis = Axis.ANCESTORORSELF; predicateAxis = Axis.DESCENDANTORSELF; break; case OpCodes.FROM_DESCENDANTS : axis = Axis.ANCESTOR; predicateAxis = Axis.DESCENDANT; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if(null == ai) { whatToShow = compiler.getWhatToShow(opPos); // %REVIEW% ai = new StepPattern(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos), axis, predicateAxis); } if (false || DEBUG_PATTERN_CREATION) { System.out.print("new step: "+ ai); System.out.print(", axis: " + Axis.getNames(ai.getAxis())); System.out.print(", predAxis: " + Axis.getNames(ai.getAxis())); System.out.print(", what: "); System.out.print(" "); ai.debugWhatToShow(ai.getWhatToShow()); } int argLen = compiler.getFirstPredicateOpPos(opPos); ai.setPredicates(compiler.getCompiledPredicates(argLen)); return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static AxesWalker createDefaultWalker(Compiler compiler, int opPos, WalkingIterator lpi, int analysis) { AxesWalker ai = null; int stepType = compiler.getOp(opPos); /* System.out.println("0: "+compiler.getOp(opPos)); System.out.println("1: "+compiler.getOp(opPos+1)); System.out.println("2: "+compiler.getOp(opPos+2)); System.out.println("3: "+compiler.getOp(opPos+3)); System.out.println("4: "+compiler.getOp(opPos+4)); System.out.println("5: "+compiler.getOp(opPos+5)); */ boolean simpleInit = false; int totalNumberWalkers = (analysis & BITS_COUNT); boolean prevIsOneStepDown = true; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; if (DEBUG_WALKER_CREATION) System.out.println("new walker: FilterExprWalker: " + analysis + ", " + compiler.toString()); ai = new FilterExprWalker(lpi); simpleInit = true; break; case OpCodes.FROM_ROOT : ai = new AxesWalker(lpi, Axis.ROOT); break; case OpCodes.FROM_ANCESTORS : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.ANCESTOR); break; case OpCodes.FROM_ANCESTORS_OR_SELF : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.ANCESTORORSELF); break; case OpCodes.FROM_ATTRIBUTES : ai = new AxesWalker(lpi, Axis.ATTRIBUTE); break; case OpCodes.FROM_NAMESPACE : ai = new AxesWalker(lpi, Axis.NAMESPACE); break; case OpCodes.FROM_CHILDREN : ai = new AxesWalker(lpi, Axis.CHILD); break; case OpCodes.FROM_DESCENDANTS : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.DESCENDANT); break; case OpCodes.FROM_DESCENDANTS_OR_SELF : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.DESCENDANTORSELF); break; case OpCodes.FROM_FOLLOWING : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.FOLLOWING); break; case OpCodes.FROM_FOLLOWING_SIBLINGS : prevIsOneStepDown = false; ai = new AxesWalker(lpi, Axis.FOLLOWINGSIBLING); break; case OpCodes.FROM_PRECEDING : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PRECEDING); break; case OpCodes.FROM_PRECEDING_SIBLINGS : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PRECEDINGSIBLING); break; case OpCodes.FROM_PARENT : prevIsOneStepDown = false; ai = new ReverseAxesWalker(lpi, Axis.PARENT); break; case OpCodes.FROM_SELF : ai = new AxesWalker(lpi, Axis.SELF); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (simpleInit) { ai.initNodeTest(DTMFilter.SHOW_ALL); } else { int whatToShow = compiler.getWhatToShow(opPos); /* System.out.print("construct: "); NodeTest.debugWhatToShow(whatToShow); System.out.println("or stuff: "+(whatToShow & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_ELEMENT | DTMFilter.SHOW_PROCESSING_INSTRUCTION))); */ if ((0 == (whatToShow & (DTMFilter.SHOW_ATTRIBUTE | DTMFilter.SHOW_NAMESPACE | DTMFilter.SHOW_ELEMENT | DTMFilter.SHOW_PROCESSING_INSTRUCTION))) || (whatToShow == DTMFilter.SHOW_ALL)) ai.initNodeTest(whatToShow); else { ai.initNodeTest(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos)); } } return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isNaturalDocOrder( Compiler compiler, int stepOpCodePos, int stepIndex, int analysis) throws javax.xml.transform.TransformerException { if(canCrissCross(analysis)) return false; // Namespaces can present some problems, so just punt if we're looking for // these. if(isSet(analysis, BIT_NAMESPACE)) return false; // The following, preceding, following-sibling, and preceding sibling can // be found in doc order if we get to this point, but if they occur // together, they produce // duplicates, so it's better for us to eliminate this case so we don't // have to check for duplicates during runtime if we're using a // WalkingIterator. if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) && isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING)) return false; // OK, now we have to check for select="@*/axis::*" patterns, which // can also cause duplicates to happen. But select="axis*/@::*" patterns // are OK, as are select="@foo/axis::*" patterns. // Unfortunately, we can't do this just via the analysis bits. int stepType; int stepCount = 0; boolean foundWildAttribute = false; // Steps that can traverse anything other than down a // subtree or that can produce duplicates when used in // combonation are counted with this variable. int potentialDuplicateMakingStepCount = 0; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; switch (stepType) { case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : if(foundWildAttribute) // Maybe not needed, but be safe. return false; // This doesn't seem to work as a test for wild card. Hmph. // int nodeTestType = compiler.getStepTestType(stepOpCodePos); String localName = compiler.getStepLocalName(stepOpCodePos); // System.err.println("localName: "+localName); if(localName.equals("*")) { foundWildAttribute = true; } break; case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : case OpCodes.FROM_DESCENDANTS_OR_SELF : case OpCodes.FROM_DESCENDANTS : if(potentialDuplicateMakingStepCount > 0) return false; potentialDuplicateMakingStepCount++; case OpCodes.FROM_ROOT : case OpCodes.FROM_CHILDREN : case OpCodes.FROM_SELF : if(foundWildAttribute) return false; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public short acceptNode(int n) { XPathContext xctxt = m_lpi.getXPathContext(); try { xctxt.pushCurrentNode(n); XObject score = execute(xctxt, n); // System.out.println("\n::acceptNode - score: "+score.num()+"::"); if (score != NodeTest.SCORE_NONE) { if (getPredicateCount() > 0) { countProximityPosition(0); if (!executePredicates(n, xctxt)) return DTMIterator.FILTER_SKIP; } return DTMIterator.FILTER_ACCEPT; } } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); } return DTMIterator.FILTER_SKIP; }
// in src/org/apache/xpath/axes/UnionChildIterator.java
public short acceptNode(int n) { XPathContext xctxt = getXPathContext(); try { xctxt.pushCurrentNode(n); for (int i = 0; i < m_nodeTests.length; i++) { PredicatedNodeTest pnt = m_nodeTests[i]; XObject score = pnt.execute(xctxt, n); if (score != NodeTest.SCORE_NONE) { // Note that we are assuming there are no positional predicates! if (pnt.getPredicateCount() > 0) { if (pnt.executePredicates(n, xctxt)) return DTMIterator.FILTER_ACCEPT; } else return DTMIterator.FILTER_ACCEPT; } } } catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); } finally { xctxt.popCurrentNode(); } return DTMIterator.FILTER_SKIP; }
// in src/org/apache/xpath/patterns/StepPattern.java
private final boolean checkProximityPosition(XPathContext xctxt, int predPos, DTM dtm, int context, int pos) { try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.PRECEDINGSIBLING); for (int child = traverser.first(context); DTM.NULL != child; child = traverser.next(context, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { throw new Error("Why: Should never have been called"); } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos--; if (pos < 1) return false; } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return (pos == 1); }
// in src/org/apache/xpath/patterns/StepPattern.java
private final int getProximityPosition(XPathContext xctxt, int predPos, boolean findLast) { int pos = 0; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int parent = dtm.getParent(context); try { DTMAxisTraverser traverser = dtm.getAxisTraverser(Axis.CHILD); for (int child = traverser.first(parent); DTM.NULL != child; child = traverser.next(parent, child)) { try { xctxt.pushCurrentNode(child); if (NodeTest.SCORE_NONE != super.execute(xctxt, child)) { boolean pass = true; try { xctxt.pushSubContextList(this); for (int i = 0; i < predPos; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { if ((pos + 1) != (int) pred.numWithSideEffects()) { pass = false; break; } } else if (!pred.boolWithSideEffects()) { pass = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } if (pass) pos++; if (!findLast && child == context) { return pos; } } } finally { xctxt.popCurrentNode(); } } } catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); } return pos; }
// in src/org/apache/xpath/Expression.java
public void assertion(boolean b, java.lang.String msg) { if (!b) { java.lang.String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }); throw new RuntimeException(fMsg); } }
25
            
// in src/org/apache/xml/utils/DOMHelper.java
catch (ParserConfigurationException pce) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CREATEDOCUMENT_NOT_SUPPORTED, null)); //"createDocument() not supported in XPathContext!"); // return null; }
// in src/org/apache/xml/dtm/ref/DTMDefaultBase.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (Exception e) { throw new RuntimeException( Utils.messages.createMessage( MsgKey.ER_RESOURCE_COULD_NOT_LOAD, new Object[] { entitiesResource, e.toString(), entitiesResource, e.toString()})); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/runtime/output/WriterOutputBuffer.java
catch (IOException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (FileNotFoundException e) { System.err.println("Could not open file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); // Strange that the other catch won't catch this... if (null != m_transformThread) postExceptionFromThread(e); // Assume we're on the main thread else throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (Exception e) { // e.printStackTrace(); if (null != m_transformThread) postExceptionFromThread(e); else throw new RuntimeException(e.getMessage()); // Assume we're on the main thread. }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
catch(IOException ioe) { ioe.printStackTrace(System.err); throw new RuntimeException(ioe.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch (CloneNotSupportedException cnse) { throw new RuntimeException(cnse.getMessage()); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
4
            
// in src/org/apache/xml/utils/DOMHelper.java
public static Node getParentOfNode(Node node) throws RuntimeException { Node parent; short nodeType = node.getNodeType(); if (Node.ATTRIBUTE_NODE == nodeType) { Document doc = node.getOwnerDocument(); /* TBD: if(null == doc) { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT, null));//"Attribute child does not have an owner document!"); } */ // Given how expensive the tree walk may be, we should first ask // whether this DOM can answer the question for us. The additional // test does slow down Level 1 DOMs slightly. DOMHelper2, which // is currently specialized for Xerces, assumes it can use the // Level 2 solution. We might want to have an intermediate stage, // which would assume DOM Level 2 but not assume Xerces. // // (Shouldn't have to check whether impl is null in a compliant DOM, // but let's be paranoid for a moment...) DOMImplementation impl=doc.getImplementation(); if(impl!=null && impl.hasFeature("Core","2.0")) { parent=((Attr)node).getOwnerElement(); return parent; } // DOM Level 1 solution, as fallback. Hugely expensive. Element rootElem = doc.getDocumentElement(); if (null == rootElem) { throw new RuntimeException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT, null)); //"Attribute child does not have an owner document element!"); } parent = locateAttrParent(rootElem, node); } else { parent = node.getParentNode(); // if((Node.DOCUMENT_NODE != nodeType) && (null == parent)) // { // throw new RuntimeException("Child does not have parent!"); // } } return parent; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void assertion(boolean condition, String msg) throws RuntimeException { if (!condition) throw new RuntimeException(msg); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private final void assertIsLocPathIterator(Expression expr1, ExpressionOwner eo) throws RuntimeException { if(!(expr1 instanceof LocPathIterator)) { String errMsg; if(expr1 instanceof Variable) { errMsg = "Programmer's assertion: expr1 not an iterator: "+ ((Variable)expr1).getQName(); } else { errMsg = "Programmer's assertion: expr1 not an iterator: "+ expr1.getClass().getName(); } throw new RuntimeException(errMsg + ", "+ eo.getClass().getName()+" "+ expr1.exprGetParent()); } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
private static void validateNewAddition(Vector paths, ExpressionOwner owner, LocPathIterator path) throws RuntimeException { assertion(owner.getExpression() == path, "owner.getExpression() != path!!!"); int n = paths.size(); // There should never be any duplicates in the list! for(int i = 0; i < n; i++) { ExpressionOwner ew = (ExpressionOwner)paths.elementAt(i); assertion(ew != owner, "duplicate owner on the list!!!"); assertion(ew.getExpression() != path, "duplicate expression on the list!!!"); } }
13
            
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (RuntimeException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (RuntimeException re) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re); return null; }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
10
            
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (RuntimeException e) { throw (LSException) createLSException(LSException.SERIALIZE_ERR, e).fillInStackTrace(); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (RuntimeException re) { throw re; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; }
0
unknown (Lib) SAXException 112
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (target.equals("xml-stylesheet")) { String href = null; // CDATA #REQUIRED String type = null; // CDATA #REQUIRED String title = null; // CDATA #IMPLIED String media = null; // CDATA #IMPLIED String charset = null; // CDATA #IMPLIED boolean alternate = false; // (yes|no) "no" StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true); boolean lookedAhead = false; Source source = null; String token = ""; while (tokenizer.hasMoreTokens()) { if (!lookedAhead) token = tokenizer.nextToken(); else lookedAhead = false; if (tokenizer.hasMoreTokens() && (token.equals(" ") || token.equals("\t") || token.equals("="))) continue; String name = token; if (name.equals("type")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); type = token.substring(1, token.length() - 1); } else if (name.equals("href")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); href = token; if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); // If the href value has parameters to be passed to a // servlet(something like "foobar?id=12..."), // we want to make sure we get them added to // the href value. Without this check, we would move on // to try to process another attribute and that would be // wrong. // We need to set lookedAhead here to flag that we // already have the next token. while ( token.equals("=") && tokenizer.hasMoreTokens()) { href = href + token + tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); lookedAhead = true; } else { break; } } } href = href.substring(1, href.length() - 1); try { // Add code to use a URIResolver. Patch from Dmitri Ilyin. if (m_uriResolver != null) { source = m_uriResolver.resolve(href, m_baseID); } else { href = SystemIDResolver.getAbsoluteURI(href, m_baseID); source = new SAXSource(new InputSource(href)); } } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } } else if (name.equals("title")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); title = token.substring(1, token.length() - 1); } else if (name.equals("media")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); media = token.substring(1, token.length() - 1); } else if (name.equals("charset")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); charset = token.substring(1, token.length() - 1); } else if (name.equals("alternate")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); alternate = token.substring(1, token.length() - 1).equals("yes"); } } if ((null != type) && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt")) && (null != href)) { if (null != m_media) { if (null != media) { if (!media.equals(m_media)) return; } else return; } if (null != m_charset) { if (null != charset) { if (!charset.equals(m_charset)) return; } else return; } if (null != m_title) { if (null != title) { if (!title.equals(m_title)) return; } else return; } m_stylesheets.addElement(source); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
protected void append(Node newNode) throws org.xml.sax.SAXException { Node currentNode = m_currentNode; if (null != currentNode) { if (currentNode == m_root && m_nextSibling != null) currentNode.insertBefore(newNode, m_nextSibling); else currentNode.appendChild(newNode); // System.out.println(newNode.getNodeName()); } else if (null != m_docFrag) { if (m_nextSibling != null) m_docFrag.insertBefore(newNode, m_nextSibling); else m_docFrag.appendChild(newNode); } else { boolean ok = true; short type = newNode.getNodeType(); if (type == Node.TEXT_NODE) { String data = newNode.getNodeValue(); if ((null != data) && (data.trim().length() > 0)) { throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null)); //"Warning: can't output text before document element! Ignoring..."); } ok = false; } else if (type == Node.ELEMENT_NODE) { if (m_doc.getDocumentElement() != null) { ok = false; throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null)); //"Can't have more than one root on a DOM!"); } } if (ok) { if (m_nextSibling != null) m_doc.insertBefore(newNode, m_nextSibling); else m_doc.appendChild(newNode); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startElement( String ns, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { Element elem; // Note that the namespace-aware call must be used to correctly // construct a Level 2 DOM, even for non-namespaced nodes. if ((null == ns) || (ns.length() == 0)) elem = m_doc.createElementNS(null,name); else elem = m_doc.createElementNS(ns, name); append(elem); try { int nAtts = atts.getLength(); if (0 != nAtts) { for (int i = 0; i < nAtts; i++) { //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) ); // First handle a possible ID attribute if (atts.getType(i).equalsIgnoreCase("ID")) setIDAttribute(atts.getValue(i), elem); String attrNS = atts.getURI(i); if("".equals(attrNS)) attrNS = null; // DOM represents no-namespace as null // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i) // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i)); // Crimson won't let us set an xmlns: attribute on the DOM. String attrQName = atts.getQName(i); // In SAX, xmlns[:] attributes have an empty namespace, while in DOM they // should have the xmlns namespace if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) { attrNS = "http://www.w3.org/2000/xmlns/"; } // ALWAYS use the DOM Level 2 call! elem.setAttributeNS(attrNS,attrQName, atts.getValue(i)); } } /* * Adding namespace nodes to the DOM tree; */ int nDecls = m_prefixMappings.size(); String prefix, declURL; for (int i = 0; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; declURL = (String) m_prefixMappings.elementAt(i + 1); elem.setAttributeNS("http://www.w3.org/2000/xmlns/", prefix, declURL); } m_prefixMappings.clear(); // append(elem); m_elemStack.push(elem); m_currentNode = elem; // append(elem); } catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); } }
// in src/org/apache/xml/utils/XMLReaderManager.java
public synchronized XMLReader getXMLReader() throws SAXException { XMLReader reader; boolean readerInUse; if (m_readers == null) { // When the m_readers.get() method is called for the first time // on a thread, a new XMLReader will automatically be created. m_readers = new ThreadLocal(); } if (m_inUse == null) { m_inUse = new Hashtable(); } // If the cached reader for this thread is in use, construct a new // one; otherwise, return the cached reader. reader = (XMLReader) m_readers.get(); boolean threadHasReader = (reader != null); if (!threadHasReader || m_inUse.get(reader) == Boolean.TRUE) { try { try { // According to JAXP 1.2 specification, if a SAXSource // is created using a SAX InputSource the Transformer or // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); } catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } } try { reader.setFeature(NAMESPACES_FEATURE, true); reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false); } catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. } } catch (ParserConfigurationException ex) { throw new SAXException(ex); } catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); } catch (NoSuchMethodError ex2) { } catch (AbstractMethodError ame) { } // Cache the XMLReader if this is the first time we've created // a reader for this thread. if (!threadHasReader) { m_readers.set(reader); m_inUse.put(reader, Boolean.TRUE); } } else { m_inUse.put(reader, Boolean.TRUE); } return reader; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_entry_pause() throws SAXException { if(fCoroutineManager==null) { // Nobody called init()? Do it now... init(null,-1,-1); } try { Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID); if(arg==Boolean.FALSE) co_yield(false); } catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public void startParse(InputSource source) throws SAXException { if (fIncrementalParser==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser."); if (fParseInProgress) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing."); boolean ok=false; try { ok = parseSomeSetup(source); } catch(Exception ex) { throw new SAXException(ex); } if(!ok) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with"); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null == m_entities) { m_entities = new Vector(); } try { systemId = SystemIDResolver.getAbsoluteURI(systemId, getDocumentBaseURI()); } catch (Exception e) { throw new org.xml.sax.SAXException(e); } // private static final int ENTITY_FIELD_PUBLICID = 0; m_entities.addElement(publicId); // private static final int ENTITY_FIELD_SYSTEMID = 1; m_entities.addElement(systemId); // private static final int ENTITY_FIELD_NOTATIONNAME = 2; m_entities.addElement(notationName); // private static final int ENTITY_FIELD_NAME = 3; m_entities.addElement(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startDocumentInternal() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_needToCallStartDocument = false; if (m_inEntityRef) return; m_needToOutputDocTypeDecl = true; m_startNewLine = false; /* The call to getXMLVersion() might emit an error message * and we should emit this message regardless of if we are * writing out an XML header or not. */ final String version = getXMLVersion(); if (getOmitXMLDeclaration() == false) { String encoding = Encodings.getMimeEncoding(getEncoding()); String standalone; if (m_standaloneWasSpecified) { standalone = " standalone=\"" + getStandalone() + "\""; } else { standalone = ""; } try { final java.io.Writer writer = m_writer; writer.write("<?xml version=\""); writer.write(version); writer.write("\" encoding=\""); writer.write(encoding); writer.write('\"'); writer.write(standalone); writer.write("?>"); if (m_doIndent) { if (m_standaloneWasSpecified || getDoctypePublic() != null || getDoctypeSystem() != null) { // We almost never put a newline after the XML // header because this XML could be used as // an extenal general parsed entity // and we don't know the context into which it // will be used in the future. Only when // standalone, or a doctype system or public is // specified are we free to insert a new line // after the header. Is it even worth bothering // in these rare cases? writer.write(m_lineSep, 0, m_lineSepLen); } } } catch(IOException e) { throw new SAXException(e); } } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (m_inEntityRef) return; flushPending(); if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) startDocumentInternal(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); int indexOfQLT = data.indexOf("?>"); if (indexOfQLT >= 0) { // See XSLT spec on error recovery of "?>" in PIs. if (indexOfQLT > 0) { writer.write(data.substring(0, indexOfQLT)); } writer.write("? >"); // add space between. if ((indexOfQLT + 2) < data.length()) { writer.write(data.substring(indexOfQLT + 2)); } } else { writer.write(data); } writer.write('?'); writer.write('>'); /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { if (m_elemContext.m_startTagOpen) { try { final String patchedName = patchName(name); final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_xmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 32 to 127 so we write out the // value directly writer.write(' '); writer.write(patchedName); writer.write("=\""); writer.write(value); writer.write('"'); } else { writer.write(' '); writer.write(patchedName); writer.write("=\""); writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); try { if (inTemporaryOutputState()) { /* leave characters un-processed as we are * creating temporary output, the output generated by * this serializer will be input to a final serializer * later on and it will do the processing in final * output state (not temporary output state). * * A "temporary" ToTextStream serializer is used to * evaluate attribute value templates (for example), * and the result of evaluating such a thing * is fed into a final serializer later on. */ m_writer.write(ch, start, length); } else { // In final output state we do process the characters! writeNormalizedChars(ch, start, length, m_lineSepUse); } if (m_tracer != null) super.fireCharEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); if (m_tracer != null) super.fireCDATAEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
private void outputDocTypeDecl(String name) throws SAXException { if (true == m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((null != doctypeSystem) || (null != doctypePublic)) { final java.io.Writer writer = m_writer; try { writer.write("<!DOCTYPE "); writer.write(name); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('"'); } if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); writer.write('"'); } writer.write('>'); outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } } m_needToOutputDocTypeDecl = false; }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { ElemContext elemContext = m_elemContext; // clean up any pending things first if (elemContext.m_startTagOpen) { closeStartTag(); elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_needToOutputDocTypeDecl) { String n = name; if (n == null || n.length() == 0) { // If the lexical QName is not given // use the localName in the DOCTYPE n = localName; } outputDocTypeDecl(n); } // if this element has a namespace then treat it like XML if (null != namespaceURI && namespaceURI.length() > 0) { super.startElement(namespaceURI, localName, name, atts); return; } try { // getElemDesc2(name) is faster than getElemDesc(name) ElemDesc elemDesc = getElemDesc2(name); int elemFlags = elemDesc.getFlags(); // deal with indentation issues first if (m_doIndent) { boolean isBlockElement = (elemFlags & ElemDesc.BLOCK) != 0; if (m_ispreserve) m_ispreserve = false; else if ( (null != elemContext.m_elementName) && (!m_inBlockElem || isBlockElement) /* && !isWhiteSpaceSensitive */ ) { m_startNewLine = true; indent(); } m_inBlockElem = !isBlockElement; } // save any attributes for later processing if (atts != null) addAttributes(atts); m_isprevtext = false; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); if (m_tracer != null) firePseudoAttributes(); if ((elemFlags & ElemDesc.EMPTY) != 0) { // an optimization for elements which are expected // to be empty. m_elemContext = elemContext.push(); /* XSLTC sometimes calls namespaceAfterStartElement() * so we need to remember the name */ m_elemContext.m_elementName = name; m_elemContext.m_elementDesc = elemDesc; return; } else { elemContext = elemContext.push(namespaceURI,localName,name); m_elemContext = elemContext; elemContext.m_elementDesc = elemDesc; elemContext.m_isRaw = (elemFlags & ElemDesc.RAW) != 0; } if ((elemFlags & ElemDesc.HEADELEM) != 0) { // This is the <HEAD> element, do some special processing closeStartTag(); elemContext.m_startTagOpen = false; if (!m_omitMetaTag) { if (m_doIndent) indent(); writer.write( "<META http-equiv=\"Content-Type\" content=\"text/html; charset="); String encoding = getEncoding(); String encode = Encodings.getMimeEncoding(encoding); writer.write(encode); writer.write("\">"); } } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement( final String namespaceURI, final String localName, final String name) throws org.xml.sax.SAXException { // deal with any pending issues if (m_cdataTagOpen) closeCDATA(); // if the element has a namespace, treat it like XML, not HTML if (null != namespaceURI && namespaceURI.length() > 0) { super.endElement(namespaceURI, localName, name); return; } try { ElemContext elemContext = m_elemContext; final ElemDesc elemDesc = elemContext.m_elementDesc; final int elemFlags = elemDesc.getFlags(); final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0; // deal with any indentation issues if (m_doIndent) { final boolean isBlockElement = (elemFlags&ElemDesc.BLOCK) != 0; boolean shouldIndent = false; if (m_ispreserve) { m_ispreserve = false; } else if (m_doIndent && (!m_inBlockElem || isBlockElement)) { m_startNewLine = true; shouldIndent = true; } if (!elemContext.m_startTagOpen && shouldIndent) indent(elemContext.m_currentElemDepth - 1); m_inBlockElem = !isBlockElement; } final java.io.Writer writer = m_writer; if (!elemContext.m_startTagOpen) { writer.write("</"); writer.write(name); writer.write('>'); } else { // the start-tag open when this method was called, // so we need to process it now. if (m_tracer != null) super.fireStartElem(name); // the starting tag was still open when we received this endElement() call // so we need to process any gathered attributes NOW, before they go away. int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (!elemEmpty) { // As per Dave/Paul recommendation 12/06/2000 // if (shouldIndent) // writer.write('>'); // indent(m_currentIndent); writer.write("></"); writer.write(name); writer.write('>'); } else { writer.write('>'); } } // clean up because the element has ended if ((elemFlags & ElemDesc.WHITESPACESENSITIVE) != 0) m_ispreserve = true; m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); // OPTIMIZE-EMPTY if (elemEmpty) { // a quick exit if the HTML element had no children. // This block of code can be removed if the corresponding block of code // in startElement() also labeled with "OPTIMIZE-EMPTY" is also removed m_elemContext = elemContext.m_prev; return; } // some more clean because the element has ended. if (!elemContext.m_startTagOpen) { if (m_doIndent && !m_preserves.isEmpty()) m_preserves.pop(); } m_elemContext = elemContext.m_prev; // m_isRawStack.pop(); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void characters(char chars[], int start, int length) throws org.xml.sax.SAXException { if (m_elemContext.m_isRaw) { try { // Clean up some pending issues. if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; writeNormalizedChars(chars, start, length, false, m_lineSepUse); // time to generate characters event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); } } else { super.characters(chars, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if ((null != m_elemContext.m_elementName) && (m_elemContext.m_elementName.equalsIgnoreCase("SCRIPT") || m_elemContext.m_elementName.equalsIgnoreCase("STYLE"))) { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); // writer.write(ch, start, length); writeNormalizedChars(ch, start, length, true, m_lineSepUse); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } } else { super.cdata(ch, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // Process any pending starDocument and startElement first. flushPending(); // Use a fairly nasty hack to tell if the next node is supposed to be // unescaped text. if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { // clean up any pending things first if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps processing instructions can be written out in HTML before * the DOCTYPE, in which case this could be emitted with the * startElement call, that knows the name of the document element * doing it right. */ if (true == m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; //writer.write("<?" + target); writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); //writer.write(data + ">"); // different from XML writer.write(data); // different from XML writer.write('>'); // different from XML // Always output a newline char if not inside of an // element. The whitespace is not significant in that // case. if (m_elemContext.m_currentElemDepth <= 0) outputLineSep(); m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } // now generate the PI event if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void entityReference(String name) throws org.xml.sax.SAXException { try { final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void closeStartTag() throws SAXException { try { // finish processing attributes, time to fire off the start element event if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs>0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); /* At this point we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) // if there are any cdata sections m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { try { final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_htmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 0 to 127 so we write out the // value directly writer.write(' '); writer.write(name); writer.write("=\""); writer.write(value); writer.write('"'); } else if ( (flags & HTML_ATTREMPTY) > 0 && (value.length() == 0 || value.equalsIgnoreCase(name))) { writer.write(' '); writer.write(name); } else { writer.write(' '); writer.write(name); writer.write("=\""); if ((flags & HTML_ATTRURL) > 0) { writeAttrURI(writer, value, m_specialEscapeURLs); } else { writeAttrString(writer, value, this.getEncoding()); } writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeCDATA() throws org.xml.sax.SAXException { try { m_writer.write(CDATA_DELIMITER_CLOSE); // write out a CDATA section closing "]]>" m_cdataTagOpen = false; // Remember that we have done so. } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected final void flushWriter() throws org.xml.sax.SAXException { final java.io.Writer writer = m_writer; if (null != writer) { try { if (writer instanceof WriterToUTF8Buffered) { if (m_shouldFlush) ((WriterToUTF8Buffered) writer).flush(); else ((WriterToUTF8Buffered) writer).flushBuffer(); } if (writer instanceof WriterToASCI) { if (m_shouldFlush) writer.flush(); } else { // Flush always. // Not a great thing if the writer was created // by this class, but don't have a choice. writer.flush(); } } catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void elementDecl(String name, String model) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ELEMENT "); writer.write(name); writer.write(' '); writer.write(model); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { DTDprolog(); outputEntityDecl(name, value); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ATTLIST "); writer.write(eName); writer.write(' '); writer.write(aName); writer.write(' '); writer.write(type); if (valueDefault != null) { writer.write(' '); writer.write(valueDefault); } //writer.write(" "); //writer.write(value); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void cdata(char ch[], int start, final int length) throws org.xml.sax.SAXException { try { final int old_start = start; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); boolean writeCDataBrackets = (((length >= 1) && escapingNotNeeded(ch[start]))); /* Write out the CDATA opening delimiter only if * we are supposed to, and if we are not already in * the middle of a CDATA section */ if (writeCDataBrackets && !m_cdataTagOpen) { m_writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } // writer.write(ch, start, length); if (isEscapingDisabled()) { charactersRaw(ch, start, length); } else writeNormalizedChars(ch, start, length, true, m_lineSepUse); /* used to always write out CDATA closing delimiter here, * but now we delay, so that we can merge CDATA sections on output. * need to write closing delimiter later */ if (writeCDataBrackets) { /* if the CDATA section ends with ] don't leave it open * as there is a chance that an adjacent CDATA sections * starts with ]>. * We don't want to merge ]] with > , or ] with ]> */ if (ch[start + length - 1] == ']') closeCDATA(); } // time to fire off CDATA event if (m_tracer != null) super.fireCDATAEvent(ch, old_start, length); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_inEntityRef) return; try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; m_writer.write(ch, start, length); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(final char chars[], final int start, final int length) throws org.xml.sax.SAXException { // It does not make sense to continue with rest of the method if the number of // characters to read from array is 0. // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node // is created if string is empty. if (length == 0 || (m_inEntityRef && !m_expandDTDEntities)) return; m_docIsEmpty = false; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); } if (m_cdataStartCalled || m_elemContext.m_isCdataSection) { /* either due to startCDATA() being called or due to * cdata-section-elements atribute, we need this as cdata */ cdata(chars, start, length); return; } if (m_cdataTagOpen) closeCDATA(); if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping)) { charactersRaw(chars, start, length); // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { int i; int startClean; // skip any leading whitspace // don't go off the end and use a hand inlined version // of isWhitespace(ch) final int end = start + length; int lastDirtyCharProcessed = start - 1; // last non-clean character that was processed // that was processed final Writer writer = m_writer; boolean isAllWhitespace = true; // process any leading whitspace i = start; while (i < end && isAllWhitespace) { char ch1 = chars[i]; if (m_charInfo.shouldMapTextChar(ch1)) { // The character is supposed to be replaced by a String // so write out the clean whitespace characters accumulated // so far // then the String. writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo .getOutputStringForChar(ch1); writer.write(outputStringForChar); // We can't say that everything we are writing out is // all whitespace, we just wrote out a String. isAllWhitespace = false; lastDirtyCharProcessed = i; // mark the last non-clean // character processed i++; } else { // The character is clean, but is it a whitespace ? switch (ch1) { // TODO: Any other whitespace to consider? case CharInfo.S_SPACE: // Just accumulate the clean whitespace i++; break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); i++; break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; i++; break; case CharInfo.S_HORIZONAL_TAB: // Just accumulate the clean whitespace i++; break; default: // The character was clean, but not a whitespace // so break the loop to continue with this character // (we don't increment index i !!) isAllWhitespace = false; break; } } } /* If there is some non-whitespace, mark that we may need * to preserve this. This is only important if we have indentation on. */ if (i < end || !isAllWhitespace) m_ispreserve = true; for (; i < end; i++) { char ch = chars[i]; if (m_charInfo.shouldMapTextChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo.getOutputStringForChar(ch); writer.write(outputStringForChar); lastDirtyCharProcessed = i; } else { if (ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: // Leave whitespace TAB as a real character break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; // Leave whitespace carriage return as a real character break; default: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars, do nothing, just add it to // the clean characters } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters, including NEL (0x85) writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#8232;"); lastDirtyCharProcessed = i; } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just leave it get added on to the clean characters } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out an entity writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } } } // we've reached the end. Any clean characters at the // end of the array than need to be written out? startClean = lastDirtyCharProcessed + 1; if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // For indentation purposes, mark that we've just writen text out m_isprevtext = true; } catch (IOException e) { throw new SAXException(e); } // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { if (m_inEntityRef) return; if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; m_docIsEmpty = false; } else if (m_cdataTagOpen) closeCDATA(); try { if (m_needToOutputDocTypeDecl) { if(null != getDoctypeSystem()) { outputDocTypeDecl(name, true); } m_needToOutputDocTypeDecl = false; } /* before we over-write the current elementLocalName etc. * lets close out the old one (if we still need to) */ if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); m_ispreserve = false; if (shouldIndent() && m_startNewLine) { indent(); } m_startNewLine = true; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); } catch (IOException e) { throw new SAXException(e); } // process the attributes now, because after this SAX call they might be gone if (atts != null) addAttributes(atts); m_elemContext = m_elemContext.push(namespaceURI,localName,name); m_isprevtext = false; if (m_tracer != null) firePseudoAttributes(); }
// in src/org/apache/xml/serializer/ToStream.java
void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException { if (m_cdataTagOpen) closeCDATA(); try { final java.io.Writer writer = m_writer; writer.write("<!DOCTYPE "); writer.write(name); String doctypePublic = getDoctypePublic(); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('\"'); } String doctypeSystem = getDoctypeSystem(); if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); if (closeDecl) { writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); closeDecl = false; // done closing } else writer.write('\"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_inEntityRef) return; // namespaces declared at the current depth are no longer valid // so get rid of them m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null); try { final java.io.Writer writer = m_writer; if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (m_spaceBeforeClose) writer.write(" />"); else writer.write("/>"); /* don't need to pop cdataSectionState because * this element ended so quickly that we didn't get * to push the state. */ } else { if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(m_elemContext.m_currentElemDepth - 1); writer.write('<'); writer.write('/'); writer.write(name); writer.write('>'); } } catch (IOException e) { throw new SAXException(e); } if (!m_elemContext.m_startTagOpen && m_doIndent) { m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); } m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { int start_old = start; if (m_inEntityRef) return; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } try { final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary. for (int i = start; i < limit; i++) { if (wasDash && ch[i] == '-') { writer.write(ch, start, i - start); writer.write(" -"); start = i + 1; } wasDash = (ch[i] == '-'); } // if we have some chars in the comment if (length > 0) { // Output the remaining characters (if any) final int remainingChars = (limit - start); if (remainingChars > 0) writer.write(ch, start, remainingChars); // Protect comment end from a single trailing dash if (ch[limit - 1] == '-') writer.write(' '); } writer.write(COMMENT_END); } catch (IOException e) { throw new SAXException(e); } /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; // time to generate comment event if (m_tracer != null) super.fireCommentEvent(ch, start_old,length); }
// in src/org/apache/xml/serializer/ToStream.java
public void endDTD() throws org.xml.sax.SAXException { try { if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } final java.io.Writer writer = m_writer; if (!m_inDoctype) writer.write("]>"); else { writer.write('>'); } writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeStartTag() throws SAXException { if (m_elemContext.m_startTagOpen) { try { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); } catch (IOException e) { throw new SAXException(e); } /* whether Xalan or XSLTC, we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeDocType(DocumentType node, boolean bStart) throws SAXException { // The DocType and internalSubset can not be modified in DOM and is // considered to be well-formed as the outcome of successful parsing. String docTypeName = node.getNodeName(); String publicId = node.getPublicId(); String systemId = node.getSystemId(); String internalSubset = node.getInternalSubset(); //DocumentType nodes are never passed to the filter if (internalSubset != null && !"".equals(internalSubset)) { if (bStart) { try { // The Serializer does not provide a way to write out the // DOCTYPE internal subset via an event call, so we write it // out here. Writer writer = fSerializer.getWriter(); StringBuffer dtd = new StringBuffer(); dtd.append("<!DOCTYPE "); dtd.append(docTypeName); if (null != publicId) { dtd.append(" PUBLIC \""); dtd.append(publicId); dtd.append('\"'); } if (null != systemId) { if (null == publicId) { dtd.append(" SYSTEM \""); } else { dtd.append(" \""); } dtd.append(systemId); dtd.append('\"'); } dtd.append(" [ "); dtd.append(fNewLine); dtd.append(internalSubset); dtd.append("]>"); dtd.append(fNewLine); writer.write(dtd.toString()); writer.flush(); } catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); } } // else if !bStart do nothing } else { if (bStart) { if (fLexicalHandler != null) { fLexicalHandler.startDTD(docTypeName, publicId, systemId); } } else { if (fLexicalHandler != null) { fLexicalHandler.endDTD(); } } } }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { final int col = qname.lastIndexOf(':'); final String prefix = (col == -1) ? null : qname.substring(0, col); SyntaxTreeNode element = makeInstance(uri, prefix, localname, attributes); if (element == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ELEMENT_PARSE_ERR, prefix+':'+localname); throw new SAXException(err.toString()); } // If this is the root element of the XML document we need to make sure // that it contains a definition of the XSL namespace URI if (_root == null) { if ((_prefixMapping == null) || (_prefixMapping.containsValue(Constants.XSLT_URI) == false)) _rootNamespaceDef = false; else _rootNamespaceDef = true; _root = element; } else { SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek(); parent.addElement(element); element.setParent(parent); } element.setAttributes(new AttributeList(attributes)); element.setPrefixMapping(_prefixMapping); if (element instanceof Stylesheet) { // Extension elements and excluded elements have to be // handled at this point in order to correctly generate // Fallback elements from <xsl:fallback>s. getSymbolTable().setCurrentNode(element); ((Stylesheet)element).declareExtensionPrefixes(this); } _prefixMapping = null; _parentStack.push(element); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void endDocument() throws SAXException { _parser.endDocument(); // create the templates try { XSLTC xsltc = _parser.getXSLTC(); // Set the translet class name if not already set String transletName; if (_systemId != null) { transletName = Util.baseName(_systemId); } else { transletName = (String)_tfactory.getAttribute("translet-name"); } xsltc.setClassName(transletName); // Get java-legal class name from XSLTC module transletName = xsltc.getClassName(); Stylesheet stylesheet = null; SyntaxTreeNode root = _parser.getDocumentRoot(); // Compile the translet - this is where the work is done! if (!_parser.errorsFound() && root != null) { // Create a Stylesheet element from the root node stylesheet = _parser.makeStylesheet(root); stylesheet.setSystemId(_systemId); stylesheet.setParentStylesheet(null); if (xsltc.getTemplateInlining()) stylesheet.setTemplateInlining(true); else stylesheet.setTemplateInlining(false); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { stylesheet.setSourceLoader(this); } _parser.setCurrentStylesheet(stylesheet); // Set it as top-level in the XSLTC object xsltc.setStylesheet(stylesheet); // Create AST under the Stylesheet element _parser.createAST(stylesheet); } // Generate the bytecodes and output the translet class(es) if (!_parser.errorsFound() && stylesheet != null) { stylesheet.setMultiDocument(xsltc.isMultiDocument()); stylesheet.setHasIdCall(xsltc.hasIdCall()); // Class synchronization is needed for BCEL synchronized (xsltc.getClass()) { stylesheet.translate(); } } if (!_parser.errorsFound()) { // Check that the transformation went well before returning final byte[][] bytecodes = xsltc.getBytecodes(); if (bytecodes != null) { _templates = new TemplatesImpl(xsltc.getBytecodes(), transletName, _parser.getOutputProperties(), _indentNumber, _tfactory); // Set URIResolver on templates object if (_uriResolver != null) { _templates.setURIResolver(_uriResolver); } } } else { StringBuffer errorMessage = new StringBuffer(); Vector errors = _parser.getErrors(); final int count = errors.size(); for (int i = 0; i < count; i++) { if (errorMessage.length() > 0) errorMessage.append('\n'); errorMessage.append(errors.elementAt(i).toString()); } throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString())); } }
// in src/org/apache/xalan/xsltc/trax/XSLTCSource.java
protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet) throws SAXException { SAXImpl idom = (SAXImpl)_dom.get(); if (idom != null) { if (dtmManager != null) { idom.migrateTo(dtmManager); } } else { Source source = _source; if (source == null) { if (_systemId != null && _systemId.length() > 0) { source = new StreamSource(_systemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR); throw new SAXException(err.toString()); } } DOMWSFilter wsfilter = null; if (translet != null && translet instanceof StripFilter) { wsfilter = new DOMWSFilter(translet); } boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false; if (dtmManager == null) { dtmManager = XSLTCDTMManager.newInstance(); } idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall); String systemId = getSystemId(); if (systemId != null) { idom.setDocumentURI(systemId); } _dom.set(idom); } return idom; }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDocument() throws SAXException { // Make sure setResult() was called before the first SAX event if (_result == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR); throw new SAXException(err.toString()); } if (!_isIdentity) { boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; XSLTCDTMManager dtmManager = null; // Create an internal DOM (not W3C) and get SAX2 input handler try { dtmManager = (XSLTCDTMManager)_transformer.getTransformerFactory() .getDTMManagerClass() .newInstance(); } catch (Exception e) { throw new SAXException(e); } DTMWSFilter wsFilter; if (_translet != null && _translet instanceof StripFilter) { wsFilter = new DOMWSFilter(_translet); } else { wsFilter = null; } // Construct the DTM using the SAX events that come through _dom = (SAXImpl)dtmManager.getDTM(null, false, wsFilter, true, false, hasIdCall); _handler = _dom.getBuilder(); _lexHandler = (LexicalHandler) _handler; _dtdHandler = (DTDHandler) _handler; _declHandler = (DeclHandler) _handler; // Set document URI _dom.setDocumentURI(_systemId); if (_locator != null) { _handler.setDocumentLocator(_locator); } } // Proxy call _handler.startDocument(); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDocument() throws SAXException { // Signal to the DOMBuilder that the document is complete _handler.endDocument(); if (!_isIdentity) { // Run the transformation now if we have a reference to a Result object if (_result != null) { try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { throw new SAXException(e); } } // Signal that the internal DOM is built (see 'setResult()'). _done = true; // Set this DOM as the transformer's DOM _transformer.setDOM(_dom); } if (_isIdentity && _result instanceof DOMResult) { ((DOMResult)_result).setNode(_transformer.getTransletOutputHandlerFactory().getNode()); } }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { if (this == handler.getCurrentProcessor()) { handler.popProcessor(); } int nChars = m_accumulator.length(); if ((nChars > 0) && ((null != m_xslTextElement) ||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator)) || handler.isSpacePreserve()) { ElemTextLiteral elem = new ElemTextLiteral(); elem.setDOMBackPointer(m_firstBackPointer); elem.setLocaterInfo(handler.getLocator()); try { elem.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } boolean doe = (null != m_xslTextElement) ? m_xslTextElement.getDisableOutputEscaping() : false; elem.setDisableOutputEscaping(doe); elem.setPreserveSpace(true); char[] chars = new char[nChars]; m_accumulator.getChars(0, nChars, chars, 0); elem.setChars(chars); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); } m_accumulator.setLength(0); m_firstBackPointer = null; }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { // ElemTemplateElement parent = handler.getElemTemplateElement(); XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); ElemTemplateElement elem = null; try { elem = (ElemTemplateElement) classObject.newInstance(); elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { ElemAttributeSet eat = new ElemAttributeSet(); eat.setLocaterInfo(handler.getLocator()); try { eat.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } eat.setDOMBackPointer(handler.getOriginatingNode()); setPropertiesFromAttributes(handler, rawName, attributes, eat); handler.getStylesheet().setAttributeSet(eat); // handler.pushElemTemplateElement(eat); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(eat); handler.pushElemTemplateElement(eat); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
AVT processAVT( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCDATA(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCHAR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (value.length() != 1)) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (value.length() != 1) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return new Character(value.charAt(0)); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; if (getSupportsAVT()) { try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (!avt.isSimple()) return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } int retVal = this.getEnum(value); if (retVal == StringToIntTable.INVALID_KEY) { StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } if (getSupportsAVT()) return avt; else return new Integer(retVal); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM_OR_PQNAME(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { Object objToReturn = null; if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); if (!avt.isSimple()) return avt; else objToReturn = avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } // An avt wasn't used. int key = this.getEnum(value); if (key != StringToIntTable.INVALID_KEY) { if (objToReturn == null) objToReturn = new Integer(key); } // enum not used. Validate qname-but-not-ncname. else { try { QName qname = new QName(value, handler, true); if (objToReturn == null) objToReturn = qname; if (qname.getPrefix() == null) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } } catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; } catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; } } return objToReturn; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processEXPR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath expr = handler.createXPath(value, owner); return expr; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNMTOKEN(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNmtoken(value))) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNmtoken(value)) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } } return value; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processPATTERN( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath pattern = handler.createMatchPatternXPath(value, owner); return pattern; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNUMBER( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { Double val; AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (avt.isSimple()) { val = Double.valueOf(value); } } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } return avt; } else { try { return Double.valueOf(value); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processAVT_QNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if (avt.isSimple()) { int indexOfNSSep = value.indexOf(':'); if (indexOfNSSep >= 0) { String prefix = value.substring(0, indexOfNSSep); if (!XML11Char.isXML11ValidNCName(prefix)) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null); return null; } } String localName = (indexOfNSSep < 0) ? value : value.substring(indexOfNSSep + 1); if ((localName == null) || (localName.length() == 0) || (!XML11Char.isXML11ValidNCName(localName))) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null ); return null; } } } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } return avt; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNCNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNCName(value))) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNCName(value)) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processSIMPLEPATTERNLIST( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nPatterns = tokenizer.countTokens(); Vector patterns = new Vector(nPatterns); for (int i = 0; i < nPatterns; i++) { XPath pattern = handler.createMatchPatternXPath(tokenizer.nextToken(), owner); patterns.addElement(pattern); } return patterns; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_URLLIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (url != null) strings.addElement(url); else throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_LIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (prefix.equals(Constants.ATTRVAL_DEFAULT_PREFIX) || url != null) strings.addElement(prefix); else throw new org.xml.sax.SAXException( XSLMessages.createMessage( XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processURL( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value // if (avt.getSimpleString() != null) { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); //} return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); return value; } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, this); try { // Get the Source from the user's URIResolver (if any). Source sourceFromURIResolver = getSourceFromUriResolver(handler); // Get the system ID of the included/imported stylesheet module String hrefUrl = getBaseURIOfIncludedStylesheet(handler, sourceFromURIResolver); if (handler.importStackContains(hrefUrl)) { throw new org.xml.sax.SAXException( XSLMessages.createMessage( getStylesheetInclErr(), new Object[]{ hrefUrl })); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!"); } // Push the system ID and corresponding Source // on some stacks for later retrieval during parse() time. handler.pushImportURL(hrefUrl); handler.pushImportSource(sourceFromURIResolver); int savedStylesheetType = handler.getStylesheetType(); handler.setStylesheetType(this.getStylesheetType()); handler.pushNewNamespaceSupport(); try { parse(handler, uri, localName, rawName, attributes); } finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); } } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warn(String msg, Object args[]) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createWarning(msg, args); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { if (null != handler) handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Exception e) throws org.xml.sax.SAXException { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); TransformerException pe; if (!(e instanceof TransformerException)) { pe = (null == e) ? new TransformerException(msg, locator) : new TransformerException(msg, locator, e); } else pe = (TransformerException) e; if (null != handler) { try { handler.error(pe); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else throw new org.xml.sax.SAXException(pe); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.fatalError(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void startNode(int node) throws org.xml.sax.SAXException { XPathContext xcntxt = m_transformer.getXPathContext(); try { if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { xcntxt.pushCurrentNode(node); if(m_startNode != node) { super.startNode(node); } else { String elemName = m_dtm.getNodeName(node); String localName = m_dtm.getLocalName(node); String namespace = m_dtm.getNamespaceURI(node); //xcntxt.pushCurrentNode(node); // SAX-like call to allow adding attributes afterwards m_handler.startElement(namespace, localName, elemName); boolean hasNSDecls = false; DTM dtm = m_dtm; for (int ns = dtm.getFirstNamespaceNode(node, true); DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true)) { SerializerUtils.ensureNamespaceDeclDeclared(m_handler,dtm, ns); } for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr)) { SerializerUtils.addAttribute(m_handler, attr); } } } else { xcntxt.pushCurrentNode(node); super.startNode(node); xcntxt.popCurrentNode(); } } catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (!m_foundFirstElement && null != m_serializer) { m_foundFirstElement = true; Serializer newSerializer; try { newSerializer = SerializerSwitcher.switchSerializerIfHTML(uri, localName, m_outputFormat.getProperties(), m_serializer); } catch (TransformerException te) { throw new SAXException(te); } if (newSerializer != m_serializer) { try { m_resultContentHandler = newSerializer.asContentHandler(); } catch (IOException ioe) // why? { throw new SAXException(ioe); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; m_serializer = newSerializer; } } flushStartDoc(); m_resultContentHandler.startElement(uri, localName, qName, attributes); }
// in src/org/apache/xalan/xslt/Process.java
public static void main(String argv[]) { // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off boolean doStackDumpOnError = false; boolean setQuietMode = false; boolean doDiag = false; String msg = null; boolean isSecureProcessing = false; // Runtime.getRuntime().traceMethodCalls(false); // Runtime.getRuntime().traceInstructions(false); /** * The default diagnostic writer... */ java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true); java.io.PrintWriter dumpWriter = diagnosticsWriter; ResourceBundle resbundle = (XSLMessages.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES)); String flavor = "s2s"; if (argv.length < 1) { printArgOptions(resbundle); } else { boolean useXSLTC = false; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { useXSLTC = true; } } TransformerFactory tfactory; if (useXSLTC) { String key = "javax.xml.transform.TransformerFactory"; String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"; Properties props = System.getProperties(); props.put(key, value); System.setProperties(props); } try { tfactory = TransformerFactory.newInstance(); tfactory.setErrorListener(new DefaultErrorHandler(false)); } catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); } boolean formatOutput = false; boolean useSourceLocation = false; String inFileName = null; String outFileName = null; String dumpFileName = null; String xslFileName = null; String treedumpFileName = null; PrintTraceListener tracer = null; String outputType = null; String media = null; Vector params = new Vector(); boolean quietConflictWarnings = false; URIResolver uriResolver = null; EntityResolver entityResolver = null; ContentHandler contentHandler = null; int recursionLimit=-1; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { // The -XSLTC option has been processed. } else if ("-TT".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceTemplates = true; } else printInvalidXSLTCOption("-TT"); // tfactory.setTraceTemplates(true); } else if ("-TG".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceGeneration = true; } else printInvalidXSLTCOption("-TG"); // tfactory.setTraceSelect(true); } else if ("-TS".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceSelection = true; } else printInvalidXSLTCOption("-TS"); // tfactory.setTraceTemplates(true); } else if ("-TTC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceElements = true; } else printInvalidXSLTCOption("-TTC"); // tfactory.setTraceTemplateChildren(true); } else if ("-INDENT".equalsIgnoreCase(argv[i])) { int indentAmount; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { indentAmount = Integer.parseInt(argv[++i]); } else { indentAmount = 0; } // TBD: // xmlProcessorLiaison.setIndent(indentAmount); } else if ("-IN".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') inFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-IN" })); //"Missing argument for); } else if ("-MEDIA".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) media = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-MEDIA" })); //"Missing argument for); } else if ("-OUT".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') outFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-OUT" })); //"Missing argument for); } else if ("-XSL".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') xslFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XSL" })); //"Missing argument for); } else if ("-FLAVOR".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { flavor = argv[++i]; } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-FLAVOR" })); //"Missing argument for); } else if ("-PARAM".equalsIgnoreCase(argv[i])) { if (i + 2 < argv.length) { String name = argv[++i]; params.addElement(name); String expression = argv[++i]; params.addElement(expression); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-PARAM" })); //"Missing argument for); } else if ("-E".equalsIgnoreCase(argv[i])) { // TBD: // xmlProcessorLiaison.setShouldExpandEntityRefs(false); } else if ("-V".equalsIgnoreCase(argv[i])) { diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version " + Version.getVersion() + ", " + /* xmlProcessorLiaison.getParserDescription()+ */ resbundle.getString("version2")); // "<<<<<<<"); } else if ("-QC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) quietConflictWarnings = true; else printInvalidXSLTCOption("-QC"); } else if ("-Q".equalsIgnoreCase(argv[i])) { setQuietMode = true; } else if ("-DIAG".equalsIgnoreCase(argv[i])) { doDiag = true; } else if ("-XML".equalsIgnoreCase(argv[i])) { outputType = "xml"; } else if ("-TEXT".equalsIgnoreCase(argv[i])) { outputType = "text"; } else if ("-HTML".equalsIgnoreCase(argv[i])) { outputType = "html"; } else if ("-EDUMP".equalsIgnoreCase(argv[i])) { doStackDumpOnError = true; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { dumpFileName = argv[++i]; } } else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { uriResolver = (URIResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); tfactory.setURIResolver(uriResolver); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); } } else { msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-URIResolver" }); //"Missing argument for); System.err.println(msg); doExit(msg); } } else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { entityResolver = (EntityResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { contentHandler = (ContentHandler) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else if ("-L".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); else printInvalidXSLTCOption("-L"); } else if ("-INCREMENTAL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/incremental", java.lang.Boolean.TRUE); else printInvalidXSLTCOption("-INCREMENTAL"); } else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i])) { // Default is true. // // %REVIEW% We should have a generalized syntax for negative // switches... and probably should accept the inverse even // if it is the default. if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/optimize", java.lang.Boolean.FALSE); else printInvalidXSLTCOption("-NOOPTIMIZE"); } else if ("-RL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (i + 1 < argv.length) recursionLimit = Integer.parseInt(argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-rl" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXSLTCOption("-RL"); } } // Generate the translet class and optionally specify the name // of the translet class. else if ("-XO".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("translet-name", argv[++i]); } else tfactory.setAttribute("generate-translet", "true"); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XO"); } } // Specify the destination directory for the translet classes. else if ("-XD".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("destination-directory", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XD" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XD"); } } // Specify the jar file name which the translet classes are packaged into. else if ("-XJ".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("jar-name", argv[++i]); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XJ" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XJ"); } } // Specify the package name prefix for the generated translet classes. else if ("-XP".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("package-name", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XP" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XP"); } } // Enable template inlining. else if ("-XN".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("enable-inlining", "true"); } else printInvalidXalanOption("-XN"); } // Turns on additional debugging message output else if ("-XX".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("debug", "true"); } else printInvalidXalanOption("-XX"); } // Create the Transformer from the translet if the translet class is newer // than the stylesheet. else if ("-XT".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("auto-translet", "true"); } else printInvalidXalanOption("-XT"); } else if ("-SECURE".equalsIgnoreCase(argv[i])) { isSecureProcessing = true; try { tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (TransformerConfigurationException e) {} } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] })); //"Invalid argument:); } // Print usage instructions if no xml and xsl file is specified in the command line if (inFileName == null && xslFileName == null) { msg = resbundle.getString("xslProc_no_input"); System.err.println(msg); doExit(msg); } // Note that there are usage cases for calling us without a -IN arg // The main XSL transformation occurs here! try { long start = System.currentTimeMillis(); if (null != dumpFileName) { dumpWriter = new PrintWriter(new FileWriter(dumpFileName)); } Templates stylesheet = null; if (null != xslFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Node xslDOM = docBuilder.parse(new InputSource(xslFileName)); stylesheet = tfactory.newTemplates(new DOMSource(xslDOM, xslFileName)); } else { // System.out.println("Calling newTemplates: "+xslFileName); stylesheet = tfactory.newTemplates(new StreamSource(xslFileName)); // System.out.println("Done calling newTemplates: "+xslFileName); } } PrintWriter resultWriter; StreamResult strResult; if (null != outFileName) { strResult = new StreamResult(new FileOutputStream(outFileName)); // One possible improvement might be to ensure this is // a valid URI before setting the systemId, but that // might have subtle changes that pre-existing users // might notice; we can think about that later -sc r1.46 strResult.setSystemId(outFileName); } else { strResult = new StreamResult(System.out); // We used to default to incremental mode in this case. // We've since decided that since the -INCREMENTAL switch is // available, that default is probably not necessary nor // necessarily a good idea. } SAXTransformerFactory stf = (SAXTransformerFactory) tfactory; // This is currently controlled via TransformerFactoryImpl. if (!useXSLTC && useSourceLocation) stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); // Did they pass in a stylesheet, or should we get it from the // document? if (null == stylesheet) { Source source = stf.getAssociatedStylesheet(new StreamSource(inFileName), media, null, null); if (null != source) stylesheet = tfactory.newTemplates(source); else { if (null != media) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: " // + inFileName + ", media=" // + media); else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: " //+ inFileName); } } if (null != stylesheet) { Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer(); transformer.setErrorListener(new DefaultErrorHandler(false)); // Override the output format? if (null != outputType) { transformer.setOutputProperty(OutputKeys.METHOD, outputType); } if (transformer instanceof org.apache.xalan.transformer.TransformerImpl) { org.apache.xalan.transformer.TransformerImpl impl = (org.apache.xalan.transformer.TransformerImpl)transformer; TraceManager tm = impl.getTraceManager(); if (null != tracer) tm.addTraceListener(tracer); impl.setQuietConflictWarnings(quietConflictWarnings); // This is currently controlled via TransformerFactoryImpl. if (useSourceLocation) impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); if(recursionLimit>0) impl.setRecursionLimit(recursionLimit); // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter ); } int nParams = params.size(); for (int i = 0; i < nParams; i += 2) { transformer.setParameter((String) params.elementAt(i), (String) params.elementAt(i + 1)); } if (uriResolver != null) transformer.setURIResolver(uriResolver); if (null != inFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setCoalescing(true); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); if (entityResolver != null) docBuilder.setEntityResolver(entityResolver); Node xmlDoc = docBuilder.parse(new InputSource(inFileName)); Document doc = docBuilder.newDocument(); org.w3c.dom.DocumentFragment outNode = doc.createDocumentFragment(); transformer.transform(new DOMSource(xmlDoc, inFileName), new DOMResult(outNode)); // Now serialize output to disk with identity transformer Transformer serializer = stf.newTransformer(); serializer.setErrorListener(new DefaultErrorHandler(false)); Properties serializationProps = stylesheet.getOutputProperties(); serializer.setOutputProperties(serializationProps); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); serializer.transform(new DOMSource(outNode), result); } else serializer.transform(new DOMSource(outNode), strResult); } else if (flavor.equals("th")) { for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior { // System.out.println("Testing the TransformerHandler..."); // =============== XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } if (!useXSLTC) stf.setAttribute(org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL, Boolean.TRUE); TransformerHandler th = stf.newTransformerHandler(stylesheet); reader.setContentHandler(th); reader.setDTDHandler(th); if(th instanceof org.xml.sax.ErrorHandler) reader.setErrorHandler((org.xml.sax.ErrorHandler)th); try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", th); } catch (org.xml.sax.SAXNotRecognizedException e){} catch (org.xml.sax.SAXNotSupportedException e){} try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) {} th.setResult(strResult); reader.parse(new InputSource(inFileName)); } } else { if (entityResolver != null) { XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } reader.setEntityResolver(entityResolver); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform( new SAXSource(reader, new InputSource(inFileName)), result); } else { transformer.transform( new SAXSource(reader, new InputSource(inFileName)), strResult); } } else if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform(new StreamSource(inFileName), result); } else { // System.out.println("Starting transform"); transformer.transform(new StreamSource(inFileName), strResult); // System.out.println("Done with transform"); } } } else { StringReader reader = new StringReader("<?xml version=\"1.0\"?> <doc/>"); transformer.transform(new StreamSource(reader), strResult); } } else { // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); doExit(msg); } // close output streams if (null != outFileName && strResult!=null) { java.io.OutputStream out = strResult.getOutputStream(); java.io.Writer writer = strResult.getWriter(); try { if (out != null) out.close(); if (writer != null) writer.close(); } catch(java.io.IOException ie) {} } long stop = System.currentTimeMillis(); long millisecondsDuration = stop - start; if (doDiag) { Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) }; msg = XSLMessages.createMessage("diagTiming", msgArgs); diagnosticsWriter.println('\n'); diagnosticsWriter.println(msg); } } catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); } if (null != dumpFileName) { dumpWriter.close(); } if (null != diagnosticsWriter) { // diagnosticsWriter.close(); } // if(!setQuietMode) // diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done"); // else // diagnosticsWriter.println(""); //"Xalan: done"); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
94
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/utils/DOMBuilder.java
catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (ParserConfigurationException ex) { throw new SAXException(ex); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(Exception ex) { throw new SAXException(ex); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
catch (Exception e) { throw new org.xml.sax.SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToTextStream.java
catch(IOException ioe) { throw new SAXException(ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch(IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (IOException e) { throw new SAXException(e); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (CompilerException e) { throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (ParserConfigurationException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (Exception e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) // why? { throw new SAXException(ioe); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); }
// in src/org/apache/xalan/xslt/Process.java
catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); }
702
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void warning (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); // Note: should we really call .toString() below, since // sometimes the message is not properly set? m_pw.println("warning: " + exception.getMessage()); m_pw.flush(); if (getThrowOnWarning()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void error (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void fatalError (SAXParseException exception) throws SAXException { logExceptionLocation(m_pw, exception); m_pw.println("fatalError: " + exception.getMessage()); m_pw.flush(); if (getThrowOnFatalError()) throw exception; }
// in src/org/apache/xml/utils/FastStringBuffer.java
public void sendSAXcharacters( org.xml.sax.ContentHandler ch, int start, int length) throws org.xml.sax.SAXException { int startChunk = start >>> m_chunkBits; int startColumn = start & m_chunkMask; if (startColumn + length < m_chunkMask && m_innerFSB == null) { ch.characters(m_array[startChunk], startColumn, length); return; } int stop = start + length; int stopChunk = stop >>> m_chunkBits; int stopColumn = stop & m_chunkMask; for (int i = startChunk; i < stopChunk; ++i) { if (i == 0 && m_innerFSB != null) m_innerFSB.sendSAXcharacters(ch, startColumn, m_chunkSize - startColumn); else ch.characters(m_array[i], startColumn, m_chunkSize - startColumn); startColumn = 0; // after first chunk } // Last, or only, chunk if (stopChunk == 0 && m_innerFSB != null) m_innerFSB.sendSAXcharacters(ch, startColumn, stopColumn - startColumn); else if (stopColumn > startColumn) { ch.characters(m_array[stopChunk], startColumn, stopColumn - startColumn); } }
// in src/org/apache/xml/utils/FastStringBuffer.java
public int sendNormalizedSAXcharacters( org.xml.sax.ContentHandler ch, int start, int length) throws org.xml.sax.SAXException { // This call always starts at the beginning of the // string being written out, either because it was called directly or // because it was an m_innerFSB recursion. This is important since // it gives us a well-known initial state for this flag: int stateForNextChunk=SUPPRESS_LEADING_WS; int stop = start + length; int startChunk = start >>> m_chunkBits; int startColumn = start & m_chunkMask; int stopChunk = stop >>> m_chunkBits; int stopColumn = stop & m_chunkMask; for (int i = startChunk; i < stopChunk; ++i) { if (i == 0 && m_innerFSB != null) stateForNextChunk= m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, m_chunkSize - startColumn); else stateForNextChunk= sendNormalizedSAXcharacters(m_array[i], startColumn, m_chunkSize - startColumn, ch,stateForNextChunk); startColumn = 0; // after first chunk } // Last, or only, chunk if (stopChunk == 0 && m_innerFSB != null) stateForNextChunk= // %REVIEW% Is this update really needed? m_innerFSB.sendNormalizedSAXcharacters(ch, startColumn, stopColumn - startColumn); else if (stopColumn > startColumn) { stateForNextChunk= // %REVIEW% Is this update really needed? sendNormalizedSAXcharacters(m_array[stopChunk], startColumn, stopColumn - startColumn, ch, stateForNextChunk | SUPPRESS_TRAILING_WS); } return stateForNextChunk; }
// in src/org/apache/xml/utils/FastStringBuffer.java
static int sendNormalizedSAXcharacters(char ch[], int start, int length, org.xml.sax.ContentHandler handler, int edgeTreatmentFlags) throws org.xml.sax.SAXException { boolean processingLeadingWhitespace = ((edgeTreatmentFlags & SUPPRESS_LEADING_WS) != 0); boolean seenWhitespace = ((edgeTreatmentFlags & CARRY_WS) != 0); int currPos = start; int limit = start+length; // Strip any leading spaces first, if required if (processingLeadingWhitespace) { for (; currPos < limit && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } // If we've only encountered leading spaces, the // current state remains unchanged if (currPos == limit) { return edgeTreatmentFlags; } } // If we get here, there are no more leading spaces to strip while (currPos < limit) { int startNonWhitespace = currPos; // Grab a chunk of non-whitespace characters for (; currPos < limit && !XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } // Non-whitespace seen - emit them, along with a single // space for any preceding whitespace characters if (startNonWhitespace != currPos) { if (seenWhitespace) { handler.characters(SINGLE_SPACE, 0, 1); seenWhitespace = false; } handler.characters(ch, startNonWhitespace, currPos - startNonWhitespace); } int startWhitespace = currPos; // Consume any whitespace characters for (; currPos < limit && XMLCharacterRecognizer.isWhiteSpace(ch[currPos]); currPos++) { } if (startWhitespace != currPos) { seenWhitespace = true; } } return (seenWhitespace ? CARRY_WS : 0) | (edgeTreatmentFlags & SUPPRESS_TRAILING_WS); }
// in src/org/apache/xml/utils/FastStringBuffer.java
public static void sendNormalizedSAXcharacters(char ch[], int start, int length, org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException { sendNormalizedSAXcharacters(ch, start, length, handler, SUPPRESS_BOTH); }
// in src/org/apache/xml/utils/FastStringBuffer.java
public void sendSAXComment( org.xml.sax.ext.LexicalHandler ch, int start, int length) throws org.xml.sax.SAXException { // %OPT% Do it this way for now... String comment = getString(start, length); ch.comment(comment.toCharArray(), 0, length); }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); traverseFragment(pos); this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverseFragment(Node pos) throws org.xml.sax.SAXException { Node top = pos; while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } }
// in src/org/apache/xml/utils/TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/utils/TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if(m_contentHandler instanceof org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler) { ((org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)m_contentHandler).characters(node); } else { String data = ((Text) node).getData(); this.m_contentHandler.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/utils/TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { if (m_contentHandler instanceof NodeConsumer) { ((NodeConsumer) m_contentHandler).setOriginatingNode(node); } if (node instanceof Locator) { Locator loc = (Locator)node; m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId()); } else { m_locator.setColumnNumber(0); m_locator.setLineNumber(0); } switch (node.getNodeType()) { case Node.COMMENT_NODE : { String data = ((Comment) node).getData(); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.comment(data.toCharArray(), 0, data.length()); } } break; case Node.DOCUMENT_FRAGMENT_NODE : // ??; break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : NamedNodeMap atts = ((Element) node).getAttributes(); int nAttrs = atts.getLength(); // System.out.println("TreeWalker#startNode: "+node.getNodeName()); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); this.m_contentHandler.startPrefixMapping(prefix, attr.getNodeValue()); } } // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node)); // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node)); String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.startElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName(), new AttList(atts, m_dh)); break; case Node.PROCESSING_INSTRUCTION_NODE : { ProcessingInstruction pi = (ProcessingInstruction) node; String name = pi.getNodeName(); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(pi.getNodeName(), pi.getData()); } } break; case Node.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case Node.TEXT_NODE : { //String data = ((Text) node).getData(); if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( eref.getNodeName()); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/utils/TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); NamedNodeMap atts = ((Element) node).getAttributes(); int nAttrs = atts.getLength(); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String attrName = attr.getNodeName(); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); this.m_contentHandler.endPrefixMapping(prefix); } } break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(eref.getNodeName()); } } break; default : } }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void warning(SAXParseException exception) throws SAXException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println("Parser warning: " + exception.getMessage()); }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void error(SAXParseException exception) throws SAXException { //printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void fatalError(SAXParseException exception) throws SAXException { // printLocation(exception); // getErrorWriter().println(exception.getMessage()); throw exception; }
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (target.equals("xml-stylesheet")) { String href = null; // CDATA #REQUIRED String type = null; // CDATA #REQUIRED String title = null; // CDATA #IMPLIED String media = null; // CDATA #IMPLIED String charset = null; // CDATA #IMPLIED boolean alternate = false; // (yes|no) "no" StringTokenizer tokenizer = new StringTokenizer(data, " \t=\n", true); boolean lookedAhead = false; Source source = null; String token = ""; while (tokenizer.hasMoreTokens()) { if (!lookedAhead) token = tokenizer.nextToken(); else lookedAhead = false; if (tokenizer.hasMoreTokens() && (token.equals(" ") || token.equals("\t") || token.equals("="))) continue; String name = token; if (name.equals("type")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); type = token.substring(1, token.length() - 1); } else if (name.equals("href")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); href = token; if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); // If the href value has parameters to be passed to a // servlet(something like "foobar?id=12..."), // we want to make sure we get them added to // the href value. Without this check, we would move on // to try to process another attribute and that would be // wrong. // We need to set lookedAhead here to flag that we // already have the next token. while ( token.equals("=") && tokenizer.hasMoreTokens()) { href = href + token + tokenizer.nextToken(); if (tokenizer.hasMoreTokens()) { token = tokenizer.nextToken(); lookedAhead = true; } else { break; } } } href = href.substring(1, href.length() - 1); try { // Add code to use a URIResolver. Patch from Dmitri Ilyin. if (m_uriResolver != null) { source = m_uriResolver.resolve(href, m_baseID); } else { href = SystemIDResolver.getAbsoluteURI(href, m_baseID); source = new SAXSource(new InputSource(href)); } } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } } else if (name.equals("title")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); title = token.substring(1, token.length() - 1); } else if (name.equals("media")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); media = token.substring(1, token.length() - 1); } else if (name.equals("charset")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); charset = token.substring(1, token.length() - 1); } else if (name.equals("alternate")) { token = tokenizer.nextToken(); while (tokenizer.hasMoreTokens() && (token.equals(" " ) || token.equals("\t") || token.equals("="))) token = tokenizer.nextToken(); alternate = token.substring(1, token.length() - 1).equals("yes"); } } if ((null != type) && (type.equals("text/xsl") || type.equals("text/xml") || type.equals("application/xml+xslt")) && (null != href)) { if (null != m_media) { if (null != media) { if (!media.equals(m_media)) return; } else return; } if (null != m_charset) { if (null != charset) { if (!charset.equals(m_charset)) return; } else return; } if (null != m_title) { if (null != title) { if (!title.equals(m_title)) return; } else return; } m_stylesheets.addElement(source); } } }
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws org.xml.sax.SAXException { throw new StopParseException(); }
// in src/org/apache/xml/utils/DOMBuilder.java
protected void append(Node newNode) throws org.xml.sax.SAXException { Node currentNode = m_currentNode; if (null != currentNode) { if (currentNode == m_root && m_nextSibling != null) currentNode.insertBefore(newNode, m_nextSibling); else currentNode.appendChild(newNode); // System.out.println(newNode.getNodeName()); } else if (null != m_docFrag) { if (m_nextSibling != null) m_docFrag.insertBefore(newNode, m_nextSibling); else m_docFrag.appendChild(newNode); } else { boolean ok = true; short type = newNode.getNodeType(); if (type == Node.TEXT_NODE) { String data = newNode.getNodeValue(); if ((null != data) && (data.trim().length() > 0)) { throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_OUTPUT_TEXT_BEFORE_DOC, null)); //"Warning: can't output text before document element! Ignoring..."); } ok = false; } else if (type == Node.ELEMENT_NODE) { if (m_doc.getDocumentElement() != null) { ok = false; throw new org.xml.sax.SAXException( XMLMessages.createXMLMessage( XMLErrorResources.ER_CANT_HAVE_MORE_THAN_ONE_ROOT, null)); //"Can't have more than one root on a DOM!"); } } if (ok) { if (m_nextSibling != null) m_doc.insertBefore(newNode, m_nextSibling); else m_doc.appendChild(newNode); } } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startDocument() throws org.xml.sax.SAXException { // No action for the moment. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endDocument() throws org.xml.sax.SAXException { // No action for the moment. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startElement( String ns, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { Element elem; // Note that the namespace-aware call must be used to correctly // construct a Level 2 DOM, even for non-namespaced nodes. if ((null == ns) || (ns.length() == 0)) elem = m_doc.createElementNS(null,name); else elem = m_doc.createElementNS(ns, name); append(elem); try { int nAtts = atts.getLength(); if (0 != nAtts) { for (int i = 0; i < nAtts; i++) { //System.out.println("type " + atts.getType(i) + " name " + atts.getLocalName(i) ); // First handle a possible ID attribute if (atts.getType(i).equalsIgnoreCase("ID")) setIDAttribute(atts.getValue(i), elem); String attrNS = atts.getURI(i); if("".equals(attrNS)) attrNS = null; // DOM represents no-namespace as null // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i) // +", qname: "+atts.getQName(i)+", value: "+atts.getValue(i)); // Crimson won't let us set an xmlns: attribute on the DOM. String attrQName = atts.getQName(i); // In SAX, xmlns[:] attributes have an empty namespace, while in DOM they // should have the xmlns namespace if (attrQName.startsWith("xmlns:") || attrQName.equals("xmlns")) { attrNS = "http://www.w3.org/2000/xmlns/"; } // ALWAYS use the DOM Level 2 call! elem.setAttributeNS(attrNS,attrQName, atts.getValue(i)); } } /* * Adding namespace nodes to the DOM tree; */ int nDecls = m_prefixMappings.size(); String prefix, declURL; for (int i = 0; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; declURL = (String) m_prefixMappings.elementAt(i + 1); elem.setAttributeNS("http://www.w3.org/2000/xmlns/", prefix, declURL); } m_prefixMappings.clear(); // append(elem); m_elemStack.push(elem); m_currentNode = elem; // append(elem); } catch(java.lang.Exception de) { // de.printStackTrace(); throw new org.xml.sax.SAXException(de); } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endElement(String ns, String localName, String name) throws org.xml.sax.SAXException { m_elemStack.pop(); m_currentNode = m_elemStack.isEmpty() ? null : (Node)m_elemStack.peek(); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error if (m_inCData) { cdata(ch, start, length); return; } String s = new String(ch, start, length); Node childNode; childNode = m_currentNode != null ? m_currentNode.getLastChild(): null; if( childNode != null && childNode.getNodeType() == Node.TEXT_NODE ){ ((Text)childNode).appendData(s); } else{ Text text = m_doc.createTextNode(s); append(text); } }
// in src/org/apache/xml/utils/DOMBuilder.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); append(m_doc.createProcessingInstruction("xslt-next-is-raw", "formatter-to-dom")); append(m_doc.createTextNode(s)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startEntity(String name) throws org.xml.sax.SAXException { // Almost certainly the wrong behavior... // entityReference(name); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endEntity(String name) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/DOMBuilder.java
public void entityReference(String name) throws org.xml.sax.SAXException { append(m_doc.createEntityReference(name)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem()) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); append(m_doc.createTextNode(s)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { append(m_doc.createProcessingInstruction(target, data)); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { append(m_doc.createComment(new String(ch, start, length))); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startCDATA() throws org.xml.sax.SAXException { m_inCData = true; append(m_doc.createCDATASection("")); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endCDATA() throws org.xml.sax.SAXException { m_inCData = false; }
// in src/org/apache/xml/utils/DOMBuilder.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if(isOutsideDocElem() && org.apache.xml.utils.XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) return; // avoid DOM006 Hierarchy request error String s = new String(ch, start, length); CDATASection section =(CDATASection) m_currentNode.getLastChild(); section.appendData(s); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException { // Do nothing for now. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endDTD() throws org.xml.sax.SAXException { // Do nothing for now. }
// in src/org/apache/xml/utils/DOMBuilder.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { if(null == prefix || prefix.length() == 0) prefix = "xmlns"; else prefix = "xmlns:"+prefix; m_prefixMappings.addElement(prefix); m_prefixMappings.addElement(uri); }
// in src/org/apache/xml/utils/DOMBuilder.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/DOMBuilder.java
public void skippedEntity(String name) throws org.xml.sax.SAXException{}
// in src/org/apache/xml/utils/XMLStringDefault.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { }
// in src/org/apache/xml/utils/XMLStringDefault.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { }
// in src/org/apache/xml/utils/XMLReaderManager.java
public synchronized XMLReader getXMLReader() throws SAXException { XMLReader reader; boolean readerInUse; if (m_readers == null) { // When the m_readers.get() method is called for the first time // on a thread, a new XMLReader will automatically be created. m_readers = new ThreadLocal(); } if (m_inUse == null) { m_inUse = new Hashtable(); } // If the cached reader for this thread is in use, construct a new // one; otherwise, return the cached reader. reader = (XMLReader) m_readers.get(); boolean threadHasReader = (reader != null); if (!threadHasReader || m_inUse.get(reader) == Boolean.TRUE) { try { try { // According to JAXP 1.2 specification, if a SAXSource // is created using a SAX InputSource the Transformer or // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); } catch (Exception e) { try { // If unable to create an instance, let's try to use // the XMLReader from JAXP if (m_parserFactory == null) { m_parserFactory = SAXParserFactory.newInstance(); m_parserFactory.setNamespaceAware(true); } reader = m_parserFactory.newSAXParser().getXMLReader(); } catch (ParserConfigurationException pce) { throw pce; // pass along pce } } try { reader.setFeature(NAMESPACES_FEATURE, true); reader.setFeature(NAMESPACE_PREFIXES_FEATURE, false); } catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. } } catch (ParserConfigurationException ex) { throw new SAXException(ex); } catch (FactoryConfigurationError ex1) { throw new SAXException(ex1.toString()); } catch (NoSuchMethodError ex2) { } catch (AbstractMethodError ame) { } // Cache the XMLReader if this is the first time we've created // a reader for this thread. if (!threadHasReader) { m_readers.set(reader); m_inUse.put(reader, Boolean.TRUE); } } else { m_inUse.put(reader, Boolean.TRUE); } return reader; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.characters(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endDocument() throws org.xml.sax.SAXException { // EXCEPTION: In this case we need to run the event BEFORE we yield. if(clientContentHandler!=null) clientContentHandler.endDocument(); eventcounter=0; co_yield(false); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.endElement(namespaceURI,localName,qName); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.endPrefixMapping(prefix); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.ignorableWhitespace(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.processingInstruction(target,data); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.skippedEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startDocument() throws org.xml.sax.SAXException { co_entry_pause(); // Otherwise, begin normal event delivery if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startDocument(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startElement(namespaceURI, localName, qName, atts); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.startPrefixMapping(prefix,uri); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.comment(ch,start,length); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endCDATA() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endCDATA(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endDTD() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endDTD(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.endEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startCDATA() throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.startCDATA(); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler. startDTD(name, publicId, systemId); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { if(null!=clientLexicalHandler) clientLexicalHandler.startEntity(name); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void notationDecl(String a, String b, String c) throws SAXException { if(null!=clientDTDHandler) clientDTDHandler.notationDecl(a,b,c); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void unparsedEntityDecl(String a, String b, String c, String d) throws SAXException { if(null!=clientDTDHandler) clientDTDHandler.unparsedEntityDecl(a,b,c,d); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void error(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void fatalError(SAXParseException exception) throws SAXException { // EXCEPTION: In this case we need to run the event BEFORE we yield -- // just as with endDocument, this terminates the event stream. if(null!=clientErrorHandler) clientErrorHandler.error(exception); eventcounter=0; co_yield(false); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void warning(SAXParseException exception) throws SAXException { if(null!=clientErrorHandler) clientErrorHandler.error(exception); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
protected void count_and_yield(boolean moreExpected) throws SAXException { if(!moreExpected) eventcounter=0; if(--eventcounter<=0) { co_yield(true); eventcounter=frequency; } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_entry_pause() throws SAXException { if(fCoroutineManager==null) { // Nobody called init()? Do it now... init(null,-1,-1); } try { Object arg=fCoroutineManager.co_entry_pause(fSourceCoroutineID); if(arg==Boolean.FALSE) co_yield(false); } catch(NoSuchMethodException e) { // Coroutine system says we haven't registered. That's an // application coding error, and is unrecoverable. if(DEBUG) e.printStackTrace(); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
public void startParse(InputSource source) throws SAXException { if(fNoMoreEvents) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INCRSAXSRCFILTER_NOT_RESTARTABLE, null)); //"IncrmentalSAXSource_Filter not currently restartable."); if(fXMLReader==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_XMLRDR_NOT_BEFORE_STARTPARSE, null)); //"XMLReader not before startParse request"); fXMLReaderInputSource=source; // Xalan thread pooling... // org.apache.xalan.transformer.TransformerImpl.runTransformThread(this); ThreadControllerWrapper.runThread(this, -1); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException { // Actually creating the text node is handled by // processAccumulatedText(); here we just accumulate the // characters into the buffer. m_char.append(ch,start,length); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endDocument() throws org.xml.sax.SAXException { // May need to tell the low-level builder code to pop up a level. // There _should't_ be any significant pending text at this point. appendEndDocument(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException { processAccumulatedText(); // No args but we do need to tell the low-level builder code to // pop up a level. appendEndElement(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException { // No-op }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException { // %TBD% I believe ignorable text isn't part of the DTM model...? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException { processAccumulatedText(); // %TBD% Which pools do target and data go into? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException { processAccumulatedText(); //%TBD% }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startDocument() throws org.xml.sax.SAXException { appendStartDocument(); }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, Attributes atts) throws org.xml.sax.SAXException { processAccumulatedText(); // %TBD% Split prefix off qname String prefix=null; int colon=qName.indexOf(':'); if(colon>0) prefix=qName.substring(0,colon); // %TBD% Where do we pool expandedName, or is it just the union, or... /**/System.out.println("Prefix="+prefix+" index="+m_prefixNames.stringToIndex(prefix)); appendStartElement(m_nsNames.stringToIndex(namespaceURI), m_localNames.stringToIndex(localName), m_prefixNames.stringToIndex(prefix)); /////// %TBD% // %TBD% I'm assuming that DTM will require resequencing of // NS decls before other attrs, hence two passes are taken. // %TBD% Is there an easier way to test for NSDecl? int nAtts=(atts==null) ? 0 : atts.getLength(); // %TBD% Countdown is more efficient if nobody cares about sequence. for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(qName.startsWith("xmlns:") || "xmlns".equals(qName)) { prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); } else { // %REVEIW% Null or ""? prefix=null; // Default prefix } appendNSDeclaration( m_prefixNames.stringToIndex(prefix), m_nsNames.stringToIndex(atts.getValue(i)), atts.getType(i).equalsIgnoreCase("ID")); } } for(int i=nAtts-1;i>=0;--i) { qName=atts.getQName(i); if(!(qName.startsWith("xmlns:") || "xmlns".equals(qName))) { // %TBD% I hate having to extract the prefix into a new // string when we may never use it. Consider pooling whole // qNames, which are already strings? prefix=null; colon=qName.indexOf(':'); if(colon>0) { prefix=qName.substring(0,colon); localName=qName.substring(colon+1); } else { prefix=""; // Default prefix localName=qName; } m_char.append(atts.getValue(i)); // Single-string value int contentEnd=m_char.length(); if(!("xmlns".equals(prefix) || "xmlns".equals(qName))) appendAttribute(m_nsNames.stringToIndex(atts.getURI(i)), m_localNames.stringToIndex(localName), m_prefixNames.stringToIndex(prefix), atts.getType(i).equalsIgnoreCase("ID"), m_char_current_start, contentEnd-m_char_current_start); m_char_current_start=contentEnd; } } }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException { // No-op in DTM, handled during element/attr processing? }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException { processAccumulatedText(); m_char.append(ch,start,length); // Single-string value appendComment(m_char_current_start,length); m_char_current_start+=length; }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endCDATA() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endDTD() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startCDATA() throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException { // No-op in DTM }
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException {}
// in src/org/apache/xml/dtm/ref/DTMDocumentImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException {}
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
public void traverse(int pos) throws org.xml.sax.SAXException { // %REVIEW% Why isn't this just traverse(pos,pos)? int top = pos; // Remember the root of this subtree while (DTM.NULL != pos) { startNode(pos); int nextNode = m_dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { endNode(pos); if (top == pos) break; nextNode = m_dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = m_dtm.getParent(pos); if ((DTM.NULL == pos) || (top == pos)) { // %REVIEW% This condition isn't tested in traverse(pos,top) // -- bug? if (DTM.NULL != pos) endNode(pos); nextNode = DTM.NULL; break; } } } pos = nextNode; } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
public void traverse(int pos, int top) throws org.xml.sax.SAXException { // %OPT% Can we simplify the loop conditionals by adding: // if(top==DTM.NULL) top=0 // -- or by simply ignoring this case and relying on the fact that // pos will never equal DTM.NULL until we're ready to exit? while (DTM.NULL != pos) { startNode(pos); int nextNode = m_dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { endNode(pos); if ((DTM.NULL != top) && top == pos) break; nextNode = m_dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = m_dtm.getParent(pos); if ((DTM.NULL == pos) || ((DTM.NULL != top) && (top == pos))) { nextNode = DTM.NULL; break; } } } pos = nextNode; } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
private final void dispatachChars(int node) throws org.xml.sax.SAXException { m_dtm.dispatchCharactersEvents(node, m_contentHandler, false); }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
protected void startNode(int node) throws org.xml.sax.SAXException { if (m_contentHandler instanceof NodeConsumer) { // %TBD% // ((NodeConsumer) m_contentHandler).setOriginatingNode(node); } switch (m_dtm.getNodeType(node)) { case DTM.COMMENT_NODE : { XMLString data = m_dtm.getStringValue(node); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); data.dispatchAsComment(lh); } } break; case DTM.DOCUMENT_FRAGMENT_NODE : // ??; break; case DTM.DOCUMENT_NODE : this.m_contentHandler.startDocument(); break; case DTM.ELEMENT_NODE : DTM dtm = m_dtm; for (int nsn = dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn; nsn = dtm.getNextNamespaceNode(node, nsn, true)) { // String prefix = dtm.getPrefix(nsn); String prefix = dtm.getNodeNameX(nsn); this.m_contentHandler.startPrefixMapping(prefix, dtm.getNodeValue(nsn)); } // System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node)); // System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node)); String ns = dtm.getNamespaceURI(node); if(null == ns) ns = ""; // %OPT% !! org.xml.sax.helpers.AttributesImpl attrs = new org.xml.sax.helpers.AttributesImpl(); for (int i = dtm.getFirstAttribute(node); i != DTM.NULL; i = dtm.getNextAttribute(i)) { attrs.addAttribute(dtm.getNamespaceURI(i), dtm.getLocalName(i), dtm.getNodeName(i), "CDATA", dtm.getNodeValue(i)); } this.m_contentHandler.startElement(ns, m_dtm.getLocalName(node), m_dtm.getNodeName(node), attrs); break; case DTM.PROCESSING_INSTRUCTION_NODE : { String name = m_dtm.getNodeName(node); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(name, m_dtm.getNodeValue(node)); } } break; case DTM.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case DTM.TEXT_NODE : { if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case DTM.ENTITY_REFERENCE_NODE : { if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( m_dtm.getNodeName(node)); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/dtm/ref/DTMTreeWalker.java
protected void endNode(int node) throws org.xml.sax.SAXException { switch (m_dtm.getNodeType(node)) { case DTM.DOCUMENT_NODE : this.m_contentHandler.endDocument(); break; case DTM.ELEMENT_NODE : String ns = m_dtm.getNamespaceURI(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dtm.getLocalName(node), m_dtm.getNodeName(node)); for (int nsn = m_dtm.getFirstNamespaceNode(node, true); DTM.NULL != nsn; nsn = m_dtm.getNextNamespaceNode(node, nsn, true)) { // String prefix = m_dtm.getPrefix(nsn); String prefix = m_dtm.getNodeNameX(nsn); this.m_contentHandler.endPrefixMapping(prefix); } break; case DTM.CDATA_SECTION_NODE : break; case DTM.ENTITY_REFERENCE_NODE : { if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(m_dtm.getNodeName(node)); } } break; default : } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public void startParse(InputSource source) throws SAXException { if (fIncrementalParser==null) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser."); if (fParseInProgress) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing."); boolean ok=false; try { ok = parseSomeSetup(source); } catch(Exception ex) { throw new SAXException(ex); } if(!ok) throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with"); }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSomeSetup(InputSource source) throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException { if(fConfigSetInput!=null) { // Obtain input from SAX inputSource object, construct XNI version of // that object. Logic adapted from Xerces2. Object[] parms1={source.getPublicId(),source.getSystemId(),null}; Object xmlsource=fConfigInputSourceCtor.newInstance(parms1); Object[] parmsa={source.getByteStream()}; fConfigSetByteStream.invoke(xmlsource,parmsa); parmsa[0]=source.getCharacterStream(); fConfigSetCharStream.invoke(xmlsource,parmsa); parmsa[0]=source.getEncoding(); fConfigSetEncoding.invoke(xmlsource,parmsa); // Bugzilla5272 patch suggested by Sandy Gao. // Has to be reflection to run with Xerces2 // after compilation against Xerces1. or vice // versa, due to return type mismatches. Object[] noparms=new Object[0]; fReset.invoke(fIncrementalParser,noparms); parmsa[0]=xmlsource; fConfigSetInput.invoke(fPullParserConfig,parmsa); // %REVIEW% Do first pull. Should we instead just return true? return parseSome(); } else { Object[] parm={source}; Object ret=fParseSomeSetup.invoke(fIncrementalParser,parm); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
private boolean parseSome() throws SAXException, IOException, IllegalAccessException, java.lang.reflect.InvocationTargetException { // Take next parsing step, return false iff parsing complete: if(fConfigSetInput!=null) { Object ret=(Boolean)(fConfigParse.invoke(fPullParserConfig,parmsfalse)); return ((Boolean)ret).booleanValue(); } else { Object ret=fParseSome.invoke(fIncrementalParser,noparms); return ((Boolean)ret).booleanValue(); } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { if(normalize) { XMLString str = getStringValue(nodeHandle); str = str.fixWhiteSpace(true, true, false); str.dispatchCharactersEvents(ch); } else { int type = getNodeType(nodeHandle); Node node = getNode(nodeHandle); dispatchNodeData(node, ch, 0); // Text coalition -- a DTM text node may represent multiple // DOM nodes. if(TEXT_NODE == type || CDATA_SECTION_NODE == type) { while( null != (node=logicalNextDOMTextNode(node)) ) { dispatchNodeData(node, ch, 0); } } } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
protected static void dispatchNodeData(Node node, org.xml.sax.ContentHandler ch, int depth) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_FRAGMENT_NODE : case Node.DOCUMENT_NODE : case Node.ELEMENT_NODE : { for (Node child = node.getFirstChild(); null != child; child = child.getNextSibling()) { dispatchNodeData(child, ch, depth+1); } } break; case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW% case Node.COMMENT_NODE : if(0 != depth) break; // NOTE: Because this operation works in the DOM space, it does _not_ attempt // to perform Text Coalition. That should only be done in DTM space. case Node.TEXT_NODE : case Node.CDATA_SECTION_NODE : case Node.ATTRIBUTE_NODE : String str = node.getNodeValue(); if(ch instanceof CharacterNodeHandler) { ((CharacterNodeHandler)ch).characters(node); } else { ch.characters(str.toCharArray(), 0, str.length()); } break; // /* case Node.PROCESSING_INSTRUCTION_NODE : // // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING); // break; */ default : // ignore break; } }
// in src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { TreeWalker treeWalker = m_walker; ContentHandler prevCH = treeWalker.getContentHandler(); if(null != prevCH) { treeWalker = new TreeWalker(null); } treeWalker.setContentHandler(ch); try { Node node = getNode(nodeHandle); treeWalker.traverseFragment(node); } finally { treeWalker.setContentHandler(null); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void startDocument() throws SAXException { // Re-initialize the tree append process m_endDocumentOccured = false; m_prefixMappings = new java.util.Vector(); m_contextIndexes = new IntStack(); m_parents = new IntStack(); m_currentDocumentNode=m_size; super.startDocument(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java
public void endDocument() throws SAXException { charactersFlush(); m_nextsib.setElementAt(NULL,m_currentDocumentNode); if (m_firstch.elementAt(m_currentDocumentNode) == NOTPROCESSED) m_firstch.setElementAt(NULL,m_currentDocumentNode); if (DTM.NULL != m_previous) m_nextsib.setElementAt(DTM.NULL,m_previous); m_parents = null; m_prefixMappings = null; m_contextIndexes = null; m_currentDocumentNode= NULL; // no longer open m_endDocumentOccured = true; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return; int type = _type(identity); if (isTextType(type)) { int dataIndex = m_dataOrQName.elementAt(identity); int offset = m_data.elementAt(dataIndex); int length = m_data.elementAt(dataIndex + 1); if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } else { int firstChild = _firstch(identity); if (DTM.NULL != firstChild) { int offset = -1; int length = 0; int startNode = identity; identity = firstChild; do { type = _type(identity); if (isTextType(type)) { int dataIndex = _dataOrQName(identity); if (-1 == offset) { offset = m_data.elementAt(dataIndex); } length += m_data.elementAt(dataIndex + 1); } identity = getNextNodeIdentity(identity); } while (DTM.NULL != identity && (_parent(identity) >= startNode)); if (length > 0) { if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } } else if(type != DTM.ELEMENT_NODE) { int dataIndex = _dataOrQName(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String str = m_valuesOrPrefixes.indexToString(dataIndex); if(normalize) FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 0, str.length(), ch); else ch.characters(str.toCharArray(), 0, str.length()); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { DTMTreeWalker treeWalker = m_walker; ContentHandler prevCH = treeWalker.getcontentHandler(); if (null != prevCH) { treeWalker = new DTMTreeWalker(); } treeWalker.setcontentHandler(ch); treeWalker.setDTM(this); try { treeWalker.traverse(nodeHandle); } finally { treeWalker.setcontentHandler(null); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException { return null; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null == m_entities) { m_entities = new Vector(); } try { systemId = SystemIDResolver.getAbsoluteURI(systemId, getDocumentBaseURI()); } catch (Exception e) { throw new org.xml.sax.SAXException(e); } // private static final int ENTITY_FIELD_PUBLICID = 0; m_entities.addElement(publicId); // private static final int ENTITY_FIELD_SYSTEMID = 1; m_entities.addElement(systemId); // private static final int ENTITY_FIELD_NOTATIONNAME = 2; m_entities.addElement(notationName); // private static final int ENTITY_FIELD_NAME = 3; m_entities.addElement(name); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startDocument() throws SAXException { if (DEBUG) System.out.println("startDocument"); int doc = addNode(DTM.DOCUMENT_NODE, m_expandedNameTable.getExpandedTypeID(DTM.DOCUMENT_NODE), DTM.NULL, DTM.NULL, 0, true); m_parents.push(doc); m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the next element. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endDocument() throws SAXException { if (DEBUG) System.out.println("endDocument"); charactersFlush(); m_nextsib.setElementAt(NULL,0); if (m_firstch.elementAt(0) == NOTPROCESSED) m_firstch.setElementAt(NULL,0); if (DTM.NULL != m_previous) m_nextsib.setElementAt(DTM.NULL,m_previous); m_parents = null; m_prefixMappings = null; m_contextIndexes = null; m_endDocumentOccured = true; // Bugzilla 4858: throw away m_locator. we cache m_systemId m_locator = null; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (DEBUG) System.out.println("startPrefixMapping: prefix: " + prefix + ", uri: " + uri); if(null == prefix) prefix = ""; m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endPrefixMapping(String prefix) throws SAXException { if (DEBUG) System.out.println("endPrefixMapping: prefix: " + prefix); if(null == prefix) prefix = ""; int index = m_contextIndexes.peek() - 1; do { index = m_prefixMappings.indexOf(prefix, ++index); } while ( (index >= 0) && ((index & 0x01) == 0x01) ); if (index > -1) { m_prefixMappings.setElementAt("%@$#^@#", index); m_prefixMappings.setElementAt("%@$#^@#", index + 1); } // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (DEBUG) { System.out.println("startElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName+", atts: " + attributes); boolean DEBUG_ATTRS=true; if(DEBUG_ATTRS & attributes!=null) { int n = attributes.getLength(); if(n==0) System.out.println("\tempty attribute list"); else for (int i = 0; i < n; i++) System.out.println("\t attr: uri: " + attributes.getURI(i) + ", localname: " + attributes.getLocalName(i) + ", qname: " + attributes.getQName(i) + ", type: " + attributes.getType(i) + ", value: " + attributes.getValue(i) ); } } charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); String prefix = getPrefix(qName, uri); int prefixIndex = (null != prefix) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); int prev = DTM.NULL; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); int val = m_valuesOrPrefixes.stringToIndex(declURL); prev = addNode(DTM.NAMESPACE_NODE, exName, elemNode, prev, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); prefix = getPrefix(attrQName, attrUri); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; int val = m_valuesOrPrefixes.stringToIndex(valString); //String attrLocalName = attributes.getLocalName(i); if (null != prefix) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); prev = addNode(nodeType, exName, elemNode, prev, val, false); } if (DTM.NULL != prev) m_nextsib.setElementAt(DTM.NULL,prev); if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endElement(String uri, String localName, String qName) throws SAXException { if (DEBUG) System.out.println("endElement: uri: " + uri + ", localname: " + localName + ", qname: "+qName); charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } int lastNode = m_previous; m_previous = m_parents.pop(); // If lastNode is still DTM.NULL, this element had no children if (DTM.NULL == lastNode) m_firstch.setElementAt(DTM.NULL,m_previous); else m_nextsib.setElementAt(DTM.NULL,lastNode); popShouldStripWhitespace(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void characters(char ch[], int start, int length) throws SAXException { if (m_textPendingStart == -1) // First one in this block { m_textPendingStart = m_chars.size(); m_coalescedTextType = m_textType; } // Type logic: If all adjacent text is CDATASections, the // concatentated text is treated as a single CDATASection (see // initialization above). If any were ordinary Text, the whole // thing is treated as Text. This may be worth %REVIEW%ing. else if (m_textType == DTM.TEXT_NODE) { m_coalescedTextType = DTM.TEXT_NODE; } m_chars.append(ch, start, length); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { // %OPT% We can probably take advantage of the fact that we know this // is whitespace. characters(ch, start, length); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void processingInstruction(String target, String data) throws SAXException { if (DEBUG) System.out.println("processingInstruction: target: " + target +", data: "+data); charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(null, target, DTM.PROCESSING_INSTRUCTION_NODE); int dataIndex = m_valuesOrPrefixes.stringToIndex(data); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void skippedEntity(String name) throws SAXException { // %REVIEW% What should be done here? // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void warning(SAXParseException e) throws SAXException { // %REVIEW% Is there anyway to get the JAXP error listener here? System.err.println(e.getMessage()); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void error(SAXParseException e) throws SAXException { throw e; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void fatalError(SAXParseException e) throws SAXException { throw e; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void elementDecl(String name, String model) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void internalEntityDecl(String name, String value) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_insideDTD = true; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endDTD() throws SAXException { m_insideDTD = false; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startEntity(String name) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endEntity(String name) throws SAXException { // no op }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void startCDATA() throws SAXException { m_textType = DTM.CDATA_SECTION_NODE; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void endCDATA() throws SAXException { m_textType = DTM.TEXT_NODE; }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(DTM.COMMENT_NODE); // For now, treat comments as strings... I guess we should do a // seperate FSB buffer instead. int dataIndex = m_valuesOrPrefixes.stringToIndex(new String(ch, start, length)); m_previous = addNode(DTM.COMMENT_NODE, exName, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { charactersFlush(); int exName = m_expandedNameTable.getExpandedTypeID(uri, localName, DTM.ELEMENT_NODE); int prefixIndex = (qName.length() != localName.length()) ? m_valuesOrPrefixes.stringToIndex(qName) : 0; int elemNode = addNode(DTM.ELEMENT_NODE, exName, m_parents.peek(), m_previous, prefixIndex, true); if(m_indexing) indexNode(exName, elemNode); m_parents.push(elemNode); int startDecls = m_contextIndexes.peek(); int nDecls = m_prefixMappings.size(); String prefix; if(!m_pastFirstElement) { // SPECIAL CASE: Implied declaration at root element prefix="xml"; String declURL = "http://www.w3.org/XML/1998/namespace"; exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); m_pastFirstElement=true; } for (int i = startDecls; i < nDecls; i += 2) { prefix = (String) m_prefixMappings.elementAt(i); if (prefix == null) continue; String declURL = (String) m_prefixMappings.elementAt(i + 1); exName = m_expandedNameTable.getExpandedTypeID(null, prefix, DTM.NAMESPACE_NODE); m_values.addElement(declURL); int val = m_valueIndex++; addNode(DTM.NAMESPACE_NODE, exName, elemNode, DTM.NULL, val, false); } int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrUri = attributes.getURI(i); String attrQName = attributes.getQName(i); String valString = attributes.getValue(i); int nodeType; String attrLocalName = attributes.getLocalName(i); if ((null != attrQName) && (attrQName.equals("xmlns") || attrQName.startsWith("xmlns:"))) { prefix = getPrefix(attrQName, attrUri); if (declAlreadyDeclared(prefix)) continue; // go to the next attribute. nodeType = DTM.NAMESPACE_NODE; } else { nodeType = DTM.ATTRIBUTE_NODE; if (m_buildIdIndex && attributes.getType(i).equalsIgnoreCase("ID")) setIDAttribute(valString, elemNode); } // Bit of a hack... if somehow valString is null, stringToIndex will // return -1, which will make things very unhappy. if(null == valString) valString = ""; m_values.addElement(valString); int val = m_valueIndex++; if (attrLocalName.length() != attrQName.length()) { prefixIndex = m_valuesOrPrefixes.stringToIndex(attrQName); int dataIndex = m_data.size(); m_data.addElement(prefixIndex); m_data.addElement(val); val = -dataIndex; } exName = m_expandedNameTable.getExpandedTypeID(attrUri, attrLocalName, nodeType); addNode(nodeType, exName, elemNode, DTM.NULL, val, false); } if (null != m_wsfilter) { short wsv = m_wsfilter.getShouldStripSpace(makeNodeHandle(elemNode), this); boolean shouldStrip = (DTMWSFilter.INHERIT == wsv) ? getShouldStripWhitespace() : (DTMWSFilter.STRIP == wsv); pushShouldStripWhitespace(shouldStrip); } m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the children. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void endElement(String uri, String localName, String qName) throws SAXException { charactersFlush(); // If no one noticed, startPrefixMapping is a drag. // Pop the context for the last child (the one pushed by startElement) m_contextIndexes.quickPop(1); // Do it again for this one (the one pushed by the last endElement). int topContextIndex = m_contextIndexes.peek(); if (topContextIndex != m_prefixMappings.size()) { m_prefixMappings.setSize(topContextIndex); } m_previous = m_parents.pop(); popShouldStripWhitespace(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void comment(char ch[], int start, int length) throws SAXException { if (m_insideDTD) // ignore comments if we're inside the DTD return; charactersFlush(); // %OPT% Saving the comment string in a Vector has a lower cost than // saving it in DTMStringPool. m_values.addElement(new String(ch, start, length)); int dataIndex = m_valueIndex++; m_previous = addNode(DTM.COMMENT_NODE, DTM.COMMENT_NODE, m_parents.peek(), m_previous, dataIndex, false); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void startDocument() throws SAXException { int doc = addNode(DTM.DOCUMENT_NODE, DTM.DOCUMENT_NODE, DTM.NULL, DTM.NULL, 0, true); m_parents.push(doc); m_previous = DTM.NULL; m_contextIndexes.push(m_prefixMappings.size()); // for the next element. }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void endDocument() throws SAXException { super.endDocument(); // Add a NULL entry to the end of the node arrays as // the end indication. m_exptype.addElement(NULL); m_parent.addElement(NULL); m_nextsib.addElement(NULL); m_firstch.addElement(NULL); // Set the cached references after the document is built. m_extendedTypes = m_expandedNameTable.getExtendedTypes(); m_exptype_map = m_exptype.getMap(); m_nextsib_map = m_nextsib.getMap(); m_firstch_map = m_firstch.getMap(); m_parent_map = m_parent.getMap(); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public void processingInstruction(String target, String data) throws SAXException { charactersFlush(); int dataIndex = m_data.size(); m_previous = addNode(DTM.PROCESSING_INSTRUCTION_NODE, DTM.PROCESSING_INSTRUCTION_NODE, m_parents.peek(), m_previous, -dataIndex, false); m_data.addElement(m_valuesOrPrefixes.stringToIndex(target)); m_values.addElement(data); m_data.addElement(m_valueIndex++); }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
public final void dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) throws SAXException { int identity = makeNodeIdentity(nodeHandle); if (identity == DTM.NULL) return; int type = _type2(identity); if (type == DTM.ELEMENT_NODE || type == DTM.DOCUMENT_NODE) { int startNode = identity; identity = _firstch2(identity); if (DTM.NULL != identity) { int offset = -1; int length = 0; do { type = _exptype2(identity); if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (-1 == offset) { offset = dataIndex >>> TEXT_LENGTH_BITS; } length += dataIndex & TEXT_LENGTH_MAX; } else { if (-1 == offset) { offset = m_data.elementAt(-dataIndex); } length += m_data.elementAt(-dataIndex + 1); } } identity++; } while (_parent2(identity) >= startNode); if (length > 0) { if(normalize) m_chars.sendNormalizedSAXcharacters(ch, offset, length); else m_chars.sendSAXcharacters(ch, offset, length); } } } else if (DTM.TEXT_NODE == type || DTM.CDATA_SECTION_NODE == type) { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex >= 0) { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); else m_chars.sendSAXcharacters(ch, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { if (normalize) m_chars.sendNormalizedSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); else m_chars.sendSAXcharacters(ch, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } else { int dataIndex = m_dataOrQName.elementAt(identity); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String str = (String)m_values.elementAt(dataIndex); if(normalize) FastStringBuffer.sendNormalizedSAXcharacters(str.toCharArray(), 0, str.length(), ch); else ch.characters(str.toCharArray(), 0, str.length()); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyTextNode(final int nodeID, SerializationHandler handler) throws SAXException { if (nodeID != DTM.NULL) { int dataIndex = m_dataOrQName.elementAt(nodeID); if (dataIndex >= 0) { m_chars.sendSAXcharacters(handler, dataIndex >>> TEXT_LENGTH_BITS, dataIndex & TEXT_LENGTH_MAX); } else { m_chars.sendSAXcharacters(handler, m_data.elementAt(-dataIndex), m_data.elementAt(-dataIndex+1)); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final String copyElement(int nodeID, int exptype, SerializationHandler handler) throws SAXException { final ExtendedType extType = m_extendedTypes[exptype]; String uri = extType.getNamespace(); String name = extType.getLocalName(); if (uri.length() == 0) { handler.startElement(name); return name; } else { int qnameIndex = m_dataOrQName.elementAt(nodeID); if (qnameIndex == 0) { handler.startElement(name); handler.namespaceAfterStartElement(EMPTY_STR, uri); return name; } if (qnameIndex < 0) { qnameIndex = -qnameIndex; qnameIndex = m_data.elementAt(qnameIndex); } String qName = m_valuesOrPrefixes.indexToString(qnameIndex); handler.startElement(qName); int prefixIndex = qName.indexOf(':'); String prefix; if (prefixIndex > 0) { prefix = qName.substring(0, prefixIndex); } else { prefix = null; } handler.namespaceAfterStartElement(prefix, uri); return qName; } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyNS(final int nodeID, SerializationHandler handler, boolean inScope) throws SAXException { // %OPT% Optimization for documents which does not have any explicit // namespace nodes. For these documents, there is an implicit // namespace node (xmlns:xml="http://www.w3.org/XML/1998/namespace") // declared on the root element node. In this case, there is no // need to do namespace copying. We can safely return without // doing anything. if (m_namespaceDeclSetElements != null && m_namespaceDeclSetElements.size() == 1 && m_namespaceDeclSets != null && ((SuballocatedIntVector)m_namespaceDeclSets.elementAt(0)) .size() == 1) return; SuballocatedIntVector nsContext = null; int nextNSNode; // Find the first namespace node if (inScope) { nsContext = findNamespaceContext(nodeID); if (nsContext == null || nsContext.size() < 1) return; else nextNSNode = makeNodeIdentity(nsContext.elementAt(0)); } else nextNSNode = getNextNamespaceNode2(nodeID); int nsIndex = 1; while (nextNSNode != DTM.NULL) { // Retrieve the name of the namespace node int eType = _exptype2(nextNSNode); String nodeName = m_extendedTypes[eType].getLocalName(); // Retrieve the node value of the namespace node int dataIndex = m_dataOrQName.elementAt(nextNSNode); if (dataIndex < 0) { dataIndex = -dataIndex; dataIndex = m_data.elementAt(dataIndex + 1); } String nodeValue = (String)m_values.elementAt(dataIndex); handler.namespaceAfterStartElement(nodeName, nodeValue); if (inScope) { if (nsIndex < nsContext.size()) { nextNSNode = makeNodeIdentity(nsContext.elementAt(nsIndex)); nsIndex++; } else return; } else nextNSNode = getNextNamespaceNode2(nextNSNode); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyAttributes(final int nodeID, SerializationHandler handler) throws SAXException{ for(int current = getFirstAttributeIdentity(nodeID); current != DTM.NULL; current = getNextAttributeIdentity(current)){ int eType = _exptype2(current); copyAttribute(current, eType, handler); } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java
protected final void copyAttribute(int nodeID, int exptype, SerializationHandler handler) throws SAXException { /* final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); */ final ExtendedType extType = m_extendedTypes[exptype]; final String uri = extType.getNamespace(); final String localName = extType.getLocalName(); String prefix = null; String qname = null; int dataIndex = _dataOrQName(nodeID); int valueIndex = dataIndex; if (dataIndex <= 0) { int prefixIndex = m_data.elementAt(-dataIndex); valueIndex = m_data.elementAt(-dataIndex+1); qname = m_valuesOrPrefixes.indexToString(prefixIndex); int colonIndex = qname.indexOf(':'); if (colonIndex > 0) { prefix = qname.substring(0, colonIndex); } } if (uri.length() != 0) { handler.namespaceAfterStartElement(prefix, uri); } String nodeName = (prefix != null) ? qname : localName; String nodeValue = (String)m_values.elementAt(valueIndex); handler.addAttribute(nodeName, nodeValue); }
// in src/org/apache/xml/serializer/TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); Node top = pos; while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/serializer/TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.m_contentHandler.startDocument(); while (null != pos) { startNode(pos); Node nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.m_contentHandler.endDocument(); }
// in src/org/apache/xml/serializer/TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if(m_Serializer != null) { this.m_Serializer.characters(node); } else { String data = ((Text) node).getData(); this.m_contentHandler.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/serializer/TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { // TODO: <REVIEW> // A Serializer implements ContentHandler, but not NodeConsumer // so drop this reference to NodeConsumer which would otherwise // pull in all sorts of things // if (m_contentHandler instanceof NodeConsumer) // { // ((NodeConsumer) m_contentHandler).setOriginatingNode(node); // } // TODO: </REVIEW> if (node instanceof Locator) { Locator loc = (Locator)node; m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId()); } else { m_locator.setColumnNumber(0); m_locator.setLineNumber(0); } switch (node.getNodeType()) { case Node.COMMENT_NODE : { String data = ((Comment) node).getData(); if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.comment(data.toCharArray(), 0, data.length()); } } break; case Node.DOCUMENT_FRAGMENT_NODE : // ??; break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : Element elem_node = (Element) node; { // Make sure the namespace node // for the element itself is declared // to the ContentHandler String uri = elem_node.getNamespaceURI(); if (uri != null) { String prefix = elem_node.getPrefix(); if (prefix==null) prefix=""; this.m_contentHandler.startPrefixMapping(prefix,uri); } } NamedNodeMap atts = elem_node.getAttributes(); int nAttrs = atts.getLength(); // System.out.println("TreeWalker#startNode: "+node.getNodeName()); // Make sure the namespace node of // each attribute is declared to the ContentHandler for (int i = 0; i < nAttrs; i++) { final Node attr = atts.item(i); final String attrName = attr.getNodeName(); final int colon = attrName.indexOf(':'); final String prefix; // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue()); if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. if (colon < 0) prefix = ""; else prefix = attrName.substring(colon + 1); this.m_contentHandler.startPrefixMapping(prefix, attr.getNodeValue()); } else if (colon > 0) { prefix = attrName.substring(0,colon); String uri = attr.getNamespaceURI(); if (uri != null) this.m_contentHandler.startPrefixMapping(prefix,uri); } } String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.startElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName(), new AttList(atts, m_dh)); break; case Node.PROCESSING_INSTRUCTION_NODE : { ProcessingInstruction pi = (ProcessingInstruction) node; String name = pi.getNodeName(); // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { nextIsRaw = true; } else { this.m_contentHandler.processingInstruction(pi.getNodeName(), pi.getData()); } } break; case Node.CDATA_SECTION_NODE : { boolean isLexH = (m_contentHandler instanceof LexicalHandler); LexicalHandler lh = isLexH ? ((LexicalHandler) this.m_contentHandler) : null; if (isLexH) { lh.startCDATA(); } dispatachChars(node); { if (isLexH) { lh.endCDATA(); } } } break; case Node.TEXT_NODE : { //String data = ((Text) node).getData(); if (nextIsRaw) { nextIsRaw = false; m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { dispatachChars(node); } } break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { ((LexicalHandler) this.m_contentHandler).startEntity( eref.getNodeName()); } else { // warning("Can not output entity to a pure SAX ContentHandler"); } } break; default : } }
// in src/org/apache/xml/serializer/TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : String ns = m_dh.getNamespaceOfNode(node); if(null == ns) ns = ""; this.m_contentHandler.endElement(ns, m_dh.getLocalNameOfNode(node), node.getNodeName()); if (m_Serializer == null) { // Don't bother with endPrefixMapping calls if the ContentHandler is a // SerializationHandler because SerializationHandler's ignore the // endPrefixMapping() calls anyways. . . . This is an optimization. Element elem_node = (Element) node; NamedNodeMap atts = elem_node.getAttributes(); int nAttrs = atts.getLength(); // do the endPrefixMapping calls in reverse order // of the startPrefixMapping calls for (int i = (nAttrs-1); 0 <= i; i--) { final Node attr = atts.item(i); final String attrName = attr.getNodeName(); final int colon = attrName.indexOf(':'); final String prefix; if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) { // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. if (colon < 0) prefix = ""; else prefix = attrName.substring(colon + 1); this.m_contentHandler.endPrefixMapping(prefix); } else if (colon > 0) { prefix = attrName.substring(0, colon); this.m_contentHandler.endPrefixMapping(prefix); } } { String uri = elem_node.getNamespaceURI(); if (uri != null) { String prefix = elem_node.getPrefix(); if (prefix==null) prefix=""; this.m_contentHandler.endPrefixMapping(prefix); } } } break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : { EntityReference eref = (EntityReference) node; if (m_contentHandler instanceof LexicalHandler) { LexicalHandler lh = ((LexicalHandler) this.m_contentHandler); lh.endEntity(eref.getNodeName()); } } break; default : } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public boolean setEscaping(boolean escape) throws SAXException { boolean oldEscapeSetting = m_escapeSetting; m_escapeSetting = escape; if (escape) { processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } return oldEscapeSetting; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void elementDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endDocument() throws SAXException { flushPending(); // Close output document m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
protected void closeStartTag() throws SAXException { m_elemContext.m_startTagOpen = false; final String localName = getLocalName(m_elemContext.m_elementName); final String uri = getNamespaceURI(m_elemContext.m_elementName, true); // Now is time to send the startElement event if (m_needToCallStartDocument) { startDocumentInternal(); } m_saxHandler.startElement(uri, localName, m_elemContext.m_elementName, m_attributes); // we've sent the official SAX attributes on their way, // now we don't need them anymore. m_attributes.clear(); if(m_state != null) m_state.setCurrentNode(null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void closeCDATA() throws SAXException { // Output closing bracket - "]]>" if (m_lexHandler != null && m_cdataTagOpen) { m_lexHandler.endCDATA(); } // There are no longer any calls made to // m_lexHandler.startCDATA() without a balancing call to // m_lexHandler.endCDATA() // so we set m_cdataTagOpen to false to remember this. m_cdataTagOpen = false; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endElement(String namespaceURI, String localName, String qName) throws SAXException { // Close any open elements etc. flushPending(); if (namespaceURI == null) { if (m_elemContext.m_elementURI != null) namespaceURI = m_elemContext.m_elementURI; else namespaceURI = getNamespaceURI(qName, true); } if (localName == null) { if (m_elemContext.m_elementLocalName != null) localName = m_elemContext.m_elementLocalName; else localName = getLocalName(qName); } m_saxHandler.endElement(namespaceURI, localName, qName); if (m_tracer != null) super.fireEndElem(qName); /* Pop all namespaces at the current element depth. * We are not waiting for official endPrefixMapping() calls. */ m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, m_saxHandler); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endPrefixMapping(String prefix) throws SAXException { /* poping all prefix mappings should have been done * in endElement() already */ return; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { m_saxHandler.ignorableWhitespace(arg0,arg1,arg2); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { m_saxHandler.skippedEntity(arg0); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { startPrefixMapping(prefix, uri, true); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException { /* Remember the mapping, and at what depth it was declared * This is one greater than the current depth because these * mappings will apply to the next depth. This is in * consideration that startElement() will soon be called */ boolean pushed; int pushDepth; if (shouldFlush) { flushPending(); // the prefix mapping applies to the child element (one deeper) pushDepth = m_elemContext.m_currentElemDepth + 1; } else { // the prefix mapping applies to the current element pushDepth = m_elemContext.m_currentElemDepth; } pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth); if (pushed) { m_saxHandler.startPrefixMapping(prefix,uri); if (getShouldOutputNSAttr()) { /* I don't know if we really needto do this. The * callers of this object should have injected both * startPrefixMapping and the attributes. We are * just covering our butt here. */ String name; if (EMPTYSTRING.equals(prefix)) { name = "xmlns"; addAttributeAlways(XMLNS_URI, name, name,"CDATA",uri, false); } else { if (!EMPTYSTRING.equals(uri)) // hack for attribset16 test { // that maps ns1 prefix to "" URI name = "xmlns:" + prefix; /* for something like xmlns:abc="w3.pretend.org" * the uri is the value, that is why we pass it in the * value, or 5th slot of addAttributeAlways() */ addAttributeAlways(XMLNS_URI, prefix, name,"CDATA",uri, false ); } } } } return pushed; }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void comment(char[] arg0, int arg1, int arg2) throws SAXException { flushPending(); if (m_lexHandler != null) m_lexHandler.comment(arg0, arg1, arg2); if (m_tracer != null) super.fireCommentEvent(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endCDATA() throws SAXException { /* Normally we would do somthing with this but we ignore it. * The neccessary call to m_lexHandler.endCDATA() will be made * in flushPending(). * * This is so that if we get calls like these: * this.startCDATA(); * this.characters(chars1, off1, len1); * this.endCDATA(); * this.startCDATA(); * this.characters(chars2, off2, len2); * this.endCDATA(); * * that we will only make these calls to the wrapped handlers: * * m_lexHandler.startCDATA(); * m_saxHandler.characters(chars1, off1, len1); * m_saxHandler.characters(chars1, off2, len2); * m_lexHandler.endCDATA(); * * We will merge adjacent CDATA blocks. */ }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endDTD() throws SAXException { if (m_lexHandler != null) m_lexHandler.endDTD(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startEntity(String arg0) throws SAXException { if (m_lexHandler != null) m_lexHandler.startEntity(arg0); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void characters(String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { startElement( elementNamespaceURI,elementLocalName,elementName, null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement(String elementName) throws SAXException { startElement(null, null, elementName, null); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { // We do the first two things in flushPending() but we don't // close any open CDATA calls. if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_elemContext.m_isCdataSection && !m_cdataTagOpen && m_lexHandler != null) { m_lexHandler.startCDATA(); // We have made a call to m_lexHandler.startCDATA() with // no balancing call to m_lexHandler.endCDATA() // so we set m_cdataTagOpen true to remember this. m_cdataTagOpen = true; } /* If there are any occurances of "]]>" in the character data * let m_saxHandler worry about it, we've already warned them with * the previous call of m_lexHandler.startCDATA(); */ m_saxHandler.characters(ch, off, len); // time to generate characters event if (m_tracer != null) fireCharEvent(ch, off, len); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { flushPending(); // Pass the processing instruction to the SAX handler m_saxHandler.processingInstruction(target, data); // we don't want to leave serializer to fire off this event, // so do it here. if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startCDATA() throws SAXException { /* m_cdataTagOpen can only be true here if we have ignored the * previous call to this.endCDATA() and the previous call * this.startCDATA() before that is still "open". In this way * we merge adjacent CDATA. If anything else happened after the * ignored call to this.endCDATA() and this call then a call to * flushPending() would have been made which would have * closed the CDATA and set m_cdataTagOpen to false. */ if (!m_cdataTagOpen ) { flushPending(); if (m_lexHandler != null) { m_lexHandler.startCDATA(); // We have made a call to m_lexHandler.startCDATA() with // no balancing call to m_lexHandler.endCDATA() // so we set m_cdataTagOpen true to remember this. m_cdataTagOpen = true; } } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws SAXException { flushPending(); super.startElement(namespaceURI, localName, name, atts); // Handle document type declaration (for first element only) if (m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); if (doctypeSystem != null && m_lexHandler != null) { String doctypePublic = getDoctypePublic(); if (doctypeSystem != null) m_lexHandler.startDTD( name, doctypePublic, doctypeSystem); } m_needToOutputDocTypeDecl = false; } m_elemContext = m_elemContext.push(namespaceURI, localName, name); // ensurePrefixIsDeclared depends on the current depth, so // the previous increment is necessary where it is. if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); // add the attributes to the collected ones if (atts != null) addAttributes(atts); // do we really need this CDATA section state? m_elemContext.m_isCdataSection = isCdataSection(); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
private void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { int index; final boolean no_prefix = ((index = rawName.indexOf(":")) < 0); String prefix = (no_prefix) ? "" : rawName.substring(0, index); if (null != prefix) { String foundURI = m_prefixMap.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(ns)) { this.startPrefixMapping(prefix, ns, false); if (getShouldOutputNSAttr()) { // Bugzilla1133: Generate attribute as well as namespace event. // SAX does expect both. this.addAttributeAlways( "http://www.w3.org/2000/xmlns/", no_prefix ? "xmlns" : prefix, // local name no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname "CDATA", ns, false); } } } } }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { ensurePrefixIsDeclared(uri, rawName); addAttributeAlways(uri, localName, rawName, type, value, false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEndElem(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDELEMENT,name, (Attributes)null); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCharEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CHARACTERS, chars, start,length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void comment(String data) throws SAXException { m_docIsEmpty = false; final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { addAttributeAlways(uri, localName, rawName, type, value, XSLAttribute); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttributes(Attributes atts) throws SAXException { int nAtts = atts.getLength(); for (int i = 0; i < nAtts; i++) { String uri = atts.getURI(i); if (null == uri) uri = ""; addAttributeAlways( uri, atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i), false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; m_inEntityRef = false; if (m_tracer != null) this.fireEndEntity(name); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void namespaceAfterStartElement(String uri, String prefix) throws SAXException { // default behavior is to do nothing }
// in src/org/apache/xml/serializer/SerializerBase.java
public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void error(SAXParseException exc) throws SAXException { }
// in src/org/apache/xml/serializer/SerializerBase.java
public void fatalError(SAXParseException exc) throws SAXException { m_elemContext.m_startTagOpen = false; }
// in src/org/apache/xml/serializer/SerializerBase.java
public void warning(SAXParseException exc) throws SAXException { }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF, name); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCDATAEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireCommentEvent(char[] chars, int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_COMMENT, new String(chars, start, length)); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void fireEndEntity(String name) throws org.xml.sax.SAXException { if (m_tracer != null) flushMyWriter(); // we do not need to handle this. }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTDOCUMENT); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEndDoc() throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENDDOCUMENT); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireStartElem(String elemName) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_STARTELEMENT, elemName, m_attributes); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEscapingEvent(String name, String data) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_PI,name, data); } }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void fireEntityReference(String name) throws org.xml.sax.SAXException { if (m_tracer != null) { flushMyWriter(); m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_ENTITYREF,name, (Attributes)null); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void startDocument() throws org.xml.sax.SAXException { // if we do get called with startDocument(), handle it right away startDocumentInternal(); m_needToCallStartDocument = false; return; }
// in src/org/apache/xml/serializer/SerializerBase.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { if (m_tracer != null) this.fireStartDoc(); }
// in src/org/apache/xml/serializer/SerializerBase.java
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException { if (m_elemContext.m_startTagOpen) { addAttributeAlways(uri, localName, rawName, type, value, false); } }
// in src/org/apache/xml/serializer/SerializerBase.java
public void notationDecl(String arg0, String arg1, String arg2) throws SAXException { // This method just provides a definition to satisfy the interface // A particular sub-class of SerializerBase provides the implementation (if desired) }
// in src/org/apache/xml/serializer/SerializerBase.java
public void unparsedEntityDecl( String arg0, String arg1, String arg2, String arg3) throws SAXException { // This method just provides a definition to satisfy the interface // A particular sub-class of SerializerBase provides the implementation (if desired) }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startDocumentInternal() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_needToCallStartDocument = false; if (m_inEntityRef) return; m_needToOutputDocTypeDecl = true; m_startNewLine = false; /* The call to getXMLVersion() might emit an error message * and we should emit this message regardless of if we are * writing out an XML header or not. */ final String version = getXMLVersion(); if (getOmitXMLDeclaration() == false) { String encoding = Encodings.getMimeEncoding(getEncoding()); String standalone; if (m_standaloneWasSpecified) { standalone = " standalone=\"" + getStandalone() + "\""; } else { standalone = ""; } try { final java.io.Writer writer = m_writer; writer.write("<?xml version=\""); writer.write(version); writer.write("\" encoding=\""); writer.write(encoding); writer.write('\"'); writer.write(standalone); writer.write("?>"); if (m_doIndent) { if (m_standaloneWasSpecified || getDoctypePublic() != null || getDoctypeSystem() != null) { // We almost never put a newline after the XML // header because this XML could be used as // an extenal general parsed entity // and we don't know the context into which it // will be used in the future. Only when // standalone, or a doctype system or public is // specified are we free to insert a new line // after the header. Is it even worth bothering // in these rare cases? writer.write(m_lineSep, 0, m_lineSepLen); } } } catch(IOException e) { throw new SAXException(e); } } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void startPreserving() throws org.xml.sax.SAXException { // Not sure this is really what we want. -sb m_preserves.push(true); m_ispreserve = true; }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endPreserving() throws org.xml.sax.SAXException { // Not sure this is really what we want. -sb m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (m_inEntityRef) return; flushPending(); if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) startDocumentInternal(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); int indexOfQLT = data.indexOf("?>"); if (indexOfQLT >= 0) { // See XSLT spec on error recovery of "?>" in PIs. if (indexOfQLT > 0) { writer.write(data.substring(0, indexOfQLT)); } writer.write("? >"); // add space between. if ((indexOfQLT + 2) < data.length()) { writer.write(data.substring(indexOfQLT + 2)); } } else { writer.write(data); } writer.write('?'); writer.write('>'); /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { if (m_elemContext.m_startTagOpen) { try { final String patchedName = patchName(name); final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_xmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 32 to 127 so we write out the // value directly writer.write(' '); writer.write(patchedName); writer.write("=\""); writer.write(value); writer.write('"'); } else { writer.write(' '); writer.write(patchedName); writer.write("=\""); writeAttrString(writer, value, this.getEncoding()); writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean xslAttribute) throws SAXException { if (m_elemContext.m_startTagOpen) { boolean was_added = addAttributeAlways(uri, localName, rawName, type, value, xslAttribute); /* * We don't run this block of code if: * 1. The attribute value was only replaced (was_added is false). * 2. The attribute is from an xsl:attribute element (that is handled * in the addAttributeAlways() call just above. * 3. The name starts with "xmlns", i.e. it is a namespace declaration. */ if (was_added && !xslAttribute && !rawName.startsWith("xmlns")) { String prefixUsed = ensureAttributesNamespaceIsDeclared( uri, localName, rawName); if (prefixUsed != null && rawName != null && !rawName.startsWith(prefixUsed)) { // use a different raw name, with the prefix used in the // generated namespace declaration rawName = prefixUsed + ":" + localName; } } addAttributeAlways(uri, localName, rawName, type, value, xslAttribute); } else { /* * The startTag is closed, yet we are adding an attribute? * * Section: 7.1.3 Creating Attributes Adding an attribute to an * element after a PI (for example) has been added to it is an * error. The attributes can be ignored. The spec doesn't explicitly * say this is disallowed, as it does for child elements, but it * makes sense to have the same treatment. * * We choose to ignore the attribute which is added too late. */ // Generate a warning of the ignored attributes // Create the warning message String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,new Object[]{ localName }); try { // Prepare to issue the warning message Transformer tran = super.getTransformer(); ErrorListener errHandler = tran.getErrorListener(); // Issue the warning message if (null != errHandler && m_sourceLocator != null) errHandler.warning(new TransformerException(msg, m_sourceLocator)); else System.out.println(msg); } catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; } } }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToXMLStream.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); return; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public boolean setEscaping(boolean escape) throws SAXException { return m_handler.setEscaping(escape); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.addAttribute(uri, localName, rawName, type, value, XSLAttribute); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addUniqueAttribute(String rawName, String value, int flags) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.addUniqueAttribute(rawName, value, flags); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void characters(String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endElement(String elementName) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endElement(elementName); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { this.startPrefixMapping(prefix,uri, true); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null) { String prefix1 = getPrefixPart(m_firstElementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_firstElementURI = uri; } } startPrefixMapping(prefix,uri, false); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException { boolean pushed = false; if (m_firstTagNotEmitted) { if (m_firstElementName != null && shouldFlush) { /* we've already seen a startElement, and this is a prefix mapping * for the up coming element, so flush the old element * then send this event on its way. */ flush(); pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush); } else { if (m_namespacePrefix == null) { m_namespacePrefix = new Vector(); m_namespaceURI = new Vector(); } m_namespacePrefix.addElement(prefix); m_namespaceURI.addElement(uri); if (m_firstElementURI == null) { if (prefix.equals(m_firstElementPrefix)) m_firstElementURI = uri; } } } else { pushed = m_handler.startPrefixMapping(prefix, uri, shouldFlush); } return pushed; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startDocument() throws SAXException { m_needToCallStartDocument = true; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement(String qName) throws SAXException { this.startElement(null, null, qName, null); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement(String namespaceURI, String localName, String qName) throws SAXException { this.startElement(namespaceURI, localName, qName, null); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startElement( String namespaceURI, String localName, String elementName, Attributes atts) throws SAXException { /* we are notified of the start of an element */ if (m_firstTagNotEmitted) { /* we have not yet sent the first element on its way */ if (m_firstElementName != null) { /* this is not the first element, but a later one. * But we have the old element pending, so flush it out, * then send this one on its way. */ flush(); m_handler.startElement(namespaceURI, localName, elementName, atts); } else { /* this is the very first element that we have seen, * so save it for flushing later. We may yet get to know its * URI due to added attributes. */ m_wrapped_handler_not_initialized = true; m_firstElementName = elementName; // null if not known m_firstElementPrefix = getPrefixPartUnknown(elementName); // null if not known m_firstElementURI = namespaceURI; // null if not known m_firstElementLocalName = localName; if (m_tracer != null) firePseudoElement(elementName); /* we don't want to call our own addAttributes, which * merely delegates to the wrapped handler, but we want to * add these attributes to m_attributes. So me must call super. * addAttributes() In this case m_attributes is only used for the * first element, after that this class totally delegates to the * wrapped handler which is either XML or HTML. */ if (atts != null) super.addAttributes(atts); // if there are attributes, then lets make the flush() // call the startElement on the handler and send the // attributes on their way. if (atts != null) flush(); } } else { // this is not the first element, but a later one, so just // send it on its way. m_handler.startElement(namespaceURI, localName, elementName, atts); } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void comment(String comment) throws SAXException { if (m_firstTagNotEmitted && m_firstElementName != null) { emitFirstTag(); } else if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } m_handler.comment(comment); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { m_handler.attributeDecl(arg0, arg1, arg2, arg3, arg4); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void elementDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.elementDecl(arg0, arg1); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.externalEntityDecl(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.internalEntityDecl(arg0, arg1); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void characters(char[] characters, int offset, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.characters(characters, offset, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endDocument() throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.endDocument(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endElement(String namespaceURI, String localName, String qName) throws SAXException { if (m_firstTagNotEmitted) { flush(); if (namespaceURI == null && m_firstElementURI != null) namespaceURI = m_firstElementURI; if (localName == null && m_firstElementLocalName != null) localName = m_firstElementLocalName; } m_handler.endElement(namespaceURI, localName, qName); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endPrefixMapping(String prefix) throws SAXException { m_handler.endPrefixMapping(prefix); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void processingInstruction(String target, String data) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.processingInstruction(target, data); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void skippedEntity(String name) throws SAXException { m_handler.skippedEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void comment(char[] ch, int start, int length) throws SAXException { if (m_firstTagNotEmitted) { flush(); } m_handler.comment(ch, start, length); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endCDATA() throws SAXException { m_handler.endCDATA(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endDTD() throws SAXException { m_handler.endDTD(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void endEntity(String name) throws SAXException { if (m_firstTagNotEmitted) { emitFirstTag(); } m_handler.endEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startCDATA() throws SAXException { m_handler.startCDATA(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_handler.startDTD(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void startEntity(String name) throws SAXException { m_handler.startEntity(name); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void initStreamOutput() throws SAXException { // Try to rule out if this is an not to be an HTML document based on prefix boolean firstElementIsHTML = isFirstElemHTML(); if (firstElementIsHTML) { // create an HTML output handler, and initialize it // keep a reference to the old handler, ... it will soon be gone SerializationHandler oldHandler = m_handler; /* We have to make sure we get an output properties with the proper * defaults for the HTML method. The easiest way to do this is to * have the OutputProperties class do it. */ Properties htmlProperties = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML); Serializer serializer = SerializerFactory.getSerializer(htmlProperties); // The factory should be returning a ToStream // Don't know what to do if it doesn't // i.e. the user has over-ridden the content-handler property // for html m_handler = (SerializationHandler) serializer; //m_handler = new ToHTMLStream(); Writer writer = oldHandler.getWriter(); if (null != writer) m_handler.setWriter(writer); else { OutputStream os = oldHandler.getOutputStream(); if (null != os) m_handler.setOutputStream(os); } // need to copy things from the old handler to the new one here // if (_setVersion_called) // { m_handler.setVersion(oldHandler.getVersion()); // } // if (_setDoctypeSystem_called) // { m_handler.setDoctypeSystem(oldHandler.getDoctypeSystem()); // } // if (_setDoctypePublic_called) // { m_handler.setDoctypePublic(oldHandler.getDoctypePublic()); // } // if (_setMediaType_called) // { m_handler.setMediaType(oldHandler.getMediaType()); // } m_handler.setTransformer(oldHandler.getTransformer()); } /* Now that we have a real wrapped handler (XML or HTML) lets * pass any cached calls to it */ // Call startDocument() if necessary if (m_needToCallStartDocument) { m_handler.startDocument(); m_needToCallStartDocument = false; } // the wrapped handler is now fully initialized m_wrapped_handler_not_initialized = false; }
// in src/org/apache/xml/serializer/ToUnknownStream.java
private void emitFirstTag() throws SAXException { if (m_firstElementName != null) { if (m_wrapped_handler_not_initialized) { initStreamOutput(); m_wrapped_handler_not_initialized = false; } // Output first tag m_handler.startElement(m_firstElementURI, null, m_firstElementName, m_attributes); // don't need the collected attributes of the first element anymore. m_attributes = null; // Output namespaces of first tag if (m_namespacePrefix != null) { final int n = m_namespacePrefix.size(); for (int i = 0; i < n; i++) { final String prefix = (String) m_namespacePrefix.elementAt(i); final String uri = (String) m_namespaceURI.elementAt(i); m_handler.startPrefixMapping(prefix, uri, false); } m_namespacePrefix = null; m_namespaceURI = null; } m_firstTagNotEmitted = false; } }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void addAttributes(Attributes atts) throws SAXException { m_handler.addAttributes(atts); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void flushPending() throws SAXException { flush(); m_handler.flushPending(); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
public void entityReference(String entityName) throws SAXException { m_handler.entityReference(entityName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endElement(String elemName) throws SAXException { if (m_tracer != null) super.fireEndElem(elemName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endElement(String arg0, String arg1, String arg2) throws SAXException { if (m_tracer != null) super.fireEndElem(arg2); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireCommentEvent(ch, start, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void comment(String data) throws org.xml.sax.SAXException { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void elementDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endPrefixMapping(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void processingInstruction(String arg0, String arg1) throws SAXException { if (m_tracer != null) super.fireEscapingEvent(arg0, arg1); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { flushPending(); super.startElement(arg0, arg1, arg2, arg3); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endDTD() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { super.startElement(elementNamespaceURI, elementLocalName, elementName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startElement( String elementName) throws SAXException { super.startElement(elementName); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void endDocument() throws SAXException { flushPending(); m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void characters(String characters) throws SAXException { final int length = characters.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } characters.getChars(0, length, m_charsBuff, 0); m_saxHandler.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void characters(char[] characters, int offset, int length) throws SAXException { m_saxHandler.characters(characters, offset, length); // time to fire off characters event if (m_tracer != null) super.fireCharEvent(characters, offset, length); }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML return false; }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { super.startDocumentInternal(); m_needToCallStartDocument = false; // No action for the moment. }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endDocument() throws org.xml.sax.SAXException { flushPending(); flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { // time to fire off startElement event if (m_tracer != null) { super.fireStartElem(name); this.firePseudoAttributes(); } return; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireEndElem(name); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); try { if (inTemporaryOutputState()) { /* leave characters un-processed as we are * creating temporary output, the output generated by * this serializer will be input to a final serializer * later on and it will do the processing in final * output state (not temporary output state). * * A "temporary" ToTextStream serializer is used to * evaluate attribute value templates (for example), * and the result of evaluating such a thing * is fed into a final serializer later on. */ m_writer.write(ch, start, length); } else { // In final output state we do process the characters! writeNormalizedChars(ch, start, length, m_lineSepUse); } if (m_tracer != null) super.fireCharEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
void writeNormalizedChars( final char ch[], final int start, final int length, final boolean useLineSep) throws IOException, org.xml.sax.SAXException { final String encoding = getEncoding(); final java.io.Writer writer = m_writer; final int end = start + length; /* copy a few "constants" before the loop for performance */ final char S_LINEFEED = CharInfo.S_LINEFEED; // This for() loop always increments i by one at the end // of the loop. Additional increments of i adjust for when // two input characters (a high/low UTF16 surrogate pair) // are processed. for (int i = start; i < end; i++) { final char c = ch[i]; if (S_LINEFEED == c && useLineSep) { writer.write(m_lineSep, 0, m_lineSepLen); // one input char processed } else if (m_encodingInfo.isInEncoding(c)) { writer.write(c); // one input char processed } else if (Encodings.isHighUTF16Surrogate(c)) { final int codePoint = writeUTF16Surrogate(c, ch, i, end); if (codePoint != 0) { // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(codePoint); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } i++; // two input chars processed } else { // Don't know what to do with this char, it is // not in the encoding and not a high char in // a surrogate pair, so write out as an entity ref if (encoding != null) { /* The output encoding is known, * so somthing is wrong. */ // not in the encoding, so write out a character reference writer.write('&'); writer.write('#'); writer.write(Integer.toString(c)); writer.write(';'); // I think we can just emit the message, // not crash and burn. final String integralValue = Integer.toString(c); final String msg = Utils.messages.createMessage( MsgKey.ER_ILLEGAL_CHARACTER, new Object[] { integralValue, encoding }); //Older behavior was to throw the message, //but newer gentler behavior is to write a message to System.err //throw new SAXException(msg); System.err.println(msg); } else { /* The output encoding is not known, * so just write it out as-is. */ writer.write(c); } // one input char was processed } } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); if (m_tracer != null) super.fireCDATAEvent(ch, start, length); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { try { writeNormalizedChars(ch, start, length, m_lineSepUse); } catch(IOException ioe) { throw new SAXException(ioe); } }
// in src/org/apache/xml/serializer/ToTextStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // flush anything pending first flushPending(); if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void comment(String data) throws org.xml.sax.SAXException { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { flushPending(); if (m_tracer != null) super.fireCommentEvent(ch, start, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void entityReference(String name) throws org.xml.sax.SAXException { if (m_tracer != null) super.fireEntityReference(name); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endCDATA() throws SAXException { // do nothing }
// in src/org/apache/xml/serializer/ToTextStream.java
public void endElement(String elemName) throws SAXException { if (m_tracer != null) super.fireEndElem(elemName); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { if (m_needToCallStartDocument) startDocumentInternal(); // time to fire off startlement event. if (m_tracer != null) { super.fireStartElem(elementName); this.firePseudoAttributes(); } return; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void characters(String characters) throws SAXException { final int length = characters.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length*2 + 1]; } characters.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToTextStream.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { // do nothing, forget about the attribute }
// in src/org/apache/xml/serializer/ToTextStream.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML return false; }
// in src/org/apache/xml/serializer/ToTextStream.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // no namespace support for HTML }
// in src/org/apache/xml/serializer/ToTextStream.java
public void flushPending() throws org.xml.sax.SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void startDocumentInternal() throws org.xml.sax.SAXException { super.startDocumentInternal(); m_needToCallStartDocument = false; m_needToOutputDocTypeDecl = true; m_startNewLine = false; setOmitXMLDeclaration(true); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
private void outputDocTypeDecl(String name) throws SAXException { if (true == m_needToOutputDocTypeDecl) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((null != doctypeSystem) || (null != doctypePublic)) { final java.io.Writer writer = m_writer; try { writer.write("<!DOCTYPE "); writer.write(name); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('"'); } if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); writer.write('"'); } writer.write('>'); outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } } m_needToOutputDocTypeDecl = false; }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endDocument() throws org.xml.sax.SAXException { flushPending(); if (m_doIndent && !m_isprevtext) { try { outputLineSep(); } catch(IOException e) { throw new SAXException(e); } } flushWriter(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { ElemContext elemContext = m_elemContext; // clean up any pending things first if (elemContext.m_startTagOpen) { closeStartTag(); elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_needToOutputDocTypeDecl) { String n = name; if (n == null || n.length() == 0) { // If the lexical QName is not given // use the localName in the DOCTYPE n = localName; } outputDocTypeDecl(n); } // if this element has a namespace then treat it like XML if (null != namespaceURI && namespaceURI.length() > 0) { super.startElement(namespaceURI, localName, name, atts); return; } try { // getElemDesc2(name) is faster than getElemDesc(name) ElemDesc elemDesc = getElemDesc2(name); int elemFlags = elemDesc.getFlags(); // deal with indentation issues first if (m_doIndent) { boolean isBlockElement = (elemFlags & ElemDesc.BLOCK) != 0; if (m_ispreserve) m_ispreserve = false; else if ( (null != elemContext.m_elementName) && (!m_inBlockElem || isBlockElement) /* && !isWhiteSpaceSensitive */ ) { m_startNewLine = true; indent(); } m_inBlockElem = !isBlockElement; } // save any attributes for later processing if (atts != null) addAttributes(atts); m_isprevtext = false; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); if (m_tracer != null) firePseudoAttributes(); if ((elemFlags & ElemDesc.EMPTY) != 0) { // an optimization for elements which are expected // to be empty. m_elemContext = elemContext.push(); /* XSLTC sometimes calls namespaceAfterStartElement() * so we need to remember the name */ m_elemContext.m_elementName = name; m_elemContext.m_elementDesc = elemDesc; return; } else { elemContext = elemContext.push(namespaceURI,localName,name); m_elemContext = elemContext; elemContext.m_elementDesc = elemDesc; elemContext.m_isRaw = (elemFlags & ElemDesc.RAW) != 0; } if ((elemFlags & ElemDesc.HEADELEM) != 0) { // This is the <HEAD> element, do some special processing closeStartTag(); elemContext.m_startTagOpen = false; if (!m_omitMetaTag) { if (m_doIndent) indent(); writer.write( "<META http-equiv=\"Content-Type\" content=\"text/html; charset="); String encoding = getEncoding(); String encode = Encodings.getMimeEncoding(encoding); writer.write(encode); writer.write("\">"); } } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement( final String namespaceURI, final String localName, final String name) throws org.xml.sax.SAXException { // deal with any pending issues if (m_cdataTagOpen) closeCDATA(); // if the element has a namespace, treat it like XML, not HTML if (null != namespaceURI && namespaceURI.length() > 0) { super.endElement(namespaceURI, localName, name); return; } try { ElemContext elemContext = m_elemContext; final ElemDesc elemDesc = elemContext.m_elementDesc; final int elemFlags = elemDesc.getFlags(); final boolean elemEmpty = (elemFlags & ElemDesc.EMPTY) != 0; // deal with any indentation issues if (m_doIndent) { final boolean isBlockElement = (elemFlags&ElemDesc.BLOCK) != 0; boolean shouldIndent = false; if (m_ispreserve) { m_ispreserve = false; } else if (m_doIndent && (!m_inBlockElem || isBlockElement)) { m_startNewLine = true; shouldIndent = true; } if (!elemContext.m_startTagOpen && shouldIndent) indent(elemContext.m_currentElemDepth - 1); m_inBlockElem = !isBlockElement; } final java.io.Writer writer = m_writer; if (!elemContext.m_startTagOpen) { writer.write("</"); writer.write(name); writer.write('>'); } else { // the start-tag open when this method was called, // so we need to process it now. if (m_tracer != null) super.fireStartElem(name); // the starting tag was still open when we received this endElement() call // so we need to process any gathered attributes NOW, before they go away. int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (!elemEmpty) { // As per Dave/Paul recommendation 12/06/2000 // if (shouldIndent) // writer.write('>'); // indent(m_currentIndent); writer.write("></"); writer.write(name); writer.write('>'); } else { writer.write('>'); } } // clean up because the element has ended if ((elemFlags & ElemDesc.WHITESPACESENSITIVE) != 0) m_ispreserve = true; m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); // OPTIMIZE-EMPTY if (elemEmpty) { // a quick exit if the HTML element had no children. // This block of code can be removed if the corresponding block of code // in startElement() also labeled with "OPTIMIZE-EMPTY" is also removed m_elemContext = elemContext.m_prev; return; } // some more clean because the element has ended. if (!elemContext.m_startTagOpen) { if (m_doIndent && !m_preserves.isEmpty()) m_preserves.pop(); } m_elemContext = elemContext.m_prev; // m_isRawStack.pop(); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void characters(char chars[], int start, int length) throws org.xml.sax.SAXException { if (m_elemContext.m_isRaw) { try { // Clean up some pending issues. if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; writeNormalizedChars(chars, start, length, false, m_lineSepUse); // time to generate characters event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage(MsgKey.ER_OIERROR,null),ioe); } } else { super.characters(chars, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void cdata(char ch[], int start, int length) throws org.xml.sax.SAXException { if ((null != m_elemContext.m_elementName) && (m_elemContext.m_elementName.equalsIgnoreCase("SCRIPT") || m_elemContext.m_elementName.equalsIgnoreCase("STYLE"))) { try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); // writer.write(ch, start, length); writeNormalizedChars(ch, start, length, true, m_lineSepUse); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } } else { super.cdata(ch, start, length); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { // Process any pending starDocument and startElement first. flushPending(); // Use a fairly nasty hack to tell if the next node is supposed to be // unescaped text. if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING)) { startNonEscaping(); } else if (target.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { endNonEscaping(); } else { try { // clean up any pending things first if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps processing instructions can be written out in HTML before * the DOCTYPE, in which case this could be emitted with the * startElement call, that knows the name of the document element * doing it right. */ if (true == m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; //writer.write("<?" + target); writer.write("<?"); writer.write(target); if (data.length() > 0 && !Character.isSpaceChar(data.charAt(0))) writer.write(' '); //writer.write(data + ">"); // different from XML writer.write(data); // different from XML writer.write('>'); // different from XML // Always output a newline char if not inside of an // element. The whitespace is not significant in that // case. if (m_elemContext.m_currentElemDepth <= 0) outputLineSep(); m_startNewLine = true; } catch(IOException e) { throw new SAXException(e); } } // now generate the PI event if (m_tracer != null) super.fireEscapingEvent(target, data); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void entityReference(String name) throws org.xml.sax.SAXException { try { final java.io.Writer writer = m_writer; writer.write('&'); writer.write(name); writer.write(';'); } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public final void endElement(String elemName) throws SAXException { endElement(null, null, elemName); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException,SAXException { /* * process the collected attributes */ for (int i = 0; i < nAttrs; i++) { processAttribute( writer, m_attributes.getQName(i), m_attributes.getValue(i), m_elemContext.m_elementDesc); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
protected void closeStartTag() throws SAXException { try { // finish processing attributes, time to fire off the start element event if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs>0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); /* At this point we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) // if there are any cdata sections m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } catch(IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { m_inDTD = true; super.startDTD(name, publicId, systemId); }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void endDTD() throws org.xml.sax.SAXException { m_inDTD = false; /* for ToHTMLStream the DOCTYPE is entirely output in the * startDocumentInternal() method, so don't do anything here */ }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void elementDecl(String name, String model) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { try { final java.io.Writer writer = m_writer; if ((flags & NO_BAD_CHARS) > 0 && m_htmlcharInfo.onlyQuotAmpLtGt) { // "flags" has indicated that the characters // '>' '<' '&' and '"' are not in the value and // m_htmlcharInfo has recorded that there are no other // entities in the range 0 to 127 so we write out the // value directly writer.write(' '); writer.write(name); writer.write("=\""); writer.write(value); writer.write('"'); } else if ( (flags & HTML_ATTREMPTY) > 0 && (value.length() == 0 || value.equalsIgnoreCase(name))) { writer.write(' '); writer.write(name); } else { writer.write(' '); writer.write(name); writer.write("=\""); if ((flags & HTML_ATTRURL) > 0) { writeAttrURI(writer, value, m_specialEscapeURLs); } else { writeAttrString(writer, value, this.getEncoding()); } writer.write('"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToHTMLStream.java
public void comment(char ch[], int start, int length) throws SAXException { // The internal DTD subset is not serialized by the ToHTMLStream serializer if (m_inDTD) return; // Clean up some pending issues, just in case // this call is coming right after a startElement() // or we are in the middle of writing out CDATA // or if a startDocument() call was not received if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_cdataTagOpen) { closeCDATA(); } else if (m_needToCallStartDocument) { startDocumentInternal(); } /* * Perhaps comments can be written out in HTML before the DOCTYPE. * In this case we might delete this call to writeOutDOCTYPE, and * it would be handled within the startElement() call. */ if (m_needToOutputDocTypeDecl) outputDocTypeDecl("html"); // best guess for the upcoming element super.comment(ch, start, length); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void indent(int n) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public boolean setEscaping(boolean escape) throws SAXException { boolean oldEscapeSetting = m_escapeSetting; m_escapeSetting = escape; if (escape) { processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } return oldEscapeSetting; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void elementDecl(String name, String model) throws SAXException { return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void internalEntityDecl(String name, String value) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endElement(String uri, String localName, String qName) throws SAXException { flushPending(); m_saxHandler.endElement(uri, localName, qName); // time to fire off endElement event if (m_tracer != null) super.fireEndElem(qName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endPrefixMapping(String prefix) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { flushPending(); m_saxHandler.processingInstruction(target,data); // time to fire off processing instruction event if (m_tracer != null) super.fireEscapingEvent(target,data); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void skippedEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { flushPending(); super.startElement(namespaceURI, localName, qName, atts); m_saxHandler.startElement(namespaceURI, localName, qName, atts); m_elemContext.m_startTagOpen = false; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void comment(char[] ch, int start, int length) throws SAXException { flushPending(); if (m_lexHandler != null) m_lexHandler.comment(ch, start, length); // time to fire off comment event if (m_tracer != null) super.fireCommentEvent(ch, start, length); return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endCDATA() throws SAXException { return; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endDTD() throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startCDATA() throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startEntity(String arg0) throws SAXException { }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endDocument() throws SAXException { flushPending(); // Close output document m_saxHandler.endDocument(); if (m_tracer != null) super.fireEndDoc(); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
protected void closeStartTag() throws SAXException { m_elemContext.m_startTagOpen = false; // Now is time to send the startElement event m_saxHandler.startElement( EMPTYSTRING, m_elemContext.m_elementName, m_elemContext.m_elementName, m_attributes); m_attributes.clear(); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void characters(final String chars) throws SAXException { final int length = chars.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } chars.getChars(0, length, m_charsBuff, 0); this.characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { super.startElement(elementNamespaceURI, elementLocalName, elementName); flushPending(); // Handle document type declaration (for first element only) if (!m_dtdHandled) { String doctypeSystem = getDoctypeSystem(); String doctypePublic = getDoctypePublic(); if ((doctypeSystem != null) || (doctypePublic != null)) { if (m_lexHandler != null) m_lexHandler.startDTD( elementName, doctypePublic, doctypeSystem); } m_dtdHandled = true; } m_elemContext = m_elemContext.push(elementNamespaceURI, elementLocalName, elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startElement(String elementName) throws SAXException { this.startElement(null,null, elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void endElement(String elementName) throws SAXException { flushPending(); m_saxHandler.endElement(EMPTYSTRING, elementName, elementName); // time to fire off endElement event if (m_tracer != null) super.fireEndElem(elementName); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { flushPending(); m_saxHandler.characters(ch, off, len); // time to fire off characters event if (m_tracer != null) super.fireCharEvent(ch, off, len); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } // Close any open element if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { // no namespace support for HTML if (shouldFlush) flushPending(); m_saxHandler.startPrefixMapping(prefix,uri); return false; }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { startPrefixMapping(prefix,uri,true); }
// in src/org/apache/xml/serializer/ToHTMLSAXHandler.java
public void namespaceAfterStartElement( final String prefix, final String uri) throws SAXException { // hack for XSLTC with finding URI for default namespace if (m_elemContext.m_elementURI == null) { String prefix1 = getPrefixPart(m_elemContext.m_elementName); if (prefix1 == null && EMPTYSTRING.equals(prefix)) { // the elements URI is not known yet, and it // doesn't have a prefix, and we are currently // setting the uri for prefix "", so we have // the uri for the element... lets remember it m_elemContext.m_elementURI = uri; } } startPrefixMapping(prefix,uri,false); }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeCDATA() throws org.xml.sax.SAXException { try { m_writer.write(CDATA_DELIMITER_CLOSE); // write out a CDATA section closing "]]>" m_cdataTagOpen = false; // Remember that we have done so. } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
protected final void flushWriter() throws org.xml.sax.SAXException { final java.io.Writer writer = m_writer; if (null != writer) { try { if (writer instanceof WriterToUTF8Buffered) { if (m_shouldFlush) ((WriterToUTF8Buffered) writer).flush(); else ((WriterToUTF8Buffered) writer).flushBuffer(); } if (writer instanceof WriterToASCI) { if (m_shouldFlush) writer.flush(); } else { // Flush always. // Not a great thing if the writer was created // by this class, but don't have a choice. writer.flush(); } } catch (IOException ioe) { throw new org.xml.sax.SAXException(ioe); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void elementDecl(String name, String model) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ELEMENT "); writer.write(name); writer.write(' '); writer.write(model); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void internalEntityDecl(String name, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { DTDprolog(); outputEntityDecl(name, value); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { // Do not inline external DTD if (m_inExternalDTD) return; try { final java.io.Writer writer = m_writer; DTDprolog(); writer.write("<!ATTLIST "); writer.write(eName); writer.write(' '); writer.write(aName); writer.write(' '); writer.write(type); if (valueDefault != null) { writer.write(' '); writer.write(valueDefault); } //writer.write(" "); //writer.write(value); writer.write('>'); writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { try { DTDprolog(); m_writer.write("<!ENTITY "); m_writer.write(name); if (publicId != null) { m_writer.write(" PUBLIC \""); m_writer.write(publicId); } else { m_writer.write(" SYSTEM \""); m_writer.write(systemId); } m_writer.write("\" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
void writeNormalizedChars( char ch[], int start, int length, boolean isCData, boolean useSystemLineSeparator) throws IOException, org.xml.sax.SAXException { final java.io.Writer writer = m_writer; int end = start + length; for (int i = start; i < end; i++) { char c = ch[i]; if (CharInfo.S_LINEFEED == c && useSystemLineSeparator) { writer.write(m_lineSep, 0, m_lineSepLen); } else if (isCData && (!escapingNotNeeded(c))) { // if (i != 0) if (m_cdataTagOpen) closeCDATA(); // This needs to go into a function... if (Encodings.isHighUTF16Surrogate(c)) { writeUTF16Surrogate(c, ch, i, end); i++ ; // process two input characters } else { writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } // if ((i != 0) && (i < (end - 1))) // if (!m_cdataTagOpen && (i < (end - 1))) // { // writer.write(CDATA_DELIMITER_OPEN); // m_cdataTagOpen = true; // } } else if ( isCData && ((i < (end - 2)) && (']' == c) && (']' == ch[i + 1]) && ('>' == ch[i + 2]))) { writer.write(CDATA_CONTINUE); i += 2; } else { if (escapingNotNeeded(c)) { if (isCData && !m_cdataTagOpen) { writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } writer.write(c); } // This needs to go into a function... else if (Encodings.isHighUTF16Surrogate(c)) { if (m_cdataTagOpen) closeCDATA(); writeUTF16Surrogate(c, ch, i, end); i++; // process two input characters } else { if (m_cdataTagOpen) closeCDATA(); writer.write("&#"); String intStr = Integer.toString((int) c); writer.write(intStr); writer.write(';'); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void endNonEscaping() throws org.xml.sax.SAXException { m_disableOutputEscapingStates.pop(); }
// in src/org/apache/xml/serializer/ToStream.java
public void startNonEscaping() throws org.xml.sax.SAXException { m_disableOutputEscapingStates.push(true); }
// in src/org/apache/xml/serializer/ToStream.java
protected void cdata(char ch[], int start, final int length) throws org.xml.sax.SAXException { try { final int old_start = start; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; if (shouldIndent()) indent(); boolean writeCDataBrackets = (((length >= 1) && escapingNotNeeded(ch[start]))); /* Write out the CDATA opening delimiter only if * we are supposed to, and if we are not already in * the middle of a CDATA section */ if (writeCDataBrackets && !m_cdataTagOpen) { m_writer.write(CDATA_DELIMITER_OPEN); m_cdataTagOpen = true; } // writer.write(ch, start, length); if (isEscapingDisabled()) { charactersRaw(ch, start, length); } else writeNormalizedChars(ch, start, length, true, m_lineSepUse); /* used to always write out CDATA closing delimiter here, * but now we delay, so that we can merge CDATA sections on output. * need to write closing delimiter later */ if (writeCDataBrackets) { /* if the CDATA section ends with ] don't leave it open * as there is a chance that an adjacent CDATA sections * starts with ]>. * We don't want to merge ]] with > , or ] with ]> */ if (ch[start + length - 1] == ']') closeCDATA(); } // time to fire off CDATA event if (m_tracer != null) super.fireCDATAEvent(ch, old_start, length); } catch (IOException ioe) { throw new org.xml.sax.SAXException( Utils.messages.createMessage( MsgKey.ER_OIERROR, null), ioe); //"IO error", ioe); } }
// in src/org/apache/xml/serializer/ToStream.java
protected void charactersRaw(char ch[], int start, int length) throws org.xml.sax.SAXException { if (m_inEntityRef) return; try { if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } m_ispreserve = true; m_writer.write(ch, start, length); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(final char chars[], final int start, final int length) throws org.xml.sax.SAXException { // It does not make sense to continue with rest of the method if the number of // characters to read from array is 0. // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node // is created if string is empty. if (length == 0 || (m_inEntityRef && !m_expandDTDEntities)) return; m_docIsEmpty = false; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); } if (m_cdataStartCalled || m_elemContext.m_isCdataSection) { /* either due to startCDATA() being called or due to * cdata-section-elements atribute, we need this as cdata */ cdata(chars, start, length); return; } if (m_cdataTagOpen) closeCDATA(); if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping)) { charactersRaw(chars, start, length); // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); return; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } try { int i; int startClean; // skip any leading whitspace // don't go off the end and use a hand inlined version // of isWhitespace(ch) final int end = start + length; int lastDirtyCharProcessed = start - 1; // last non-clean character that was processed // that was processed final Writer writer = m_writer; boolean isAllWhitespace = true; // process any leading whitspace i = start; while (i < end && isAllWhitespace) { char ch1 = chars[i]; if (m_charInfo.shouldMapTextChar(ch1)) { // The character is supposed to be replaced by a String // so write out the clean whitespace characters accumulated // so far // then the String. writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo .getOutputStringForChar(ch1); writer.write(outputStringForChar); // We can't say that everything we are writing out is // all whitespace, we just wrote out a String. isAllWhitespace = false; lastDirtyCharProcessed = i; // mark the last non-clean // character processed i++; } else { // The character is clean, but is it a whitespace ? switch (ch1) { // TODO: Any other whitespace to consider? case CharInfo.S_SPACE: // Just accumulate the clean whitespace i++; break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); i++; break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; i++; break; case CharInfo.S_HORIZONAL_TAB: // Just accumulate the clean whitespace i++; break; default: // The character was clean, but not a whitespace // so break the loop to continue with this character // (we don't increment index i !!) isAllWhitespace = false; break; } } } /* If there is some non-whitespace, mark that we may need * to preserve this. This is only important if we have indentation on. */ if (i < end || !isAllWhitespace) m_ispreserve = true; for (; i < end; i++) { char ch = chars[i]; if (m_charInfo.shouldMapTextChar(ch)) { // The character is supposed to be replaced by a String // e.g. '&' --> "&amp;" // e.g. '<' --> "&lt;" writeOutCleanChars(chars, i, lastDirtyCharProcessed); String outputStringForChar = m_charInfo.getOutputStringForChar(ch); writer.write(outputStringForChar); lastDirtyCharProcessed = i; } else { if (ch <= 0x1F) { // Range 0x00 through 0x1F inclusive // // This covers the non-whitespace control characters // in the range 0x1 to 0x1F inclusive. // It also covers the whitespace control characters in the same way: // 0x9 TAB // 0xA NEW LINE // 0xD CARRIAGE RETURN // // We also cover 0x0 ... It isn't valid // but we will output "&#0;" // The default will handle this just fine, but this // is a little performance boost to handle the more // common TAB, NEW-LINE, CARRIAGE-RETURN switch (ch) { case CharInfo.S_HORIZONAL_TAB: // Leave whitespace TAB as a real character break; case CharInfo.S_LINEFEED: lastDirtyCharProcessed = processLineFeed(chars, i, lastDirtyCharProcessed, writer); break; case CharInfo.S_CARRIAGERETURN: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#13;"); lastDirtyCharProcessed = i; // Leave whitespace carriage return as a real character break; default: writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; break; } } else if (ch < 0x7F) { // Range 0x20 through 0x7E inclusive // Normal ASCII chars, do nothing, just add it to // the clean characters } else if (ch <= 0x9F){ // Range 0x7F through 0x9F inclusive // More control characters, including NEL (0x85) writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } else if (ch == CharInfo.S_LINE_SEPARATOR) { // LINE SEPARATOR writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#8232;"); lastDirtyCharProcessed = i; } else if (m_encodingInfo.isInEncoding(ch)) { // If the character is in the encoding, and // not in the normal ASCII range, we also // just leave it get added on to the clean characters } else { // This is a fallback plan, we should never get here // but if the character wasn't previously handled // (i.e. isn't in the encoding, etc.) then what // should we do? We choose to write out an entity writeOutCleanChars(chars, i, lastDirtyCharProcessed); writer.write("&#"); writer.write(Integer.toString(ch)); writer.write(';'); lastDirtyCharProcessed = i; } } } // we've reached the end. Any clean characters at the // end of the array than need to be written out? startClean = lastDirtyCharProcessed + 1; if (i > startClean) { int lengthClean = i - startClean; m_writer.write(chars, startClean, lengthClean); } // For indentation purposes, mark that we've just writen text out m_isprevtext = true; } catch (IOException e) { throw new SAXException(e); } // time to fire off characters generation event if (m_tracer != null) super.fireCharEvent(chars, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void characters(String s) throws org.xml.sax.SAXException { if (m_inEntityRef && !m_expandDTDEntities) return; final int length = s.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } s.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String namespaceURI, String localName, String name, Attributes atts) throws org.xml.sax.SAXException { if (m_inEntityRef) return; if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; m_docIsEmpty = false; } else if (m_cdataTagOpen) closeCDATA(); try { if (m_needToOutputDocTypeDecl) { if(null != getDoctypeSystem()) { outputDocTypeDecl(name, true); } m_needToOutputDocTypeDecl = false; } /* before we over-write the current elementLocalName etc. * lets close out the old one (if we still need to) */ if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (namespaceURI != null) ensurePrefixIsDeclared(namespaceURI, name); m_ispreserve = false; if (shouldIndent() && m_startNewLine) { indent(); } m_startNewLine = true; final java.io.Writer writer = m_writer; writer.write('<'); writer.write(name); } catch (IOException e) { throw new SAXException(e); } // process the attributes now, because after this SAX call they might be gone if (atts != null) addAttributes(atts); m_elemContext = m_elemContext.push(namespaceURI,localName,name); m_isprevtext = false; if (m_tracer != null) firePseudoAttributes(); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement( String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException { startElement(elementNamespaceURI, elementLocalName, elementName, null); }
// in src/org/apache/xml/serializer/ToStream.java
public void startElement(String elementName) throws SAXException { startElement(null, null, elementName, null); }
// in src/org/apache/xml/serializer/ToStream.java
void outputDocTypeDecl(String name, boolean closeDecl) throws SAXException { if (m_cdataTagOpen) closeCDATA(); try { final java.io.Writer writer = m_writer; writer.write("<!DOCTYPE "); writer.write(name); String doctypePublic = getDoctypePublic(); if (null != doctypePublic) { writer.write(" PUBLIC \""); writer.write(doctypePublic); writer.write('\"'); } String doctypeSystem = getDoctypeSystem(); if (null != doctypeSystem) { if (null == doctypePublic) writer.write(" SYSTEM \""); else writer.write(" \""); writer.write(doctypeSystem); if (closeDecl) { writer.write("\">"); writer.write(m_lineSep, 0, m_lineSepLen); closeDecl = false; // done closing } else writer.write('\"'); } } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void processAttributes(java.io.Writer writer, int nAttrs) throws IOException, SAXException { /* real SAX attributes are not passed in, so process the * attributes that were collected after the startElement call. * _attribVector is a "cheap" list for Stream serializer output * accumulated over a series of calls to attribute(name,value) */ String encoding = getEncoding(); for (int i = 0; i < nAttrs; i++) { // elementAt is JDK 1.1.8 final String name = m_attributes.getQName(i); final String value = m_attributes.getValue(i); writer.write(' '); writer.write(name); writer.write("=\""); writeAttrString(writer, value, encoding); writer.write('\"'); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String namespaceURI, String localName, String name) throws org.xml.sax.SAXException { if (m_inEntityRef) return; // namespaces declared at the current depth are no longer valid // so get rid of them m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth, null); try { final java.io.Writer writer = m_writer; if (m_elemContext.m_startTagOpen) { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } if (m_spaceBeforeClose) writer.write(" />"); else writer.write("/>"); /* don't need to pop cdataSectionState because * this element ended so quickly that we didn't get * to push the state. */ } else { if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(m_elemContext.m_currentElemDepth - 1); writer.write('<'); writer.write('/'); writer.write(name); writer.write('>'); } } catch (IOException e) { throw new SAXException(e); } if (!m_elemContext.m_startTagOpen && m_doIndent) { m_ispreserve = m_preserves.isEmpty() ? false : m_preserves.pop(); } m_isprevtext = false; // fire off the end element event if (m_tracer != null) super.fireEndElem(name); m_elemContext = m_elemContext.m_prev; }
// in src/org/apache/xml/serializer/ToStream.java
public void endElement(String name) throws org.xml.sax.SAXException { endElement(null, null, name); }
// in src/org/apache/xml/serializer/ToStream.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // the "true" causes the flush of any open tags startPrefixMapping(prefix, uri, true); }
// in src/org/apache/xml/serializer/ToStream.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws org.xml.sax.SAXException { /* Remember the mapping, and at what depth it was declared * This is one greater than the current depth because these * mappings will apply to the next depth. This is in * consideration that startElement() will soon be called */ boolean pushed; int pushDepth; if (shouldFlush) { flushPending(); // the prefix mapping applies to the child element (one deeper) pushDepth = m_elemContext.m_currentElemDepth + 1; } else { // the prefix mapping applies to the current element pushDepth = m_elemContext.m_currentElemDepth; } pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth); if (pushed) { /* Brian M.: don't know if we really needto do this. The * callers of this object should have injected both * startPrefixMapping and the attributes. We are * just covering our butt here. */ String name; if (EMPTYSTRING.equals(prefix)) { name = "xmlns"; addAttributeAlways(XMLNS_URI, name, name, "CDATA", uri, false); } else { if (!EMPTYSTRING.equals(uri)) // hack for XSLTC attribset16 test { // that maps ns1 prefix to "" URI name = "xmlns:" + prefix; /* for something like xmlns:abc="w3.pretend.org" * the uri is the value, that is why we pass it in the * value, or 5th slot of addAttributeAlways() */ addAttributeAlways(XMLNS_URI, prefix, name, "CDATA", uri, false); } } } return pushed; }
// in src/org/apache/xml/serializer/ToStream.java
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException { int start_old = start; if (m_inEntityRef) return; if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } else if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } try { final int limit = start + length; boolean wasDash = false; if (m_cdataTagOpen) closeCDATA(); if (shouldIndent()) indent(); final java.io.Writer writer = m_writer; writer.write(COMMENT_BEGIN); // Detect occurrences of two consecutive dashes, handle as necessary. for (int i = start; i < limit; i++) { if (wasDash && ch[i] == '-') { writer.write(ch, start, i - start); writer.write(" -"); start = i + 1; } wasDash = (ch[i] == '-'); } // if we have some chars in the comment if (length > 0) { // Output the remaining characters (if any) final int remainingChars = (limit - start); if (remainingChars > 0) writer.write(ch, start, remainingChars); // Protect comment end from a single trailing dash if (ch[limit - 1] == '-') writer.write(' '); } writer.write(COMMENT_END); } catch (IOException e) { throw new SAXException(e); } /* * Don't write out any indentation whitespace now, * because there may be non-whitespace text after this. * * Simply mark that at this point if we do decide * to indent that we should * add a newline on the end of the current line before * the indentation at the start of the next line. */ m_startNewLine = true; // time to generate comment event if (m_tracer != null) super.fireCommentEvent(ch, start_old,length); }
// in src/org/apache/xml/serializer/ToStream.java
public void endCDATA() throws org.xml.sax.SAXException { if (m_cdataTagOpen) closeCDATA(); m_cdataStartCalled = false; }
// in src/org/apache/xml/serializer/ToStream.java
public void endDTD() throws org.xml.sax.SAXException { try { if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } final java.io.Writer writer = m_writer; if (!m_inDoctype) writer.write("]>"); else { writer.write('>'); } writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { throw new SAXException(e); } }
// in src/org/apache/xml/serializer/ToStream.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException { // do nothing }
// in src/org/apache/xml/serializer/ToStream.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (0 == length) return; characters(ch, start, length); }
// in src/org/apache/xml/serializer/ToStream.java
public void skippedEntity(String name) throws org.xml.sax.SAXException { // TODO: Should handle }
// in src/org/apache/xml/serializer/ToStream.java
public void startCDATA() throws org.xml.sax.SAXException { m_cdataStartCalled = true; }
// in src/org/apache/xml/serializer/ToStream.java
public void startEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = true; if (!m_expandDTDEntities && !m_inExternalDTD) { /* Only leave the entity as-is if * we've been told not to expand them * and this is not the magic [dtd] name. */ startNonEscaping(); characters("&" + name + ';'); endNonEscaping(); } m_inEntityRef = true; }
// in src/org/apache/xml/serializer/ToStream.java
protected void closeStartTag() throws SAXException { if (m_elemContext.m_startTagOpen) { try { if (m_tracer != null) super.fireStartElem(m_elemContext.m_elementName); int nAttrs = m_attributes.getLength(); if (nAttrs > 0) { processAttributes(m_writer, nAttrs); // clear attributes object for re-use with next element m_attributes.clear(); } m_writer.write('>'); } catch (IOException e) { throw new SAXException(e); } /* whether Xalan or XSLTC, we have the prefix mappings now, so * lets determine if the current element is specified in the cdata- * section-elements list. */ if (m_CdataElems != null) m_elemContext.m_isCdataSection = isCdataSection(); if (m_doIndent) { m_isprevtext = false; m_preserves.push(m_ispreserve); } } }
// in src/org/apache/xml/serializer/ToStream.java
public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException { setDoctypeSystem(systemId); setDoctypePublic(publicId); m_elemContext.m_elementName = name; m_inDoctype = true; }
// in src/org/apache/xml/serializer/ToStream.java
protected String ensureAttributesNamespaceIsDeclared( String ns, String localName, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { // extract the prefix in front of the raw name int index = 0; String prefixFromRawName = (index = rawName.indexOf(":")) < 0 ? "" : rawName.substring(0, index); if (index > 0) { // we have a prefix, lets see if it maps to a namespace String uri = m_prefixMap.lookupNamespace(prefixFromRawName); if (uri != null && uri.equals(ns)) { // the prefix in the raw name is already maps to the given namespace uri // so we don't need to do anything return null; } else { // The uri does not map to the prefix in the raw name, // so lets make the mapping. this.startPrefixMapping(prefixFromRawName, ns, false); this.addAttribute( "http://www.w3.org/2000/xmlns/", prefixFromRawName, "xmlns:" + prefixFromRawName, "CDATA", ns, false); return prefixFromRawName; } } else { // we don't have a prefix in the raw name. // Does the URI map to a prefix already? String prefix = m_prefixMap.lookupPrefix(ns); if (prefix == null) { // uri is not associated with a prefix, // so lets generate a new prefix to use prefix = m_prefixMap.generateNextPrefix(); this.startPrefixMapping(prefix, ns, false); this.addAttribute( "http://www.w3.org/2000/xmlns/", prefix, "xmlns:" + prefix, "CDATA", ns, false); } return prefix; } } return null; }
// in src/org/apache/xml/serializer/ToStream.java
void ensurePrefixIsDeclared(String ns, String rawName) throws org.xml.sax.SAXException { if (ns != null && ns.length() > 0) { int index; final boolean no_prefix = ((index = rawName.indexOf(":")) < 0); String prefix = (no_prefix) ? "" : rawName.substring(0, index); if (null != prefix) { String foundURI = m_prefixMap.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(ns)) { this.startPrefixMapping(prefix, ns); // Bugzilla1133: Generate attribute as well as namespace event. // SAX does expect both. this.addAttributeAlways( "http://www.w3.org/2000/xmlns/", no_prefix ? "xmlns" : prefix, // local name no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname "CDATA", ns, false); } } } }
// in src/org/apache/xml/serializer/ToStream.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } if (m_writer != null) { try { m_writer.flush(); } catch(IOException e) { // what? me worry? } } }
// in src/org/apache/xml/serializer/ToStream.java
public void notationDecl(String name, String pubID, String sysID) throws SAXException { // TODO Auto-generated method stub try { DTDprolog(); m_writer.write("<!NOTATION "); m_writer.write(name); if (pubID != null) { m_writer.write(" PUBLIC \""); m_writer.write(pubID); } else { m_writer.write(" SYSTEM \""); m_writer.write(sysID); } m_writer.write("\" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
public void unparsedEntityDecl(String name, String pubID, String sysID, String notationName) throws SAXException { // TODO Auto-generated method stub try { DTDprolog(); m_writer.write("<!ENTITY "); m_writer.write(name); if (pubID != null) { m_writer.write(" PUBLIC \""); m_writer.write(pubID); } else { m_writer.write(" SYSTEM \""); m_writer.write(sysID); } m_writer.write("\" NDATA "); m_writer.write(notationName); m_writer.write(" >"); m_writer.write(m_lineSep, 0, m_lineSepLen); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
// in src/org/apache/xml/serializer/ToStream.java
private void DTDprolog() throws SAXException, IOException { final java.io.Writer writer = m_writer; if (m_needToOutputDocTypeDecl) { outputDocTypeDecl(m_elemContext.m_elementName, false); m_needToOutputDocTypeDecl = false; } if (m_inDoctype) { writer.write(" ["); writer.write(m_lineSep, 0, m_lineSepLen); m_inDoctype = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void startDocumentInternal() throws SAXException { if (m_needToCallStartDocument) { super.startDocumentInternal(); m_saxHandler.startDocument(); m_needToCallStartDocument = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startDTD(String arg0, String arg1, String arg2) throws SAXException { // do nothing for now }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void characters(String characters) throws SAXException { final int len = characters.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } characters.getChars(0,len, m_charsBuff, 0); characters(m_charsBuff, 0, len); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void comment(String comment) throws SAXException { flushPending(); // Ignore if a lexical handler has not been set if (m_lexHandler != null) { final int len = comment.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } comment.getChars(0,len, m_charsBuff, 0); m_lexHandler.comment(m_charsBuff, 0, len); // time to fire off comment event if (m_tracer != null) super.fireCommentEvent(m_charsBuff, 0, len); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void processingInstruction(String target, String data) throws SAXException { // Redefined in SAXXMLOutput }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void closeStartTag() throws SAXException { }
// in src/org/apache/xml/serializer/ToSAXHandler.java
protected void closeCDATA() throws SAXException { // Redefined in SAXXMLOutput }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(arg2); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void flushPending() throws SAXException { if (m_needToCallStartDocument) { startDocumentInternal(); m_needToCallStartDocument = false; } if (m_elemContext.m_startTagOpen) { closeStartTag(); m_elemContext.m_startTagOpen = false; } if (m_cdataTagOpen) { closeCDATA(); m_cdataTagOpen = false; } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement(String uri, String localName, String qName) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(qName); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void startElement(String qName) throws SAXException { if (m_state != null) { m_state.resetState(getTransformer()); } // fire off the start element event if (m_tracer != null) super.fireStartElem(qName); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { // remember the current node if (m_state != null) { m_state.setCurrentNode(node); } // Get the node's value as a String and use that String as if // it were an input character notification. String data = node.getNodeValue(); if (data != null) { this.characters(data); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void fatalError(SAXParseException exc) throws SAXException { super.fatalError(exc); m_needToCallStartDocument = false; if (m_saxHandler instanceof ErrorHandler) { ((ErrorHandler)m_saxHandler).fatalError(exc); } }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void error(SAXParseException exc) throws SAXException { super.error(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).error(exc); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void warning(SAXParseException exc) throws SAXException { super.warning(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).warning(exc); }
// in src/org/apache/xml/serializer/ToSAXHandler.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
public void traverse(Node pos) throws org.xml.sax.SAXException { this.fSerializer.startDocument(); // Determine if the Node is a DOM Level 3 Core Node. if (pos.getNodeType() != Node.DOCUMENT_NODE) { Document ownerDoc = pos.getOwnerDocument(); if (ownerDoc != null && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } else { if (((Document) pos) .getImplementation() .hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } if (fSerializer instanceof LexicalHandler) { fLexicalHandler = ((LexicalHandler) this.fSerializer); } if (fFilter != null) fWhatToShowFilter = fFilter.getWhatToShow(); Node top = pos; while (null != pos) { startNode(pos); Node nextNode = null; nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if (top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || (top.equals(pos))) { if (null != pos) endNode(pos); nextNode = null; break; } } } pos = nextNode; } this.fSerializer.endDocument(); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { this.fSerializer.startDocument(); // Determine if the Node is a DOM Level 3 Core Node. if (pos.getNodeType() != Node.DOCUMENT_NODE) { Document ownerDoc = pos.getOwnerDocument(); if (ownerDoc != null && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } else { if (((Document) pos) .getImplementation() .hasFeature("Core", "3.0")) { fIsLevel3DOM = true; } } if (fSerializer instanceof LexicalHandler) { fLexicalHandler = ((LexicalHandler) this.fSerializer); } if (fFilter != null) fWhatToShowFilter = fFilter.getWhatToShow(); while (null != pos) { startNode(pos); Node nextNode = null; nextNode = pos.getFirstChild(); while (null == nextNode) { endNode(pos); if ((null != top) && top.equals(pos)) break; nextNode = pos.getNextSibling(); if (null == nextNode) { pos = pos.getParentNode(); if ((null == pos) || ((null != top) && top.equals(pos))) { nextNode = null; break; } } } pos = nextNode; } this.fSerializer.endDocument(); }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
private final void dispatachChars(Node node) throws org.xml.sax.SAXException { if (fSerializer != null) { this.fSerializer.characters(node); } else { String data = ((Text) node).getData(); this.fSerializer.characters(data.toCharArray(), 0, data.length()); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void startNode(Node node) throws org.xml.sax.SAXException { if (node instanceof Locator) { Locator loc = (Locator) node; fLocator.setColumnNumber(loc.getColumnNumber()); fLocator.setLineNumber(loc.getLineNumber()); fLocator.setPublicId(loc.getPublicId()); fLocator.setSystemId(loc.getSystemId()); } else { fLocator.setColumnNumber(0); fLocator.setLineNumber(0); } switch (node.getNodeType()) { case Node.DOCUMENT_TYPE_NODE : serializeDocType((DocumentType) node, true); break; case Node.COMMENT_NODE : serializeComment((Comment) node); break; case Node.DOCUMENT_FRAGMENT_NODE : // Children are traversed break; case Node.DOCUMENT_NODE : break; case Node.ELEMENT_NODE : serializeElement((Element) node, true); break; case Node.PROCESSING_INSTRUCTION_NODE : serializePI((ProcessingInstruction) node); break; case Node.CDATA_SECTION_NODE : serializeCDATASection((CDATASection) node); break; case Node.TEXT_NODE : serializeText((Text) node); break; case Node.ENTITY_REFERENCE_NODE : serializeEntityReference((EntityReference) node, true); break; default : } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void endNode(Node node) throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_NODE : break; case Node.DOCUMENT_TYPE_NODE : serializeDocType((DocumentType) node, false); break; case Node.ELEMENT_NODE : serializeElement((Element) node, false); break; case Node.CDATA_SECTION_NODE : break; case Node.ENTITY_REFERENCE_NODE : serializeEntityReference((EntityReference) node, false); break; default : } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeDocType(DocumentType node, boolean bStart) throws SAXException { // The DocType and internalSubset can not be modified in DOM and is // considered to be well-formed as the outcome of successful parsing. String docTypeName = node.getNodeName(); String publicId = node.getPublicId(); String systemId = node.getSystemId(); String internalSubset = node.getInternalSubset(); //DocumentType nodes are never passed to the filter if (internalSubset != null && !"".equals(internalSubset)) { if (bStart) { try { // The Serializer does not provide a way to write out the // DOCTYPE internal subset via an event call, so we write it // out here. Writer writer = fSerializer.getWriter(); StringBuffer dtd = new StringBuffer(); dtd.append("<!DOCTYPE "); dtd.append(docTypeName); if (null != publicId) { dtd.append(" PUBLIC \""); dtd.append(publicId); dtd.append('\"'); } if (null != systemId) { if (null == publicId) { dtd.append(" SYSTEM \""); } else { dtd.append(" \""); } dtd.append(systemId); dtd.append('\"'); } dtd.append(" [ "); dtd.append(fNewLine); dtd.append(internalSubset); dtd.append("]>"); dtd.append(fNewLine); writer.write(dtd.toString()); writer.flush(); } catch (IOException e) { throw new SAXException(Utils.messages.createMessage( MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); } } // else if !bStart do nothing } else { if (bStart) { if (fLexicalHandler != null) { fLexicalHandler.startDTD(docTypeName, publicId, systemId); } } else { if (fLexicalHandler != null) { fLexicalHandler.endDTD(); } } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeComment(Comment node) throws SAXException { // comments=true if ((fFeatures & COMMENTS) != 0) { String data = node.getData(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCommentWellFormed(data); } if (fLexicalHandler != null) { // apply the LSSerializer filter after the operations requested by the // DOMConfiguration parameters have been applied if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { return; } fLexicalHandler.comment(data.toCharArray(), 0, data.length()); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeElement(Element node, boolean bStart) throws SAXException { if (bStart) { fElementDepth++; // We use the Xalan specific startElement and starPrefixMapping calls // (and addAttribute and namespaceAfterStartElement) as opposed to // SAX specific, for performance reasons as they reduce the overhead // of creating an AttList object upfront. // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isElementWellFormed(node); } // REVISIT: We apply the LSSerializer filter for elements before // namesapce fixup if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { return; } // namespaces=true, record and fixup namspaced element if ((fFeatures & NAMESPACES) != 0) { fNSBinder.pushContext(); fLocalNSBinder.reset(); recordLocalNSDecl(node); fixupElementNS(node); } // Namespace normalization fSerializer.startElement( node.getNamespaceURI(), node.getLocalName(), node.getNodeName()); serializeAttList(node); } else { fElementDepth--; // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { return; } this.fSerializer.endElement( node.getNamespaceURI(), node.getLocalName(), node.getNodeName()); // since endPrefixMapping was not used by SerializationHandler it was removed // for performance reasons. if ((fFeatures & NAMESPACES) != 0 ) { fNSBinder.popContext(); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeAttList(Element node) throws SAXException { NamedNodeMap atts = node.getAttributes(); int nAttrs = atts.getLength(); for (int i = 0; i < nAttrs; i++) { Node attr = atts.item(i); String localName = attr.getLocalName(); String attrName = attr.getNodeName(); String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix(); String attrValue = attr.getNodeValue(); // Determine the Attr's type. String type = null; if (fIsLevel3DOM) { type = ((Attr) attr).getSchemaTypeInfo().getTypeName(); } type = type == null ? "CDATA" : type; String attrNS = attr.getNamespaceURI(); if (attrNS !=null && attrNS.length() == 0) { attrNS=null; // we must remove prefix for this attribute attrName=attr.getLocalName(); } boolean isSpecified = ((Attr) attr).getSpecified(); boolean addAttr = true; boolean applyFilter = false; boolean xmlnsAttr = attrName.equals("xmlns") || attrName.startsWith("xmlns:"); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isAttributeWellFormed(attr); } //----------------------------------------------------------------- // start Attribute namespace fixup //----------------------------------------------------------------- // namespaces=true, normalize all non-namespace attributes // Step 3. Attribute if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) { // If the Attr has a namespace URI if (attrNS != null) { attrPrefix = attrPrefix == null ? "" : attrPrefix; String declAttrPrefix = fNSBinder.getPrefix(attrNS); String declAttrNS = fNSBinder.getURI(attrPrefix); // attribute has no prefix (default namespace decl does not apply to // attributes) // OR // attribute prefix is not declared // OR // conflict: attribute has a prefix that conflicts with a binding if ("".equals(attrPrefix) || "".equals(declAttrPrefix) || !attrPrefix.equals(declAttrPrefix)) { // namespaceURI matches an in scope declaration of one or // more prefixes if (declAttrPrefix != null && !"".equals(declAttrPrefix)) { // pick the prefix that was found and change attribute's // prefix and nodeName. attrPrefix = declAttrPrefix; if (declAttrPrefix.length() > 0 ) { attrName = declAttrPrefix + ":" + localName; } else { attrName = localName; } } else { // The current prefix is not null and it has no in scope // declaration if (attrPrefix != null && !"".equals(attrPrefix) && declAttrNS == null) { // declare this prefix if ((fFeatures & NAMESPACEDECLS) != 0) { fSerializer.addAttribute(XMLNS_URI, attrPrefix, XMLNS_PREFIX + ":" + attrPrefix, "CDATA", attrNS); fNSBinder.declarePrefix(attrPrefix, attrNS); fLocalNSBinder.declarePrefix(attrPrefix, attrNS); } } else { // find a prefix following the pattern "NS" +index // (starting at 1) // make sure this prefix is not declared in the current // scope. int counter = 1; attrPrefix = "NS" + counter++; while (fLocalNSBinder.getURI(attrPrefix) != null) { attrPrefix = "NS" + counter++; } // change attribute's prefix and Name attrName = attrPrefix + ":" + localName; // create a local namespace declaration attribute // Add the xmlns declaration attribute if ((fFeatures & NAMESPACEDECLS) != 0) { fSerializer.addAttribute(XMLNS_URI, attrPrefix, XMLNS_PREFIX + ":" + attrPrefix, "CDATA", attrNS); fNSBinder.declarePrefix(attrPrefix, attrNS); fLocalNSBinder.declarePrefix(attrPrefix, attrNS); } } } } } else { // if the Attr has no namespace URI // Attr has no localName if (localName == null) { // DOM Level 1 node! String msg = Utils.messages.createMessage( MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, new Object[] { attrName }); if (fErrorHandler != null) { fErrorHandler .handleError(new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, null, null)); } } else { // uri=null and no colon // attr has no namespace URI and no prefix // no action is required, since attrs don't use default } } } // discard-default-content=true // Default attr's are not passed to the filter and this contraint // is applied only when discard-default-content=true // What about default xmlns attributes???? check for xmlnsAttr if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified) || ((fFeatures & DISCARDDEFAULT) == 0)) { applyFilter = true; } else { addAttr = false; } if (applyFilter) { // apply the filter for Attributes that are not default attributes // or namespace decl attributes if (fFilter != null && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE) != 0) { if (!xmlnsAttr) { short code = fFilter.acceptNode(attr); switch (code) { case NodeFilter.FILTER_REJECT : case NodeFilter.FILTER_SKIP : addAttr = false; break; default : //fall through.. } } } } // if the node is a namespace node if (addAttr && xmlnsAttr) { // If namespace-declarations=true, add the node , else don't add it if ((fFeatures & NAMESPACEDECLS) != 0) { // The namespace may have been fixed up, in that case don't add it. if (localName != null && !"".equals(localName)) { fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue); } } } else if ( addAttr && !xmlnsAttr) { // if the node is not a namespace node // If namespace-declarations=true, add the node with the Attr nodes namespaceURI // else add the node setting it's namespace to null or else the serializer will later // attempt to add a xmlns attr for the prefixed attribute if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) { fSerializer.addAttribute( attrNS, localName, attrName, type, attrValue); } else { fSerializer.addAttribute( "", localName, attrName, type, attrValue); } } // if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) { int index; // Use "" instead of null, as Xerces likes "" for the // name of the default namespace. Fix attributed // to "Steven Murray" <smurray@ebt.com>. String prefix = (index = attrName.indexOf(":")) < 0 ? "" : attrName.substring(index + 1); if (!"".equals(prefix)) { fSerializer.namespaceAfterStartElement(prefix, attrValue); } } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializePI(ProcessingInstruction node) throws SAXException { ProcessingInstruction pi = node; String name = pi.getNodeName(); // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isPIWellFormed(node); } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { return; } // String data = pi.getData(); if (name.equals("xslt-next-is-raw")) { fNextIsRaw = true; } else { this.fSerializer.processingInstruction(name, pi.getData()); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeCDATASection(CDATASection node) throws SAXException { // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isCDATASectionWellFormed(node); } // cdata-sections = true if ((fFeatures & CDATA) != 0) { // split-cdata-sections = true // Assumption: This parameter has an effect only when // cdata-sections=true // ToStream, by default splits cdata-sections. Hence the check // below. String nodeValue = node.getNodeValue(); int endIndex = nodeValue.indexOf("]]>"); if ((fFeatures & SPLITCDATA) != 0) { if (endIndex >= 0) { // The first node split will contain the ]] markers String relatedData = nodeValue.substring(0, endIndex + 2); String msg = Utils.messages.createMessage( MsgKey.ER_CDATA_SECTIONS_SPLIT, null); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_WARNING, msg, MsgKey.ER_CDATA_SECTIONS_SPLIT, null, relatedData, null)); } } } else { if (endIndex >= 0) { // The first node split will contain the ]] markers String relatedData = nodeValue.substring(0, endIndex + 2); String msg = Utils.messages.createMessage( MsgKey.ER_CDATA_SECTIONS_SPLIT, null); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_CDATA_SECTIONS_SPLIT)); } // Report an error and return. What error??? return; } } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) { return; } // splits the cdata-section if (fLexicalHandler != null) { fLexicalHandler.startCDATA(); } dispatachChars(node); if (fLexicalHandler != null) { fLexicalHandler.endCDATA(); } } else { dispatachChars(node); } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeText(Text node) throws SAXException { if (fNextIsRaw) { fNextIsRaw = false; fSerializer.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); dispatachChars(node); fSerializer.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } else { // keep track of dispatch or not to avoid duplicaiton of filter code boolean bDispatch = false; // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isTextWellFormed(node); } // if the node is whitespace // Determine the Attr's type. boolean isElementContentWhitespace = false; if (fIsLevel3DOM) { isElementContentWhitespace = node.isElementContentWhitespace(); } if (isElementContentWhitespace) { // element-content-whitespace=true if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) { bDispatch = true; } } else { bDispatch = true; } // apply the LSSerializer filter if (!applyFilter(node, NodeFilter.SHOW_TEXT)) { return; } if (bDispatch) { dispatachChars(node); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void serializeEntityReference( EntityReference node, boolean bStart) throws SAXException { if (bStart) { EntityReference eref = node; // entities=true if ((fFeatures & ENTITIES) != 0) { // perform well-formedness and other checking only if // entities = true // well-formed=true if ((fFeatures & WELLFORMED) != 0) { isEntityReferneceWellFormed(node); } // check "unbound-prefix-in-entity-reference" [fatal] // Raised if the configuration parameter "namespaces" is set to true if ((fFeatures & NAMESPACES) != 0) { checkUnboundPrefixInEntRef(node); } // The filter should not apply in this case, since the // EntityReference is not being expanded. // should we pass entity reference nodes to the filter??? } if (fLexicalHandler != null) { // startEntity outputs only Text but not Element, Attr, Comment // and PI child nodes. It does so by setting the m_inEntityRef // in ToStream and using this to decide if a node is to be // serialized or not. fLexicalHandler.startEntity(eref.getNodeName()); } } else { EntityReference eref = node; // entities=true or false, if (fLexicalHandler != null) { fLexicalHandler.endEntity(eref.getNodeName()); } } }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
protected void fixupElementNS(Node node) throws SAXException { String namespaceURI = ((Element) node).getNamespaceURI(); String prefix = ((Element) node).getPrefix(); String localName = ((Element) node).getLocalName(); if (namespaceURI != null) { //if ( Element's prefix/namespace pair (or default namespace, // if no prefix) are within the scope of a binding ) prefix = prefix == null ? "" : prefix; String inScopeNamespaceURI = fNSBinder.getURI(prefix); if ((inScopeNamespaceURI != null && inScopeNamespaceURI.equals(namespaceURI))) { // do nothing, declaration in scope is inherited } else { // Create a local namespace declaration attr for this namespace, // with Element's current prefix (or a default namespace, if // no prefix). If there's a conflicting local declaration // already present, change its value to use this namespace. // Add the xmlns declaration attribute //fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth); if ((fFeatures & NAMESPACEDECLS) != 0) { if ("".equals(prefix) || "".equals(namespaceURI)) { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI); } else { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI); } } fLocalNSBinder.declarePrefix(prefix, namespaceURI); fNSBinder.declarePrefix(prefix, namespaceURI); } } else { // Element has no namespace // DOM Level 1 if (localName == null || "".equals(localName)) { // DOM Level 1 node! String msg = Utils.messages.createMessage( MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, new Object[] { node.getNodeName()}); if (fErrorHandler != null) { fErrorHandler.handleError( new DOMErrorImpl( DOMError.SEVERITY_ERROR, msg, MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, null, null)); } } else { namespaceURI = fNSBinder.getURI(""); if (namespaceURI !=null && namespaceURI.length() > 0) { ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, ""); fLocalNSBinder.declarePrefix("", ""); fNSBinder.declarePrefix("", ""); } } } }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException() throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException(char[] chars, int off, int len) throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
protected void couldThrowSAXException(String elemQName) throws SAXException { return; // don't do anything. }
// in src/org/apache/xml/serializer/EmptySerializer.java
public boolean setEscaping(boolean escape) throws SAXException { couldThrowSAXException(); return false; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void flushPending() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttribute( String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttributes(Attributes atts) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(String chars) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endElement(String elemName) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startDocument() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement(String uri, String localName, String qName) throws SAXException { couldThrowSAXException(qName); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement(String qName) throws SAXException { couldThrowSAXException(qName); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void namespaceAfterStartElement(String uri, String prefix) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public boolean startPrefixMapping( String prefix, String uri, boolean shouldFlush) throws SAXException { couldThrowSAXException(); return false; }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void entityReference(String entityName) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endDocument() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startPrefixMapping(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endPrefixMapping(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startElement( String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endElement(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(arg0, arg1, arg2); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void processingInstruction(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void skippedEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void comment(String comment) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startDTD(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endDTD() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endEntity(String arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void startCDATA() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void endCDATA() throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void comment(char[] arg0, int arg1, int arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void elementDecl(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void attributeDecl( String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void internalEntityDecl(String arg0, String arg1) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void warning(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void error(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void fatalError(SAXParseException arg0) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addUniqueAttribute(String name, String value, int flags) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void characters(Node node) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void notationDecl(String arg0, String arg1, String arg2) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xml/serializer/EmptySerializer.java
public void unparsedEntityDecl( String arg0, String arg1, String arg2, String arg3) throws SAXException { couldThrowSAXException(); }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void characters(char[] ch, int off, int len) throws SAXException { if (_nestedLevel > 0) return; if (_str != null) { _buffer.append(_str); _str = null; } _buffer.append(ch, off, len); }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void characters(String characters) throws SAXException { if (_nestedLevel > 0) return; if (_str == null && _buffer.length() == 0) { _str = characters; } else { if (_str != null) { _buffer.append(_str); _str = null; } _buffer.append(characters); } }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void startElement(String qname) throws SAXException { _nestedLevel++; }
// in src/org/apache/xalan/xsltc/runtime/StringValueHandler.java
public void endElement(String qname) throws SAXException { _nestedLevel--; }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { final int col = qname.lastIndexOf(':'); final String prefix = (col == -1) ? null : qname.substring(0, col); SyntaxTreeNode element = makeInstance(uri, prefix, localname, attributes); if (element == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.ELEMENT_PARSE_ERR, prefix+':'+localname); throw new SAXException(err.toString()); } // If this is the root element of the XML document we need to make sure // that it contains a definition of the XSL namespace URI if (_root == null) { if ((_prefixMapping == null) || (_prefixMapping.containsValue(Constants.XSLT_URI) == false)) _rootNamespaceDef = false; else _rootNamespaceDef = true; _root = element; } else { SyntaxTreeNode parent = (SyntaxTreeNode)_parentStack.peek(); parent.addElement(element); element.setParent(parent); } element.setAttributes(new AttributeList(attributes)); element.setPrefixMapping(_prefixMapping); if (element instanceof Stylesheet) { // Extension elements and excluded elements have to be // handled at this point in order to correctly generate // Fallback elements from <xsl:fallback>s. getSymbolTable().setCurrentNode(element); ((Stylesheet)element).declareExtensionPrefixes(this); } _prefixMapping = null; _parentStack.push(element); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void startDocument() throws SAXException { }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void endDocument() throws SAXException { // Set the String value when the document is built. if (_size == 1) _text = _textArray[0]; else { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < _size; i++) { buffer.append(_textArray[i]); } _text = buffer.toString(); } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(String str) throws SAXException { // Resize the text array if necessary if (_size >= _textArray.length) { String[] newTextArray = new String[_textArray.length * 2]; System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length); _textArray = newTextArray; } // If the escape setting is false, set the corresponding bit in // the _dontEscape BitArray. if (!_escaping) { // The _dontEscape array is only created when needed. if (_dontEscape == null) { _dontEscape = new BitArray(8); } // Resize the _dontEscape array if necessary if (_size >= _dontEscape.size()) _dontEscape.resize(_dontEscape.size() * 2); _dontEscape.setBit(_size); } _textArray[_size++] = str; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(char[] ch, int offset, int length) throws SAXException { if (_size >= _textArray.length) { String[] newTextArray = new String[_textArray.length * 2]; System.arraycopy(_textArray, 0, newTextArray, 0, _textArray.length); _textArray = newTextArray; } if (!_escaping) { if (_dontEscape == null) { _dontEscape = new BitArray(8); } if (_size >= _dontEscape.size()) _dontEscape.resize(_dontEscape.size() * 2); _dontEscape.setBit(_size); } _textArray[_size++] = new String(ch, offset, length); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public boolean setEscaping(boolean escape) throws SAXException { final boolean temp = _escaping; _escaping = escape; return temp; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void dispatchCharactersEvents( int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
private void maybeEmitStartElement() throws SAXException { if (_openElementName != null) { int index; if ((index =_openElementName.indexOf(":")) < 0) _dom.startElement(null, _openElementName, _openElementName, _attributes); else _dom.startElement(null, _openElementName.substring(index+1), _openElementName, _attributes); _openElementName = null; } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
private void prepareNewDOM() throws SAXException { _dom = (SAXImpl)_dtmManager.getDTM(null, true, _wsfilter, true, false, false, _initSize, _buildIdIndex); _dom.startDocument(); // Flush pending Text nodes to SAXImpl for (int i = 0; i < _size; i++) { String str = _textArray[i]; _dom.characters(str.toCharArray(), 0, str.length()); } _size = 0; }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startDocument() throws SAXException { }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endDocument() throws SAXException { if (_dom != null) { _dom.endDocument(); } else { super.endDocument(); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(String str) throws SAXException { if (_dom != null) { characters(str.toCharArray(), 0, str.length()); } else { super.characters(str); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(char[] ch, int offset, int length) throws SAXException { if (_dom != null) { maybeEmitStartElement(); _dom.characters(ch, offset, length); } else { super.characters(ch, offset, length); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public boolean setEscaping(boolean escape) throws SAXException { if (_dom != null) { return _dom.setEscaping(escape); } else { return super.setEscaping(escape); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String elementName) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _openElementName = elementName; _attributes.clear(); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String uri, String localName, String qName) throws SAXException { startElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { startElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endElement(String elementName) throws SAXException { maybeEmitStartElement(); _dom.endElement(null, null, elementName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { endElement(qName); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException { addAttribute(qName, value); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException { if (_dom == null) { prepareNewDOM(); } _dom.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void comment(String comment) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); char[] chars = comment.toCharArray(); _dom.comment(chars, 0, chars.length); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void comment(char[] chars, int offset, int length) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.comment(chars, offset, length); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void processingInstruction(String target, String data) throws SAXException { if (_dom == null) { prepareNewDOM(); } maybeEmitStartElement(); _dom.processingInstruction(target, data); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void dispatchCharactersEvents(int nodeHandle, org.xml.sax.ContentHandler ch, boolean normalize) throws org.xml.sax.SAXException { if (_dom != null) { _dom.dispatchCharactersEvents(nodeHandle, ch, normalize); } else { super.dispatchCharactersEvents(nodeHandle, ch, normalize); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void dispatchToEvents(int nodeHandle, org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { if (_dom != null) { _dom.dispatchToEvents(nodeHandle, ch); } else { super.dispatchToEvents(nodeHandle, ch); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(char[] ch, int start, int length) throws SAXException { super.characters(ch, start, length); _disableEscaping = !_escaping; _textNodeToProcess = getNumberOfNodes(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startDocument() throws SAXException { super.startDocument(); _nsIndex.put(new Integer(0), new Integer(_uriCount++)); definePrefixAndUri(XML_PREFIX, XML_URI); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void endDocument() throws SAXException { super.endDocument(); handleTextEscaping(); _namesSize = m_expandedNameTable.getSize(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes, Node node) throws SAXException { this.startElement(uri, localName, qname, attributes); if (m_buildIdIndex) { _node2Ids.put(node, new Integer(m_parents.peek())); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException { super.startElement(uri, localName, qname, attributes); handleTextEscaping(); if (m_wsfilter != null) { // Look for any xml:space attributes // Depending on the implementation of attributes, this // might be faster than looping through all attributes. ILENE final int index = attributes.getIndex(XMLSPACE_STRING); if (index >= 0) { xmlSpaceDefine(attributes.getValue(index), m_parents.peek()); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void endElement(String namespaceURI, String localName, String qname) throws SAXException { super.endElement(namespaceURI, localName, qname); handleTextEscaping(); // Revert to strip/preserve-space setting from before this element if (m_wsfilter != null) { xmlSpaceRevert(m_previous); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void processingInstruction(String target, String data) throws SAXException { super.processingInstruction(target, data); handleTextEscaping(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { super.ignorableWhitespace(ch, start, length); _textNodeToProcess = getNumberOfNodes(); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { super.startPrefixMapping(prefix, uri); handleTextEscaping(); definePrefixAndUri(prefix, uri); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void definePrefixAndUri(String prefix, String uri) throws SAXException { // Check if the URI already exists before pushing on stack Integer eType = new Integer(getIdForNamespace(uri)); if ((Integer)_nsIndex.get(eType) == null) { _nsIndex.put(eType, new Integer(_uriCount++)); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void comment(char[] ch, int start, int length) throws SAXException { super.comment(ch, start, length); handleTextEscaping(); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _handler.startDocument(); parse(_dom); _handler.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
private void parse(Node node) throws IOException, SAXException { if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: _handler.startCDATA(); _handler.characters(node.getNodeValue()); _handler.endCDATA(); break; case Node.COMMENT_NODE: // should be handled!!! _handler.comment(node.getNodeValue()); break; case Node.DOCUMENT_NODE: _handler.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _handler.endDocument(); break; case Node.DOCUMENT_FRAGMENT_NODE: next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } break; case Node.ELEMENT_NODE: // Generate SAX event to start element final String qname = node.getNodeName(); _handler.startElement(null, null, qname); int colon; String prefix; final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace attributes first for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a namespace declaration? if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uriAttr); } } // Process all non-namespace attributes next NamespaceMappings nm = new NamespaceMappings(); for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Is this a regular attribute? if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); // Uri may be implicitly declared if (uriAttr != null && !uriAttr.equals(EMPTYSTRING) ) { colon = qnameAttr.lastIndexOf(':'); // Fix for bug 26319 // For attributes not given an prefix explictly // but having a namespace uri we need // to explicitly generate the prefix String newPrefix = nm.lookupPrefix(uriAttr); if (newPrefix == null) newPrefix = nm.generateNextPrefix(); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : newPrefix; _handler.namespaceAfterStartElement(prefix, uriAttr); _handler.addAttribute((prefix + ":" + qnameAttr), attr.getNodeValue()); } else { _handler.addAttribute(qnameAttr, attr.getNodeValue()); } } } // Now element namespace and children final String uri = node.getNamespaceURI(); final String localName = node.getLocalName(); // Uri may be implicitly declared if (uri != null) { colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, uri); }else { // Fix for bug 26319 // If an element foo is created using // createElementNS(null,locName) // then the element should be serialized // <foo xmlns=" "/> if (uri == null && localName != null) { prefix = EMPTYSTRING; _handler.namespaceAfterStartElement(prefix, EMPTYSTRING); } } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _handler.endElement(qname); break; case Node.PROCESSING_INSTRUCTION_NODE: _handler.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: _handler.characters(node.getNodeValue()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private boolean startPrefixMapping(String prefix, String uri) throws SAXException { boolean pushed = true; Stack uriStack = (Stack) _nsPrefixes.get(prefix); if (uriStack != null) { if (uriStack.isEmpty()) { _sax.startPrefixMapping(prefix, uri); uriStack.push(uri); } else { final String lastUri = (String) uriStack.peek(); if (!lastUri.equals(uri)) { _sax.startPrefixMapping(prefix, uri); uriStack.push(uri); } else { pushed = false; } } } else { _sax.startPrefixMapping(prefix, uri); _nsPrefixes.put(prefix, uriStack = new Stack()); uriStack.push(uri); } return pushed; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void endPrefixMapping(String prefix) throws SAXException { final Stack uriStack = (Stack) _nsPrefixes.get(prefix); if (uriStack != null) { _sax.endPrefixMapping(prefix); uriStack.pop(); } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(InputSource unused) throws IOException, SAXException { parse(_dom); }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse() throws IOException, SAXException { if (_dom != null) { boolean isIncomplete = (_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE); if (isIncomplete) { _sax.startDocument(); parse(_dom); _sax.endDocument(); } else { parse(_dom); } } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
private void parse(Node node) throws IOException, SAXException { Node first = null; if (node == null) return; switch (node.getNodeType()) { case Node.ATTRIBUTE_NODE: // handled by ELEMENT_NODE case Node.DOCUMENT_FRAGMENT_NODE: case Node.DOCUMENT_TYPE_NODE : case Node.ENTITY_NODE : case Node.ENTITY_REFERENCE_NODE: case Node.NOTATION_NODE : // These node types are ignored!!! break; case Node.CDATA_SECTION_NODE: final String cdata = node.getNodeValue(); if (_lex != null) { _lex.startCDATA(); _sax.characters(cdata.toCharArray(), 0, cdata.length()); _lex.endCDATA(); } else { // in the case where there is no lex handler, we still // want the text of the cdate to make its way through. _sax.characters(cdata.toCharArray(), 0, cdata.length()); } break; case Node.COMMENT_NODE: // should be handled!!! if (_lex != null) { final String value = node.getNodeValue(); _lex.comment(value.toCharArray(), 0, value.length()); } break; case Node.DOCUMENT_NODE: _sax.setDocumentLocator(this); _sax.startDocument(); Node next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } _sax.endDocument(); break; case Node.ELEMENT_NODE: String prefix; List pushedPrefixes = new ArrayList(); final AttributesImpl attrs = new AttributesImpl(); final NamedNodeMap map = node.getAttributes(); final int length = map.getLength(); // Process all namespace declarations for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore everything but NS declarations here if (qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNodeValue(); final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(colon + 1) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } } // Process all other attributes for (int i = 0; i < length; i++) { final Node attr = map.item(i); final String qnameAttr = attr.getNodeName(); // Ignore NS declarations here if (!qnameAttr.startsWith(XMLNS_PREFIX)) { final String uriAttr = attr.getNamespaceURI(); final String localNameAttr = getLocalName(attr); // Uri may be implicitly declared if (uriAttr != null) { final int colon = qnameAttr.lastIndexOf(':'); prefix = (colon > 0) ? qnameAttr.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uriAttr)) { pushedPrefixes.add(prefix); } } // Add attribute to list attrs.addAttribute(attr.getNamespaceURI(), getLocalName(attr), qnameAttr, "CDATA", attr.getNodeValue()); } } // Now process the element itself final String qname = node.getNodeName(); final String uri = node.getNamespaceURI(); final String localName = getLocalName(node); // Uri may be implicitly declared if (uri != null) { final int colon = qname.lastIndexOf(':'); prefix = (colon > 0) ? qname.substring(0, colon) : EMPTYSTRING; if (startPrefixMapping(prefix, uri)) { pushedPrefixes.add(prefix); } } // Generate SAX event to start element if (_saxImpl != null) { _saxImpl.startElement(uri, localName, qname, attrs, node); } else { _sax.startElement(uri, localName, qname, attrs); } // Traverse all child nodes of the element (if any) next = node.getFirstChild(); while (next != null) { parse(next); next = next.getNextSibling(); } // Generate SAX event to close element _sax.endElement(uri, localName, qname); // Generate endPrefixMapping() for all pushed prefixes final int nPushedPrefixes = pushedPrefixes.size(); for (int i = 0; i < nPushedPrefixes; i++) { endPrefixMapping((String) pushedPrefixes.get(i)); } break; case Node.PROCESSING_INSTRUCTION_NODE: _sax.processingInstruction(node.getNodeName(), node.getNodeValue()); break; case Node.TEXT_NODE: final String data = node.getNodeValue(); _sax.characters(data.toCharArray(), 0, data.length()); break; } }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void parse(String sysId) throws IOException, SAXException { throw new IOException("This method is not yet implemented."); }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void endDocument() throws SAXException { _parser.endDocument(); // create the templates try { XSLTC xsltc = _parser.getXSLTC(); // Set the translet class name if not already set String transletName; if (_systemId != null) { transletName = Util.baseName(_systemId); } else { transletName = (String)_tfactory.getAttribute("translet-name"); } xsltc.setClassName(transletName); // Get java-legal class name from XSLTC module transletName = xsltc.getClassName(); Stylesheet stylesheet = null; SyntaxTreeNode root = _parser.getDocumentRoot(); // Compile the translet - this is where the work is done! if (!_parser.errorsFound() && root != null) { // Create a Stylesheet element from the root node stylesheet = _parser.makeStylesheet(root); stylesheet.setSystemId(_systemId); stylesheet.setParentStylesheet(null); if (xsltc.getTemplateInlining()) stylesheet.setTemplateInlining(true); else stylesheet.setTemplateInlining(false); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { stylesheet.setSourceLoader(this); } _parser.setCurrentStylesheet(stylesheet); // Set it as top-level in the XSLTC object xsltc.setStylesheet(stylesheet); // Create AST under the Stylesheet element _parser.createAST(stylesheet); } // Generate the bytecodes and output the translet class(es) if (!_parser.errorsFound() && stylesheet != null) { stylesheet.setMultiDocument(xsltc.isMultiDocument()); stylesheet.setHasIdCall(xsltc.hasIdCall()); // Class synchronization is needed for BCEL synchronized (xsltc.getClass()) { stylesheet.translate(); } } if (!_parser.errorsFound()) { // Check that the transformation went well before returning final byte[][] bytecodes = xsltc.getBytecodes(); if (bytecodes != null) { _templates = new TemplatesImpl(xsltc.getBytecodes(), transletName, _parser.getOutputProperties(), _indentNumber, _tfactory); // Set URIResolver on templates object if (_uriResolver != null) { _templates.setURIResolver(_uriResolver); } } } else { StringBuffer errorMessage = new StringBuffer(); Vector errors = _parser.getErrors(); final int count = errors.size(); for (int i = 0; i < count; i++) { if (errorMessage.length() > 0) errorMessage.append('\n'); errorMessage.append(errors.elementAt(i).toString()); } throw new SAXException(ErrorMsg.JAXP_COMPILE_ERR, new TransformerException(errorMessage.toString())); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
public void startElement(String uri, String localname, String qname, Attributes attributes) throws SAXException { _parser.startElement(uri, localname, qname, attributes); }
// in src/org/apache/xalan/xsltc/trax/XSLTCSource.java
protected DOM getDOM(XSLTCDTMManager dtmManager, AbstractTranslet translet) throws SAXException { SAXImpl idom = (SAXImpl)_dom.get(); if (idom != null) { if (dtmManager != null) { idom.migrateTo(dtmManager); } } else { Source source = _source; if (source == null) { if (_systemId != null && _systemId.length() > 0) { source = new StreamSource(_systemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.XSLTC_SOURCE_ERR); throw new SAXException(err.toString()); } } DOMWSFilter wsfilter = null; if (translet != null && translet instanceof StripFilter) { wsfilter = new DOMWSFilter(translet); } boolean hasIdCall = (translet != null) ? translet.hasIdCall() : false; if (dtmManager == null) { dtmManager = XSLTCDTMManager.newInstance(); } idom = (SAXImpl)dtmManager.getDTM(source, true, wsfilter, false, false, hasIdCall); String systemId = getSystemId(); if (systemId != null) { idom.setDocumentURI(systemId); } _dom.set(idom); } return idom; }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
private void createParent() throws SAXException { XMLReader parent = null; try { SAXParserFactory pfactory = SAXParserFactory.newInstance(); pfactory.setNamespaceAware(true); if (_transformer.isSecureProcessing()) { try { pfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (SAXException e) {} } SAXParser saxparser = pfactory.newSAXParser(); parent = saxparser.getXMLReader(); } catch (ParserConfigurationException e) { throw new SAXException(e); } catch (FactoryConfigurationError e) { throw new SAXException(e.toString()); } if (parent == null) { parent = XMLReaderFactory.createXMLReader(); } // make this XMLReader the parent of this filter setParent(parent); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (InputSource input) throws SAXException, IOException { XMLReader managedReader = null; try { if (getParent() == null) { try { managedReader = XMLReaderManager.getInstance() .getXMLReader(); setParent(managedReader); } catch (SAXException e) { throw new SAXException(e.toString()); } } // call parse on the parent getParent().parse(input); } finally { if (managedReader != null) { XMLReaderManager.getInstance().releaseXMLReader(managedReader); } } }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
public void parse (String systemId) throws SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void characters(char[] ch, int start, int length) throws SAXException { _handler.characters(ch, start, length); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDocument() throws SAXException { // Make sure setResult() was called before the first SAX event if (_result == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_RESULT_ERR); throw new SAXException(err.toString()); } if (!_isIdentity) { boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; XSLTCDTMManager dtmManager = null; // Create an internal DOM (not W3C) and get SAX2 input handler try { dtmManager = (XSLTCDTMManager)_transformer.getTransformerFactory() .getDTMManagerClass() .newInstance(); } catch (Exception e) { throw new SAXException(e); } DTMWSFilter wsFilter; if (_translet != null && _translet instanceof StripFilter) { wsFilter = new DOMWSFilter(_translet); } else { wsFilter = null; } // Construct the DTM using the SAX events that come through _dom = (SAXImpl)dtmManager.getDTM(null, false, wsFilter, true, false, hasIdCall); _handler = _dom.getBuilder(); _lexHandler = (LexicalHandler) _handler; _dtdHandler = (DTDHandler) _handler; _declHandler = (DeclHandler) _handler; // Set document URI _dom.setDocumentURI(_systemId); if (_locator != null) { _handler.setDocumentLocator(_locator); } } // Proxy call _handler.startDocument(); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDocument() throws SAXException { // Signal to the DOMBuilder that the document is complete _handler.endDocument(); if (!_isIdentity) { // Run the transformation now if we have a reference to a Result object if (_result != null) { try { _transformer.setDOM(_dom); _transformer.transform(null, _result); } catch (TransformerException e) { throw new SAXException(e); } } // Signal that the internal DOM is built (see 'setResult()'). _done = true; // Set this DOM as the transformer's DOM _transformer.setDOM(_dom); } if (_isIdentity && _result instanceof DOMResult) { ((DOMResult)_result).setNode(_transformer.getTransletOutputHandlerFactory().getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startElement(String uri, String localName, String qname, Attributes attributes) throws SAXException { _handler.startElement(uri, localName, qname, attributes); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endElement(String namespaceURI, String localName, String qname) throws SAXException { _handler.endElement(namespaceURI, localName, qname); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void processingInstruction(String target, String data) throws SAXException { _handler.processingInstruction(target, data); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.startCDATA(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endCDATA() throws SAXException { if (_lexHandler != null) { _lexHandler.endCDATA(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void comment(char[] ch, int start, int length) throws SAXException { if (_lexHandler != null) { _lexHandler.comment(ch, start, length); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { _handler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void skippedEntity(String name) throws SAXException { _handler.skippedEntity(name); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { _handler.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endPrefixMapping(String prefix) throws SAXException { _handler.endPrefixMapping(prefix); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { if (_lexHandler != null) { _lexHandler.startDTD(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endDTD() throws SAXException { if (_lexHandler != null) { _lexHandler.endDTD(); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void startEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.startEntity(name); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void endEntity(String name) throws SAXException { if (_lexHandler != null) { _lexHandler.endEntity(name); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException { if (_dtdHandler != null) { _dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (_dtdHandler != null) { _dtdHandler.notationDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void attributeDecl(String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (_declHandler != null) { _declHandler.attributeDecl(eName, aName, type, valueDefault, value); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void elementDecl(String name, String model) throws SAXException { if (_declHandler != null) { _declHandler.elementDecl(name, model); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void externalEntityDecl(String name, String publicId, String systemId) throws SAXException { if (_declHandler != null) { _declHandler.externalEntityDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
public void internalEntityDecl(String name, String value) throws SAXException { if (_declHandler != null) { _declHandler.internalEntityDecl(name, value); } }
// in src/org/apache/xalan/xsltc/trax/SAX2DOM.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { // Hmmm... for the moment I don't think I'll have default properties set for this. -sb m_outputProperties = new OutputProperties(); m_outputProperties.setDOMBackPointer(handler.getOriginatingNode()); m_outputProperties.setLocaterInfo(handler.getLocator()); m_outputProperties.setUid(handler.nextUid()); setPropertiesFromAttributes(handler, rawName, attributes, this); // Access this only from the Hashtable level... we don't want to // get default properties. String entitiesFileName = (String) m_outputProperties.getProperties().get(OutputPropertiesFactory.S_KEY_ENTITIES); if (null != entitiesFileName) { try { String absURL = SystemIDResolver.getAbsoluteURI(entitiesFileName, handler.getBaseIdentifier()); m_outputProperties.getProperties().put(OutputPropertiesFactory.S_KEY_ENTITIES, absURL); } catch(TransformerException te) { handler.error(te.getMessage(), te); } } handler.getStylesheet().setOutput(m_outputProperties); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(m_outputProperties); m_outputProperties = null; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { if (this == handler.getCurrentProcessor()) { handler.popProcessor(); } int nChars = m_accumulator.length(); if ((nChars > 0) && ((null != m_xslTextElement) ||!XMLCharacterRecognizer.isWhiteSpace(m_accumulator)) || handler.isSpacePreserve()) { ElemTextLiteral elem = new ElemTextLiteral(); elem.setDOMBackPointer(m_firstBackPointer); elem.setLocaterInfo(handler.getLocator()); try { elem.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } boolean doe = (null != m_xslTextElement) ? m_xslTextElement.getDisableOutputEscaping() : false; elem.setDisableOutputEscaping(doe); elem.setPreserveSpace(true); char[] chars = new char[nChars]; m_accumulator.getChars(0, nChars, chars, 0); elem.setChars(chars); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); } m_accumulator.setLength(0); m_firstBackPointer = null; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void characters( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { m_accumulator.append(ch, start, length); if(null == m_firstBackPointer) m_firstBackPointer = handler.getOriginatingNode(); // Catch all events until a non-character event. if (this != handler.getCurrentProcessor()) handler.pushProcessor(this); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { // Since this has been installed as the current processor, we // may get and end element event, in which case, we pop and clear // and then call the real element processor. startNonText(handler); handler.getCurrentProcessor().endElement(handler, uri, localName, rawName); handler.popProcessor(); }
// in src/org/apache/xalan/processor/ProcessorExsltFuncResult.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws SAXException { String msg = ""; super.startElement(handler, uri, localName, rawName, attributes); ElemTemplateElement ancestor = handler.getElemTemplateElement().getParentElem(); while (ancestor != null && !(ancestor instanceof ElemExsltFunction)) { if (ancestor instanceof ElemVariable || ancestor instanceof ElemParam || ancestor instanceof ElemExsltFuncResult) { msg = "func:result cannot appear within a variable, parameter, or another func:result."; handler.error(msg, new SAXException(msg)); } ancestor = ancestor.getParentElem(); } if (ancestor == null) { msg = "func:result must appear in a func:function element"; handler.error(msg, new SAXException(msg)); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { // ElemTemplateElement parent = handler.getElemTemplateElement(); XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); ElemTemplateElement elem = null; try { elem = (ElemTemplateElement) classObject.newInstance(); elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, ie);//"Failed creating ElemTemplateElement instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMTMPL, null, iae);//"Failed creating ElemTemplateElement instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { ElemTemplateElement parent = handler.getElemTemplateElement(); if(null != parent) // defensive, for better multiple error reporting. -sb { parent.appendChild(elem); handler.pushElemTemplateElement(elem); } }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { super.endElement(handler, uri, localName, rawName); handler.popElemTemplateElement().setEndLocaterInfo(handler.getLocator()); }
// in src/org/apache/xalan/processor/ProcessorPreserveSpace.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { Stylesheet thisSheet = handler.getStylesheet(); WhitespaceInfoPaths paths = new WhitespaceInfoPaths(thisSheet); setPropertiesFromAttributes(handler, rawName, attributes, paths); Vector xpaths = paths.getElements(); for (int i = 0; i < xpaths.size(); i++) { WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), false, thisSheet); wsi.setUid(handler.nextUid()); thisSheet.setPreserveSpaces(wsi); } paths.clearElements(); }
// in src/org/apache/xalan/processor/ProcessorDecimalFormat.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { DecimalFormatProperties dfp = new DecimalFormatProperties(handler.nextUid()); dfp.setDOMBackPointer(handler.getOriginatingNode()); dfp.setLocaterInfo(handler.getLocator()); setPropertiesFromAttributes(handler, rawName, attributes, dfp); handler.getStylesheet().setDecimalFormat(dfp); handler.getStylesheet().appendChild(dfp); }
// in src/org/apache/xalan/processor/ProcessorNamespaceAlias.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { final String resultNS; NamespaceAlias na = new NamespaceAlias(handler.nextUid()); setPropertiesFromAttributes(handler, rawName, attributes, na); String prefix = na.getStylesheetPrefix(); if(prefix.equals("#default")) { prefix = ""; na.setStylesheetPrefix(prefix); } String stylesheetNS = handler.getNamespaceForPrefix(prefix); na.setStylesheetNamespace(stylesheetNS); prefix = na.getResultPrefix(); if(prefix.equals("#default")) { prefix = ""; na.setResultPrefix(prefix); resultNS = handler.getNamespaceForPrefix(prefix); if(null == resultNS) handler.error(XSLTErrorResources.ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX_FOR_DEFAULT, null, null); } else { resultNS = handler.getNamespaceForPrefix(prefix); if(null == resultNS) handler.error(XSLTErrorResources.ER_INVALID_NAMESPACE_URI_VALUE_FOR_RESULT_PREFIX, new Object[] {prefix}, null); } na.setResultNamespace(resultNS); handler.getStylesheet().setNamespaceAlias(na); handler.getStylesheet().appendChild(na); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemTemplateElement elem = handler.getElemTemplateElement(); if (elem instanceof ElemLiteralResult) { if (((ElemLiteralResult) elem).getIsLiteralResultAsStylesheet()) { handler.popStylesheet(); } } super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorTemplate.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { super.appendAndPush(handler, elem); elem.setDOMBackPointer(handler.getOriginatingNode()); handler.getStylesheet().setTemplate((ElemTemplate) elem); }
// in src/org/apache/xalan/processor/ProcessorStripSpace.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { Stylesheet thisSheet = handler.getStylesheet(); WhitespaceInfoPaths paths = new WhitespaceInfoPaths(thisSheet); setPropertiesFromAttributes(handler, rawName, attributes, paths); Vector xpaths = paths.getElements(); for (int i = 0; i < xpaths.size(); i++) { WhiteSpaceInfo wsi = new WhiteSpaceInfo((XPath) xpaths.elementAt(i), true, thisSheet); wsi.setUid(handler.nextUid()); thisSheet.setStripSpaces(wsi); } paths.clearElements(); }
// in src/org/apache/xalan/processor/ProcessorText.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Don't push this element onto the element stack. ProcessorCharacters charProcessor = (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text"); charProcessor.setXslTextElement((ElemText) elem); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(elem); elem.setDOMBackPointer(handler.getOriginatingNode()); }
// in src/org/apache/xalan/processor/ProcessorText.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ProcessorCharacters charProcessor = (ProcessorCharacters) handler.getProcessorFor(null, "text()", "text"); charProcessor.setXslTextElement(null); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { ElemAttributeSet eat = new ElemAttributeSet(); eat.setLocaterInfo(handler.getLocator()); try { eat.setPrefixes(handler.getNamespaceSupport()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } eat.setDOMBackPointer(handler.getOriginatingNode()); setPropertiesFromAttributes(handler, rawName, attributes, eat); handler.getStylesheet().setAttributeSet(eat); // handler.pushElemTemplateElement(eat); ElemTemplateElement parent = handler.getElemTemplateElement(); parent.appendChild(eat); handler.pushElemTemplateElement(eat); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { handler.popElemTemplateElement(); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
AVT processAVT( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCDATA(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processCHAR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (value.length() != 1)) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (value.length() != 1) { handleError(handler, XSLTErrorResources.INVALID_TCHAR, new Object[] {name, value},null); return null; } return new Character(value.charAt(0)); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; if (getSupportsAVT()) { try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (!avt.isSimple()) return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } int retVal = this.getEnum(value); if (retVal == StringToIntTable.INVALID_KEY) { StringBuffer enumNamesList = getListOfEnums(); handleError(handler, XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } if (getSupportsAVT()) return avt; else return new Integer(retVal); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processENUM_OR_PQNAME(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { Object objToReturn = null; if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); if (!avt.isSimple()) return avt; else objToReturn = avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } // An avt wasn't used. int key = this.getEnum(value); if (key != StringToIntTable.INVALID_KEY) { if (objToReturn == null) objToReturn = new Integer(key); } // enum not used. Validate qname-but-not-ncname. else { try { QName qname = new QName(value, handler, true); if (objToReturn == null) objToReturn = qname; if (qname.getPrefix() == null) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },null); return null; } } catch (IllegalArgumentException ie) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },ie); return null; } catch (RuntimeException re) { StringBuffer enumNamesList = getListOfEnums(); enumNamesList.append(" <qname-but-not-ncname>"); handleError(handler,XSLTErrorResources.INVALID_ENUM,new Object[]{name, value, enumNamesList.toString() },re); return null; } } return objToReturn; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processEXPR( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath expr = handler.createXPath(value, owner); return expr; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNMTOKEN(StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNmtoken(value))) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNmtoken(value)) { handleError(handler,XSLTErrorResources.INVALID_NMTOKEN, new Object[] {name,value},null); return null; } } return value; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processPATTERN( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { XPath pattern = handler.createMatchPatternXPath(value, owner); return pattern; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNUMBER( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { Double val; AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If this attribute used an avt, then we can't validate at this time. if (avt.isSimple()) { val = Double.valueOf(value); } } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } return avt; } else { try { return Double.valueOf(value); } catch (NumberFormatException nfe) { handleError(handler,XSLTErrorResources.INVALID_NUMBER, new Object[] {name, value}, nfe); return null; } } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processQNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { QName qname = new QName(value, handler, true); return qname; } catch (IllegalArgumentException ie) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},ie); return null; } catch (RuntimeException re) { // thrown by QName constructor handleError(handler,XSLTErrorResources.INVALID_QNAME, new Object[] {name, value},re); return null; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processAVT_QNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if (avt.isSimple()) { int indexOfNSSep = value.indexOf(':'); if (indexOfNSSep >= 0) { String prefix = value.substring(0, indexOfNSSep); if (!XML11Char.isXML11ValidNCName(prefix)) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null); return null; } } String localName = (indexOfNSSep < 0) ? value : value.substring(indexOfNSSep + 1); if ((localName == null) || (localName.length() == 0) || (!XML11Char.isXML11ValidNCName(localName))) { handleError(handler,XSLTErrorResources.INVALID_QNAME,new Object[]{name,value },null ); return null; } } } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } return avt; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processNCNAME( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { AVT avt = null; try { avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value if ((avt.isSimple()) && (!XML11Char.isXML11ValidNCName(value))) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return avt; } catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); } } else { if (!XML11Char.isXML11ValidNCName(value)) { handleError(handler,XSLTErrorResources.INVALID_NCNAME,new Object[] {name,value},null); return null; } return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processQNAMES( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nQNames = tokenizer.countTokens(); Vector qnames = new Vector(nQNames); for (int i = 0; i < nQNames; i++) { // Fix from Alexander Rudnev qnames.addElement(new QName(tokenizer.nextToken(), handler)); } return qnames; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
final Vector processQNAMESRNU(StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nQNames = tokenizer.countTokens(); Vector qnames = new Vector(nQNames); String defaultURI = handler.getNamespaceForPrefix(""); for (int i = 0; i < nQNames; i++) { String tok = tokenizer.nextToken(); if (tok.indexOf(':') == -1) { qnames.addElement(new QName(defaultURI,tok)); } else { qnames.addElement(new QName(tok, handler)); } } return qnames; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Vector processSIMPLEPATTERNLIST( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { try { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nPatterns = tokenizer.countTokens(); Vector patterns = new Vector(nPatterns); for (int i = 0; i < nPatterns; i++) { XPath pattern = handler.createMatchPatternXPath(tokenizer.nextToken(), owner); patterns.addElement(pattern); } return patterns; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_URLLIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (url != null) strings.addElement(url); else throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
StringVector processPREFIX_LIST( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { StringTokenizer tokenizer = new StringTokenizer(value, " \t\n\r\f"); int nStrings = tokenizer.countTokens(); StringVector strings = new StringVector(nStrings); for (int i = 0; i < nStrings; i++) { String prefix = tokenizer.nextToken(); String url = handler.getNamespaceForPrefix(prefix); if (prefix.equals(Constants.ATTRVAL_DEFAULT_PREFIX) || url != null) strings.addElement(prefix); else throw new org.xml.sax.SAXException( XSLMessages.createMessage( XSLTErrorResources.ER_CANT_RESOLVE_NSPREFIX, new Object[] {prefix})); } return strings; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processURL( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { if (getSupportsAVT()) { try { AVT avt = new AVT(handler, uri, name, rawName, value, owner); // If an AVT wasn't used, validate the value // if (avt.getSimpleString() != null) { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); //} return avt; } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else { // TODO: syntax check URL value. // return SystemIDResolver.getAbsoluteURI(value, // handler.getBaseIdentifier()); return value; } }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
private Boolean processYESNO( StylesheetHandler handler, String uri, String name, String rawName, String value) throws org.xml.sax.SAXException { // Is this already checked somewhere else? -sb if (!(value.equals("yes") || value.equals("no"))) { handleError(handler, XSLTErrorResources.INVALID_BOOLEAN, new Object[] {name,value}, null); return null; } return new Boolean(value.equals("yes") ? true : false); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
Object processValue( StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner) throws org.xml.sax.SAXException { int type = getType(); Object processedValue = null; switch (type) { case T_AVT : processedValue = processAVT(handler, uri, name, rawName, value, owner); break; case T_CDATA : processedValue = processCDATA(handler, uri, name, rawName, value, owner); break; case T_CHAR : processedValue = processCHAR(handler, uri, name, rawName, value, owner); break; case T_ENUM : processedValue = processENUM(handler, uri, name, rawName, value, owner); break; case T_EXPR : processedValue = processEXPR(handler, uri, name, rawName, value, owner); break; case T_NMTOKEN : processedValue = processNMTOKEN(handler, uri, name, rawName, value, owner); break; case T_PATTERN : processedValue = processPATTERN(handler, uri, name, rawName, value, owner); break; case T_NUMBER : processedValue = processNUMBER(handler, uri, name, rawName, value, owner); break; case T_QNAME : processedValue = processQNAME(handler, uri, name, rawName, value, owner); break; case T_QNAMES : processedValue = processQNAMES(handler, uri, name, rawName, value); break; case T_QNAMES_RESOLVE_NULL: processedValue = processQNAMESRNU(handler, uri, name, rawName, value); break; case T_SIMPLEPATTERNLIST : processedValue = processSIMPLEPATTERNLIST(handler, uri, name, rawName, value, owner); break; case T_URL : processedValue = processURL(handler, uri, name, rawName, value, owner); break; case T_YESNO : processedValue = processYESNO(handler, uri, name, rawName, value); break; case T_STRINGLIST : processedValue = processSTRINGLIST(handler, uri, name, rawName, value); break; case T_PREFIX_URLLIST : processedValue = processPREFIX_URLLIST(handler, uri, name, rawName, value); break; case T_ENUM_OR_PQNAME : processedValue = processENUM_OR_PQNAME(handler, uri, name, rawName, value, owner); break; case T_NCNAME : processedValue = processNCNAME(handler, uri, name, rawName, value, owner); break; case T_AVT_QNAME : processedValue = processAVT_QNAME(handler, uri, name, rawName, value, owner); break; case T_PREFIXLIST : processedValue = processPREFIX_LIST(handler, uri, name, rawName, value); break; default : } return processedValue; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
void setDefAttrValue(StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { setAttrValue(handler, this.getNamespace(), this.getName(), this.getName(), this.getDefault(), elem); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
boolean setAttrValue( StylesheetHandler handler, String attrUri, String attrLocalName, String attrRawName, String attrValue, ElemTemplateElement elem) throws org.xml.sax.SAXException { if(attrRawName.equals("xmlns") || attrRawName.startsWith("xmlns:")) return true; String setterString = getSetterMethodName(); // If this is null, then it is a foreign namespace and we // do not process it. if (null != setterString) { try { Method meth; Object[] args; if(setterString.equals(S_FOREIGNATTR_SETTER)) { // workaround for possible crimson bug if( attrUri==null) attrUri=""; // First try to match with the primative value. Class sclass = attrUri.getClass(); Class[] argTypes = new Class[]{ sclass, sclass, sclass, sclass }; meth = elem.getClass().getMethod(setterString, argTypes); args = new Object[]{ attrUri, attrLocalName, attrRawName, attrValue }; } else { Object value = processValue(handler, attrUri, attrLocalName, attrRawName, attrValue, elem); // If a warning was issued because the value for this attribute was // invalid, then the value will be null. Just return if (null == value) return false; // First try to match with the primative value. Class[] argTypes = new Class[]{ getPrimativeClass(value) }; try { meth = elem.getClass().getMethod(setterString, argTypes); } catch (NoSuchMethodException nsme) { Class cl = ((Object) value).getClass(); // If this doesn't work, try it with the non-primative value; argTypes[0] = cl; meth = elem.getClass().getMethod(setterString, argTypes); } args = new Object[]{ value }; } meth.invoke(elem, args); } catch (NoSuchMethodException nsme) { if (!setterString.equals(S_FOREIGNATTR_SETTER)) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, nsme);//"Failed calling " + setterString + " method!", nsme); return false; } } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CALLING_METHOD, new Object[]{setterString}, iae);//"Failed calling " + setterString + " method!", iae); return false; } catch (InvocationTargetException nsme) { handleError(handler, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, getName()}, nsme); return false; } } return true; }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
private void handleError(StylesheetHandler handler, String msg, Object [] args, Exception exc) throws org.xml.sax.SAXException { switch (getErrorType()) { case (FATAL): case (ERROR): handler.error(msg, args, exc); break; case (WARNING): handler.warn(msg, args); default: break; } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, this); try { // Get the Source from the user's URIResolver (if any). Source sourceFromURIResolver = getSourceFromUriResolver(handler); // Get the system ID of the included/imported stylesheet module String hrefUrl = getBaseURIOfIncludedStylesheet(handler, sourceFromURIResolver); if (handler.importStackContains(hrefUrl)) { throw new org.xml.sax.SAXException( XSLMessages.createMessage( getStylesheetInclErr(), new Object[]{ hrefUrl })); //"(StylesheetHandler) "+hrefUrl+" is directly or indirectly importing itself!"); } // Push the system ID and corresponding Source // on some stacks for later retrieval during parse() time. handler.pushImportURL(hrefUrl); handler.pushImportSource(sourceFromURIResolver); int savedStylesheetType = handler.getStylesheetType(); handler.setStylesheetType(this.getStylesheetType()); handler.pushNewNamespaceSupport(); try { parse(handler, uri, localName, rawName, attributes); } finally { handler.setStylesheetType(savedStylesheetType); handler.popImportURL(); handler.popImportSource(); handler.popNamespaceSupport(); } } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public InputSource resolveEntity( StylesheetHandler handler, String publicId, String systemId) throws org.xml.sax.SAXException { return null; }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void startNonText(StylesheetHandler handler) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { if (m_savedLastOrder == null) m_savedLastOrder = new IntStack(); m_savedLastOrder.push(getElemDef().getLastOrder()); getElemDef().setLastOrder(-1); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { if (m_savedLastOrder != null && !m_savedLastOrder.empty()) getElemDef().setLastOrder(m_savedLastOrder.pop()); if (!getElemDef().getRequiredFound()) handler.error(XSLTErrorResources.ER_REQUIRED_ELEM_NOT_FOUND, new Object[]{getElemDef().getRequiredElem()}, null); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void characters( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { handler.error(XSLTErrorResources.ER_CHARS_NOT_ALLOWED, null, null);//"Characters are not allowed at this point in the document!", //null); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void ignorableWhitespace( StylesheetHandler handler, char ch[], int start, int length) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void processingInstruction( StylesheetHandler handler, String target, String data) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
public void skippedEntity(StylesheetHandler handler, String name) throws org.xml.sax.SAXException { // no op }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
void setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, ElemTemplateElement target) throws org.xml.sax.SAXException { setPropertiesFromAttributes(handler, rawName, attributes, target, true); }
// in src/org/apache/xalan/processor/XSLTElementProcessor.java
Attributes setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, ElemTemplateElement target, boolean throwError) throws org.xml.sax.SAXException { XSLTElementDef def = getElemDef(); AttributesImpl undefines = null; boolean isCompatibleMode = ((null != handler.getStylesheet() && handler.getStylesheet().getCompatibleMode()) || !throwError); if (isCompatibleMode) undefines = new AttributesImpl(); // Keep track of which XSLTAttributeDefs have been processed, so // I can see which default values need to be set. List processedDefs = new ArrayList(); // Keep track of XSLTAttributeDefs that were invalid List errorDefs = new ArrayList(); int nAttrs = attributes.getLength(); for (int i = 0; i < nAttrs; i++) { String attrUri = attributes.getURI(i); // Hack for Crimson. -sb if((null != attrUri) && (attrUri.length() == 0) && (attributes.getQName(i).startsWith("xmlns:") || attributes.getQName(i).equals("xmlns"))) { attrUri = org.apache.xalan.templates.Constants.S_XMLNAMESPACEURI; } String attrLocalName = attributes.getLocalName(i); XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName); if (null == attrDef) { if (!isCompatibleMode) { // Then barf, because this element does not allow this attribute. handler.error(XSLTErrorResources.ER_ATTR_NOT_ALLOWED, new Object[]{attributes.getQName(i), rawName}, null);//"\""+attributes.getQName(i)+"\"" //+ " attribute is not allowed on the " + rawName // + " element!", null); } else { undefines.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } else { // Can we switch the order here: boolean success = attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); // Now we only add the element if it passed a validation check if (success) processedDefs.add(attrDef); else errorDefs.add(attrDef); } } XSLTAttributeDef[] attrDefs = def.getAttributes(); int nAttrDefs = attrDefs.length; for (int i = 0; i < nAttrDefs; i++) { XSLTAttributeDef attrDef = attrDefs[i]; String defVal = attrDef.getDefault(); if (null != defVal) { if (!processedDefs.contains(attrDef)) { attrDef.setDefAttrValue(handler, target); } } if (attrDef.getRequired()) { if ((!processedDefs.contains(attrDef)) && (!errorDefs.contains(attrDef))) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null); } } return undefines; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException { return getCurrentProcessor().resolveEntity(this, publicId, systemId); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
XSLTElementProcessor getProcessorFor( String uri, String localName, String rawName) throws org.xml.sax.SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor(); XSLTElementDef def = currentProcessor.getElemDef(); XSLTElementProcessor elemProcessor = def.getProcessorFor(uri, localName); if (null == elemProcessor && !(currentProcessor instanceof ProcessorStylesheetDoc) && ((null == getStylesheet() || Double.valueOf(getStylesheet().getVersion()).doubleValue() > Constants.XSLTVERSUPPORTED) ||(!uri.equals(Constants.S_XSLNAMESPACEURL) && currentProcessor instanceof ProcessorStylesheetElement) || getElemVersion() > Constants.XSLTVERSUPPORTED )) { elemProcessor = def.getProcessorForUnknown(uri, localName); } if (null == elemProcessor) error(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_ALLOWED_IN_POSITION, new Object[]{rawName}),null);//rawName + " is not allowed in this position in the stylesheet!", return elemProcessor; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startDocument() throws org.xml.sax.SAXException { m_stylesheetLevel++; pushSpaceHandling(false); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startPrefixMapping(String prefix, String uri) throws org.xml.sax.SAXException { // m_nsSupport.pushContext(); // this.getNamespaceSupport().declarePrefix(prefix, uri); //m_prefixMappings.add(prefix); // JDK 1.2+ only -sc //m_prefixMappings.add(uri); // JDK 1.2+ only -sc m_prefixMappings.addElement(prefix); // JDK 1.1.x compat -sc m_prefixMappings.addElement(uri); // JDK 1.1.x compat -sc }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException { // m_nsSupport.popContext(); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
private void flushCharacters() throws org.xml.sax.SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void startElement( String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { NamespaceSupport nssupport = this.getNamespaceSupport(); nssupport.pushContext(); int n = m_prefixMappings.size(); for (int i = 0; i < n; i++) { String prefix = (String)m_prefixMappings.elementAt(i++); String nsURI = (String)m_prefixMappings.elementAt(i); nssupport.declarePrefix(prefix, nsURI); } //m_prefixMappings.clear(); // JDK 1.2+ only -sc m_prefixMappings.removeAllElements(); // JDK 1.1.x compat -sc m_elementID++; // This check is currently done for all elements. We should possibly consider // limiting this check to xsl:stylesheet elements only since that is all it really // applies to. Also, it could be bypassed if m_shouldProcess is already true. // In other words, the next two statements could instead look something like this: // if (!m_shouldProcess) // { // if (localName.equals(Constants.ELEMNAME_STYLESHEET_STRING) && // url.equals(Constants.S_XSLNAMESPACEURL)) // { // checkForFragmentID(attributes); // if (!m_shouldProcess) // return; // } // else // return; // } // I didn't include this code statement at this time because in practice // it is a small performance hit and I was waiting to see if its absence // caused a problem. - GLP checkForFragmentID(attributes); if (!m_shouldProcess) return; flushCharacters(); pushSpaceHandling(attributes); XSLTElementProcessor elemProcessor = getProcessorFor(uri, localName, rawName); if(null != elemProcessor) // defensive, for better multiple error reporting. -sb { this.pushProcessor(elemProcessor); elemProcessor.startElement(this, uri, localName, rawName, attributes); } else { m_shouldProcess = false; popSpaceHandling(); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endElement(String uri, String localName, String rawName) throws org.xml.sax.SAXException { m_elementID--; if (!m_shouldProcess) return; if ((m_elementID + 1) == m_fragmentID) m_shouldProcess = false; flushCharacters(); popSpaceHandling(); XSLTElementProcessor p = getCurrentProcessor(); p.endElement(this, uri, localName, rawName); this.popProcessor(); this.getNamespaceSupport().popContext(); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; XSLTElementProcessor elemProcessor = getCurrentProcessor(); XSLTElementDef def = elemProcessor.getElemDef(); if (def.getType() != XSLTElementDef.T_PCDATA) elemProcessor = def.getProcessorFor(null, "text()"); if (null == elemProcessor) { // If it's whitespace, just ignore it, otherwise flag an error. if (!XMLCharacterRecognizer.isWhiteSpace(ch, start, length)) error( XSLMessages.createMessage(XSLTErrorResources.ER_NONWHITESPACE_NOT_ALLOWED_IN_POSITION, null),null);//"Non-whitespace text is not allowed in this position in the stylesheet!", } else elemProcessor.characters(this, ch, start, length); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().ignorableWhitespace(this, ch, start, length); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; // Recreating Scott's kluge: // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced. // String localName = getLocalName(target); // String ns = m_stylesheet.getNamespaceFromStack(target); // // %REVIEW%: We need a better PI architecture String prefix="",ns="", localName=target; int colon=target.indexOf(':'); if(colon>=0) { ns=getNamespaceForPrefix(prefix=target.substring(0,colon)); localName=target.substring(colon+1); } try { // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced... but since the XML Namespaces // spec never defined namespaces as applying to PI's, and since // the testcase we're trying to support is inconsistant in whether // it binds the prefix, I'm going to make this sloppy for // testing purposes. if( "xalan-doc-cache-off".equals(target) || "xalan:doc-cache-off".equals(target) || ("doc-cache-off".equals(localName) && ns.equals("org.apache.xalan.xslt.extensions.Redirect") ) ) { if(!(m_elems.peek() instanceof ElemForEach)) throw new TransformerException ("xalan:doc-cache-off not allowed here!", getLocator()); ElemForEach elem = (ElemForEach)m_elems.peek(); elem.m_doc_cache_off = true; //System.out.println("JJK***** Recognized <? {"+ns+"}"+prefix+":"+localName+" "+data+"?>"); } } catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? } flushCharacters(); getCurrentProcessor().processingInstruction(this, target, data); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void skippedEntity(String name) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; getCurrentProcessor().skippedEntity(this, name); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warn(String msg, Object args[]) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createWarning(msg, args); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { if (null != handler) handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Exception e) throws org.xml.sax.SAXException { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); TransformerException pe; if (!(e instanceof TransformerException)) { pe = (null == e) ? new TransformerException(msg, locator) : new TransformerException(msg, locator, e); } else pe = (TransformerException) e; if (null != handler) { try { handler.error(pe); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } } else throw new org.xml.sax.SAXException(pe); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
protected void error(String msg, Object args[], Exception e) throws org.xml.sax.SAXException { String formattedMsg = XSLMessages.createMessage(msg, args); error(formattedMsg, e); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.warning(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException { String formattedMsg = e.getMessage(); SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.fatalError(new TransformerException(formattedMsg, locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Just push, but don't append. handler.pushElemTemplateElement(elem); }
// in src/org/apache/xalan/processor/ProcessorGlobalParamDecl.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemParam v = (ElemParam) handler.getElemTemplateElement(); handler.getStylesheet().appendChild(v); handler.getStylesheet().setParam(v); super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws org.xml.sax.SAXException { // Just push, but don't append. handler.pushElemTemplateElement(elem); }
// in src/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { ElemVariable v = (ElemVariable) handler.getElemTemplateElement(); handler.getStylesheet().appendChild(v); handler.getStylesheet().setVariable(v); super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws org.xml.sax.SAXException { super.endElement(handler, uri, localName, rawName); handler.popElemTemplateElement(); handler.popStylesheet(); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws SAXException { //System.out.println("ProcessorFunction.startElement()"); String msg = ""; if (!(handler.getElemTemplateElement() instanceof Stylesheet)) { msg = "func:function element must be top level."; handler.error(msg, new SAXException(msg)); } super.startElement(handler, uri, localName, rawName, attributes); String val = attributes.getValue("name"); int indexOfColon = val.indexOf(":"); if (indexOfColon > 0) { //String prefix = val.substring(0, indexOfColon); //String localVal = val.substring(indexOfColon + 1); //String ns = handler.getNamespaceSupport().getURI(prefix); //if (ns.length() > 0) // System.out.println("fullfuncname " + ns + localVal); } else { msg = "func:function name must have namespace"; handler.error(msg, new SAXException(msg)); } }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
protected void appendAndPush( StylesheetHandler handler, ElemTemplateElement elem) throws SAXException { //System.out.println("ProcessorFunction appendAndPush()" + elem); super.appendAndPush(handler, elem); //System.out.println("originating node " + handler.getOriginatingNode()); elem.setDOMBackPointer(handler.getOriginatingNode()); handler.getStylesheet().setTemplate((ElemTemplate) elem); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void endElement( StylesheetHandler handler, String uri, String localName, String rawName) throws SAXException { ElemTemplateElement function = handler.getElemTemplateElement(); validate(function, handler); // may throw exception super.endElement(handler, uri, localName, rawName); }
// in src/org/apache/xalan/processor/ProcessorExsltFunction.java
public void validate(ElemTemplateElement elem, StylesheetHandler handler) throws SAXException { String msg = ""; while (elem != null) { //System.out.println("elem " + elem); if (elem instanceof ElemExsltFuncResult && elem.getNextSiblingElem() != null && !(elem.getNextSiblingElem() instanceof ElemFallback)) { msg = "func:result has an illegal following sibling (only xsl:fallback allowed)"; handler.error(msg, new SAXException(msg)); } if((elem instanceof ElemApplyImport || elem instanceof ElemApplyTemplates || elem instanceof ElemAttribute || elem instanceof ElemCallTemplate || elem instanceof ElemComment || elem instanceof ElemCopy || elem instanceof ElemCopyOf || elem instanceof ElemElement || elem instanceof ElemLiteralResult || elem instanceof ElemNumber || elem instanceof ElemPI || elem instanceof ElemText || elem instanceof ElemTextLiteral || elem instanceof ElemValueOf) && !(ancestorIsOk(elem))) { msg ="misplaced literal result in a func:function container."; handler.error(msg, new SAXException(msg)); } ElemTemplateElement nextElem = elem.getFirstChildElem(); while (nextElem == null) { nextElem = elem.getNextSiblingElem(); if (nextElem == null) elem = elem.getParentElem(); if (elem == null || elem instanceof ElemExsltFunction) return; // ok } elem = nextElem; } }
// in src/org/apache/xalan/processor/ProcessorKey.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { KeyDeclaration kd = new KeyDeclaration(handler.getStylesheet(), handler.nextUid()); kd.setDOMBackPointer(handler.getOriginatingNode()); kd.setLocaterInfo(handler.getLocator()); setPropertiesFromAttributes(handler, rawName, attributes, kd); handler.getStylesheet().setKey(kd); }
// in src/org/apache/xalan/processor/ProcessorKey.java
void setPropertiesFromAttributes( StylesheetHandler handler, String rawName, Attributes attributes, org.apache.xalan.templates.ElemTemplateElement target) throws org.xml.sax.SAXException { XSLTElementDef def = getElemDef(); // Keep track of which XSLTAttributeDefs have been processed, so // I can see which default values need to be set. List processedDefs = new ArrayList(); int nAttrs = attributes.getLength(); for (int i = 0; i < nAttrs; i++) { String attrUri = attributes.getURI(i); String attrLocalName = attributes.getLocalName(i); XSLTAttributeDef attrDef = def.getAttributeDef(attrUri, attrLocalName); if (null == attrDef) { // Then barf, because this element does not allow this attribute. handler.error(attributes.getQName(i) + "attribute is not allowed on the " + rawName + " element!", null); } else { String valueString = attributes.getValue(i); if (valueString.indexOf(org.apache.xpath.compiler.Keywords.FUNC_KEY_STRING + "(") >= 0) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_KEY_CALL, null), null); processedDefs.add(attrDef); attrDef.setAttrValue(handler, attrUri, attrLocalName, attributes.getQName(i), attributes.getValue(i), target); } } XSLTAttributeDef[] attrDefs = def.getAttributes(); int nAttrDefs = attrDefs.length; for (int i = 0; i < nAttrDefs; i++) { XSLTAttributeDef attrDef = attrDefs[i]; String defVal = attrDef.getDefault(); if (null != defVal) { if (!processedDefs.contains(attrDef)) { attrDef.setDefAttrValue(handler, target); } } if (attrDef.getRequired()) { if (!processedDefs.contains(attrDef)) handler.error( XSLMessages.createMessage( XSLTErrorResources.ER_REQUIRES_ATTRIB, new Object[]{ rawName, attrDef.getName() }), null); } } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (InputSource input) throws org.xml.sax.SAXException, IOException { if(null == getParent()) { XMLReader reader=null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (m_transformer.getStylesheet().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} XMLReader parent; if( reader==null ) parent= XMLReaderFactory.createXMLReader(); else parent=reader; try { parent.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se){} // setParent calls setupParse... setParent(parent); } else { // Make sure everything is set up. setupParse (); } if(null == m_transformer.getContentHandler()) { throw new org.xml.sax.SAXException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CALL_PARSE, null)); //"parse can not be called if the ContentHandler has not been set!"); } getParent().parse(input); Exception e = m_transformer.getExceptionThrown(); if(null != e) { if(e instanceof org.xml.sax.SAXException) throw (org.xml.sax.SAXException)e; else throw new org.xml.sax.SAXException(e); } }
// in src/org/apache/xalan/transformer/TrAXFilter.java
public void parse (String systemId) throws org.xml.sax.SAXException, IOException { parse(new InputSource(systemId)); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { if (m_entityResolver != null) { return m_entityResolver.resolveEntity(publicId, systemId); } else { return null; } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (m_dtdHandler != null) { m_dtdHandler.notationDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (m_dtdHandler != null) { m_dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startDocument() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startDocument"); m_insideParse = true; // Thread listener = new Thread(m_transformer); if (m_contentHandler != null) { //m_transformer.setTransformThread(listener); if(m_incremental) { m_transformer.setSourceTreeDocForThread(m_dtm.getDocument()); int cpriority = Thread.currentThread().getPriority(); // runTransformThread is equivalent with the 2.0.1 code, // except that the Thread may come from a pool. m_transformer.runTransformThread( cpriority ); } // This is now done _last_, because IncrementalSAXSource_Filter // will immediately go into a "wait until events are requested" // pause. I believe that will close our timing window. // %REVIEW% m_contentHandler.startDocument(); } //listener.setDaemon(false); //listener.start(); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endDocument() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endDocument"); m_insideParse = false; if (m_contentHandler != null) { m_contentHandler.endDocument(); } if(m_incremental) { m_transformer.waitTransformThread(); } else { m_transformer.setSourceTreeDocForThread(m_dtm.getDocument()); m_transformer.run(); } /* Thread transformThread = m_transformer.getTransformThread(); if (null != transformThread) { try { // This should wait until the transformThread is considered not alive. transformThread.join(); if (!m_transformer.hasTransformThreadErrorCatcher()) { Exception e = m_transformer.getExceptionThrown(); if (null != e) throw new org.xml.sax.SAXException(e); } m_transformer.setTransformThread(null); } catch (InterruptedException ie){} }*/ }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startPrefixMapping: " + prefix + ", " + uri); if (m_contentHandler != null) { m_contentHandler.startPrefixMapping(prefix, uri); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endPrefixMapping(String prefix) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endPrefixMapping: " + prefix); if (m_contentHandler != null) { m_contentHandler.endPrefixMapping(prefix); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startElement( String uri, String localName, String qName, Attributes atts) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startElement: " + qName); if (m_contentHandler != null) { m_contentHandler.startElement(uri, localName, qName, atts); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endElement: " + qName); if (m_contentHandler != null) { m_contentHandler.endElement(uri, localName, qName); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void characters(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#characters: " + start + ", " + length); if (m_contentHandler != null) { m_contentHandler.characters(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#ignorableWhitespace: " + start + ", " + length); if (m_contentHandler != null) { m_contentHandler.ignorableWhitespace(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void processingInstruction(String target, String data) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#processingInstruction: " + target + ", " + data); if (m_contentHandler != null) { m_contentHandler.processingInstruction(target, data); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void skippedEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#skippedEntity: " + name); if (m_contentHandler != null) { m_contentHandler.skippedEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void warning(SAXParseException e) throws SAXException { // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).warning(e); } else { try { errorListener.warning(new javax.xml.transform.TransformerException(e)); } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void error(SAXParseException e) throws SAXException { // %REVIEW% I don't think this should be called. -sb // clearCoRoutine(e); // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).error(e); if(null != m_errorHandler) m_errorHandler.error(e); // may not be called. } else { try { errorListener.error(new javax.xml.transform.TransformerException(e)); if(null != m_errorHandler) m_errorHandler.error(e); // may not be called. } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void fatalError(SAXParseException e) throws SAXException { if(null != m_errorHandler) { try { m_errorHandler.fatalError(e); } catch(SAXParseException se) { // ignore } // clearCoRoutine(e); } // This is not great, but we really would rather have the error // handler be the error listener if it is a error handler. Coroutine's fatalError // can't really be configured, so I think this is the best thing right now // for error reporting. Possibly another JAXP 1.1 hole. -sb javax.xml.transform.ErrorListener errorListener = m_transformer.getErrorListener(); if(errorListener instanceof ErrorHandler) { ((ErrorHandler)errorListener).fatalError(e); if(null != m_errorHandler) m_errorHandler.fatalError(e); // may not be called. } else { try { errorListener.fatalError(new javax.xml.transform.TransformerException(e)); if(null != m_errorHandler) m_errorHandler.fatalError(e); // may not be called. } catch(javax.xml.transform.TransformerException te) { throw e; } } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startDTD: " + name + ", " + publicId + ", " + systemId); if (null != m_lexicalHandler) { m_lexicalHandler.startDTD(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endDTD() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endDTD"); if (null != m_lexicalHandler) { m_lexicalHandler.endDTD(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startEntity: " + name); if (null != m_lexicalHandler) { m_lexicalHandler.startEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endEntity(String name) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endEntity: " + name); if (null != m_lexicalHandler) { m_lexicalHandler.endEntity(name); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void startCDATA() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#startCDATA"); if (null != m_lexicalHandler) { m_lexicalHandler.startCDATA(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void endCDATA() throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#endCDATA"); if (null != m_lexicalHandler) { m_lexicalHandler.endCDATA(); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void comment(char ch[], int start, int length) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#comment: " + start + ", " + length); if (null != m_lexicalHandler) { m_lexicalHandler.comment(ch, start, length); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void elementDecl(String name, String model) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#elementDecl: " + name + ", " + model); if (null != m_declHandler) { m_declHandler.elementDecl(name, model); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void attributeDecl( String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#attributeDecl: " + eName + ", " + aName + ", etc..."); if (null != m_declHandler) { m_declHandler.attributeDecl(eName, aName, type, valueDefault, value); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void internalEntityDecl(String name, String value) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#internalEntityDecl: " + name + ", " + value); if (null != m_declHandler) { m_declHandler.internalEntityDecl(name, value); } }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
public void externalEntityDecl( String name, String publicId, String systemId) throws SAXException { if (DEBUG) System.out.println("TransformerHandlerImpl#externalEntityDecl: " + name + ", " + publicId + ", " + systemId); if (null != m_declHandler) { m_declHandler.externalEntityDecl(name, publicId, systemId); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
public void traverse(int pos) throws org.xml.sax.SAXException { m_dtm = m_transformer.getXPathContext().getDTM(pos); m_startNode = pos; super.traverse(pos); }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void endNode(int node) throws org.xml.sax.SAXException { super.endNode(node); if(DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { m_transformer.getXPathContext().popCurrentNode(); } }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
protected void startNode(int node) throws org.xml.sax.SAXException { XPathContext xcntxt = m_transformer.getXPathContext(); try { if (DTM.ELEMENT_NODE == m_dtm.getNodeType(node)) { xcntxt.pushCurrentNode(node); if(m_startNode != node) { super.startNode(node); } else { String elemName = m_dtm.getNodeName(node); String localName = m_dtm.getLocalName(node); String namespace = m_dtm.getNamespaceURI(node); //xcntxt.pushCurrentNode(node); // SAX-like call to allow adding attributes afterwards m_handler.startElement(namespace, localName, elemName); boolean hasNSDecls = false; DTM dtm = m_dtm; for (int ns = dtm.getFirstNamespaceNode(node, true); DTM.NULL != ns; ns = dtm.getNextNamespaceNode(node, ns, true)) { SerializerUtils.ensureNamespaceDeclDeclared(m_handler,dtm, ns); } for (int attr = dtm.getFirstAttribute(node); DTM.NULL != attr; attr = dtm.getNextAttribute(attr)) { SerializerUtils.addAttribute(m_handler, attr); } } } else { xcntxt.pushCurrentNode(node); super.startNode(node); xcntxt.popCurrentNode(); } } catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void waitTransformThread() throws SAXException { // This is called to make sure the task is done. // It is possible that the thread has been reused - // but for a different transformation. ( what if we // recycle the transformer ? Not a problem since this is // still in use. ) Thread transformThread = this.getTransformThread(); if (null != transformThread) { try { ThreadControllerWrapper.waitThread(transformThread, this); if (!this.hasTransformThreadErrorCatcher()) { Exception e = this.getExceptionThrown(); if (null != e) { e.printStackTrace(); throw new org.xml.sax.SAXException(e); } } this.setTransformThread(null); } catch (InterruptedException ie){} } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void notationDecl(String name, String publicId, String systemId) throws SAXException { if (null != m_resultDTDHandler) m_resultDTDHandler.notationDecl(name, publicId, systemId); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void unparsedEntityDecl( String name, String publicId, String systemId, String notationName) throws SAXException { if (null != m_resultDTDHandler) m_resultDTDHandler.unparsedEntityDecl(name, publicId, systemId, notationName); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDocument() throws SAXException { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new SAXException(te.getMessage(), te); } // Reset for multiple transforms with this transformer. m_flushedStartDoc = false; m_foundFirstElement = false; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
protected final void flushStartDoc() throws SAXException { if(!m_flushedStartDoc) { if (m_resultContentHandler == null) { try { createResultContentHandler(m_result); } catch(TransformerException te) { throw new SAXException(te); } } m_resultContentHandler.startDocument(); m_flushedStartDoc = true; } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endDocument() throws SAXException { flushStartDoc(); m_resultContentHandler.endDocument(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startPrefixMapping(String prefix, String uri) throws SAXException { flushStartDoc(); m_resultContentHandler.startPrefixMapping(prefix, uri); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endPrefixMapping(String prefix) throws SAXException { flushStartDoc(); m_resultContentHandler.endPrefixMapping(prefix); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (!m_foundFirstElement && null != m_serializer) { m_foundFirstElement = true; Serializer newSerializer; try { newSerializer = SerializerSwitcher.switchSerializerIfHTML(uri, localName, m_outputFormat.getProperties(), m_serializer); } catch (TransformerException te) { throw new SAXException(te); } if (newSerializer != m_serializer) { try { m_resultContentHandler = newSerializer.asContentHandler(); } catch (IOException ioe) // why? { throw new SAXException(ioe); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; m_serializer = newSerializer; } } flushStartDoc(); m_resultContentHandler.startElement(uri, localName, qName, attributes); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endElement(String uri, String localName, String qName) throws SAXException { m_resultContentHandler.endElement(uri, localName, qName); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void characters(char ch[], int start, int length) throws SAXException { flushStartDoc(); m_resultContentHandler.characters(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { m_resultContentHandler.ignorableWhitespace(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void processingInstruction(String target, String data) throws SAXException { flushStartDoc(); m_resultContentHandler.processingInstruction(target, data); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void skippedEntity(String name) throws SAXException { flushStartDoc(); m_resultContentHandler.skippedEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startDTD(String name, String publicId, String systemId) throws SAXException { flushStartDoc(); if (null != m_resultLexicalHandler) m_resultLexicalHandler.startDTD(name, publicId, systemId); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endDTD() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endDTD(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startEntity(String name) throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.startEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endEntity(String name) throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endEntity(name); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void startCDATA() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.startCDATA(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void endCDATA() throws SAXException { if (null != m_resultLexicalHandler) m_resultLexicalHandler.endCDATA(); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void comment(char ch[], int start, int length) throws SAXException { flushStartDoc(); if (null != m_resultLexicalHandler) m_resultLexicalHandler.comment(ch, start, length); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void elementDecl (String name, String model) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.elementDecl(name, model); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void attributeDecl (String eName, String aName, String type, String valueDefault, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.attributeDecl(eName, aName, type, valueDefault, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void internalEntityDecl (String name, String value) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.internalEntityDecl(name, value); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void externalEntityDecl (String name, String publicId, String systemId) throws SAXException { if (null != m_resultDeclHandler) m_resultDeclHandler.externalEntityDecl(name, publicId, systemId); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void outputResultTreeFragment( SerializationHandler handler, XObject obj, XPathContext support) throws org.xml.sax.SAXException { int doc = obj.rtf(); DTM dtm = support.getDTM(doc); if (null != dtm) { for (int n = dtm.getFirstChild(doc); DTM.NULL != n; n = dtm.getNextSibling(n)) { handler.flushPending(); // I think. . . . This used to have a (true) arg // to flush prefixes, will that cause problems ??? if (dtm.getNodeType(n) == DTM.ELEMENT_NODE && dtm.getNamespaceURI(n) == null) handler.startPrefixMapping("", ""); dtm.dispatchToEvents(n, handler); } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void ensureNamespaceDeclDeclared( SerializationHandler handler, DTM dtm, int namespace) throws org.xml.sax.SAXException { String uri = dtm.getNodeValue(namespace); String prefix = dtm.getNodeNameX(namespace); if ((uri != null && uri.length() > 0) && (null != prefix)) { String foundURI; NamespaceMappings ns = handler.getNamespaceMappings(); if (ns != null) { foundURI = ns.lookupNamespace(prefix); if ((null == foundURI) || !foundURI.equals(uri)) { handler.startPrefixMapping(prefix, uri, false); } } } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
protected static void dispatchNodeData( Node node, ContentHandler ch, int depth )throws org.xml.sax.SAXException { switch (node.getNodeType()) { case Node.DOCUMENT_FRAGMENT_NODE : case Node.DOCUMENT_NODE : case Node.ELEMENT_NODE : { for (Node child = node.getFirstChild(); null != child; child = child.getNextSibling()) { dispatchNodeData(child, ch, depth+1); } } break; case Node.PROCESSING_INSTRUCTION_NODE : // %REVIEW% case Node.COMMENT_NODE : if(0 != depth) break; // NOTE: Because this operation works in the DOM space, it does _not_ attempt // to perform Text Coalition. That should only be done in DTM space. case Node.TEXT_NODE : case Node.CDATA_SECTION_NODE : case Node.ATTRIBUTE_NODE : String str = node.getNodeValue(); if(ch instanceof CharacterNodeHandler) { ((CharacterNodeHandler)ch).characters(node); } else { ch.characters(str.toCharArray(), 0, str.length()); } break; // /* case Node.PROCESSING_INSTRUCTION_NODE : // // warning(XPATHErrorResources.WG_PARSING_AND_PREPARING); // break; */ default : // ignore break; } }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dispatchToEvents( int parm1, ContentHandler parm2 )throws org.xml.sax.SAXException { if (DEBUG) { System.out.println( "dispathcToEvents(" + parm1 + "," + parm2 + ")"); } return; }
// in src/org/apache/xalan/lib/sql/DTMDocument.java
public void dispatchCharactersEvents( int nodeHandle, ContentHandler ch, boolean normalize )throws org.xml.sax.SAXException { if (DEBUG) { System.out.println("dispatchCharacterEvents(" + nodeHandle + "," + ch + "," + normalize + ")"); } if(normalize) { XMLString str = getStringValue(nodeHandle); str = str.fixWhiteSpace(true, true, false); str.dispatchCharactersEvents(ch); } else { Node node = getNode(nodeHandle); dispatchNodeData(node, ch, 0); } }
// in src/org/apache/xpath/objects/XObject.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { xstr().dispatchCharactersEvents(ch); }
// in src/org/apache/xpath/objects/XStringForFSB.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { fsb().sendSAXcharacters(ch, m_start, m_length); }
// in src/org/apache/xpath/objects/XStringForFSB.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { fsb().sendSAXComment(lh, m_start, m_length); }
// in src/org/apache/xpath/objects/XString.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { String str = str(); ch.characters(str.toCharArray(), 0, str.length()); }
// in src/org/apache/xpath/objects/XString.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { String str = str(); lh.comment(str.toCharArray(), 0, str.length()); }
// in src/org/apache/xpath/objects/XStringForChars.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { ch.characters((char[])m_obj, m_start, m_length); }
// in src/org/apache/xpath/objects/XStringForChars.java
public void dispatchAsComment(org.xml.sax.ext.LexicalHandler lh) throws org.xml.sax.SAXException { lh.comment((char[])m_obj, m_start, m_length); }
// in src/org/apache/xpath/objects/XNodeSet.java
public void dispatchCharactersEvents(org.xml.sax.ContentHandler ch) throws org.xml.sax.SAXException { int node = item(0); if(node != DTM.NULL) { m_dtmMgr.getDTM(node).dispatchCharactersEvents(node, ch, false); } }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { if(Arg0IsNodesetExpr()) { int node = getArg0AsNode(xctxt); if(DTM.NULL != node) { DTM dtm = xctxt.getDTM(node); dtm.dispatchCharactersEvents(node, handler, true); } } else { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public void executeCharsToContentHandler( XPathContext xctxt, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { LocPathIterator clone = (LocPathIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); clone.setRoot(current, xctxt); int node = clone.nextNode(); DTM dtm = clone.getDTM(node); clone.detach(); if(node != DTM.NULL) { dtm.dispatchCharactersEvents(node, handler, false); } }
// in src/org/apache/xpath/Expression.java
public void executeCharsToContentHandler( XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); obj.detach(); }
84
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/utils/XMLReaderManager.java
catch (SAXException se) { // Try to carry on if we've got a parser that // doesn't know about namespace prefixes. }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch (SAXException ex) { Exception inner=ex.getException(); if(inner instanceof StopException){ // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); } else { // Unexpected malfunction if(DEBUG) { System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); inner.printStackTrace(); } arg=ex; } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch (SAXException ex) { arg = ex; }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(SAXException e) { e.printStackTrace(); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/serializer/ToXMLSAXHandler.java
catch (SAXException e) { // falls through }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (SAXException e) { // falls through }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/ToStream.java
catch (SAXException e) { // TODO Auto-generated catch block e.printStackTrace(); }
// in src/org/apache/xml/serializer/ToStream.java
catch (SAXException se) { // ignore ? }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/NamespaceMappings.java
catch (SAXException e) { // not much we can do if they aren't willing to listen }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { runTimeError(RUN_TIME_COPY_ERR); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { Throwable ex = e.getException(); if (_xsltc.debug()) { e.printStackTrace(); if (ex != null) ex.printStackTrace(); } reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) {}
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXException e) { reportError(ERROR, new ErrorMsg(e.getMessage())); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (SAXException e) { Exception ex = e.getException(); if (_debug) { if (ex != null) ex.printStackTrace(); e.printStackTrace(); } System.err.print(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)); if (ex != null) System.err.println(ex.getMessage()); else System.err.println(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) {}
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { return; }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException e) {}
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (SAXException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (SAXException e) { // Falls through }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException e) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { tException = new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemAttribute.java
catch (SAXException e) { }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/transformer/TrAXFilter.java
catch (org.xml.sax.SAXException se){}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { // We don't care. }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se){}
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (SAXException e) { // do something? }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXException se) {}
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
53
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXException se) { throw new DTMException(se.getMessage(), se); }
// in src/org/apache/xml/serializer/ToUnknownStream.java
catch(SAXException e) { throw new RuntimeException(e.toString()); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
catch (SAXException e) { throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/trax/TrAXFilter.java
catch (SAXException e) { throw new SAXException(e.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
5
unknown (Lib) SAXNotRecognizedException 1
            
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
0 10
            
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
7
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(SAXNotRecognizedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(org.xml.sax.SAXNotRecognizedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXNotRecognizedException e){}
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (SAXNotRecognizedException e){}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXNotRecognizedException snre){}
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXNotRecognizedException e){}
1
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
0
unknown (Lib) SAXNotSupportedException 6
            
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double max(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double maxValue = - Double.MAX_VALUE; for (int i = 0; i < contextNodes.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result > maxValue) maxValue = result; } xctxt.popContextNodeList(); return maxValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double min(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double minValue = Double.MAX_VALUE; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result < minValue) minValue = result; } xctxt.popContextNodeList(); return minValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double sum(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double sum = 0; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); sum = sum + result; } xctxt.popContextNodeList(); return sum; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList map(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; Document lDoc = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); NodeSet resultSet = new NodeSet(); resultSet.setShouldCacheNodes(true); for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!resultSet.contains(n)) resultSet.addNode(n); } } else { if (lDoc == null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); lDoc = db.newDocument(); } Element element = null; if (object instanceof XNumber) element = lDoc.createElementNS(EXSL_URI, "exsl:number"); else if (object instanceof XBoolean) element = lDoc.createElementNS(EXSL_URI, "exsl:boolean"); else element = lDoc.createElementNS(EXSL_URI, "exsl:string"); Text textNode = lDoc.createTextNode(object.str()); element.appendChild(textNode); resultSet.addNode(element); } } catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); return resultSet; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { if (myContext instanceof XPathContext.XPathExpressionContext) { XPathContext xctxt = null; try { xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); return dynamicXPath.execute(xctxt, myContext.getContextNode(), xctxt.getNamespaceContext()); } catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); } } else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate " }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList closure(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSet closureSet = new NodeSet(); closureSet.setShouldCacheNodes(true); NodeList iterationList = nl; do { NodeSet iterationSet = new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt); xctxt.pushContextNodeList(contextNodes); for (int i = 0; i < iterationList.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!iterationSet.contains(n)) iterationSet.addNode(n); } } else { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); iterationList = iterationSet; for (int i = 0; i < iterationList.getLength(); i++) { Node n = iterationList.item(i); if (!closureSet.contains(n)) closureSet.addNode(n); } } while(iterationList.getLength() > 0); return closureSet; }
0 16
            
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2TO.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return false; }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { }
// in src/org/apache/xalan/xsltc/trax/DOM2SAX.java
public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException { return null; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean getFeature(String name) throws SAXNotRecognizedException, SAXNotSupportedException { if ("http://xml.org/trax/features/sax/input".equals(name)) return true; else if ("http://xml.org/trax/features/dom/input".equals(name)) return true; throw new SAXNotRecognizedException(name); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double max(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double maxValue = - Double.MAX_VALUE; for (int i = 0; i < contextNodes.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result > maxValue) maxValue = result; } xctxt.popContextNodeList(); return maxValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double min(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double minValue = Double.MAX_VALUE; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); if (result < minValue) minValue = result; } xctxt.popContextNodeList(); return minValue; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static double sum(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return Double.NaN; NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); double sum = 0; for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); double result = 0; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); result = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()).num(); } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; } xctxt.popCurrentNode(); sum = sum + result; } xctxt.popContextNodeList(); return sum; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList map(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; Document lDoc = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt); xctxt.pushContextNodeList(contextNodes); NodeSet resultSet = new NodeSet(); resultSet.setShouldCacheNodes(true); for (int i = 0; i < nl.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!resultSet.contains(n)) resultSet.addNode(n); } } else { if (lDoc == null) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); lDoc = db.newDocument(); } Element element = null; if (object instanceof XNumber) element = lDoc.createElementNS(EXSL_URI, "exsl:number"); else if (object instanceof XBoolean) element = lDoc.createElementNS(EXSL_URI, "exsl:boolean"); else element = lDoc.createElementNS(EXSL_URI, "exsl:string"); Text textNode = lDoc.createTextNode(object.str()); element.appendChild(textNode); resultSet.addNode(element); } } catch (Exception e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); return resultSet; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { if (myContext instanceof XPathContext.XPathExpressionContext) { XPathContext xctxt = null; try { xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); return dynamicXPath.execute(xctxt, myContext.getContextNode(), xctxt.getNamespaceContext()); } catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); } } else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); //"Invalid context passed to evaluate " }
// in src/org/apache/xalan/lib/ExsltDynamic.java
public static NodeList closure(ExpressionContext myContext, NodeList nl, String expr) throws SAXNotSupportedException { XPathContext xctxt = null; if (myContext instanceof XPathContext.XPathExpressionContext) xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext(); else throw new SAXNotSupportedException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_CONTEXT_PASSED, new Object[]{myContext })); if (expr == null || expr.length() == 0) return new NodeSet(); NodeSet closureSet = new NodeSet(); closureSet.setShouldCacheNodes(true); NodeList iterationList = nl; do { NodeSet iterationSet = new NodeSet(); NodeSetDTM contextNodes = new NodeSetDTM(iterationList, xctxt); xctxt.pushContextNodeList(contextNodes); for (int i = 0; i < iterationList.getLength(); i++) { int contextNode = contextNodes.item(i); xctxt.pushCurrentNode(contextNode); XObject object = null; try { XPath dynamicXPath = new XPath(expr, xctxt.getSAXLocator(), xctxt.getNamespaceContext(), XPath.SELECT); object = dynamicXPath.execute(xctxt, contextNode, xctxt.getNamespaceContext()); if (object instanceof XNodeSet) { NodeList nodelist = null; nodelist = ((XNodeSet)object).nodelist(); for (int k = 0; k < nodelist.getLength(); k++) { Node n = nodelist.item(k); if (!iterationSet.contains(n)) iterationSet.addNode(n); } } else { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } } catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); } xctxt.popCurrentNode(); } xctxt.popContextNodeList(); iterationList = iterationSet; for (int i = 0; i < iterationList.getLength(); i++) { Node n = iterationList.item(i); if (!closureSet.contains(n)) closureSet.addNode(n); } } while(iterationList.getLength() > 0); return closureSet; }
// in src/org/apache/xalan/lib/Extensions.java
public static XObject evaluate(ExpressionContext myContext, String xpathExpr) throws SAXNotSupportedException { return ExsltDynamic.evaluate(myContext, xpathExpr); }
6
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(SAXNotSupportedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
catch(org.xml.sax.SAXNotSupportedException e) { // Nothing we can do about it }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (SAXNotSupportedException e){}
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (SAXNotSupportedException e){}
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
// in src/org/apache/xalan/xslt/Process.java
catch (org.xml.sax.SAXNotSupportedException e){}
1
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
0
unknown (Lib) SAXParseException 1
            
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(Attributes attrs) throws org.xml.sax.SAXParseException { String value = attrs.getValue("xml:space"); if(null == value) { m_spacePreserveStack.push(m_spacePreserveStack.peekOrFalse()); } else if(value.equals("preserve")) { m_spacePreserveStack.push(true); } else if(value.equals("default")) { m_spacePreserveStack.push(false); } else { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_XMLSPACE_VALUE, null), locator)); //"Illegal value for xml:space", locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); } m_spacePreserveStack.push(m_spacePreserveStack.peek()); } }
1
            
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
2
            
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(boolean b) throws org.xml.sax.SAXParseException { m_spacePreserveStack.push(b); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
void pushSpaceHandling(Attributes attrs) throws org.xml.sax.SAXParseException { String value = attrs.getValue("xml:space"); if(null == value) { m_spacePreserveStack.push(m_spacePreserveStack.peekOrFalse()); } else if(value.equals("preserve")) { m_spacePreserveStack.push(true); } else if(value.equals("default")) { m_spacePreserveStack.push(false); } else { SAXSourceLocator locator = getLocator(); ErrorListener handler = m_stylesheetProcessor.getErrorListener(); try { handler.error(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_XMLSPACE_VALUE, null), locator)); //"Illegal value for xml:space", locator)); } catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); } m_spacePreserveStack.push(m_spacePreserveStack.peek()); } }
3
            
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (SAXParseException e){ reportError(ERROR, new ErrorMsg(e.getMessage(),e.getLineNumber())); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(SAXParseException se) { // ignore }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXParseException spe) { fatalError(spe); }
0 0
unknown (Lib) SQLException 3
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public Connection getConnection() throws SQLException { if (jdbcSource == null) { try { findDatasource(); } catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); } } try { if (user != null || pwd != null) { Object arglist[] = { user, pwd }; return (Connection) getConnectionWithArgs.invoke(jdbcSource, arglist); } else { Object arglist[] = {}; return (Connection) getConnection.invoke(jdbcSource, arglist); } } catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
2
            
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); }
15
            
// in src/org/apache/xalan/lib/sql/SQLQueryParser.java
public void registerOutputParameters(CallableStatement cstmt) throws SQLException { // Register output parameters if call. if ( m_IsCallable && m_hasOutput ) { for ( int indx = 0 ; indx < m_Parameters.size() ; indx++ ) { QueryParameter parm = (QueryParameter) m_Parameters.elementAt(indx); if ( parm.isOutput() ) { //System.out.println("chrysalisSQLStatement() Registering output parameter for parm " + indx); cstmt.registerOutParameter(indx + 1, parm.getType()); } } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized Connection getConnection( )throws IllegalArgumentException, SQLException { PooledConnection pcon = null; // We will fill up the pool any time it is less than the // Minimum. THis could be cause by the enableing and disabling // or the pool. // if ( m_pool.size() < m_PoolMinSize ) { initializePool(); } // find a connection not in use for ( int x = 0; x < m_pool.size(); x++ ) { pcon = (PooledConnection) m_pool.elementAt(x); // Check to see if the Connection is in use if ( pcon.inUse() == false ) { // Mark it as in use pcon.setInUse(true); // return the JDBC Connection stored in the // PooledConnection object return pcon.getConnection(); } } // Could not find a free connection, // create and add a new one // Create a new JDBC Connection Connection con = createConnection(); // Create a new PooledConnection, passing it the JDBC // Connection pcon = new PooledConnection(con); // Mark the connection as in use pcon.setInUse(true); // Add the new PooledConnection object to the pool m_pool.addElement(pcon); // return the new Connection return pcon.getConnection(); }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void releaseConnection( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection " + x); } if (! isEnabled()) { con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } } else { // Set it's inuse attribute to false, which // releases it for use pcon.setInUse(false); } break; } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void releaseConnectionOnError( Connection con )throws SQLException { // find the PooledConnection Object for ( int x = 0; x < m_pool.size(); x++ ) { PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // Check for correct Connection if ( pcon.getConnection() == con ) { if (DEBUG) { System.out.println("Releasing Connection On Error" + x); } con.close(); m_pool.removeElementAt(x); if (DEBUG) { System.out.println("-->Inactive Pool, Closing connection"); } break; } } }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
private Connection createConnection( )throws SQLException { Connection con = null; // Create a Connection directly from the Driver that was loaded // with the context class loader. This is to support JDK1.4 con = m_Driver.connect(m_url, m_ConnectionProtocol ); return con; }
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
public synchronized void initializePool( )throws IllegalArgumentException, SQLException { // Check our initial values if ( m_driver == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_DRIVER_NAME_SPECIFIED, null)); // "No Driver Name Specified!"); } if ( m_url == null ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_URL_SPECIFIED, null)); // "No URL Specified!"); } if ( m_PoolMinSize < 1 ) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_POOLSIZE_LESS_THAN_ONE, null)); // "Pool size is less than 1!"); } // Create the Connections // Load the Driver class file try { // We have also had problems with drivers unloading // load an instance that will get freed with the class. m_Driver = (Driver) ObjectFactory.newInstance( m_driver, ObjectFactory.findClassLoader(), true); // Register the Driver that was loaded with the Context Classloader // but we will ask for connections directly from the Driver // instance DriverManager.registerDriver(m_Driver); } catch(ObjectFactory.ConfigurationError e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); // "Invalid Driver Name Specified!"); } catch(Exception e) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_DRIVER_NAME, null)); } // IF we are not active, don't actuall build a pool yet // Just set up the driver and periphal items. if ( !m_IsActive) return; // Create Connections based on the size member do { Connection con = createConnection(); if ( con != null ) { // Create a PooledConnection to encapsulate the // real JDBC Connection PooledConnection pcon = new PooledConnection(con); // Add the Connection the pool. addConnection(pcon); if (DEBUG) System.out.println("Adding DB Connection to the Pool"); } } while (m_pool.size() < m_PoolMinSize); }
// in src/org/apache/xalan/lib/sql/XConnection.java
private void initFromElement( Element e )throws SQLException { Properties prop = new Properties(); String driver = ""; String dbURL = ""; Node n = e.getFirstChild(); if (null == n) return; // really need to throw an error do { String nName = n.getNodeName(); if (nName.equalsIgnoreCase("dbdriver")) { driver = ""; Node n1 = n.getFirstChild(); if (null != n1) { driver = n1.getNodeValue(); } } if (nName.equalsIgnoreCase("dburl")) { dbURL = ""; Node n1 = n.getFirstChild(); if (null != n1) { dbURL = n1.getNodeValue(); } } if (nName.equalsIgnoreCase("password")) { String s = ""; Node n1 = n.getFirstChild(); if (null != n1) { s = n1.getNodeValue(); } prop.put("password", s); } if (nName.equalsIgnoreCase("user")) { String s = ""; Node n1 = n.getFirstChild(); if (null != n1) { s = n1.getNodeValue(); } prop.put("user", s); } if (nName.equalsIgnoreCase("protocol")) { String Name = ""; NamedNodeMap attrs = n.getAttributes(); Node n1 = attrs.getNamedItem("name"); if (null != n1) { String s = ""; Name = n1.getNodeValue(); Node n2 = n.getFirstChild(); if (null != n2) s = n2.getNodeValue(); prop.put(Name, s); } } } while ( (n = n.getNextSibling()) != null); init(driver, dbURL, prop); }
// in src/org/apache/xalan/lib/sql/XConnection.java
private void init( String driver, String dbURL, Properties prop )throws SQLException { Connection con = null; if (DEBUG) System.out.println("XConnection, Connection Init"); String user = prop.getProperty("user"); if (user == null) user = ""; String passwd = prop.getProperty("password"); if (passwd == null) passwd = ""; String poolName = driver + dbURL + user + passwd; ConnectionPool cpool = m_PoolMgr.getPool(poolName); if (cpool == null) { if (DEBUG) { System.out.println("XConnection, Creating Connection"); System.out.println(" Driver :" + driver); System.out.println(" URL :" + dbURL); System.out.println(" user :" + user); System.out.println(" passwd :" + passwd); } DefaultConnectionPool defpool = new DefaultConnectionPool(); if ((DEBUG) && (defpool == null)) System.out.println("Failed to Create a Default Connection Pool"); defpool.setDriver(driver); defpool.setURL(dbURL); defpool.setProtocol(prop); // Only enable pooling in the default pool if we are explicatly // told too. if (m_DefaultPoolingEnabled) defpool.setPoolEnabled(true); m_PoolMgr.registerPool(poolName, defpool); m_ConnectionPool = defpool; } else { m_ConnectionPool = cpool; } m_IsDefaultPool = true; // // Let's test to see if we really can connect // Just remember to give it back after the test. // try { con = m_ConnectionPool.getConnection(); } catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; } finally { if ( con != null ) m_ConnectionPool.releaseConnection(con); } }
// in src/org/apache/xalan/lib/sql/XConnection.java
public void close( )throws SQLException { if (DEBUG) System.out.println("Entering XConnection.close()"); // // This function is included just for Legacy support // If it is really called then we must me using a single // document interface, so close all open documents. while(m_OpenSQLDocuments.size() != 0) { SQLDocument d = (SQLDocument) m_OpenSQLDocuments.elementAt(0); try { // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. d.close(m_IsDefaultPool); } catch (Exception se ) {} m_OpenSQLDocuments.removeElementAt(0); } if ( null != m_Connection ) { m_ConnectionPool.releaseConnection(m_Connection); m_Connection = null; } if (DEBUG) System.out.println("Exiting XConnection.close"); }
// in src/org/apache/xalan/lib/sql/XConnection.java
public void close(ExpressionContext exprContext, Object doc) throws SQLException { if (DEBUG) System.out.println("Entering XConnection.close(" + doc + ")"); SQLDocument sqlDoc = locateSQLDocument(exprContext, doc); if (sqlDoc != null) { // If we are using the Default Connection Pool, then // force the connection pool to flush unused connections. sqlDoc.close(m_IsDefaultPool); m_OpenSQLDocuments.remove(sqlDoc); } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public Connection getConnection() throws SQLException { if (jdbcSource == null) { try { findDatasource(); } catch (NamingException ne) { throw new SQLException( "Could not create jndi context for " + jndiPath + " - " + ne.getLocalizedMessage()); } } try { if (user != null || pwd != null) { Object arglist[] = { user, pwd }; return (Connection) getConnectionWithArgs.invoke(jdbcSource, arglist); } else { Object arglist[] = {}; return (Connection) getConnection.invoke(jdbcSource, arglist); } } catch (Exception e) { throw new SQLException( "Could not create jndi connection for " + jndiPath + " - " + e.getLocalizedMessage()); } }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void releaseConnection(Connection con) throws SQLException { con.close(); }
// in src/org/apache/xalan/lib/sql/JNDIConnectionPool.java
public void releaseConnectionOnError(Connection con) throws SQLException { con.close(); }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
public void execute(XConnection xconn, SQLQueryParser query) throws SQLException { try { m_StreamingMode = "true".equals(xconn.getFeature("streaming")); m_MultipleResults = "true".equals(xconn.getFeature("multiple-results")); m_IsStatementCachingEnabled = "true".equals(xconn.getFeature("cache-statements")); m_XConnection = xconn; m_QueryParser = query; executeSQLStatement(); createExpandedNameTable(); // Start the document here m_DocumentIdx = addElement(0, m_Document_TypeID, DTM.NULL, DTM.NULL); m_SQLIdx = addElement(1, m_SQL_TypeID, m_DocumentIdx, DTM.NULL); if ( ! m_MultipleResults ) extractSQLMetaData(m_ResultSet.getMetaData()); // Only grab the first row, subsequent rows will be // fetched on demand. // We need to do this here so at least on row is set up // to measure when we are actually reading rows. // We won't grab the first record in case the skip function // is applied prior to looking at the first record. // JCG Changed 9/15/04 // addRowToDTMFromResultSet(); } catch(SQLException e) { m_HasErrors = true; throw e; } }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
private void executeSQLStatement() throws SQLException { m_ConnectionPool = m_XConnection.getConnectionPool(); Connection conn = m_ConnectionPool.getConnection(); if (! m_QueryParser.hasParameters() ) { m_Statement = conn.createStatement(); m_ResultSet = m_Statement.executeQuery(m_QueryParser.getSQLQuery()); } else if (m_QueryParser.isCallable()) { CallableStatement cstmt = conn.prepareCall(m_QueryParser.getSQLQuery()); m_QueryParser.registerOutputParameters(cstmt); m_QueryParser.populateStatement(cstmt, m_ExpressionContext); m_Statement = cstmt; if (! cstmt.execute()) throw new SQLException("Error in Callable Statement"); m_ResultSet = m_Statement.getResultSet(); } else { PreparedStatement stmt = conn.prepareStatement(m_QueryParser.getSQLQuery()); m_QueryParser.populateStatement(stmt, m_ExpressionContext); m_Statement = stmt; m_ResultSet = stmt.executeQuery(); } }
9
            
// in src/org/apache/xalan/lib/sql/PooledConnection.java
catch (SQLException sqle) { System.err.println(sqle.getMessage()); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e, exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { setError(e,exprContext); return new XBooleanStatic(false); }
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(SQLException e) { m_HasErrors = true; throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch (SQLException se) {}
2
            
// in src/org/apache/xalan/lib/sql/XConnection.java
catch(SQLException e) { if (con != null) { m_ConnectionPool.releaseConnectionOnError(con); con = null; } throw e; }
// in src/org/apache/xalan/lib/sql/SQLDocument.java
catch(SQLException e) { m_HasErrors = true; throw e; }
0
unknown (Lib) SecurityException 0 0 4
            
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
113
            
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se) {// user.dir not accessible from applet }
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/utils/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (SecurityException se) { return "file:" + localPath; }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (SecurityException se) { return systemId; }
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/utils/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/utils/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/utils/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/utils/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/DTMManager.java
catch (SecurityException ex){}
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/serializer/TreeWalker.java
catch (SecurityException se) {// user.dir not accessible from applet }
// in src/org/apache/xml/serializer/TreeWalker.java
catch (SecurityException se){// user.dir not accessible from applet }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // No-op for sandbox/applet case, leave null -sc }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // No-op for sandbox/applet case, leave null -sc }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (SecurityException se) { return "file:" + localPath; }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (SecurityException se) { return systemId; }
// in src/org/apache/xml/serializer/Encodings.java
catch (SecurityException se) { encoding = DEFAULT_MIME_ENCODING; }
// in src/org/apache/xml/serializer/dom3/DOM3TreeWalker.java
catch (SecurityException se) { // user.dir not accessible from applet }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/runtime/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/dom/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/cmdline/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/trax/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SecurityException se) {}
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se) { // For applet context, etc. h.put( "java.version", "WARNING: SecurityException thrown accessing system version properties"); }
// in src/org/apache/xalan/xslt/EnvironmentCheck.java
catch (SecurityException se2) { // For applet context, etc. h.put( "java.class.path", "WARNING: SecurityException thrown accessing system classpath properties"); }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xslt/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/sql/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/extensions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) { }
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xpath/functions/SecuritySupport.java
catch (SecurityException ex) {}
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (SecurityException se) { // Ignore and continue w/ next location }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (SecurityException e) { // try again... fLastModified = -1; fXalanProperties = null; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch(SecurityException e){ throw e; }
19
            
// in src/org/apache/xml/utils/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xsltc/util/JavaCupRedirect.java
catch (SecurityException e) { System.err.println("No permission to file "+args[i]); throw new RuntimeException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch(SecurityException e){ throw e; }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch(SecurityException e){ throw e; }
2
runtime (Domain) StopException
static class StopException extends RuntimeException
  {
          static final long serialVersionUID = -1129245796185754956L;
  }
1
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
private void co_yield(boolean moreRemains) throws SAXException { // Horrendous kluge to run filter to completion. See below. if(fNoMoreEvents) return; try // Coroutine manager might throw no-such. { Object arg=Boolean.FALSE; if(moreRemains) { // Yield control, resume parsing when done arg = fCoroutineManager.co_resume(Boolean.TRUE, fSourceCoroutineID, fControllerCoroutineID); } // If we're at end of document or were told to stop early if(arg==Boolean.FALSE) { fNoMoreEvents=true; if(fXMLReader!=null) // Running under startParseThread() throw new StopException(); // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager.co_exit_to(Boolean.FALSE, fSourceCoroutineID, fControllerCoroutineID); } } catch(NoSuchMethodException e) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents=true; fCoroutineManager.co_exit(fSourceCoroutineID); throw new SAXException(e); } }
0 0 1
            
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java
catch(StopException ex) { // Expected and harmless if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception"); }
0 0
unknown (Domain) StopParseException
public class StopParseException extends org.xml.sax.SAXException
{
        static final long serialVersionUID = 210102479218258961L;
  /**
   * Constructor StopParseException.
   */
  StopParseException()
  {
    super("Stylesheet PIs found, stop the parse");
  }
}
1
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws org.xml.sax.SAXException { throw new StopParseException(); }
0 0 2
            
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (StopParseException e ) { // startElement encountered so do not parse further }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (StopParseException spe) { // OK, good. }
0 0
unknown (Lib) TargetLostException 0 0 0 7
            
// in src/org/apache/xalan/xsltc/compiler/Stylesheet.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/Mode.java
catch (TargetLostException e) { // TODO: move target down into the list }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException e) { InstructionHandle[] targets = e.getTargets(); // If there were still references to old instructions lingering, // clean those up. The only instructions targetting the deleted // instructions should have been part of the chunk that was just // deleted, except that instructions might branch to the start of // the outlined chunk; similarly, all the live ranges of local // variables should have been adjusted, except for unreferenced // variables. for (int i = 0; i < targets.length; i++) { InstructionHandle lostTarget = targets[i]; InstructionTargeter[] targeters = lostTarget.getTargeters(); for (int j = 0; j < targeters.length; j++) { if (targeters[j] instanceof LocalVariableGen) { LocalVariableGen lvgTargeter = (LocalVariableGen) targeters[j]; // In the case of any lingering variable references, // just make the live range point to the outlined // function reference. Such variables should be unused // anyway. if (lvgTargeter.getStart() == lostTarget) { lvgTargeter.setStart(outlinedMethodRef); } if (lvgTargeter.getEnd() == lostTarget) { lvgTargeter.setEnd(outlinedMethodRef); } } else { targeters[j].updateTarget(lostTarget, outlinedMethodCallSetup); } } } }
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
1
            
// in src/org/apache/xalan/xsltc/compiler/util/MethodGenerator.java
catch (TargetLostException tle) { // This can never happen - we updated the list of // instructions that target the deleted instruction // prior to deleting it. String msg = new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET, tle.getMessage()).toString(); throw new InternalError(msg); }
1
checked (Lib) Throwable 0 0 1
            
// in src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
protected void finalize( )throws Throwable { if (DEBUG) { System.out.println("In Default Connection Pool, Finalize"); } // Iterate over the entire pool closing the // JDBC Connections. for ( int x = 0; x < m_pool.size(); x++ ) { if (DEBUG) { System.out.println("Closing JDBC Connection " + x); } PooledConnection pcon = (PooledConnection) m_pool.elementAt(x); // If the PooledConnection is not in use, close it if ( pcon.inUse() == false ) { pcon.close(); } else { if (DEBUG) { System.out.println("--> Force close"); } // If it still in use, sleep for 30 seconds and // force close. try { java.lang.Thread.sleep(30000); pcon.close(); } catch (InterruptedException ie) { if (DEBUG) System.err.println(ie.getMessage()); } } } if (DEBUG) { System.out.println("Exit Default Connection Pool, Finalize"); } super.finalize(); }
6
            
// in src/org/apache/xml/dtm/DTMException.java
catch (Throwable e) {}
// in src/org/apache/xml/dtm/DTMException.java
catch (Throwable e) { s.println("Could not print stack trace..."); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(Throwable throwable) { throwable.printStackTrace(); }
// in src/org/apache/xalan/xslt/Process.java
catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); }
// in src/org/apache/xalan/lib/Extensions.java
catch (Throwable t) { // Simply return null; no need to report error return null; }
1
            
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
0
unknown (Lib) TransformerConfigurationException 36
            
// in src/org/apache/xalan/xsltc/trax/Util.java
public static InputSource getInputSource(XSLTC xsltc, Source source) throws TransformerConfigurationException { InputSource input = null; String systemId = source.getSystemId(); try { // Try to get InputSource from SAXSource input if (source instanceof SAXSource) { final SAXSource sax = (SAXSource)source; input = sax.getInputSource(); // Pass the SAX parser to the compiler try { XMLReader reader = sax.getXMLReader(); /* * Fix for bug 24695 * According to JAXP 1.2 specification if a SAXSource * is created using a SAX InputSource the Transformer or * TransformerFactory creates a reader via the * XMLReaderFactory if setXMLReader is not used */ if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); } catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } } } reader.setFeature ("http://xml.org/sax/features/namespaces",true); reader.setFeature ("http://xml.org/sax/features/namespace-prefixes",false); xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); } } // handle DOMSource else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource)source; final Document dom = (Document)domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(dom); xsltc.setXMLReader(dom2sax); // Try to get SAX InputSource from DOM Source. input = SAXSource.sourceToInputSource(source); if (input == null){ input = new InputSource(domsrc.getSystemId()); } } // Try to get InputStream or Reader from StreamSource else if (source instanceof StreamSource) { final StreamSource stream = (StreamSource)source; final InputStream istream = stream.getInputStream(); final Reader reader = stream.getReader(); xsltc.setXMLReader(null); // Clear old XML reader // Create InputSource from Reader or InputStream in Source if (istream != null) { input = new InputSource(istream); } else if (reader != null) { input = new InputSource(reader); } else { input = new InputSource(systemId); } } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR); throw new TransformerConfigurationException(err.toString()); } input.setSystemId(systemId); } catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); } catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); } return input; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void defineTransletClasses() throws TransformerConfigurationException { if (_bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR); throw new TransformerConfigurationException(err.toString()); } TransletClassLoader loader = (TransletClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new TransletClassLoader(ObjectFactory.findClassLoader()); } }); try { final int classCount = _bytecodes.length; _class = new Class[classCount]; if (classCount > 1) { _auxClasses = new Hashtable(); } for (int i = 0; i < classCount; i++) { _class[i] = loader.defineClass(_bytecodes[i]); final Class superClass = _class[i].getSuperclass(); // Check if this is the main class if (superClass.getName().equals(ABSTRACT_TRANSLET)) { _transletIndex = i; } else { _auxClasses.put(_class[i].getName(), _class[i]); } } if (_transletIndex < 0) { ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name); throw new TransformerConfigurationException(err.toString()); } } catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private Translet getTransletInstance() throws TransformerConfigurationException { try { if (_name == null) return null; if (_class == null) defineTransletClasses(); // The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance(); translet.postInitialization(); translet.setTemplates(this); if (_auxClasses != null) { translet.setAuxiliaryClasses(_auxClasses); } return translet; } catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseId; XMLReader reader = null; InputSource isource = null; /** * Fix for bugzilla bug 24187 */ StylesheetPIHandler _stylesheetPIHandler = new StylesheetPIHandler(null,media,title,charset); try { if (source instanceof DOMSource ) { final DOMSource domsrc = (DOMSource) source; baseId = domsrc.getSystemId(); final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); _stylesheetPIHandler.setBaseId(baseId); dom2sax.setContentHandler( _stylesheetPIHandler); dom2sax.parse(); } else { isource = SAXSource.sourceToInputSource(source); baseId = isource.getSystemId(); SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); if (reader == null) { reader = XMLReaderFactory.createXMLReader(); } _stylesheetPIHandler.setBaseId(baseId); reader.setContentHandler(_stylesheetPIHandler); reader.parse(isource); } if (_uriResolver != null ) { _stylesheetPIHandler.setURIResolver(_uriResolver); } } catch (StopParseException e ) { // startElement encountered so do not parse further } catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return _stylesheetPIHandler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { // If the _useClasspath attribute is true, try to load the translet from // the CLASSPATH and create a template object using the loaded // translet. if (_useClasspath) { String transletName = getTransletBaseName(source); if (_packageName != null) transletName = _packageName + "." + transletName; try { final Class clazz = ObjectFactory.findProviderClass( transletName, ObjectFactory.findClassLoader(), true); resetTransientAttributes(); return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this); } catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); } catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); } } // If _autoTranslet is true, we will try to load the bytecodes // from the translet classes without compiling the stylesheet. if (_autoTranslet) { byte[][] bytecodes = null; String transletClassName = getTransletBaseName(source); if (_packageName != null) transletClassName = _packageName + "." + transletClassName; if (_jarFileName != null) bytecodes = getBytecodesFromJar(source, transletClassName); else bytecodes = getBytecodesFromClasses(source, transletClassName); if (bytecodes != null) { if (_debug) { if (_jarFileName != null) System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName)); else System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName)); } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this); } } // Create and initialize a stylesheet compiler final XSLTC xsltc = new XSLTC(); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); else xsltc.setTemplateInlining(false); if (_isSecureProcessing) xsltc.setSecureProcessing(true); xsltc.init(); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { xsltc.setSourceLoader(this); } // Pass parameters to the Parser to make sure it locates the correct // <?xml-stylesheet ...?> PI in an XML input document if ((_piParams != null) && (_piParams.get(source) != null)) { // Get the parameters for this Source object PIParamWrapper p = (PIParamWrapper)_piParams.get(source); // Pass them on to the compiler (which will pass then to the parser) if (p != null) { xsltc.setPIParameters(p._media, p._title, p._charset); } } // Set the attributes for translet generation int outputType = XSLTC.BYTEARRAY_OUTPUT; if (_generateTranslet || _autoTranslet) { // Set the translet name xsltc.setClassName(getTransletBaseName(source)); if (_destinationDirectory != null) xsltc.setDestDirectory(_destinationDirectory); else { String xslName = getStylesheetFileName(source); if (xslName != null) { File xslFile = new File(xslName); String xslDir = xslFile.getParent(); if (xslDir != null) xsltc.setDestDirectory(xslDir); } } if (_packageName != null) xsltc.setPackageName(_packageName); if (_jarFileName != null) { xsltc.setJarFileName(_jarFileName); outputType = XSLTC.BYTEARRAY_AND_JAR_OUTPUT; } else outputType = XSLTC.BYTEARRAY_AND_FILE_OUTPUT; } // Compile the stylesheet final InputSource input = Util.getInputSource(xsltc, source); byte[][] bytecodes = xsltc.compile(null, input, outputType); final String transletName = xsltc.getClassName(); // Output to the jar file if the jar file name is set. if ((_generateTranslet || _autoTranslet) && bytecodes != null && _jarFileName != null) { try { xsltc.outputToJar(); } catch (java.io.IOException e) { } } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); // Pass compiler warnings to the error listener if (_errorListener != this) { try { passWarningsToListener(xsltc.getWarnings()); } catch (TransformerException e) { throw new TransformerConfigurationException(e); } } else { xsltc.printWarnings(); } // Check that the transformation went well before returning if (bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); TransformerConfigurationException exc = new TransformerConfigurationException(err.toString()); // Pass compiler errors to the error listener if (_errorListener != null) { passErrorsToListener(xsltc.getErrors()); // As required by TCK 1.2, send a fatalError to the // error listener because compilation of the stylesheet // failed and no further processing will be possible. try { _errorListener.fatalError(exc); } catch (TransformerException te) { // well, we tried. } } else { xsltc.printErrors(); } throw exc; } return new TemplatesImpl(bytecodes, transletName, xsltc.getOutputProperties(), _indentNumber, this); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public javax.xml.transform.Templates processFromNode(Node node) throws TransformerConfigurationException { try { TemplatesHandler builder = newTemplatesHandler(); TreeWalker walker = new TreeWalker(builder, new org.apache.xml.utils.DOM2Helper(), builder.getSystemId()); walker.traverse(node); return builder.getTemplates(); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } } catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; } /* catch (TransformerException tce) { // Assume it's already been reported to the error listener. throw new TransformerConfigurationException(tce.getMessage(), tce); }*/ catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new TrAXFilter(templates); } catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
30
            
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/Util.java
catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
48
            
// in src/org/apache/xalan/xsltc/trax/Util.java
public static InputSource getInputSource(XSLTC xsltc, Source source) throws TransformerConfigurationException { InputSource input = null; String systemId = source.getSystemId(); try { // Try to get InputSource from SAXSource input if (source instanceof SAXSource) { final SAXSource sax = (SAXSource)source; input = sax.getInputSource(); // Pass the SAX parser to the compiler try { XMLReader reader = sax.getXMLReader(); /* * Fix for bug 24695 * According to JAXP 1.2 specification if a SAXSource * is created using a SAX InputSource the Transformer or * TransformerFactory creates a reader via the * XMLReaderFactory if setXMLReader is not used */ if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); } catch (Exception e ) { try { //Incase there is an exception thrown // resort to JAXP SAXParserFactory parserFactory = SAXParserFactory.newInstance(); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { try { parserFactory.setFeature( XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } reader = parserFactory.newSAXParser() .getXMLReader(); } catch (ParserConfigurationException pce ) { throw new TransformerConfigurationException ("ParserConfigurationException" ,pce); } } } reader.setFeature ("http://xml.org/sax/features/namespaces",true); reader.setFeature ("http://xml.org/sax/features/namespace-prefixes",false); xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException ("SAXNotRecognizedException ",snre); }catch (SAXNotSupportedException snse ) { throw new TransformerConfigurationException ("SAXNotSupportedException ",snse); }catch (SAXException se ) { throw new TransformerConfigurationException ("SAXException ",se); } } // handle DOMSource else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource)source; final Document dom = (Document)domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(dom); xsltc.setXMLReader(dom2sax); // Try to get SAX InputSource from DOM Source. input = SAXSource.sourceToInputSource(source); if (input == null){ input = new InputSource(domsrc.getSystemId()); } } // Try to get InputStream or Reader from StreamSource else if (source instanceof StreamSource) { final StreamSource stream = (StreamSource)source; final InputStream istream = stream.getInputStream(); final Reader reader = stream.getReader(); xsltc.setXMLReader(null); // Clear old XML reader // Create InputSource from Reader or InputStream in Source if (istream != null) { input = new InputSource(istream); } else if (reader != null) { input = new InputSource(reader); } else { input = new InputSource(systemId); } } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_SOURCE_ERR); throw new TransformerConfigurationException(err.toString()); } input.setSystemId(systemId); } catch (NullPointerException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR, "TransformerFactory.newTemplates()"); throw new TransformerConfigurationException(err.toString()); } catch (SecurityException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.FILE_ACCESS_ERR, systemId); throw new TransformerConfigurationException(err.toString()); } return input; }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private void defineTransletClasses() throws TransformerConfigurationException { if (_bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.NO_TRANSLET_CLASS_ERR); throw new TransformerConfigurationException(err.toString()); } TransletClassLoader loader = (TransletClassLoader) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new TransletClassLoader(ObjectFactory.findClassLoader()); } }); try { final int classCount = _bytecodes.length; _class = new Class[classCount]; if (classCount > 1) { _auxClasses = new Hashtable(); } for (int i = 0; i < classCount; i++) { _class[i] = loader.defineClass(_bytecodes[i]); final Class superClass = _class[i].getSuperclass(); // Check if this is the main class if (superClass.getName().equals(ABSTRACT_TRANSLET)) { _transletIndex = i; } else { _auxClasses.put(_class[i].getName(), _class[i]); } } if (_transletIndex < 0) { ErrorMsg err= new ErrorMsg(ErrorMsg.NO_MAIN_TRANSLET_ERR, _name); throw new TransformerConfigurationException(err.toString()); } } catch (ClassFormatError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_CLASS_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (LinkageError e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
private Translet getTransletInstance() throws TransformerConfigurationException { try { if (_name == null) return null; if (_class == null) defineTransletClasses(); // The translet needs to keep a reference to all its auxiliary // class to prevent the GC from collecting them AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance(); translet.postInitialization(); translet.setTemplates(this); if (_auxClasses != null) { translet.setAuxiliaryClasses(_auxClasses); } return translet; } catch (InstantiationException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } catch (IllegalAccessException e) { ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
public synchronized Transformer newTransformer() throws TransformerConfigurationException { TransformerImpl transformer; transformer = new TransformerImpl(getTransletInstance(), _outputProperties, _indentNumber, _tfactory); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } if (_tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) { transformer.setSecureProcessing(true); } return transformer; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { _isSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseId; XMLReader reader = null; InputSource isource = null; /** * Fix for bugzilla bug 24187 */ StylesheetPIHandler _stylesheetPIHandler = new StylesheetPIHandler(null,media,title,charset); try { if (source instanceof DOMSource ) { final DOMSource domsrc = (DOMSource) source; baseId = domsrc.getSystemId(); final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); _stylesheetPIHandler.setBaseId(baseId); dom2sax.setContentHandler( _stylesheetPIHandler); dom2sax.parse(); } else { isource = SAXSource.sourceToInputSource(source); baseId = isource.getSystemId(); SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); if (reader == null) { reader = XMLReaderFactory.createXMLReader(); } _stylesheetPIHandler.setBaseId(baseId); reader.setContentHandler(_stylesheetPIHandler); reader.parse(isource); } if (_uriResolver != null ) { _stylesheetPIHandler.setURIResolver(_uriResolver); } } catch (StopParseException e ) { // startElement encountered so do not parse further } catch (javax.xml.parsers.ParserConfigurationException e) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", e); } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe ) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return _stylesheetPIHandler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { TransformerImpl result = new TransformerImpl(new Properties(), _indentNumber, this); if (_uriResolver != null) { result.setURIResolver(_uriResolver); } if (_isSecureProcessing) { result.setSecureProcessing(true); } return result; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { final Templates templates = newTemplates(source); final Transformer transformer = templates.newTransformer(); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return(transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { // If the _useClasspath attribute is true, try to load the translet from // the CLASSPATH and create a template object using the loaded // translet. if (_useClasspath) { String transletName = getTransletBaseName(source); if (_packageName != null) transletName = _packageName + "." + transletName; try { final Class clazz = ObjectFactory.findProviderClass( transletName, ObjectFactory.findClassLoader(), true); resetTransientAttributes(); return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this); } catch (ClassNotFoundException cnfe) { ErrorMsg err = new ErrorMsg(ErrorMsg.CLASS_NOT_FOUND_ERR, transletName); throw new TransformerConfigurationException(err.toString()); } catch (Exception e) { ErrorMsg err = new ErrorMsg( new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY) + e.getMessage()); throw new TransformerConfigurationException(err.toString()); } } // If _autoTranslet is true, we will try to load the bytecodes // from the translet classes without compiling the stylesheet. if (_autoTranslet) { byte[][] bytecodes = null; String transletClassName = getTransletBaseName(source); if (_packageName != null) transletClassName = _packageName + "." + transletClassName; if (_jarFileName != null) bytecodes = getBytecodesFromJar(source, transletClassName); else bytecodes = getBytecodesFromClasses(source, transletClassName); if (bytecodes != null) { if (_debug) { if (_jarFileName != null) System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_JAR_STR, transletClassName, _jarFileName)); else System.err.println(new ErrorMsg( ErrorMsg.TRANSFORM_WITH_TRANSLET_STR, transletClassName)); } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); return new TemplatesImpl(bytecodes, transletClassName, null, _indentNumber, this); } } // Create and initialize a stylesheet compiler final XSLTC xsltc = new XSLTC(); if (_debug) xsltc.setDebug(true); if (_enableInlining) xsltc.setTemplateInlining(true); else xsltc.setTemplateInlining(false); if (_isSecureProcessing) xsltc.setSecureProcessing(true); xsltc.init(); // Set a document loader (for xsl:include/import) if defined if (_uriResolver != null) { xsltc.setSourceLoader(this); } // Pass parameters to the Parser to make sure it locates the correct // <?xml-stylesheet ...?> PI in an XML input document if ((_piParams != null) && (_piParams.get(source) != null)) { // Get the parameters for this Source object PIParamWrapper p = (PIParamWrapper)_piParams.get(source); // Pass them on to the compiler (which will pass then to the parser) if (p != null) { xsltc.setPIParameters(p._media, p._title, p._charset); } } // Set the attributes for translet generation int outputType = XSLTC.BYTEARRAY_OUTPUT; if (_generateTranslet || _autoTranslet) { // Set the translet name xsltc.setClassName(getTransletBaseName(source)); if (_destinationDirectory != null) xsltc.setDestDirectory(_destinationDirectory); else { String xslName = getStylesheetFileName(source); if (xslName != null) { File xslFile = new File(xslName); String xslDir = xslFile.getParent(); if (xslDir != null) xsltc.setDestDirectory(xslDir); } } if (_packageName != null) xsltc.setPackageName(_packageName); if (_jarFileName != null) { xsltc.setJarFileName(_jarFileName); outputType = XSLTC.BYTEARRAY_AND_JAR_OUTPUT; } else outputType = XSLTC.BYTEARRAY_AND_FILE_OUTPUT; } // Compile the stylesheet final InputSource input = Util.getInputSource(xsltc, source); byte[][] bytecodes = xsltc.compile(null, input, outputType); final String transletName = xsltc.getClassName(); // Output to the jar file if the jar file name is set. if ((_generateTranslet || _autoTranslet) && bytecodes != null && _jarFileName != null) { try { xsltc.outputToJar(); } catch (java.io.IOException e) { } } // Reset the per-session attributes to their default values // after each newTemplates() call. resetTransientAttributes(); // Pass compiler warnings to the error listener if (_errorListener != this) { try { passWarningsToListener(xsltc.getWarnings()); } catch (TransformerException e) { throw new TransformerConfigurationException(e); } } else { xsltc.printWarnings(); } // Check that the transformation went well before returning if (bytecodes == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR); TransformerConfigurationException exc = new TransformerConfigurationException(err.toString()); // Pass compiler errors to the error listener if (_errorListener != null) { passErrorsToListener(xsltc.getErrors()); // As required by TCK 1.2, send a fatalError to the // error listener because compilation of the stylesheet // failed and no further processing will be possible. try { _errorListener.fatalError(exc); } catch (TransformerException te) { // well, we tried. } } else { xsltc.printErrors(); } throw exc; } return new TemplatesImpl(bytecodes, transletName, xsltc.getOutputProperties(), _indentNumber, this); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { final TemplatesHandlerImpl handler = new TemplatesHandlerImpl(_indentNumber, this); if (_uriResolver != null) { handler.setURIResolver(_uriResolver); } return handler; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { final Transformer transformer = newTransformer(); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { final Transformer transformer = newTransformer(src); if (_uriResolver != null) { transformer.setURIResolver(_uriResolver); } return new TransformerHandlerImpl((TransformerImpl) transformer); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { final Transformer transformer = templates.newTransformer(); final TransformerImpl internal = (TransformerImpl)transformer; return new TransformerHandlerImpl(internal); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if (templates == null) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new org.apache.xalan.xsltc.trax.TrAXFilter(templates); } catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_SET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // secure processing? else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); throw new TransformerConfigurationException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Source getAssociatedStylesheet(Source source, String media, String title, String charset) throws TransformerConfigurationException { if (_currFactory == null) { createXSLTCTransformerFactory(); } return _currFactory.getAssociatedStylesheet(source, media, title, charset); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } _currFactory = _xalanFactory; return _currFactory.newTransformer(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } _currFactory = _xalanFactory; return _currFactory.newTransformer(source); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } _currFactory = _xsltcFactory; return _currFactory.newTemplates(source); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } return _xsltcFactory.newTemplatesHandler(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } return _xalanFactory.newTransformerHandler(); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { if (_xalanFactory == null) { createXalanTransformerFactory(); } if (_errorlistener != null) { _xalanFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xalanFactory.setURIResolver(_uriresolver); } return _xalanFactory.newTransformerHandler(src); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } return _xsltcFactory.newTransformerHandler(templates); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } if (_errorlistener != null) { _xsltcFactory.setErrorListener(_errorlistener); } if (_uriresolver != null) { _xsltcFactory.setURIResolver(_uriresolver); } Templates templates = _xsltcFactory.newTemplates(src); if (templates == null ) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new org.apache.xalan.xsltc.trax.TrAXFilter(templates); } catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
protected Stylesheet getStylesheetRoot(StylesheetHandler handler) throws TransformerConfigurationException { StylesheetRoot stylesheet; stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener()); if (handler.getStylesheetProcessor().isSecureProcessing()) stylesheet.setSecureProcessing(true); return stylesheet; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public javax.xml.transform.Templates processFromNode(Node node) throws TransformerConfigurationException { try { TemplatesHandler builder = newTemplatesHandler(); TreeWalker walker = new TreeWalker(builder, new org.apache.xml.utils.DOM2Helper(), builder.getSystemId()); walker.traverse(node); return builder.getTemplates(); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } } catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; } /* catch (TransformerException tce) { // Assume it's already been reported to the error listener. throw new TransformerConfigurationException(tce.getMessage(), tce); }*/ catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
javax.xml.transform.Templates processFromNode(Node node, String systemID) throws TransformerConfigurationException { m_DOMsystemID = systemID; return processFromNode(node); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Source getAssociatedStylesheet( Source source, String media, String title, String charset) throws TransformerConfigurationException { String baseID; InputSource isource = null; Node node = null; XMLReader reader = null; if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; node = dsource.getNode(); baseID = dsource.getSystemId(); } else { isource = SAXSource.sourceToInputSource(source); baseID = isource.getSystemId(); } // What I try to do here is parse until the first startElement // is found, then throw a special exception in order to terminate // the parse. StylesheetPIHandler handler = new StylesheetPIHandler(baseID, media, title, charset); // Use URIResolver. Patch from Dmitri Ilyin if (m_uriResolver != null) { handler.setURIResolver(m_uriResolver); } try { if (null != node) { TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), baseID); walker.traverse(node); } else { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException e) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } // Need to set options! reader.setContentHandler(handler); reader.parse(isource); } } catch (StopParseException spe) { // OK, good. } catch (org.xml.sax.SAXException se) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", se); } catch (IOException ioe) { throw new TransformerConfigurationException( "getAssociatedStylesheets failed", ioe); } return handler.getAssociatedStylesheet(); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TemplatesHandler newTemplatesHandler() throws TransformerConfigurationException { return new StylesheetHandler(this); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public void setFeature(String name, boolean value) throws TransformerConfigurationException { // feature name cannot be null if (name == null) { throw new NullPointerException( XSLMessages.createMessage( XSLTErrorResources.ER_SET_FEATURE_NULL_NAME, null)); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { m_isSecureProcessing = value; } // This implementation does not support the setting of a feature other than // the secure processing feature. else { throw new TransformerConfigurationException( XSLMessages.createMessage( XSLTErrorResources.ER_UNSUPPORTED_FEATURE, new Object[] {name})); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newXMLFilter(templates); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public XMLFilter newXMLFilter(Templates templates) throws TransformerConfigurationException { try { return new TrAXFilter(templates); } catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Source src) throws TransformerConfigurationException { Templates templates = newTemplates(src); if( templates==null ) return null; return newTransformerHandler(templates); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler(Templates templates) throws TransformerConfigurationException { try { TransformerImpl transformer = (TransformerImpl) templates.newTransformer(); transformer.setURIResolver(m_uriResolver); TransformerHandler th = (TransformerHandler) transformer.getInputContentHandler(true); return th; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public TransformerHandler newTransformerHandler() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer(Source source) throws TransformerConfigurationException { try { Templates tmpl=newTemplates( source ); /* this can happen if an ErrorListener is present and it doesn't throw any exception in fatalError. The spec says: "a Transformer must use this interface instead of throwing an exception" - the newTemplates() does that, and returns null. */ if( tmpl==null ) return null; Transformer transformer = tmpl.newTransformer(); transformer.setURIResolver(m_uriResolver); return transformer; } catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Transformer newTransformer() throws TransformerConfigurationException { return new TransformerIdentityImpl(m_isSecureProcessing); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
public Templates newTemplates(Source source) throws TransformerConfigurationException { String baseID = source.getSystemId(); if (null != baseID) { baseID = SystemIDResolver.getAbsoluteURI(baseID); } if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; Node node = dsource.getNode(); if (null != node) return processFromNode(node, baseID); else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } TemplatesHandler builder = newTemplatesHandler(); builder.setSystemId(baseID); try { InputSource isource = SAXSource.sourceToInputSource(source); isource.setSystemId(baseID); XMLReader reader = null; if (source instanceof SAXSource) reader = ((SAXSource) source).getXMLReader(); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (m_isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); // If you set the namespaces to true, we'll end up getting double // xmlns attributes. Needs to be fixed. -sb // reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); reader.setContentHandler(builder); reader.parse(isource); } catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } } catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } } return builder.getTemplates(); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
protected Stylesheet getStylesheetRoot(StylesheetHandler handler) throws TransformerConfigurationException { StylesheetRoot stylesheet; stylesheet = new StylesheetRoot(handler.getSchema(), handler.getStylesheetProcessor().getErrorListener()); if (handler.getStylesheetProcessor().isSecureProcessing()) stylesheet.setSecureProcessing(true); return stylesheet; }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
20
            
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
catch (TransformerConfigurationException e) { return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerConfigurationException e) {}
19
            
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException tce) { // Assume it's already been reported to the error listener. throw tce; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex) { throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex1 ) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerConfigurationException ex1) { throw ex1; }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
1
unknown (Lib) TransformerException 135
            
// in src/org/apache/xml/utils/DOM2Helper.java
public void parse(InputSource source) throws TransformerException { try { // I guess I should use JAXP factory here... when it's legal. // org.apache.xerces.parsers.DOMParser parser // = new org.apache.xerces.parsers.DOMParser(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); builderFactory.setValidating(true); DocumentBuilder parser = builderFactory.newDocumentBuilder(); /* // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true); if(m_useDOM2getNamespaceURI) { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true); parser.setFeature("http://xml.org/sax/features/namespaces", true); } else { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); } parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true); */ parser.setErrorHandler( new org.apache.xml.utils.DefaultErrorHandler()); // if(null != m_entityResolver) // { // System.out.println("Setting the entity resolver."); // parser.setEntityResolver(m_entityResolver); // } setDocument(parser.parse(source)); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } catch (IOException ioe) { throw new TransformerException(ioe); } // setDocument(((org.apache.xerces.parsers.DOMParser)parser).getDocument()); }
// in src/org/apache/xml/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void transform(Source source, Result result) throws TransformerException { if (!_isIdentity) { if (_translet == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR); throw new TransformerException(err.toString()); } // Pass output properties to the translet transferOutputProperties(_translet); } final SerializationHandler toHandler = getOutputHandler(result); if (toHandler == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR); throw new TransformerException(err.toString()); } if (_uriResolver != null && !_isIdentity) { _translet.setDOMCache(this); } // Pass output properties to handler if identity if (_isIdentity) { transferOutputProperties(toHandler); } transform(source, toHandler, _encoding); if (result instanceof DOMResult) { ((DOMResult)result).setNode(_tohFactory.getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public SerializationHandler getOutputHandler(Result result) throws TransformerException { // Get output method using get() to ignore defaults _method = (String) _properties.get(OutputKeys.METHOD); // Get encoding using getProperty() to use defaults _encoding = (String) _properties.getProperty(OutputKeys.ENCODING); _tohFactory = TransletOutputHandlerFactory.newInstance(); _tohFactory.setEncoding(_encoding); if (_method != null) { _tohFactory.setOutputMethod(_method); } // Set indentation number in the factory if (_indentNumber >= 0) { _tohFactory.setIndentNumber(_indentNumber); } // Return the content handler for this Result object try { // Result object could be SAXResult, DOMResult, or StreamResult if (result instanceof SAXResult) { final SAXResult target = (SAXResult)result; final ContentHandler handler = target.getHandler(); _tohFactory.setHandler(handler); /** * Fix for bug 24414 * If the lexicalHandler is set then we need to get that * for obtaining the lexical information */ LexicalHandler lexicalHandler = target.getLexicalHandler(); if (lexicalHandler != null ) { _tohFactory.setLexicalHandler(lexicalHandler); } _tohFactory.setOutputType(TransletOutputHandlerFactory.SAX); return _tohFactory.getSerializationHandler(); } else if (result instanceof DOMResult) { _tohFactory.setNode(((DOMResult) result).getNode()); _tohFactory.setNextSibling(((DOMResult) result).getNextSibling()); _tohFactory.setOutputType(TransletOutputHandlerFactory.DOM); return _tohFactory.getSerializationHandler(); } else if (result instanceof StreamResult) { // Get StreamResult final StreamResult target = (StreamResult) result; // StreamResult may have been created with a java.io.File, // java.io.Writer, java.io.OutputStream or just a String // systemId. _tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM); // try to get a Writer from Result object final Writer writer = target.getWriter(); if (writer != null) { _tohFactory.setWriter(writer); return _tohFactory.getSerializationHandler(); } // or try to get an OutputStream from Result object final OutputStream ostream = target.getOutputStream(); if (ostream != null) { _tohFactory.setOutputStream(ostream); return _tohFactory.getSerializationHandler(); } // or try to get just a systemId string from Result object String systemId = result.getSystemId(); if (systemId == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR); throw new TransformerException(err.toString()); } // System Id may be in one of several forms, (1) a uri // that starts with 'file:', (2) uri that starts with 'http:' // or (3) just a filename on the local system. URL url = null; if (systemId.startsWith("file:")) { url = new URL(systemId); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } else if (systemId.startsWith("http:")) { url = new URL(systemId); final URLConnection connection = url.openConnection(); _tohFactory.setOutputStream(_ostream = connection.getOutputStream()); return _tohFactory.getSerializationHandler(); } else { // system id is just a filename url = new File(systemId).toURL(); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } } } // If we cannot write to the location specified by the SystemId catch (UnknownServiceException e) { throw new TransformerException(e); } catch (ParserConfigurationException e) { throw new TransformerException(e); } // If we cannot create the file specified by the SystemId catch (IOException e) { throw new TransformerException(e); } return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private DOM getDOM(Source source) throws TransformerException { try { DOM dom = null; if (source != null) { DTMWSFilter wsfilter; if (_translet != null && _translet instanceof StripFilter) { wsfilter = new DOMWSFilter(_translet); } else { wsfilter = null; } boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; if (_dtmManager == null) { _dtmManager = (XSLTCDTMManager)_tfactory.getDTMManagerClass() .newInstance(); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, false, false, 0, hasIdCall); } else if (_dom != null) { dom = _dom; _dom = null; // use only once, so reset to 'null' } else { return null; } if (!_isIdentity) { // Give the translet the opportunity to make a prepass of // the document, in case it can extract useful information early _translet.prepassDocument(dom); } return dom; } catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transformIdentity(Source source, SerializationHandler handler) throws Exception { // Get systemId from source if (source != null) { _sourceSystemId = source.getSystemId(); } if (source instanceof StreamSource) { final StreamSource stream = (StreamSource) source; final InputStream streamInput = stream.getInputStream(); final Reader streamReader = stream.getReader(); final XMLReader reader = _readerManager.getXMLReader(); try { // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Create input source from source InputSource input; if (streamInput != null) { input = new InputSource(streamInput); input.setSystemId(_sourceSystemId); } else if (streamReader != null) { input = new InputSource(streamReader); input.setSystemId(_sourceSystemId); } else if (_sourceSystemId != null) { input = new InputSource(_sourceSystemId); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } // Start pushing SAX events reader.parse(input); } finally { _readerManager.releaseXMLReader(reader); } } else if (source instanceof SAXSource) { final SAXSource sax = (SAXSource) source; XMLReader reader = sax.getXMLReader(); final InputSource input = sax.getInputSource(); boolean userReader = true; try { // Create a reader if not set by user if (reader == null) { reader = _readerManager.getXMLReader(); userReader = false; } // Hook up reader and output handler try { reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler); } catch (SAXException e) { // Falls through } reader.setContentHandler(handler); // Start pushing SAX events reader.parse(input); } finally { if (!userReader) { _readerManager.releaseXMLReader(reader); } } } else if (source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; new DOM2TO(domsrc.getNode(), handler).parse(); } else if (source instanceof XSLTCSource) { final DOM dom = ((XSLTCSource) source).getDOM(null, _translet); ((SAXImpl)dom).copy(handler); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR); throw new TransformerException(err.toString()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transform(Source source, SerializationHandler handler, String encoding) throws TransformerException { try { /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 * situations, since there is no clear spec. how to create * an empty tree when both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new if (systemID != null) { source.setSystemId(systemID); } } if (_isIdentity) { transformIdentity(source, handler); } else { _translet.transform(getDOM(source), handler); } } catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } finally { _dtmManager = null; } // If we create an output stream for the Result, we need to close it after the transformation. if (_ostream != null) { try { _ostream.close(); } catch (IOException e) {} _ostream = null; } }
// in src/org/apache/xalan/processor/ProcessorLRE.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { try { ElemTemplateElement p = handler.getElemTemplateElement(); boolean excludeXSLDecl = false; boolean isLREAsStyleSheet = false; if (null == p) { // Literal Result Template as stylesheet. XSLTElementProcessor lreProcessor = handler.popProcessor(); XSLTElementProcessor stylesheetProcessor = handler.getProcessorFor(Constants.S_XSLNAMESPACEURL, "stylesheet", "xsl:stylesheet"); handler.pushProcessor(lreProcessor); Stylesheet stylesheet; try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } // stylesheet.setDOMBackPointer(handler.getOriginatingNode()); // ***** Note that we're assigning an empty locator. Is this necessary? SAXSourceLocator slocator = new SAXSourceLocator(); Locator locator = handler.getLocator(); if(null != locator) { slocator.setLineNumber(locator.getLineNumber()); slocator.setColumnNumber(locator.getColumnNumber()); slocator.setPublicId(locator.getPublicId()); slocator.setSystemId(locator.getSystemId()); } stylesheet.setLocaterInfo(slocator); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); isLREAsStyleSheet = true; AttributesImpl stylesheetAttrs = new AttributesImpl(); AttributesImpl lreAttrs = new AttributesImpl(); int n = attributes.getLength(); for (int i = 0; i < n; i++) { String attrLocalName = attributes.getLocalName(i); String attrUri = attributes.getURI(i); String value = attributes.getValue(i); if ((null != attrUri) && attrUri.equals(Constants.S_XSLNAMESPACEURL)) { stylesheetAttrs.addAttribute(null, attrLocalName, attrLocalName, attributes.getType(i), attributes.getValue(i)); } else if ((attrLocalName.startsWith("xmlns:") || attrLocalName.equals( "xmlns")) && value.equals(Constants.S_XSLNAMESPACEURL)) { // ignore } else { lreAttrs.addAttribute(attrUri, attrLocalName, attributes.getQName(i), attributes.getType(i), attributes.getValue(i)); } } attributes = lreAttrs; // Set properties from the attributes, but don't throw // an error if there is an attribute defined that is not // allowed on a stylesheet. try{ stylesheetProcessor.setPropertiesFromAttributes(handler, "stylesheet", stylesheetAttrs, stylesheet); } catch (Exception e) { // This is pretty ugly, but it will have to do for now. // This is just trying to append some text specifying that // this error came from a missing or invalid XSLT namespace // declaration. // If someone comes up with a better solution, please feel // free to contribute it. -mm if (stylesheet.getDeclaredPrefixes() == null || !declaredXSLNS(stylesheet)) { throw new org.xml.sax.SAXException(XSLMessages.createWarning(XSLTErrorResources.WG_OLD_XSLT_NS, null)); } else { throw new org.xml.sax.SAXException(e); } } handler.pushElemTemplateElement(stylesheet); ElemTemplate template = new ElemTemplate(); if (slocator != null) template.setLocaterInfo(slocator); appendAndPush(handler, template); XPath rootMatch = new XPath("/", stylesheet, stylesheet, XPath.MATCH, handler.getStylesheetProcessor().getErrorListener()); template.setMatch(rootMatch); // template.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setTemplate(template); p = handler.getElemTemplateElement(); excludeXSLDecl = true; } XSLTElementDef def = getElemDef(); Class classObject = def.getClassObject(); boolean isExtension = false; boolean isComponentDecl = false; boolean isUnknownTopLevel = false; while (null != p) { // System.out.println("Checking: "+p); if (p instanceof ElemLiteralResult) { ElemLiteralResult parentElem = (ElemLiteralResult) p; isExtension = parentElem.containsExtensionElementURI(uri); } else if (p instanceof Stylesheet) { Stylesheet parentElem = (Stylesheet) p; isExtension = parentElem.containsExtensionElementURI(uri); if ((false == isExtension) && (null != uri) && (uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL) || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))) { isComponentDecl = true; } else { isUnknownTopLevel = true; } } if (isExtension) break; p = p.getParentElem(); } ElemTemplateElement elem = null; try { if (isExtension) { // System.out.println("Creating extension(1): "+uri); elem = new ElemExtensionCall(); } else if (isComponentDecl) { elem = (ElemTemplateElement) classObject.newInstance(); } else if (isUnknownTopLevel) { // TBD: Investigate, not sure about this. -sb elem = (ElemTemplateElement) classObject.newInstance(); } else { elem = (ElemTemplateElement) classObject.newInstance(); } elem.setDOMBackPointer(handler.getOriginatingNode()); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport(), excludeXSLDecl); if (elem instanceof ElemLiteralResult) { ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); ((ElemLiteralResult) elem).setIsLiteralResultAsStylesheet( isLREAsStyleSheet); } } catch (InstantiationException ie) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, ie);//"Failed creating ElemLiteralResult instance!", ie); } catch (IllegalAccessException iae) { handler.error(XSLTErrorResources.ER_FAILED_CREATING_ELEMLITRSLT, null, iae);//"Failed creating ElemLiteralResult instance!", iae); } setPropertiesFromAttributes(handler, rawName, attributes, elem); // bit of a hack here... if (!isExtension && (elem instanceof ElemLiteralResult)) { isExtension = ((ElemLiteralResult) elem).containsExtensionElementURI(uri); if (isExtension) { // System.out.println("Creating extension(2): "+uri); elem = new ElemExtensionCall(); elem.setLocaterInfo(handler.getLocator()); elem.setPrefixes(handler.getNamespaceSupport()); ((ElemLiteralResult) elem).setNamespace(uri); ((ElemLiteralResult) elem).setLocalName(localName); ((ElemLiteralResult) elem).setRawName(rawName); setPropertiesFromAttributes(handler, rawName, attributes, elem); } } appendAndPush(handler, elem); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
protected void parse( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); try { Source source = null; // The base identifier, an aboslute URI // that is associated with the included/imported // stylesheet module is known in this method, // so this method does the pushing of the // base ID onto the stack. if (null != uriresolver) { // There is a user provided URI resolver. // At the startElement() call we would // have tried to obtain a Source from it // which we now retrieve source = handler.peekSourceFromURIResolver(); if (null != source && source instanceof DOMSource) { Node node = ((DOMSource)source).getNode(); // There is a user provided URI resolver. // At the startElement() call we would // have already pushed the system ID, obtained // from either the source.getSystemId(), if non-null // or from SystemIDResolver.getAbsoluteURI() as a backup // which we now retrieve. String systemId = handler.peekImportURL(); // Push the absolute URI of the included/imported // stylesheet module onto the stack. if (systemId != null) handler.pushBaseIndentifier(systemId); TreeWalker walker = new TreeWalker(handler, new org.apache.xml.utils.DOM2Helper(), systemId); try { walker.traverse(node); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (systemId != null) handler.popBaseIndentifier(); return; } } if(null == source) { String absURL = SystemIDResolver.getAbsoluteURI(getHref(), handler.getBaseIdentifier()); source = new StreamSource(absURL); } // possible callback to a class that over-rides this method. source = processSource(handler, source); XMLReader reader = null; if(source instanceof SAXSource) { SAXSource saxSource = (SAXSource)source; reader = saxSource.getXMLReader(); // may be null } InputSource inputSource = SAXSource.sourceToInputSource(source); if (null == reader) { // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); if (handler.getStylesheetProcessor().isSecureProcessing()) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} } if (null == reader) reader = XMLReaderFactory.createXMLReader(); if (null != reader) { reader.setContentHandler(handler); // Push the absolute URI of the included/imported // stylesheet module onto the stack. handler.pushBaseIndentifier(inputSource.getSystemId()); try { reader.parse(inputSource); } finally { handler.popBaseIndentifier(); } } } catch (IOException ioe) { handler.error(XSLTErrorResources.ER_IOEXCEPTION, new Object[]{ getHref() }, ioe); } catch(TransformerException te) { handler.error(te.getMessage(), te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void endDocument() throws org.xml.sax.SAXException { try { if (null != getStylesheetRoot()) { if (0 == m_stylesheetLevel) getStylesheetRoot().recompose(); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!"); XSLTElementProcessor elemProcessor = getCurrentProcessor(); if (null != elemProcessor) elemProcessor.startNonText(this); m_stylesheetLevel--; popSpaceHandling(); // WARNING: This test works only as long as stylesheets are parsed // more or less recursively. If we switch to an iterative "work-list" // model, this will become true prematurely. In that case, // isStylesheetParsingComplete() will have to be adjusted to be aware // of the worklist. m_parsingComplete = (m_stylesheetLevel < 0); } catch (TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException { if (!m_shouldProcess) return; // Recreating Scott's kluge: // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced. // String localName = getLocalName(target); // String ns = m_stylesheet.getNamespaceFromStack(target); // // %REVIEW%: We need a better PI architecture String prefix="",ns="", localName=target; int colon=target.indexOf(':'); if(colon>=0) { ns=getNamespaceForPrefix(prefix=target.substring(0,colon)); localName=target.substring(colon+1); } try { // A xsl:for-each or xsl:apply-templates may have a special // PI that tells us not to cache the document. This PI // should really be namespaced... but since the XML Namespaces // spec never defined namespaces as applying to PI's, and since // the testcase we're trying to support is inconsistant in whether // it binds the prefix, I'm going to make this sloppy for // testing purposes. if( "xalan-doc-cache-off".equals(target) || "xalan:doc-cache-off".equals(target) || ("doc-cache-off".equals(localName) && ns.equals("org.apache.xalan.xslt.extensions.Redirect") ) ) { if(!(m_elems.peek() instanceof ElemForEach)) throw new TransformerException ("xalan:doc-cache-off not allowed here!", getLocator()); ElemForEach elem = (ElemForEach)m_elems.peek(); elem.m_doc_cache_off = true; //System.out.println("JJK***** Recognized <? {"+ns+"}"+prefix+":"+localName+" "+data+"?>"); } } catch(Exception e) { // JJK: Officially, unknown PIs can just be ignored. // Do we want to issue a warning? } flushCharacters(); getCurrentProcessor().processingInstruction(this, target, data); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { super.startElement(handler, uri, localName, rawName, attributes); try { int stylesheetType = handler.getStylesheetType(); Stylesheet stylesheet; if (stylesheetType == StylesheetHandler.STYPE_ROOT) { try { stylesheet = getStylesheetRoot(handler); } catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); } } else { Stylesheet parent = handler.getStylesheet(); if (stylesheetType == StylesheetHandler.STYPE_IMPORT) { StylesheetComposed sc = new StylesheetComposed(parent); parent.setImport(sc); stylesheet = sc; } else { stylesheet = new Stylesheet(parent); parent.setInclude(stylesheet); } } stylesheet.setDOMBackPointer(handler.getOriginatingNode()); stylesheet.setLocaterInfo(handler.getLocator()); stylesheet.setPrefixes(handler.getNamespaceSupport()); handler.pushStylesheet(stylesheet); setPropertiesFromAttributes(handler, rawName, attributes, handler.getStylesheet()); handler.pushElemTemplateElement(handler.getStylesheet()); } catch(TransformerException te) { throw new org.xml.sax.SAXException(te); } }
// in src/org/apache/xalan/templates/ElemElement.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { boolean shouldAddAttrs; try { SerializationHandler rhandler = transformer.getResultTreeHandler(); if (null == nodeName) { shouldAddAttrs = false; } else { if (null != prefix) { rhandler.startPrefixMapping(prefix, nodeNamespace, true); } rhandler.startElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); super.execute(transformer); shouldAddAttrs = true; } transformer.executeChildTemplates(this, shouldAddAttrs); // Now end the element if name was valid if (null != nodeName) { rhandler.endElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); if (null != prefix) { rhandler.endPrefixMapping(prefix); } } } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getStylesheet().isSecureProcessing()) throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { transformer.getResultTreeHandler().flushPending(); ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(m_extns); if (null == nsh) { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { TransformerException te = new TransformerException(XSLMessages.createMessage( XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); } return; } try { nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this); } catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } } } catch(TransformerException e) { transformer.getErrorListener().fatalError(e); } catch(SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemUse.java
private void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet, QName attributeSetsNames[]) throws TransformerException { if (null != attributeSetsNames) { int nNames = attributeSetsNames.length; for (int i = 0; i < nNames; i++) { QName qname = attributeSetsNames[i]; java.util.List attrSets = stylesheet.getAttributeSetComposed(qname); if (null != attrSets) { int nSets = attrSets.size(); // Highest priority attribute set will be at the top, // so process it last. for (int k = nSets-1; k >= 0 ; k--) { ElemAttributeSet attrSet = (ElemAttributeSet) attrSets.get(k); attrSet.execute(transformer); } } else { throw new TransformerException( XSLMessages.createMessage(XSLTErrorResources.ER_NO_ATTRIB_SET, new Object[] {qname}),this); } } } }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Optimize for "." if (false && m_isDot && !transformer.getDebug()) { int child = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(child); xctxt.pushCurrentNode(child); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { dtm.dispatchCharactersEvents(child, rth, false); } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); } } else { xctxt.pushNamespaceContext(this); int current = xctxt.getCurrentNode(); xctxt.pushCurrentNodeAndExpression(current, current); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { Expression expr = m_selectExpression.getExpression(); if (transformer.getDebug()) { XObject obj = expr.execute(xctxt); transformer.getTraceManager().fireSelectedEvent(current, this, "select", m_selectExpression, obj); obj.dispatchCharactersEvents(rth); } else { expr.executeCharsToContentHandler(xctxt, rth); } } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } } } catch (SAXException se) { throw new TransformerException(se); } catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemNumber.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); String countString = getCountString(transformer, sourceNode); try { transformer.getResultTreeHandler().characters(countString.toCharArray(), 0, countString.length()); } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); String lang = null; String srcURL = null; String scriptSrc = null; if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Register the extension namespace if it has not already been registered. ExtensionNamespaceSupport extNsSpt = null; ExtensionNamespacesManager extNsMgr = sroot.getExtensionNamespacesManager(); if (extNsMgr.namespaceIndex(declNamespace, extNsMgr.getExtensions()) == -1) { if (lang.equals("javaclass")) { if (null == srcURL) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace); } else if (extNsMgr.namespaceIndex(srcURL, extNsMgr.getExtensions()) == -1) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace, srcURL); } } else // not java { String handler = "org.apache.xalan.extensions.ExtensionHandlerGeneral"; Object [] args = {declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()}; extNsSpt = new ExtensionNamespaceSupport(declNamespace, handler, args); } } if (extNsSpt != null) extNsMgr.registerExtension(extNsSpt); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void execute(TransformerImpl transformer) throws TransformerException { SerializationHandler rhandler = transformer.getSerializationHandler(); try { if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. rhandler.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } // JJK Bugzilla 3464, test namespace85 -- make sure LRE's // namespace is asserted even if default, since xsl:element // may have changed the context. rhandler.startPrefixMapping(getPrefix(), getNamespace()); // Add namespace declarations. executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { throw new TransformerException(se); } /* * If we make it to here we have done a successful startElement() * we will do an endElement() call for balance, no matter what happens * in the middle. */ // tException remembers if we had an exception "in the middle" TransformerException tException = null; try { // Process any possible attributes from xsl:use-attribute-sets first super.execute(transformer); //xsl:version, excludeResultPrefixes??? // Process the list of avts next if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String stringedValue = avt.evaluate(xctxt, sourceNode, this); if (null != stringedValue) { // Important Note: I'm not going to check for excluded namespace // prefixes here. It seems like it's too expensive, and I'm not // even sure this is right. But I could be wrong, so this needs // to be tested against other implementations. rhandler.addAttribute( avt.getURI(), avt.getName(), avt.getRawName(), "CDATA", stringedValue, false); } } // end for } // Now process all the elements in this subtree // TODO: Process m_extensionElementPrefixes && m_attributeSetsNames transformer.executeChildTemplates(this, true); } catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; } catch (SAXException se) { tException = new TransformerException(se); } try { /* we need to do this endElement() to balance the * successful startElement() call even if * there was an exception in the middle. * Otherwise an exception in the middle could cause a system to hang. */ if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. //rhandler.flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } rhandler.endElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); } /* If an exception was thrown in the middle but not with startElement() or * or endElement() then its time to let it percolate. */ if (tException != null) throw tException; unexecuteNSDecls(transformer); // JJK Bugzilla 3464, test namespace85 -- balance explicit start. try { rhandler.endPrefixMapping(getPrefix()); } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/ElemPI.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String piName = m_name_atv == null ? null : m_name_atv.evaluate(xctxt, sourceNode, this); // Ignore processing instruction if name is null if (piName == null) return; if (piName.equalsIgnoreCase("xml")) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Only check if an avt was used (ie. this wasn't checked at compose time.) // Ignore processing instruction, if invalid else if ((!m_name_atv.isSimple()) && (!XML11Char.isXML11ValidNCName(piName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); try { transformer.getResultTreeHandler().processingInstruction(piName, data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemAttributeSet.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (transformer.isRecursiveAttrSet(this)) { throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF, new Object[]{ m_qname.getLocalPart() })); //"xsl:attribute-set '"+m_qname.m_localpart+ } transformer.pushElemAttributeSet(this); super.execute(transformer); ElemAttribute attr = (ElemAttribute) getFirstChildElem(); while (null != attr) { attr.execute(transformer); attr = (ElemAttribute) attr.getNextSiblingElem(); } transformer.popElemAttributeSet(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void execute(TransformerImpl transformer, XObject[] args) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); // Increment the frame bottom of the variable stack by the // frame size int thisFrame = vars.getStackFrame(); int nextFrame = vars.link(m_frameSize); if (m_inArgsSize < args.length) { throw new TransformerException ("function called with too many args"); } // Set parameters, // have to clear the section of the stack frame that has params. if (m_inArgsSize > 0) { vars.clearLocalSlots(0, m_inArgsSize); if (args.length > 0) { vars.setStackFrame(thisFrame); NodeList children = this.getChildNodes(); for (int i = 0; i < args.length; i ++) { Node child = children.item(i); if (children.item(i) instanceof ElemParam) { ElemParam param = (ElemParam)children.item(i); vars.setLocalVariable(param.getIndex(), args[i], nextFrame); } } vars.setStackFrame(nextFrame); } } // Removed ElemTemplate 'push' and 'pop' of RTFContext, in order to avoid losing the RTF context // before a value can be returned. ElemExsltFunction operates in the scope of the template that called // the function. // xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); vars.setStackFrame(nextFrame); transformer.executeChildTemplates(this, true); // Reset the stack frame after the function call vars.unlink(thisFrame); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // Following ElemTemplate 'pop' removed -- see above. // xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.endPrefixMapping(decl.getPrefix()); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemCopy.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode); short nodeType = dtm.getNodeType(sourceNode); if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType)) { SerializationHandler rthandler = transformer.getSerializationHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // TODO: Process the use-attribute-sets stuff ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, rthandler, false); if (DTM.ELEMENT_NODE == nodeType) { super.execute(transformer); SerializerUtils.processNSDecls(rthandler, sourceNode, nodeType, dtm); transformer.executeChildTemplates(this, true); String ns = dtm.getNamespaceURI(sourceNode); String localName = dtm.getLocalName(sourceNode); transformer.getResultTreeHandler().endElement(ns, localName, dtm.getNodeName(sourceNode)); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); super.execute(transformer); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { xctxt.popCurrentNode(); } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Call compose on each param no matter if this is apply-templates // or call templates. int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.compose(sroot); } if ((null != m_templateName) && (null == m_template)) { m_template = this.getStylesheetRoot().getTemplateComposed(m_templateName); if (null == m_template) { String themsg = XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[] { m_templateName }); throw new TransformerException(themsg, this); //"Could not find template named: '"+templateName+"'"); } length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.m_index = -1; // Find the position of the param in the template being called, // and set the index of the param slot. int etePos = 0; for (ElemTemplateElement ete = m_template.getFirstChildElem(); null != ete; ete = ete.getNextSiblingElem()) { if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE) { ElemParam ep = (ElemParam)ete; if(ep.getName().equals(ewp.getName())) { ewp.m_index = etePos; } } else break; etePos++; } } } }
// in src/org/apache/xalan/templates/ElemComment.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); transformer.getResultTreeHandler().comment(data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); XObject value = m_selectExpression.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectExpression, value); SerializationHandler handler = transformer.getSerializationHandler(); if (null != value) { int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); // Copy the tree. DTMTreeWalker tw = new TreeWalker2Result(transformer, handler); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = xctxt.getDTMManager().getDTM(pos); short t = dtm.getNodeType(pos); // If we just copy the whole document, a startDoc and endDoc get // generated, so we need to only walk the child nodes. if (t == DTM.DOCUMENT_NODE) { for (int child = dtm.getFirstChild(pos); child != DTM.NULL; child = dtm.getNextSibling(child)) { tw.traverse(child); } } else if (t == DTM.ATTRIBUTE_NODE) { SerializerUtils.addAttribute(handler, pos); } else { tw.traverse(pos); } } // nl.detach(); break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( handler, value, transformer.getXPathContext()); break; default : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; } } // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endSelect", m_selectExpression, value); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExsltFuncResult.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext context = transformer.getXPathContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // Verify that result has not already been set by another result // element. Recursion is allowed: intermediate results are cleared // in the owner ElemExsltFunction execute(). if (transformer.currentFuncResultSeen()) { throw new TransformerException("An EXSLT function cannot set more than one result!"); } int sourceNode = context.getCurrentNode(); // Set the return value; XObject var = getValue(transformer, sourceNode); transformer.popCurrentFuncResult(); transformer.pushCurrentFuncResult(var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
public void execute( TransformerImpl transformer) throws TransformerException { try { SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) { // flush any pending cached processing before the trace event. rth.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } rth.characters(m_ch, 0, m_ch.length); if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } } }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static void switchSerializerIfHTML( TransformerImpl transformer, String ns, String localName) throws TransformerException { if (null == transformer) return; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)) return; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = transformer.getOutputFormat().getProperties(); // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); try { // Serializer oldSerializer = transformer.getSerializer(); Serializer oldSerializer = null; if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = oldSerializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } // transformer.setSerializer(serializer); ContentHandler ch = serializer.asContentHandler(); transformer.setContentHandler(ch); } } catch (java.io.IOException e) { throw new TransformerException(e); } } }
// in src/org/apache/xalan/transformer/StackGuard.java
public void checkForInfinateLoop() throws TransformerException { int nTemplates = m_transformer.getCurrentTemplateElementsCount(); if(nTemplates < m_recursionLimit) return; if(m_recursionLimit <= 0) return; // Safety check. // loop from the top index down to the recursion limit (I don't think // there's any need to go below that). for (int i = (nTemplates - 1); i >= m_recursionLimit; i--) { ElemTemplate template = getNextMatchOrNamedTemplate(i); if(null == template) break; int loopCount = countLikeTemplates(template, i); if (loopCount >= m_recursionLimit) { // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+ // ", template "+((null == template.getName()) ? "name = " : "match = ")+ // ((null != template.getName()) ? template.getName().toString() // : template.getMatch().getPatternString())); String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null); Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs, ((null != template.getName()) ? template.getName().toString() : template.getMatch().getPatternString()) }; String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs); throw new TransformerException(msg); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source, boolean shouldRelease) throws TransformerException { try { // Patch for bugzilla #13863. If we don't reset the namespaceContext // then we will get a NullPointerException if transformer is reused // (for stylesheets that use xsl:key). Not sure if this should go // here or in reset(). -is if(getXPathContext().getNamespaceContext() == null){ getXPathContext().setNamespaceContext(getStylesheet()); } String base = source.getSystemId(); // If no systemID of the source, use the base of the stylesheet. if(null == base) { base = m_stylesheetRoot.getBaseIdentifier(); } // As a last resort, use the current user dir. if(null == base) { String currentDir = ""; try { currentDir = System.getProperty("user.dir"); } catch (SecurityException se) {}// user.dir not accessible from applet if (currentDir.startsWith(java.io.File.separator)) base = "file://" + currentDir; else base = "file:///" + currentDir; base = base + java.io.File.separatorChar + source.getClass().getName(); } setBaseURLOfSource(base); DTMManager mgr = m_xcontext.getDTMManager(); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e) { fatalError(e); } } DTM dtm = mgr.getDTM(source, false, this, true, true); dtm.setDocumentBaseURI(base); boolean hardDelete = true; // %REVIEW% I have to think about this. -sb try { // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, look at dtm.getDocumentRoot(nodeHandle). this.transformNode(dtm.getDocument()); } finally { if (shouldRelease) mgr.release(dtm, hardDelete); } // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). // reader.parse( xmlSource ); // This has to be done to catch exceptions thrown from // the transform thread spawned by the STree handler. Exception e = getExceptionThrown(); if (null != e) { if (e instanceof javax.xml.transform.TransformerException) { throw (javax.xml.transform.TransformerException) e; } else if (e instanceof org.apache.xml.utils.WrappedRuntimeException) { fatalError( ((org.apache.xml.utils.WrappedRuntimeException) e).getException()); } else { throw new javax.xml.transform.TransformerException(e); } } else if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); } // Patch attributed to David Eisenberg <david@catcode.com> catch (org.xml.sax.SAXParseException spe) { fatalError(spe); } catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); } finally { m_hasTransformThreadErrorCatcher = false; // This looks to be redundent to the one done in TransformNode. reset(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
private int transformToRTF(ElemTemplateElement templateParent,DTM dtmFrag) throws TransformerException { XPathContext xctxt = m_xcontext; ContentHandler rtfHandler = dtmFrag.getContentHandler(); // Obtain the ResultTreeFrag's root node. // NOTE: In SAX2RTFDTM, this value isn't available until after // the startDocument has been issued, so assignment has been moved // down a bit in the code. int resultFragment; // not yet reliably = dtmFrag.getDocument(); // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // And make a new handler for the RTF. ToSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(rtfHandler); h.setTransformer(this); // Replace the old handler (which was already saved) m_serializationHandler = h; // use local variable for the current handler SerializationHandler rth = m_serializationHandler; try { rth.startDocument(); // startDocument is "bottlenecked" in RTH. We need it acted upon immediately, // to set the DTM's state as in-progress, so that if the xsl:variable's body causes // further RTF activity we can keep that from bashing this DTM. rth.flushPending(); try { // Do the transformation of the child elements. executeChildTemplates(templateParent, true); // Make sure everything is flushed! rth.flushPending(); // Get the document ID. May not exist until the RTH has not only // received, but flushed, the startDocument, and may be invalid // again after the document has been closed (still debating that) // ... so waiting until just before the end seems simplest/safest. resultFragment = dtmFrag.getDocument(); } finally { rth.endDocument(); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { // Restore the previous result tree handler. this.m_serializationHandler = savedRTreeHandler; } return resultFragment; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean applyTemplateToNode(ElemTemplateElement xslInstruction, // xsl:apply-templates or xsl:for-each ElemTemplate template, int child) throws TransformerException { DTM dtm = m_xcontext.getDTM(child); short nodeType = dtm.getNodeType(child); boolean isDefaultTextRule = false; boolean isApplyImports = false; isApplyImports = ((xslInstruction == null) ? false : xslInstruction.getXSLToken() == Constants.ELEMNAME_APPLY_IMPORTS); if (null == template || isApplyImports) { int maxImportLevel, endImportLevel=0; if (isApplyImports) { maxImportLevel = template.getStylesheetComposed().getImportCountComposed() - 1; endImportLevel = template.getStylesheetComposed().getEndImportCountComposed(); } else { maxImportLevel = -1; } // If we're trying an xsl:apply-imports at the top level (ie there are no // imported stylesheets), we need to indicate that there is no matching template. // The above logic will calculate a maxImportLevel of -1 which indicates // that we should find any template. This is because a value of -1 for // maxImportLevel has a special meaning. But we don't want that. // We want to match -no- templates. See bugzilla bug 1170. if (isApplyImports && (maxImportLevel == -1)) { template = null; } else { // Find the XSL template that is the best match for the // element. XPathContext xctxt = m_xcontext; try { xctxt.pushNamespaceContext(xslInstruction); QName mode = this.getMode(); if (isApplyImports) template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, maxImportLevel, endImportLevel, m_quietConflictWarnings, dtm); else template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, m_quietConflictWarnings, dtm); } finally { xctxt.popNamespaceContext(); } } // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = m_stylesheetRoot.getDefaultRule(); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : case DTM.ATTRIBUTE_NODE : template = m_stylesheetRoot.getDefaultTextRule(); isDefaultTextRule = true; break; case DTM.DOCUMENT_NODE : template = m_stylesheetRoot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. return false; } } } // If we are processing the default text rule, then just clone // the value directly to the result tree. try { pushElemTemplateElement(template); m_xcontext.pushCurrentNode(child); pushPairCurrentMatched(template, child); // Fix copy copy29 test. if (!isApplyImports) { DTMIterator cnl = new org.apache.xpath.NodeSetDTM(child, m_xcontext.getDTMManager()); m_xcontext.pushContextNodeList(cnl); } if (isDefaultTextRule) { switch (nodeType) { case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : ClonerToResultTree.cloneToResultTree(child, nodeType, dtm, getResultTreeHandler(), false); break; case DTM.ATTRIBUTE_NODE : dtm.dispatchCharactersEvents(child, getResultTreeHandler(), false); break; } } else { // Fire a trace event for the template. if (m_debug) getTraceManager().fireTraceEvent(template); // And execute the child templates. // 9/11/00: If template has been compiled, hand off to it // since much (most? all?) of the processing has been inlined. // (It would be nice if there was a single entry point that // worked for both... but the interpretive system works by // having the Tranformer execute the children, while the // compiled obviously has to run its own code. It's // also unclear that "execute" is really the right name for // that entry point.) m_xcontext.setSAXLocator(template); // m_xcontext.getVarStack().link(); m_xcontext.getVarStack().link(template.m_frameSize); executeChildTemplates(template, true); if (m_debug) getTraceManager().fireTraceEndEvent(template); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); } return true; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, boolean shouldAddAttrs) throws TransformerException { // Does this element have any children? ElemTemplateElement t = elem.getFirstChildElem(); if (null == t) return; if(elem.hasTextLitOnly() && m_optimizer) { char[] chars = ((ElemTextLiteral)t).getChars(); try { // Have to push stuff on for tooling... this.pushElemTemplateElement(t); m_serializationHandler.characters(chars, 0, chars.length); } catch(SAXException se) { throw new TransformerException(se); } finally { this.popElemTemplateElement(); } return; } // // Check for infinite loops if we have to. // boolean check = (m_stackGuard.m_recursionLimit > -1); // // if (check) // getStackGuard().push(elem, xctxt.getCurrentNode()); XPathContext xctxt = m_xcontext; xctxt.pushSAXLocatorNull(); int currentTemplateElementsTop = m_currentTemplateElements.size(); m_currentTemplateElements.push(null); try { // Loop through the children of the template, calling execute on // each of them. for (; t != null; t = t.getNextSiblingElem()) { if (!shouldAddAttrs && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE) continue; xctxt.setSAXLocator(t); m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop); t.execute(this); } } catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; } finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); } // Check for infinite loops if we have to // if (check) // getStackGuard().pop(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, ContentHandler handler) throws TransformerException { SerializationHandler xoh = this.getSerializationHandler(); // These may well not be the same! In this case when calling // the Redirect extension, it has already set the ContentHandler // in the Transformer. SerializationHandler savedHandler = xoh; try { xoh.flushPending(); // %REVIEW% Make sure current node is being pushed. LexicalHandler lex = null; if (handler instanceof LexicalHandler) { lex = (LexicalHandler) handler; } m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding()); m_serializationHandler.setTransformer(this); executeChildTemplates(elem, true); } catch (TransformerException e) { throw e; } catch (SAXException se) { throw new TransformerException(se); } finally { m_serializationHandler = savedHandler; } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException { ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) { errHandler.warning(new TransformerException(msg, srcLctr)); } else { if (terminate) throw new TransformerException(msg, srcLctr); else System.out.println(msg); } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object args[], Exception e) throws TransformerException { //msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg; String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
public static void cloneToResultTree(int node, int nodeType, DTM dtm, SerializationHandler rth, boolean shouldCloneAttributes) throws TransformerException { try { switch (nodeType) { case DTM.TEXT_NODE : dtm.dispatchCharactersEvents(node, rth, false); break; case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.DOCUMENT_NODE : // Can't clone a document, but refrain from throwing an error // so that copy-of will work break; case DTM.ELEMENT_NODE : { // Note: SAX apparently expects "no namespace" to be // represented as "" rather than null. String ns = dtm.getNamespaceURI(node); if (ns==null) ns=""; String localName = dtm.getLocalName(node); // rth.startElement(ns, localName, dtm.getNodeNameX(node), null); // don't call a real SAX startElement (as commented out above), // call a SAX-like startElement, to be able to add attributes after this call rth.startElement(ns, localName, dtm.getNodeNameX(node)); // If outputting attrs as separate events, they must // _follow_ the startElement event. (Think of the // xsl:attribute directive.) if (shouldCloneAttributes) { SerializerUtils.addAttributes(rth, node); SerializerUtils.processNSDecls(rth, node, nodeType, dtm); } } break; case DTM.CDATA_SECTION_NODE : rth.startCDATA(); dtm.dispatchCharactersEvents(node, rth, false); rth.endCDATA(); break; case DTM.ATTRIBUTE_NODE : SerializerUtils.addAttribute(rth, node); break; case DTM.NAMESPACE_NODE: // %REVIEW% Normally, these should have been handled with element. // It's possible that someone may write a stylesheet that tries to // clone them explicitly. If so, we need the equivalent of // rth.addAttribute(). SerializerUtils.processNSDecls(rth,node,DTM.NAMESPACE_NODE,dtm); break; case DTM.COMMENT_NODE : XMLString xstr = dtm.getStringValue (node); xstr.dispatchAsComment(rth); break; case DTM.ENTITY_REFERENCE_NODE : rth.entityReference(dtm.getNodeNameX(node)); break; case DTM.PROCESSING_INSTRUCTION_NODE : { // %REVIEW% Is the node name the same as the "target"? rth.processingInstruction(dtm.getNodeNameX(node), dtm.getNodeValue(node)); } break; default : //"Can not create item in result tree: "+node.getNodeName()); throw new TransformerException( "Can't clone node: "+dtm.getNodeName(node)); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
private void createResultContentHandler(Result outputTarget) throws TransformerException { if (outputTarget instanceof SAXResult) { SAXResult saxResult = (SAXResult) outputTarget; m_resultContentHandler = saxResult.getHandler(); m_resultLexicalHandler = saxResult.getLexicalHandler(); if (m_resultContentHandler instanceof Serializer) { // Dubious but needed, I think. m_serializer = (Serializer) m_resultContentHandler; } } else if (outputTarget instanceof DOMResult) { DOMResult domResult = (DOMResult) outputTarget; Node outputNode = domResult.getNode(); Node nextSibling = domResult.getNextSibling(); Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (Node.DOCUMENT_NODE == type) ? (Document) outputNode : outputNode.getOwnerDocument(); } else { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); if (m_isSecureProcessing) { try { dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.newDocument(); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder domBuilder = (Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) domBuilder.setNextSibling(nextSibling); m_resultContentHandler = domBuilder; m_resultLexicalHandler = domBuilder; } else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { Serializer serializer = SerializerFactory.getSerializer(m_outputFormat.getProperties()); m_serializer = serializer; if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) { fileURL = fileURL.substring(8); } else { fileURL = fileURL.substring(7); } } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) { fileURL = fileURL.substring(6); } else { fileURL = fileURL.substring(5); } } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); m_resultContentHandler = serializer.asContentHandler(); } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " // + outputTarget.getClass().getName() // + "!"); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof DeclHandler) m_resultDeclHandler = (DeclHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void processNSDecls( SerializationHandler handler, int src, int type, DTM dtm) throws TransformerException { try { if (type == DTM.ELEMENT_NODE) { for (int namespace = dtm.getFirstNamespaceNode(src, true); DTM.NULL != namespace; namespace = dtm.getNextNamespaceNode(src, namespace, true)) { // String prefix = dtm.getPrefix(namespace); String prefix = dtm.getNodeNameX(namespace); String desturi = handler.getNamespaceURIFromPrefix(prefix); // String desturi = getURI(prefix); String srcURI = dtm.getNodeValue(namespace); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } else if (type == DTM.NAMESPACE_NODE) { String prefix = dtm.getNodeNameX(src); // Brian M. - some changes here to get desturi String desturi = handler.getNamespaceURIFromPrefix(prefix); String srcURI = dtm.getNodeValue(src); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/xslt/Process.java
public static void main(String argv[]) { // Runtime.getRuntime().traceMethodCalls(false); // turns Java tracing off boolean doStackDumpOnError = false; boolean setQuietMode = false; boolean doDiag = false; String msg = null; boolean isSecureProcessing = false; // Runtime.getRuntime().traceMethodCalls(false); // Runtime.getRuntime().traceInstructions(false); /** * The default diagnostic writer... */ java.io.PrintWriter diagnosticsWriter = new PrintWriter(System.err, true); java.io.PrintWriter dumpWriter = diagnosticsWriter; ResourceBundle resbundle = (XSLMessages.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.ERROR_RESOURCES)); String flavor = "s2s"; if (argv.length < 1) { printArgOptions(resbundle); } else { boolean useXSLTC = false; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { useXSLTC = true; } } TransformerFactory tfactory; if (useXSLTC) { String key = "javax.xml.transform.TransformerFactory"; String value = "org.apache.xalan.xsltc.trax.TransformerFactoryImpl"; Properties props = System.getProperties(); props.put(key, value); System.setProperties(props); } try { tfactory = TransformerFactory.newInstance(); tfactory.setErrorListener(new DefaultErrorHandler(false)); } catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); } boolean formatOutput = false; boolean useSourceLocation = false; String inFileName = null; String outFileName = null; String dumpFileName = null; String xslFileName = null; String treedumpFileName = null; PrintTraceListener tracer = null; String outputType = null; String media = null; Vector params = new Vector(); boolean quietConflictWarnings = false; URIResolver uriResolver = null; EntityResolver entityResolver = null; ContentHandler contentHandler = null; int recursionLimit=-1; for (int i = 0; i < argv.length; i++) { if ("-XSLTC".equalsIgnoreCase(argv[i])) { // The -XSLTC option has been processed. } else if ("-TT".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceTemplates = true; } else printInvalidXSLTCOption("-TT"); // tfactory.setTraceTemplates(true); } else if ("-TG".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceGeneration = true; } else printInvalidXSLTCOption("-TG"); // tfactory.setTraceSelect(true); } else if ("-TS".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceSelection = true; } else printInvalidXSLTCOption("-TS"); // tfactory.setTraceTemplates(true); } else if ("-TTC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (null == tracer) tracer = new PrintTraceListener(diagnosticsWriter); tracer.m_traceElements = true; } else printInvalidXSLTCOption("-TTC"); // tfactory.setTraceTemplateChildren(true); } else if ("-INDENT".equalsIgnoreCase(argv[i])) { int indentAmount; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { indentAmount = Integer.parseInt(argv[++i]); } else { indentAmount = 0; } // TBD: // xmlProcessorLiaison.setIndent(indentAmount); } else if ("-IN".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') inFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-IN" })); //"Missing argument for); } else if ("-MEDIA".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) media = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-MEDIA" })); //"Missing argument for); } else if ("-OUT".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') outFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-OUT" })); //"Missing argument for); } else if ("-XSL".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') xslFileName = argv[++i]; else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XSL" })); //"Missing argument for); } else if ("-FLAVOR".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { flavor = argv[++i]; } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-FLAVOR" })); //"Missing argument for); } else if ("-PARAM".equalsIgnoreCase(argv[i])) { if (i + 2 < argv.length) { String name = argv[++i]; params.addElement(name); String expression = argv[++i]; params.addElement(expression); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-PARAM" })); //"Missing argument for); } else if ("-E".equalsIgnoreCase(argv[i])) { // TBD: // xmlProcessorLiaison.setShouldExpandEntityRefs(false); } else if ("-V".equalsIgnoreCase(argv[i])) { diagnosticsWriter.println(resbundle.getString("version") //">>>>>>> Xalan Version " + Version.getVersion() + ", " + /* xmlProcessorLiaison.getParserDescription()+ */ resbundle.getString("version2")); // "<<<<<<<"); } else if ("-QC".equalsIgnoreCase(argv[i])) { if (!useXSLTC) quietConflictWarnings = true; else printInvalidXSLTCOption("-QC"); } else if ("-Q".equalsIgnoreCase(argv[i])) { setQuietMode = true; } else if ("-DIAG".equalsIgnoreCase(argv[i])) { doDiag = true; } else if ("-XML".equalsIgnoreCase(argv[i])) { outputType = "xml"; } else if ("-TEXT".equalsIgnoreCase(argv[i])) { outputType = "text"; } else if ("-HTML".equalsIgnoreCase(argv[i])) { outputType = "html"; } else if ("-EDUMP".equalsIgnoreCase(argv[i])) { doStackDumpOnError = true; if (((i + 1) < argv.length) && (argv[i + 1].charAt(0) != '-')) { dumpFileName = argv[++i]; } } else if ("-URIRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { uriResolver = (URIResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); tfactory.setURIResolver(uriResolver); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-URIResolver" }); System.err.println(msg); doExit(msg); } } else { msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-URIResolver" }); //"Missing argument for); System.err.println(msg); doExit(msg); } } else if ("-ENTITYRESOLVER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { entityResolver = (EntityResolver) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-EntityResolver" }); System.err.println(msg); doExit(msg); } } else if ("-CONTENTHANDLER".equalsIgnoreCase(argv[i])) { if (i + 1 < argv.length) { try { contentHandler = (ContentHandler) ObjectFactory.newInstance( argv[++i], ObjectFactory.findClassLoader(), true); } catch (ObjectFactory.ConfigurationError cnfe) { msg = XSLMessages.createMessage( XSLTErrorResources.ER_CLASS_NOT_FOUND_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else { // "Missing argument for); msg = XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-ContentHandler" }); System.err.println(msg); doExit(msg); } } else if ("-L".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); else printInvalidXSLTCOption("-L"); } else if ("-INCREMENTAL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/incremental", java.lang.Boolean.TRUE); else printInvalidXSLTCOption("-INCREMENTAL"); } else if ("-NOOPTIMIZE".equalsIgnoreCase(argv[i])) { // Default is true. // // %REVIEW% We should have a generalized syntax for negative // switches... and probably should accept the inverse even // if it is the default. if (!useXSLTC) tfactory.setAttribute ("http://xml.apache.org/xalan/features/optimize", java.lang.Boolean.FALSE); else printInvalidXSLTCOption("-NOOPTIMIZE"); } else if ("-RL".equalsIgnoreCase(argv[i])) { if (!useXSLTC) { if (i + 1 < argv.length) recursionLimit = Integer.parseInt(argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-rl" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXSLTCOption("-RL"); } } // Generate the translet class and optionally specify the name // of the translet class. else if ("-XO".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("translet-name", argv[++i]); } else tfactory.setAttribute("generate-translet", "true"); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XO"); } } // Specify the destination directory for the translet classes. else if ("-XD".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("destination-directory", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XD" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XD"); } } // Specify the jar file name which the translet classes are packaged into. else if ("-XJ".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') { tfactory.setAttribute("generate-translet", "true"); tfactory.setAttribute("jar-name", argv[++i]); } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XJ" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XJ"); } } // Specify the package name prefix for the generated translet classes. else if ("-XP".equalsIgnoreCase(argv[i])) { if (useXSLTC) { if (i + 1 < argv.length && argv[i+1].charAt(0) != '-') tfactory.setAttribute("package-name", argv[++i]); else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_MISSING_ARG_FOR_OPTION, new Object[]{ "-XP" })); //"Missing argument for); } else { if (i + 1 < argv.length && argv[i + 1].charAt(0) != '-') i++; printInvalidXalanOption("-XP"); } } // Enable template inlining. else if ("-XN".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("enable-inlining", "true"); } else printInvalidXalanOption("-XN"); } // Turns on additional debugging message output else if ("-XX".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("debug", "true"); } else printInvalidXalanOption("-XX"); } // Create the Transformer from the translet if the translet class is newer // than the stylesheet. else if ("-XT".equalsIgnoreCase(argv[i])) { if (useXSLTC) { tfactory.setAttribute("auto-translet", "true"); } else printInvalidXalanOption("-XT"); } else if ("-SECURE".equalsIgnoreCase(argv[i])) { isSecureProcessing = true; try { tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (TransformerConfigurationException e) {} } else System.err.println( XSLMessages.createMessage( XSLTErrorResources.ER_INVALID_OPTION, new Object[]{ argv[i] })); //"Invalid argument:); } // Print usage instructions if no xml and xsl file is specified in the command line if (inFileName == null && xslFileName == null) { msg = resbundle.getString("xslProc_no_input"); System.err.println(msg); doExit(msg); } // Note that there are usage cases for calling us without a -IN arg // The main XSL transformation occurs here! try { long start = System.currentTimeMillis(); if (null != dumpFileName) { dumpWriter = new PrintWriter(new FileWriter(dumpFileName)); } Templates stylesheet = null; if (null != xslFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); Node xslDOM = docBuilder.parse(new InputSource(xslFileName)); stylesheet = tfactory.newTemplates(new DOMSource(xslDOM, xslFileName)); } else { // System.out.println("Calling newTemplates: "+xslFileName); stylesheet = tfactory.newTemplates(new StreamSource(xslFileName)); // System.out.println("Done calling newTemplates: "+xslFileName); } } PrintWriter resultWriter; StreamResult strResult; if (null != outFileName) { strResult = new StreamResult(new FileOutputStream(outFileName)); // One possible improvement might be to ensure this is // a valid URI before setting the systemId, but that // might have subtle changes that pre-existing users // might notice; we can think about that later -sc r1.46 strResult.setSystemId(outFileName); } else { strResult = new StreamResult(System.out); // We used to default to incremental mode in this case. // We've since decided that since the -INCREMENTAL switch is // available, that default is probably not necessary nor // necessarily a good idea. } SAXTransformerFactory stf = (SAXTransformerFactory) tfactory; // This is currently controlled via TransformerFactoryImpl. if (!useXSLTC && useSourceLocation) stf.setAttribute(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); // Did they pass in a stylesheet, or should we get it from the // document? if (null == stylesheet) { Source source = stf.getAssociatedStylesheet(new StreamSource(inFileName), media, null, null); if (null != source) stylesheet = tfactory.newTemplates(source); else { if (null != media) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: " // + inFileName + ", media=" // + media); else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_PI, new Object[]{inFileName})); //"No xml-stylesheet PI found in: " //+ inFileName); } } if (null != stylesheet) { Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer(); transformer.setErrorListener(new DefaultErrorHandler(false)); // Override the output format? if (null != outputType) { transformer.setOutputProperty(OutputKeys.METHOD, outputType); } if (transformer instanceof org.apache.xalan.transformer.TransformerImpl) { org.apache.xalan.transformer.TransformerImpl impl = (org.apache.xalan.transformer.TransformerImpl)transformer; TraceManager tm = impl.getTraceManager(); if (null != tracer) tm.addTraceListener(tracer); impl.setQuietConflictWarnings(quietConflictWarnings); // This is currently controlled via TransformerFactoryImpl. if (useSourceLocation) impl.setProperty(XalanProperties.SOURCE_LOCATION, Boolean.TRUE); if(recursionLimit>0) impl.setRecursionLimit(recursionLimit); // sc 28-Feb-01 if we re-implement this, please uncomment helpmsg in printArgOptions // impl.setDiagnosticsOutput( setQuietMode ? null : diagnosticsWriter ); } int nParams = params.size(); for (int i = 0; i < nParams; i += 2) { transformer.setParameter((String) params.elementAt(i), (String) params.elementAt(i + 1)); } if (uriResolver != null) transformer.setURIResolver(uriResolver); if (null != inFileName) { if (flavor.equals("d2d")) { // Parse in the xml data into a DOM DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); dfactory.setCoalescing(true); dfactory.setNamespaceAware(true); if (isSecureProcessing) { try { dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); if (entityResolver != null) docBuilder.setEntityResolver(entityResolver); Node xmlDoc = docBuilder.parse(new InputSource(inFileName)); Document doc = docBuilder.newDocument(); org.w3c.dom.DocumentFragment outNode = doc.createDocumentFragment(); transformer.transform(new DOMSource(xmlDoc, inFileName), new DOMResult(outNode)); // Now serialize output to disk with identity transformer Transformer serializer = stf.newTransformer(); serializer.setErrorListener(new DefaultErrorHandler(false)); Properties serializationProps = stylesheet.getOutputProperties(); serializer.setOutputProperties(serializationProps); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); serializer.transform(new DOMSource(outNode), result); } else serializer.transform(new DOMSource(outNode), strResult); } else if (flavor.equals("th")) { for (int i = 0; i < 1; i++) // Loop for diagnosing bugs with inconsistent behavior { // System.out.println("Testing the TransformerHandler..."); // =============== XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } if (!useXSLTC) stf.setAttribute(org.apache.xalan.processor.TransformerFactoryImpl.FEATURE_INCREMENTAL, Boolean.TRUE); TransformerHandler th = stf.newTransformerHandler(stylesheet); reader.setContentHandler(th); reader.setDTDHandler(th); if(th instanceof org.xml.sax.ErrorHandler) reader.setErrorHandler((org.xml.sax.ErrorHandler)th); try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", th); } catch (org.xml.sax.SAXNotRecognizedException e){} catch (org.xml.sax.SAXNotSupportedException e){} try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) {} th.setResult(strResult); reader.parse(new InputSource(inFileName)); } } else { if (entityResolver != null) { XMLReader reader = null; // Use JAXP1.1 ( if possible ) try { javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware(true); if (isSecureProcessing) { try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (org.xml.sax.SAXException se) {} } javax.xml.parsers.SAXParser jaxpParser = factory.newSAXParser(); reader = jaxpParser.getXMLReader(); } catch (javax.xml.parsers.ParserConfigurationException ex) { throw new org.xml.sax.SAXException(ex); } catch (javax.xml.parsers.FactoryConfigurationError ex1) { throw new org.xml.sax.SAXException(ex1.toString()); } catch (NoSuchMethodError ex2){} catch (AbstractMethodError ame){} if (null == reader) { reader = XMLReaderFactory.createXMLReader(); } reader.setEntityResolver(entityResolver); if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform( new SAXSource(reader, new InputSource(inFileName)), result); } else { transformer.transform( new SAXSource(reader, new InputSource(inFileName)), strResult); } } else if (contentHandler != null) { SAXResult result = new SAXResult(contentHandler); transformer.transform(new StreamSource(inFileName), result); } else { // System.out.println("Starting transform"); transformer.transform(new StreamSource(inFileName), strResult); // System.out.println("Done with transform"); } } } else { StringReader reader = new StringReader("<?xml version=\"1.0\"?> <doc/>"); transformer.transform(new StreamSource(reader), strResult); } } else { // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); doExit(msg); } // close output streams if (null != outFileName && strResult!=null) { java.io.OutputStream out = strResult.getOutputStream(); java.io.Writer writer = strResult.getWriter(); try { if (out != null) out.close(); if (writer != null) writer.close(); } catch(java.io.IOException ie) {} } long stop = System.currentTimeMillis(); long millisecondsDuration = stop - start; if (doDiag) { Object[] msgArgs = new Object[]{ inFileName, xslFileName, new Long(millisecondsDuration) }; msg = XSLMessages.createMessage("diagTiming", msgArgs); diagnosticsWriter.println('\n'); diagnosticsWriter.println(msg); } } catch (Throwable throwable) { while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) doStackDumpOnError = true; diagnosticsWriter.println(); if (doStackDumpOnError) throwable.printStackTrace(dumpWriter); else { DefaultErrorHandler.printLocation(diagnosticsWriter, throwable); diagnosticsWriter.println( XSLMessages.createMessage(XSLTErrorResources.ER_XSLT_ERROR, null) + " (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } // diagnosticsWriter.println(XSLMessages.createMessage(XSLTErrorResources.ER_NOT_SUCCESSFUL, null)); //"XSL Process was not successful."); if (null != dumpFileName) { dumpWriter.close(); } doExit(throwable.getMessage()); } if (null != dumpFileName) { dumpWriter.close(); } if (null != diagnosticsWriter) { // diagnosticsWriter.close(); } // if(!setQuietMode) // diagnosticsWriter.println(resbundle.getString("xsldone")); //"Xalan: done"); // else // diagnosticsWriter.println(""); //"Xalan: done"); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.equals("new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = null; if (methodKey != null) c = (Constructor) getFromCache(methodKey, null, methodArgs); if (c != null && !trans.getDebug()) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } c = MethodResolver.getConstructor(m_classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else { int resolveType; Object targetObject = null; methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = null; if (methodKey != null) m = (Method) getFromCache(methodKey, null, methodArgs); if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); if (Modifier.isStatic(m.getModifiers())) return m.invoke(null, convertedArgs[0]); else { // This is tricky. We get the actual number of target arguments (excluding any // ExpressionContext). If we passed in the same number, we need the implied object. int nTargetArgs = convertedArgs[0].length; if (ExpressionContext.class.isAssignableFrom(paramTypes[0])) nTargetArgs--; if (methodArgs.length <= nTargetArgs) return m.invoke(m_defaultInstance, convertedArgs[0]); else { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); return m.invoke(targetObject, convertedArgs[0]); } } } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } if (args.size() > 0) { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); if (m_classObj.isAssignableFrom(targetObject.getClass())) resolveType = MethodResolver.DYNAMIC; else resolveType = MethodResolver.STATIC_AND_INSTANCE; } else { targetObject = null; resolveType = MethodResolver.STATIC_AND_INSTANCE; } m = MethodResolver.getMethod(m_classObj, funcName, methodArgs, convertedArgs, exprContext, resolveType); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (MethodResolver.DYNAMIC == resolveType) { // First argument was object type if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } else // First arg was not object. See if we need the implied object. { if (Modifier.isStatic(m.getModifiers())) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { if (null == m_defaultInstance) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, m_defaultInstance, convertedArgs[0]); Object result; try { result = m.invoke(m_defaultInstance, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); } return result; } else return m.invoke(m_defaultInstance, convertedArgs[0]); } } } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
public ExtensionHandler launch() throws TransformerException { ExtensionHandler handler = null; try { Class cl = ExtensionHandler.getClassForName(m_handlerClass); Constructor con = null; //System.out.println("class " + cl + " " + m_args + " " + m_args.length + " " + m_sig); if (m_sig != null) con = cl.getConstructor(m_sig); else // Pick the constructor based on number of args. { Constructor[] cons = cl.getConstructors(); for (int i = 0; i < cons.length; i ++) { if (cons[i].getParameterTypes().length == m_args.length) { con = cons[i]; break; } } } // System.out.println("constructor " + con); if (con != null) handler = (ExtensionHandler)con.newInstance(m_args); else throw new TransformerException("ExtensionHandler constructor not found"); } catch (Exception e) { throw new TransformerException(e); } return handler; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { String className; String methodName; Class classObj; Object targetObject; int lastDot = funcName.lastIndexOf('.'); Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.endsWith(".new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = (methodKey != null) ? (Constructor) getFromCache(methodKey, null, methodArgs) : null; if (c != null) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } c = MethodResolver.getConstructor(classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else if (-1 != lastDot) { // Handle static method call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, null, methodArgs) : null; if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(null, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); methodName = funcName.substring(lastDot + 1); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } m = MethodResolver.getMethod(classObj, methodName, methodArgs, convertedArgs, exprContext, MethodResolver.STATIC_ONLY); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { // Handle instance method call if (args.size() < 1) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INSTANCE_MTHD_CALL_REQUIRES, new Object[]{funcName })); //"Instance method call to method " + funcName //+ " requires an Object instance as first argument"); } targetObject = args.get(0); if (targetObject instanceof XObject) // Next level down for XObjects targetObject = ((XObject) targetObject).object(); methodArgs = new Object[args.size() - 1]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i+1); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, targetObject, methodArgs) : null; if (m != null) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(targetObject, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } classObj = targetObject.getClass(); m = MethodResolver.getMethod(classObj, funcName, methodArgs, convertedArgs, exprContext, MethodResolver.INSTANCE_ONLY); if (methodKey != null) putToCache(methodKey, targetObject, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] argArray; try { argArray = new Object[args.size()]; for (int i = 0; i < argArray.length; i++) { Object o = args.get(i); argArray[i] = (o instanceof XObject) ? ((XObject) o).object() : o; o = argArray[i]; if(null != o && o instanceof DTMIterator) { argArray[i] = new DTMNodeList((DTMIterator)o); } } if (m_engineCall == null) { m_engineCall = m_engine.getClass().getMethod("call", new Class[]{ Object.class, String.class, Object[].class }); } return m_engineCall.invoke(m_engine, new Object[]{ null, funcName, argArray }); } catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { throw new TransformerException("This method should not be called."); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { // Find the template which invokes this EXSLT function. ExpressionNode parent = extFunction.exprGetParent(); while (parent != null && !(parent instanceof ElemTemplate)) { parent = parent.exprGetParent(); } ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null; XObject[] methodArgs; methodArgs = new XObject[args.size()]; try { for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = XObject.create(args.get(i)); } ElemExsltFunction elemFunc = getFunction(extFunction.getFunctionName()); if (null != elemFunc) { XPathContext context = exprContext.getXPathContext(); TransformerImpl transformer = (TransformerImpl)context.getOwnerObject(); transformer.pushCurrentFuncResult(null); elemFunc.execute(transformer, methodArgs); XObject val = (XObject)transformer.popCurrentFuncResult(); return (val == null) ? new XString("") // value if no result element. : val; } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_FUNCTION_NOT_FOUND, new Object[] {extFunction.getFunctionName()})); } } catch (TransformerException e) { throw e; } catch (Exception e) { throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public XObject getVariableOrParam( XPathContext xctxt, org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver prefixResolver = xctxt.getNamespaceContext(); // Get the current ElemTemplateElement, which must be pushed in as the // prefix resolver, and then walk backwards in document order, searching // for an xsl:param element or xsl:variable element that matches our // qname. If we reach the top level, use the StylesheetRoot's composed // list of top level variables and parameters. if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement) { org.apache.xalan.templates.ElemVariable vvar; org.apache.xalan.templates.ElemTemplateElement prev = (org.apache.xalan.templates.ElemTemplateElement) prefixResolver; if (!(prev instanceof org.apache.xalan.templates.Stylesheet)) { while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) ) { org.apache.xalan.templates.ElemTemplateElement savedprev = prev; while (null != (prev = prev.getPreviousSiblingElem())) { if (prev instanceof org.apache.xalan.templates.ElemVariable) { vvar = (org.apache.xalan.templates.ElemVariable) prev; if (vvar.getName().equals(qname)) return getLocalVariable(xctxt, vvar.getIndex()); } } prev = savedprev.getParentElem(); } } vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname); if (null != vvar) return getGlobalVariable(xctxt, vvar.getIndex()); } throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname); }
// in src/org/apache/xpath/compiler/Compiler.java
public void error(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != m_errorHandler) { m_errorHandler.fatalError(new TransformerException(fmsg, m_locator)); } else { // System.out.println(te.getMessage() // +"; file "+te.getSystemId() // +"; line "+te.getLineNumber() // +"; column "+te.getColumnNumber()); throw new TransformerException(fmsg, (SAXSourceLocator)m_locator); } }
// in src/org/apache/xpath/compiler/FunctionTable.java
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
// in src/org/apache/xpath/compiler/OpMap.java
public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = org.apache.xalan.res.XSLMessages.createXPATHMessage(msg, args); throw new javax.xml.transform.TransformerException(fmsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.isSecureProcessing()) throw new javax.xml.transform.TransformerException( XPATHMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] {toString()})); XObject result; Vector argVec = new Vector(); int nArgs = m_argVec.size(); for (int i = 0; i < nArgs; i++) { Expression arg = (Expression) m_argVec.elementAt(i); XObject xobj = arg.execute(xctxt); /* * Should cache the arguments for func:function */ xobj.allowDetachToRelease(false); argVec.addElement(xobj); } //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); Object val = extProvider.extFunction(this, argVec); if (null != val) { result = XObject.create(val, xctxt); } else { result = new XNull(); } return result; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree( String base, String urlString, SourceLocator locator, XPathContext xctxt) throws TransformerException { // System.out.println("getSourceTree"); try { Source source = this.resolveURI(base, urlString, locator); // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId()); return getSourceTree(source, locator, xctxt); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); } /* catch (TransformerException te) { throw new TransformerException(te.getMessage(), locator, te); }*/ }
// in src/org/apache/xpath/SourceTreeManager.java
public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { try { Object xowner = xctxt.getOwnerObject(); DTM dtm; if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter) { dtm = xctxt.getDTM(source, false, (org.apache.xml.dtm.DTMWSFilter)xowner, false, true); } else { dtm = xctxt.getDTM(source, false, null, false, true); } return dtm.getDocument(); } catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
93
            
// in src/org/apache/xml/utils/DOM2Helper.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xml/utils/DOM2Helper.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xml/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
catch (MalformedURIException mue) { throw new TransformerException(mue); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (ParserConfigurationException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerConfigurationException tfe) { throw new TransformerException(tfe); }
// in src/org/apache/xalan/templates/ElemElement.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); }
// in src/org/apache/xalan/templates/ElemValueOf.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/AVT.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemNumber.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); }
// in src/org/apache/xalan/templates/ElemPI.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopy.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemComment.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
catch (java.io.IOException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch(SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException pce) { throw new TransformerException(pce); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (IOException ioe) { throw new TransformerException(ioe); }
// in src/org/apache/xalan/serialize/SerializerUtils.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (Exception e) { throw new javax.xml.transform.TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (ClassNotFoundException e) { throw new TransformerException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue) { int indexOfColon = m_scriptSrcURL.indexOf(':'); int indexOfSlash = m_scriptSrcURL.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url is absolute. url = null; throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue); //"src attribute not yet supported for " //+ scriptLang); } else { try{ url = new URL(new URL(SystemIDResolver.getAbsoluteURI(systemId)), m_scriptSrcURL); } catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (java.net.MalformedURLException mue2) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), mue2); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (IOException ioe) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_COULD_NOT_FIND_EXTERN_SCRIPT, new Object[]{m_scriptSrcURL}), ioe); //"src attribute not yet supported for " //+ scriptLang); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CMPL_EXTENSN, null), e); //"Could not compile extension", e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
catch(org.xml.sax.SAXException se) { throw new TransformerException(se); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (Exception e) { throw new TransformerException(e); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/compiler/FunctionTable.java
catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); }
// in src/org/apache/xpath/SourceTreeManager.java
catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/LocPathIterator.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); }
566
            
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void warning(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("warning: " + exception.getMessage()); m_pw.flush(); if (getThrowOnWarning()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void error(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/ListingErrorHandler.java
public void fatalError(TransformerException exception) throws TransformerException { logExceptionLocation(m_pw, exception); m_pw.println("error: " + exception.getMessage()); m_pw.flush(); if (getThrowOnError()) throw exception; }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void warning(TransformerException exception) throws TransformerException { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void error(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
// in src/org/apache/xml/utils/DefaultErrorHandler.java
public void fatalError(TransformerException exception) throws TransformerException { // If the m_throwExceptionOnError flag is true, rethrow the exception. // Otherwise report the error to System.err. if (m_throwExceptionOnError) throw exception; else { PrintWriter pw = getErrorWriter(); printLocation(pw, exception); pw.println(exception.getMessage()); } }
// in src/org/apache/xml/utils/DOMHelper.java
public boolean shouldStripSourceNode(Node textNode) throws javax.xml.transform.TransformerException { // return (null == m_envSupport) ? false : m_envSupport.shouldStripSourceNode(textNode); return false; }
// in src/org/apache/xml/utils/DOM2Helper.java
public void checkNode(Node node) throws TransformerException { // if(!(node instanceof org.apache.xerces.dom.NodeImpl)) // throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type" //+((Object)node).getClass()); }
// in src/org/apache/xml/utils/DOM2Helper.java
public void parse(InputSource source) throws TransformerException { try { // I guess I should use JAXP factory here... when it's legal. // org.apache.xerces.parsers.DOMParser parser // = new org.apache.xerces.parsers.DOMParser(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); builderFactory.setValidating(true); DocumentBuilder parser = builderFactory.newDocumentBuilder(); /* // domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true); if(m_useDOM2getNamespaceURI) { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true); parser.setFeature("http://xml.org/sax/features/namespaces", true); } else { parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false); } parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true); */ parser.setErrorHandler( new org.apache.xml.utils.DefaultErrorHandler()); // if(null != m_entityResolver) // { // System.out.println("Setting the entity resolver."); // parser.setEntityResolver(m_entityResolver); // } setDocument(parser.parse(source)); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } catch (IOException ioe) { throw new TransformerException(ioe); } // setDocument(((org.apache.xerces.parsers.DOMParser)parser).getDocument()); }
// in src/org/apache/xml/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xml/serializer/utils/SystemIDResolver.java
public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String getSource() throws TransformerException { StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); String text = ""; try { URL docURL = new URL(m_documentBase, m_treeURL); synchronized (m_tfactory) { Transformer transformer = m_tfactory.newTransformer(); StreamSource source = new StreamSource(docURL.toString()); StreamResult result = new StreamResult(pw); transformer.transform(source, result); text = osw.toString(); } } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } catch (Exception any_error) { any_error.printStackTrace(); } return text; }
// in src/org/apache/xalan/client/XSLTProcessorApplet.java
private String processTransformation() throws TransformerException { String htmlData = null; this.showStatus("Waiting for Transformer and Parser to finish loading and JITing..."); synchronized (m_tfactory) { URL documentURL = null; URL styleURL = null; StringWriter osw = new StringWriter(); PrintWriter pw = new PrintWriter(osw, false); StreamResult result = new StreamResult(pw); this.showStatus("Begin Transformation..."); try { documentURL = new URL(m_codeBase, m_documentURL); StreamSource xmlSource = new StreamSource(documentURL.toString()); styleURL = new URL(m_codeBase, m_styleURL); StreamSource xslSource = new StreamSource(styleURL.toString()); Transformer transformer = m_tfactory.newTransformer(xslSource); Iterator m_entries = m_parameters.entrySet().iterator(); while (m_entries.hasNext()) { Map.Entry entry = (Map.Entry) m_entries.next(); Object key = entry.getKey(); Object expression = entry.getValue(); transformer.setParameter((String) key, expression); } transformer.transform(xmlSource, result); } catch (TransformerConfigurationException tfe) { tfe.printStackTrace(); throw new RuntimeException(tfe.getMessage()); } catch (MalformedURLException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } this.showStatus("Transformation Done!"); htmlData = osw.toString(); } return htmlData; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
private void passWarningsToListener(Vector messages) throws TransformerException { if (_errorListener == null || messages == null) { return; } // Pass messages to listener, one by one final int count = messages.size(); for (int pos = 0; pos < count; pos++) { ErrorMsg msg = (ErrorMsg)messages.elementAt(pos); // Workaround for the TCK failure ErrorListener.errorTests.error001. if (msg.isWarningError()) _errorListener.error( new TransformerConfigurationException(msg.toString())); else _errorListener.warning( new TransformerConfigurationException(msg.toString())); } }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void transform(Source source, Result result) throws TransformerException { if (!_isIdentity) { if (_translet == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_TRANSLET_ERR); throw new TransformerException(err.toString()); } // Pass output properties to the translet transferOutputProperties(_translet); } final SerializationHandler toHandler = getOutputHandler(result); if (toHandler == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_HANDLER_ERR); throw new TransformerException(err.toString()); } if (_uriResolver != null && !_isIdentity) { _translet.setDOMCache(this); } // Pass output properties to handler if identity if (_isIdentity) { transferOutputProperties(toHandler); } transform(source, toHandler, _encoding); if (result instanceof DOMResult) { ((DOMResult)result).setNode(_tohFactory.getNode()); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public SerializationHandler getOutputHandler(Result result) throws TransformerException { // Get output method using get() to ignore defaults _method = (String) _properties.get(OutputKeys.METHOD); // Get encoding using getProperty() to use defaults _encoding = (String) _properties.getProperty(OutputKeys.ENCODING); _tohFactory = TransletOutputHandlerFactory.newInstance(); _tohFactory.setEncoding(_encoding); if (_method != null) { _tohFactory.setOutputMethod(_method); } // Set indentation number in the factory if (_indentNumber >= 0) { _tohFactory.setIndentNumber(_indentNumber); } // Return the content handler for this Result object try { // Result object could be SAXResult, DOMResult, or StreamResult if (result instanceof SAXResult) { final SAXResult target = (SAXResult)result; final ContentHandler handler = target.getHandler(); _tohFactory.setHandler(handler); /** * Fix for bug 24414 * If the lexicalHandler is set then we need to get that * for obtaining the lexical information */ LexicalHandler lexicalHandler = target.getLexicalHandler(); if (lexicalHandler != null ) { _tohFactory.setLexicalHandler(lexicalHandler); } _tohFactory.setOutputType(TransletOutputHandlerFactory.SAX); return _tohFactory.getSerializationHandler(); } else if (result instanceof DOMResult) { _tohFactory.setNode(((DOMResult) result).getNode()); _tohFactory.setNextSibling(((DOMResult) result).getNextSibling()); _tohFactory.setOutputType(TransletOutputHandlerFactory.DOM); return _tohFactory.getSerializationHandler(); } else if (result instanceof StreamResult) { // Get StreamResult final StreamResult target = (StreamResult) result; // StreamResult may have been created with a java.io.File, // java.io.Writer, java.io.OutputStream or just a String // systemId. _tohFactory.setOutputType(TransletOutputHandlerFactory.STREAM); // try to get a Writer from Result object final Writer writer = target.getWriter(); if (writer != null) { _tohFactory.setWriter(writer); return _tohFactory.getSerializationHandler(); } // or try to get an OutputStream from Result object final OutputStream ostream = target.getOutputStream(); if (ostream != null) { _tohFactory.setOutputStream(ostream); return _tohFactory.getSerializationHandler(); } // or try to get just a systemId string from Result object String systemId = result.getSystemId(); if (systemId == null) { ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_RESULT_ERR); throw new TransformerException(err.toString()); } // System Id may be in one of several forms, (1) a uri // that starts with 'file:', (2) uri that starts with 'http:' // or (3) just a filename on the local system. URL url = null; if (systemId.startsWith("file:")) { url = new URL(systemId); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } else if (systemId.startsWith("http:")) { url = new URL(systemId); final URLConnection connection = url.openConnection(); _tohFactory.setOutputStream(_ostream = connection.getOutputStream()); return _tohFactory.getSerializationHandler(); } else { // system id is just a filename url = new File(systemId).toURL(); _tohFactory.setOutputStream( _ostream = new FileOutputStream(url.getFile())); return _tohFactory.getSerializationHandler(); } } } // If we cannot write to the location specified by the SystemId catch (UnknownServiceException e) { throw new TransformerException(e); } catch (ParserConfigurationException e) { throw new TransformerException(e); } // If we cannot create the file specified by the SystemId catch (IOException e) { throw new TransformerException(e); } return null; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private DOM getDOM(Source source) throws TransformerException { try { DOM dom = null; if (source != null) { DTMWSFilter wsfilter; if (_translet != null && _translet instanceof StripFilter) { wsfilter = new DOMWSFilter(_translet); } else { wsfilter = null; } boolean hasIdCall = (_translet != null) ? _translet.hasIdCall() : false; if (_dtmManager == null) { _dtmManager = (XSLTCDTMManager)_tfactory.getDTMManagerClass() .newInstance(); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, false, false, 0, hasIdCall); } else if (_dom != null) { dom = _dom; _dom = null; // use only once, so reset to 'null' } else { return null; } if (!_isIdentity) { // Give the translet the opportunity to make a prepass of // the document, in case it can extract useful information early _translet.prepassDocument(dom); } return dom; } catch (Exception e) { if (_errorListener != null) { postErrorToListener(e.getMessage()); } throw new TransformerException(e); } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
private void transform(Source source, SerializationHandler handler, String encoding) throws TransformerException { try { /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 * situations, since there is no clear spec. how to create * an empty tree when both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new if (systemID != null) { source.setSystemId(systemID); } } if (_isIdentity) { transformIdentity(source, handler); } else { _translet.transform(getDOM(source), handler); } } catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (RuntimeException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } catch (Exception e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); } finally { _dtmManager = null; } // If we create an output stream for the Result, we need to close it after the transformation. if (_ostream != null) { try { _ostream.close(); } catch (IOException e) {} _ostream = null; } }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void error(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.ERROR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.ERROR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void fatalError(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.FATAL_ERR_MSG, e.getMessageAndLocation())); } throw e; }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
public void warning(TransformerException e) throws TransformerException { Throwable wrapped = e.getException(); if (wrapped != null) { System.err.println(new ErrorMsg(ErrorMsg.WARNING_PLUS_WRAPPED_MSG, e.getMessageAndLocation(), wrapped.getMessage())); } else { System.err.println(new ErrorMsg(ErrorMsg.WARNING_MSG, e.getMessageAndLocation())); } }
// in src/org/apache/xalan/processor/ProcessorInclude.java
private Source getSourceFromUriResolver(StylesheetHandler handler) throws TransformerException { Source s = null; TransformerFactoryImpl processor = handler.getStylesheetProcessor(); URIResolver uriresolver = processor.getURIResolver(); if (uriresolver != null) { String href = getHref(); String base = handler.getBaseIdentifier(); s = uriresolver.resolve(href,base); } return s; }
// in src/org/apache/xalan/processor/ProcessorInclude.java
private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s) throws TransformerException { String baseURI; String idFromUriResolverSource; if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) { // We have a Source obtained from a users's URIResolver, // and the system ID is set on it, so return that as the base URI baseURI = idFromUriResolverSource; } else { // The user did not provide a URIResolver, or it did not // return a Source for the included stylesheet module, or // the Source has no system ID set, so we fall back to using // the system ID Resolver to take the href and base // to generate the baseURI of the included stylesheet. baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler .getBaseIdentifier()); } return baseURI; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
public XPath createXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.SELECT, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
// in src/org/apache/xalan/processor/StylesheetHandler.java
XPath createMatchPatternXPath(String str, ElemTemplateElement owningTemplate) throws javax.xml.transform.TransformerException { ErrorListener handler = m_stylesheetProcessor.getErrorListener(); XPath xpath = new XPath(str, owningTemplate, this, XPath.MATCH, handler, m_funcTable); // Visit the expression, registering namespaces for any extension functions it includes. xpath.callVisitors(xpath, new ExpressionVisitor(getStylesheetRoot())); return xpath; }
// in src/org/apache/xalan/templates/ElemElement.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_name_avt) m_name_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_namespace_avt) m_namespace_avt.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemElement.java
protected String resolvePrefix(SerializationHandler rhandler, String prefix, String nodeNamespace) throws TransformerException { // if (null != prefix && prefix.length() == 0) // { // String foundPrefix = rhandler.getPrefix(nodeNamespace); // // // System.out.println("nsPrefix: "+nsPrefix); // if (null == foundPrefix) // foundPrefix = ""; // } return prefix; }
// in src/org/apache/xalan/templates/ElemElement.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); SerializationHandler rhandler = transformer.getSerializationHandler(); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String nodeName = m_name_avt == null ? null : m_name_avt.evaluate(xctxt, sourceNode, this); String prefix = null; String nodeNamespace = ""; // Only validate if an AVT was used. if ((nodeName != null) && (!m_name_avt.isSimple()) && (!XML11Char.isXML11ValidQName(nodeName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, nodeName }); nodeName = null; } else if (nodeName != null) { prefix = QName.getPrefixPart(nodeName); if (null != m_namespace_avt) { nodeNamespace = m_namespace_avt.evaluate(xctxt, sourceNode, this); if (null == nodeNamespace || (prefix != null && prefix.length()>0 && nodeNamespace.length()== 0) ) transformer.getMsgMgr().error( this, XSLTErrorResources.ER_NULL_URI_NAMESPACE); else { // Determine the actual prefix that we will use for this nodeNamespace prefix = resolvePrefix(rhandler, prefix, nodeNamespace); if (null == prefix) prefix = ""; if (prefix.length() > 0) nodeName = (prefix + ":" + QName.getLocalPart(nodeName)); else nodeName = QName.getLocalPart(nodeName); } } // No namespace attribute was supplied. Use the namespace declarations // currently in effect for the xsl:element element. else { try { // Maybe temporary, until I get this worked out. test: axes59 nodeNamespace = getNamespaceForPrefix(prefix); // If we get back a null nodeNamespace, that means that this prefix could // not be found in the table. This is okay only for a default namespace // that has never been declared. if ( (null == nodeNamespace) && (prefix.length() == 0) ) nodeNamespace = ""; else if (null == nodeNamespace) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; } } catch (Exception ex) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_COULD_NOT_RESOLVE_PREFIX, new Object[]{ prefix }); nodeName = null; } } } constructNode(nodeName, prefix, nodeNamespace, transformer); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemElement.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { boolean shouldAddAttrs; try { SerializationHandler rhandler = transformer.getResultTreeHandler(); if (null == nodeName) { shouldAddAttrs = false; } else { if (null != prefix) { rhandler.startPrefixMapping(prefix, nodeNamespace, true); } rhandler.startElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); super.execute(transformer); shouldAddAttrs = true; } transformer.executeChildTemplates(this, shouldAddAttrs); // Now end the element if name was valid if (null != nodeName) { rhandler.endElement(nodeNamespace, QName.getLocalPart(nodeName), nodeName); if (null != prefix) { rhandler.endPrefixMapping(prefix); } } } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemFallback.java
public void execute( TransformerImpl transformer) throws TransformerException { }
// in src/org/apache/xalan/templates/ElemFallback.java
public void executeFallback( TransformerImpl transformer) throws TransformerException { int parentElemType = m_parentNode.getXSLToken(); if (Constants.ELEMNAME_EXTENSIONCALL == parentElemType || Constants.ELEMNAME_UNDEFINED == parentElemType) { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { // Should never happen System.out.println( "Error! parent of xsl:fallback must be an extension or unknown element!"); } }
// in src/org/apache/xalan/templates/XUnresolvedVariable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (!m_doneEval) { this.m_transformer.getMsgMgr().error (xctxt.getSAXLocator(), XSLTErrorResources.ER_REFERENCING_ITSELF, new Object[]{((ElemVariable)this.object()).getName().getLocalName()}); } VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int currentFrame = vars.getStackFrame(); //// vars.setStackFrame(m_varStackPos); ElemVariable velem = (ElemVariable)m_obj; try { m_doneEval = false; if(-1 != velem.m_frameSize) vars.link(velem.m_frameSize); XObject var = velem.getValue(m_transformer, m_context); m_doneEval = true; return var; } finally { // These two statements need to be combined into one operation. // vars.setStackFrame(currentFrame); if(-1 != velem.m_frameSize) vars.unlink(currentFrame); } }
// in src/org/apache/xalan/templates/ElemParam.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_qnameID = sroot.getComposeState().getQNameID(m_qname); int parentToken = m_parentNode.getXSLToken(); if (parentToken == Constants.ELEMNAME_TEMPLATE || parentToken == Constants.EXSLT_ELEMNAME_FUNCTION) ((ElemTemplate)m_parentNode).m_inArgsSize++; }
// in src/org/apache/xalan/templates/ElemParam.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); VariableStack vars = transformer.getXPathContext().getVarStack(); if(!vars.isLocalSet(m_index)) { int sourceNode = transformer.getXPathContext().getCurrentNode(); XObject var = getValue(transformer, sourceNode); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); m_extns = this.getNamespace(); m_decl = getElemExtensionDecl(sroot, m_extns); // Register the extension namespace if the extension does not have // an ElemExtensionDecl ("component"). if (m_decl == null) sroot.getExtensionNamespacesManager().registerExtension(m_extns); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
private void executeFallbacks( TransformerImpl transformer) throws TransformerException { for (ElemTemplateElement child = m_firstChild; child != null; child = child.m_nextSibling) { if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) { try { transformer.pushElemTemplateElement(child); ((ElemFallback) child).executeFallback(transformer); } finally { transformer.popElemTemplateElement(); } } } }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getStylesheet().isSecureProcessing()) throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_EXTENSION_ELEMENT_NOT_ALLOWED_IN_SECURE_PROCESSING, new Object[] {getRawName()})); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { transformer.getResultTreeHandler().flushPending(); ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(m_extns); if (null == nsh) { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { TransformerException te = new TransformerException(XSLMessages.createMessage( XSLTErrorResources.ER_CALL_TO_EXT_FAILED, new Object[]{getNodeName()})); transformer.getErrorListener().fatalError(te); } return; } try { nsh.processElement(this.getLocalName(), this, transformer, getStylesheet(), this); } catch (Exception e) { if (hasFallbackChildren()) executeFallbacks(transformer); else { if(e instanceof TransformerException) { TransformerException te = (TransformerException)e; if(null == te.getLocator()) te.setLocator(this); transformer.getErrorListener().fatalError(te); } else if (e instanceof RuntimeException) { transformer.getErrorListener().fatalError(new TransformerException(e)); } else { transformer.getErrorListener().warning(new TransformerException(e)); } } } } catch(TransformerException e) { transformer.getErrorListener().fatalError(e); } catch(SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
public String getAttribute( String rawName, org.w3c.dom.Node sourceNode, TransformerImpl transformer) throws TransformerException { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt) && avt.getRawName().equals(rawName)) { XPathContext xctxt = transformer.getXPathContext(); return avt.evaluate(xctxt, xctxt.getDTMHandleFromNode(sourceNode), this); } return null; }
// in src/org/apache/xalan/templates/ElemUse.java
public void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet) throws TransformerException { applyAttrSets(transformer, stylesheet, m_attributeSetsNames); }
// in src/org/apache/xalan/templates/ElemUse.java
private void applyAttrSets( TransformerImpl transformer, StylesheetRoot stylesheet, QName attributeSetsNames[]) throws TransformerException { if (null != attributeSetsNames) { int nNames = attributeSetsNames.length; for (int i = 0; i < nNames; i++) { QName qname = attributeSetsNames[i]; java.util.List attrSets = stylesheet.getAttributeSetComposed(qname); if (null != attrSets) { int nSets = attrSets.size(); // Highest priority attribute set will be at the top, // so process it last. for (int k = nSets-1; k >= 0 ; k--) { ElemAttributeSet attrSet = (ElemAttributeSet) attrSets.get(k); attrSet.execute(transformer); } } else { throw new TransformerException( XSLMessages.createMessage(XSLTErrorResources.ER_NO_ATTRIB_SET, new Object[] {qname}),this); } } } }
// in src/org/apache/xalan/templates/ElemUse.java
public void execute( TransformerImpl transformer) throws TransformerException { if (null != m_attributeSetsNames) { applyAttrSets(transformer, getStylesheetRoot(), m_attributeSetsNames); } }
// in src/org/apache/xalan/templates/ElemChoose.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); boolean found = false; for (ElemTemplateElement childElem = getFirstChildElem(); childElem != null; childElem = childElem.getNextSiblingElem()) { int type = childElem.getXSLToken(); if (Constants.ELEMNAME_WHEN == type) { found = true; ElemWhen when = (ElemWhen) childElem; // must be xsl:when XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); // System.err.println("\""+when.getTest().getPatternString()+"\""); // if(when.getTest().getPatternString().equals("COLLECTION/icuser/ictimezone/LITERAL='GMT +13:00 Pacific/Tongatapu'")) // System.err.println("Found COLLECTION/icuser/ictimezone/LITERAL"); if (transformer.getDebug()) { XObject test = when.getTest().execute(xctxt, sourceNode, when); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, when, "test", when.getTest(), test); if (test.bool()) { transformer.getTraceManager().fireTraceEvent(when); transformer.executeChildTemplates(when, true); transformer.getTraceManager().fireTraceEndEvent(when); return; } } else if (when.getTest().bool(xctxt, sourceNode, when)) { transformer.executeChildTemplates(when, true); return; } } else if (Constants.ELEMNAME_OTHERWISE == type) { found = true; if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(childElem); // xsl:otherwise transformer.executeChildTemplates(childElem, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(childElem); return; } } if (!found) transformer.getMsgMgr().error( this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/FuncDocument.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocumentRoot(context); XObject arg = (XObject) this.getArg0().execute(xctxt); String base = ""; Expression arg1Expr = this.getArg1(); if (null != arg1Expr) { // The URI reference may be relative. The base URI (see [3.2 Base URI]) // of the node in the second argument node-set that is first in document // order is used as the base URI for resolving the // relative URI into an absolute URI. XObject arg2 = arg1Expr.execute(xctxt); if (XObject.CLASS_NODESET == arg2.getType()) { int baseNode = arg2.iter().nextNode(); if (baseNode == DTM.NULL) { // See http://www.w3.org/1999/11/REC-xslt-19991116-errata#E14. // If the second argument is an empty nodeset, this is an error. // The processor can recover by returning an empty nodeset. warn(xctxt, XSLTErrorResources.WG_EMPTY_SECOND_ARG, null); XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); return nodes; } else{ DTM baseDTM = xctxt.getDTM(baseNode); base = baseDTM.getDocumentBaseURI(); } // %REVIEW% This doesn't seem to be a problem with the conformance // suite, but maybe it's just not doing a good test? // int baseDoc = baseDTM.getDocument(); // // if (baseDoc == DTM.NULL /* || baseDoc instanceof Stylesheet -->What to do?? */) // { // // // base = ((Stylesheet)baseDoc).getBaseIdentifier(); // base = xctxt.getNamespaceContext().getBaseIdentifier(); // } // else // base = xctxt.getSourceTreeManager().findURIFromDoc(baseDoc); } else { //Can not convert other type to a node-set!; arg2.iter(); } } else { // If the second argument is omitted, then it defaults to // the node in the stylesheet that contains the expression that // includes the call to the document function. Note that a // zero-length URI reference is a reference to the document // relative to which the URI reference is being resolved; thus // document("") refers to the root node of the stylesheet; // the tree representation of the stylesheet is exactly // the same as if the XML document containing the stylesheet // was the initial source document. assertion(null != xctxt.getNamespaceContext(), "Namespace context can not be null!"); base = xctxt.getNamespaceContext().getBaseIdentifier(); } XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM mnl = nodes.mutableNodeset(); DTMIterator iterator = (XObject.CLASS_NODESET == arg.getType()) ? arg.iter() : null; int pos = DTM.NULL; while ((null == iterator) || (DTM.NULL != (pos = iterator.nextNode()))) { XMLString ref = (null != iterator) ? xctxt.getDTM(pos).getStringValue(pos) : arg.xstr(); // The first and only argument was a nodeset, the base in that // case is the base URI of the node from the first argument nodeset. // Remember, when the document function has exactly one argument and // the argument is a node-set, then the result is the union, for each // node in the argument node-set, of the result of calling the document // function with the first argument being the string-value of the node, // and the second argument being a node-set with the node as its only // member. if (null == arg1Expr && DTM.NULL != pos) { DTM baseDTM = xctxt.getDTM(pos); base = baseDTM.getDocumentBaseURI(); } if (null == ref) continue; if (DTM.NULL == docContext) { error(xctxt, XSLTErrorResources.ER_NO_CONTEXT_OWNERDOC, null); //"context does not have an owner document!"); } // From http://www.ics.uci.edu/pub/ietf/uri/rfc1630.txt // A partial form can be distinguished from an absolute form in that the // latter must have a colon and that colon must occur before any slash // characters. Systems not requiring partial forms should not use any // unencoded slashes in their naming schemes. If they do, absolute URIs // will still work, but confusion may result. int indexOfColon = ref.indexOf(':'); int indexOfSlash = ref.indexOf('/'); if ((indexOfColon != -1) && (indexOfSlash != -1) && (indexOfColon < indexOfSlash)) { // The url (or filename, for that matter) is absolute. base = null; } int newDoc = getDoc(xctxt, context, ref.toString(), base); // nodes.mutableNodeset().addNode(newDoc); if (DTM.NULL != newDoc) { // TODO: mnl.addNodeInDocOrder(newDoc, true, xctxt); ?? if (!mnl.contains(newDoc)) { mnl.addElement(newDoc); } } if (null == iterator || newDoc == DTM.NULL) break; } return nodes; }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/FuncDocument.java
public void error(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.error(spe); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/templates/FuncDocument.java
public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); TransformerException spe = new TransformerException(formattedMsg, (SourceLocator)xctxt.getSAXLocator()); if (null != errHandler) errHandler.warning(spe); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_selectExpression) m_selectExpression.fixupVariables( vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemValueOf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Optimize for "." if (false && m_isDot && !transformer.getDebug()) { int child = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(child); xctxt.pushCurrentNode(child); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { dtm.dispatchCharactersEvents(child, rth, false); } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popCurrentNode(); } } else { xctxt.pushNamespaceContext(this); int current = xctxt.getCurrentNode(); xctxt.pushCurrentNodeAndExpression(current, current); if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); try { Expression expr = m_selectExpression.getExpression(); if (transformer.getDebug()) { XObject obj = expr.execute(xctxt); transformer.getTraceManager().fireSelectedEvent(current, this, "select", m_selectExpression, obj); obj.dispatchCharactersEvents(rth); } else { expr.executeCharsToContentHandler(xctxt, rth); } } finally { if (m_disableOutputEscaping) rth.processingInstruction( javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } } } catch (SAXException se) { throw new TransformerException(se); } catch (RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(this); throw te; } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public void recompose() throws TransformerException { // Now we make a Vector that is going to hold all of the recomposable elements Vector recomposableElements = new Vector(); // First, we build the global import tree. if (null == m_globalImportList) { Vector importList = new Vector(); addImports(this, true, importList); // Now we create an array and reverse the order of the importList vector. // We built the importList vector backwards so that we could use addElement // to append to the end of the vector instead of constantly pushing new // stylesheets onto the front of the vector and having to shift the rest // of the vector each time. m_globalImportList = new StylesheetComposed[importList.size()]; for (int i = 0, j= importList.size() -1; i < importList.size(); i++) { m_globalImportList[j] = (StylesheetComposed) importList.elementAt(i); // Build the global include list for this stylesheet. // This needs to be done ahead of the recomposeImports // because we need the info from the composed includes. m_globalImportList[j].recomposeIncludes(m_globalImportList[j]); // Calculate the number of this import. m_globalImportList[j--].recomposeImports(); } } // Next, we walk the import tree and add all of the recomposable elements to the vector. int n = getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = getGlobalImport(i); imported.recompose(recomposableElements); } // We sort the elements into ascending order. QuickSort2(recomposableElements, 0, recomposableElements.size() - 1); // We set up the global variables that will hold the recomposed information. m_outputProperties = new OutputProperties(org.apache.xml.serializer.Method.UNKNOWN); // m_outputProperties = new OutputProperties(Method.XML); m_attrSets = new HashMap(); m_decimalFormatSymbols = new Hashtable(); m_keyDecls = new Vector(); m_namespaceAliasComposed = new Hashtable(); m_templateList = new TemplateList(); m_variables = new Vector(); // Now we sequence through the sorted elements, // calling the recompose() function on each one. This will call back into the // appropriate routine here to actually do the recomposition. // Note that we're going backwards, encountering the highest precedence items first. for (int i = recomposableElements.size() - 1; i >= 0; i--) ((ElemTemplateElement) recomposableElements.elementAt(i)).recompose(this); /* * Backing out REE again, as it seems to cause some new failures * which need to be investigated. -is */ // This has to be done before the initialization of the compose state, because // eleminateRedundentGlobals will add variables to the m_variables vector, which // it then copied in the ComposeState constructor. // if(true && org.apache.xalan.processor.TransformerFactoryImpl.m_optimize) // { // RedundentExprEliminator ree = new RedundentExprEliminator(); // callVisitors(ree); // ree.eleminateRedundentGlobals(this); // } initComposeState(); // Need final composition of TemplateList. This adds the wild cards onto the chains. m_templateList.compose(this); // Need to clear check for properties at the same import level. m_outputProperties.compose(this); m_outputProperties.endCompose(this); // Now call the compose() method on every element to give it a chance to adjust // based on composed values. n = getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = this.getGlobalImport(i); int includedCount = imported.getIncludeCountComposed(); for (int j = -1; j < includedCount; j++) { Stylesheet included = imported.getIncludeComposed(j); composeTemplates(included); } } // Attempt to register any remaining unregistered extension namespaces. if (m_extNsMgr != null) m_extNsMgr.registerUnregisteredNamespaces(); clearComposeState(); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
void composeTemplates(ElemTemplateElement templ) throws TransformerException { templ.compose(this); for (ElemTemplateElement child = templ.getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { composeTemplates(child); } templ.endCompose(this); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
void recomposeOutput(OutputProperties oprops) throws TransformerException { m_outputProperties.copyFrom(oprops); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, boolean quietConflictWarnings, DTM dtm) throws TransformerException { return m_templateList.getTemplate(xctxt, targetNode, mode, quietConflictWarnings, dtm); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public ElemTemplate getTemplateComposed(XPathContext xctxt, int targetNode, QName mode, int maxImportLevel, int endImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { return m_templateList.getTemplate(xctxt, targetNode, mode, maxImportLevel, endImportLevel, quietConflictWarnings, dtm); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public WhiteSpaceInfo getWhiteSpaceInfo( XPathContext support, int targetElement, DTM dtm) throws TransformerException { if (null != m_whiteSpaceInfoList) return (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support, targetElement, null, false, dtm); else return null; }
// in src/org/apache/xalan/templates/StylesheetRoot.java
public boolean shouldStripWhiteSpace( XPathContext support, int targetElement) throws TransformerException { if (null != m_whiteSpaceInfoList) { while(DTM.NULL != targetElement) { DTM dtm = support.getDTM(targetElement); WhiteSpaceInfo info = (WhiteSpaceInfo) m_whiteSpaceInfoList.getTemplate(support, targetElement, null, false, dtm); if(null != info) return info.getShouldStripSpace(); int parent = dtm.getParent(targetElement); if(DTM.NULL != parent && DTM.ELEMENT_NODE == dtm.getNodeType(parent)) targetElement = parent; else targetElement = DTM.NULL; } } return false; }
// in src/org/apache/xalan/templates/StylesheetRoot.java
private void initDefaultRule(ErrorListener errorListener) throws TransformerException { // Then manufacture a default m_defaultRule = new ElemTemplate(); m_defaultRule.setStylesheet(this); XPath defMatch = new XPath("*", this, this, XPath.MATCH, errorListener); m_defaultRule.setMatch(defMatch); ElemApplyTemplates childrenElement = new ElemApplyTemplates(); childrenElement.setIsDefaultTemplate(true); childrenElement.setSelect(m_selectDefault); m_defaultRule.appendChild(childrenElement); m_startRule = m_defaultRule; // ----------------------------- m_defaultTextRule = new ElemTemplate(); m_defaultTextRule.setStylesheet(this); defMatch = new XPath("text() | @*", this, this, XPath.MATCH, errorListener); m_defaultTextRule.setMatch(defMatch); ElemValueOf elemValueOf = new ElemValueOf(); m_defaultTextRule.appendChild(elemValueOf); XPath selectPattern = new XPath(".", this, this, XPath.SELECT, errorListener); elemValueOf.setSelect(selectPattern); //-------------------------------- m_defaultRootRule = new ElemTemplate(); m_defaultRootRule.setStylesheet(this); defMatch = new XPath("/", this, this, XPath.MATCH, errorListener); m_defaultRootRule.setMatch(defMatch); childrenElement = new ElemApplyTemplates(); childrenElement.setIsDefaultTemplate(true); m_defaultRootRule.appendChild(childrenElement); childrenElement.setSelect(m_selectDefault); }
// in src/org/apache/xalan/templates/AVT.java
public String evaluate( XPathContext xctxt, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { if (null != m_simpleString){ return m_simpleString; }else if (null != m_parts){ final FastStringBuffer buf =getBuffer(); String out = null; int n = m_parts.size(); try{ for (int i = 0; i < n; i++){ AVTPart part = (AVTPart) m_parts.elementAt(i); part.evaluate(xctxt, buf, context, nsNode); } out = buf.toString(); }finally{ if(USE_OBJECT_POOL){ StringBufferPool.free(buf); }else{ buf.setLength(0); } } return out; }else{ return ""; } }
// in src/org/apache/xalan/templates/ElemWhen.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_test) m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemForEach.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); int length = getSortElemCount(); for (int i = 0; i < length; i++) { getSortElem(i).compose(sroot); } java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_selectExpression) m_selectExpression.fixupVariables( vnames, sroot.getComposeState().getGlobalsSize()); else { m_selectExpression = getStylesheetRoot().m_selectDefault.getExpression(); } }
// in src/org/apache/xalan/templates/ElemForEach.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { int length = getSortElemCount(); for (int i = 0; i < length; i++) { getSortElem(i).endCompose(sroot); } super.endCompose(sroot); }
// in src/org/apache/xalan/templates/ElemForEach.java
public void execute(TransformerImpl transformer) throws TransformerException { transformer.pushCurrentTemplateRuleIsNull(true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this);//trigger for-each element event try { transformSelectedNodes(transformer); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); transformer.popCurrentTemplateRuleIsNull(); } }
// in src/org/apache/xalan/templates/ElemForEach.java
public DTMIterator sortNodes( XPathContext xctxt, Vector keys, DTMIterator sourceNodes) throws TransformerException { NodeSorter sorter = new NodeSorter(xctxt); sourceNodes.setShouldCacheNodes(true); sourceNodes.runTo(-1); xctxt.pushContextNodeList(sourceNodes); try { sorter.sort(sourceNodes, keys, xctxt); sourceNodes.setCurrentPos(0); } finally { xctxt.popContextNodeList(); } return sourceNodes; }
// in src/org/apache/xalan/templates/ElemForEach.java
public void transformSelectedNodes(TransformerImpl transformer) throws TransformerException { final XPathContext xctxt = transformer.getXPathContext(); final int sourceNode = xctxt.getCurrentNode(); DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); try { final Vector keys = (m_sortElems == null) ? null : transformer.processSortKeys(this, sourceNode); // Sort if we need to. if (null != keys) sourceNodes = sortNodes(xctxt, keys, sourceNodes); if (transformer.getDebug()) { // The original code, which is broken for bug#16889, // which fails to get the original select expression in the select event. /* transformer.getTraceManager().fireSelectedEvent( * sourceNode, * this, * "select", * new XPath(m_selectExpression), * new org.apache.xpath.objects.XNodeSet(sourceNodes)); */ // The following code fixes bug#16889 // Solution: Store away XPath in setSelect(Xath), and use it here. // Pass m_xath, which the current node is associated with, onto the TraceManager. Expression expr = m_xpath.getExpression(); org.apache.xpath.objects.XObject xObject = expr.execute(xctxt); int current = xctxt.getCurrentNode(); transformer.getTraceManager().fireSelectedEvent( current, this, "select", m_xpath, xObject); } xctxt.pushCurrentNode(DTM.NULL); IntStack currentNodes = xctxt.getCurrentNodeStack(); xctxt.pushCurrentExpressionNode(DTM.NULL); IntStack currentExpressionNodes = xctxt.getCurrentExpressionNodeStack(); xctxt.pushSAXLocatorNull(); xctxt.pushContextNodeList(sourceNodes); transformer.pushElemTemplateElement(null); // pushParams(transformer, xctxt); // Should be able to get this from the iterator but there must be a bug. DTM dtm = xctxt.getDTM(sourceNode); int docID = sourceNode & DTMManager.IDENT_DTM_DEFAULT; int child; while (DTM.NULL != (child = sourceNodes.nextNode())) { currentNodes.setTop(child); currentExpressionNodes.setTop(child); if ((child & DTMManager.IDENT_DTM_DEFAULT) != docID) { dtm = xctxt.getDTM(child); docID = child & DTMManager.IDENT_DTM_DEFAULT; } //final int exNodeType = dtm.getExpandedTypeID(child); final int nodeType = dtm.getNodeType(child); // Fire a trace event for the template. if (transformer.getDebug()) { transformer.getTraceManager().fireTraceEvent(this); } // And execute the child templates. // Loop through the children of the template, calling execute on // each of them. for (ElemTemplateElement t = this.m_firstChild; t != null; t = t.m_nextSibling) { xctxt.setSAXLocator(t); transformer.setCurrentElement(t); t.execute(transformer); } if (transformer.getDebug()) { // We need to make sure an old current element is not // on the stack. See TransformerImpl#getElementCallstack. transformer.setCurrentElement(null); transformer.getTraceManager().fireTraceEndEvent(this); } // KLUGE: Implement <?xalan:doc_cache_off?> // ASSUMPTION: This will be set only when the XPath was indeed // a call to the Document() function. Calling it in other // situations is likely to fry Xalan. // // %REVIEW% We need a MUCH cleaner solution -- one that will // handle cleaning up after document() and getDTM() in other // contexts. The whole SourceTreeManager mechanism should probably // be moved into DTMManager rather than being explicitly invoked in // FuncDocument and here. if(m_doc_cache_off) { if(DEBUG) System.out.println("JJK***** CACHE RELEASE *****\n"+ "\tdtm="+dtm.getDocumentBaseURI()); // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, this would require substantial rework. xctxt.getSourceTreeManager().removeDocumentFromCache(dtm.getDocument()); xctxt.release(dtm,false); } } } finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); xctxt.popSAXLocator(); xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); } }
// in src/org/apache/xalan/templates/AVTPartXPath.java
public void evaluate( XPathContext xctxt, FastStringBuffer buf, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { XObject xobj = m_xpath.execute(xctxt, context, nsNode); if (null != xobj) { xobj.appendToFsb(buf); } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // A bit of an ugly hack to get our context. ElemTemplateElement templElem = (ElemTemplateElement) xctxt.getNamespaceContext(); StylesheetRoot ss = templElem.getStylesheetRoot(); java.text.DecimalFormat formatter = null; java.text.DecimalFormatSymbols dfs = null; double num = getArg0().execute(xctxt).num(); String patternStr = getArg1().execute(xctxt).str(); // TODO: what should be the behavior here?? if (patternStr.indexOf(0x00A4) > 0) ss.error(XSLTErrorResources.ER_CURRENCY_SIGN_ILLEGAL); // currency sign not allowed // this third argument is not a locale name. It is the name of a // decimal-format declared in the stylesheet!(xsl:decimal-format try { Expression arg2Expr = getArg2(); if (null != arg2Expr) { String dfName = arg2Expr.execute(xctxt).str(); QName qname = new QName(dfName, xctxt.getNamespaceContext()); dfs = ss.getDecimalFormatComposed(qname); if (null == dfs) { warn(xctxt, XSLTErrorResources.WG_NO_DECIMALFORMAT_DECLARATION, new Object[]{ dfName }); //"not found!!! //formatter = new java.text.DecimalFormat(patternStr); } else { //formatter = new java.text.DecimalFormat(patternStr, dfs); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); } } //else if (null == formatter) { // look for a possible default decimal-format dfs = ss.getDecimalFormatComposed(new QName("")); if (dfs != null) { formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); formatter.applyLocalizedPattern(patternStr); } else { dfs = new java.text.DecimalFormatSymbols(java.util.Locale.US); dfs.setInfinity(Constants.ATTRVAL_INFINITY); dfs.setNaN(Constants.ATTRVAL_NAN); formatter = new java.text.DecimalFormat(); formatter.setDecimalFormatSymbols(dfs); if (null != patternStr) formatter.applyLocalizedPattern(patternStr); } } return new XString(formatter.format(num)); } catch (Exception iae) { templElem.error(XSLTErrorResources.ER_MALFORMED_FORMAT_STRING, new Object[]{ patternStr }); return XString.EMPTYSTRING; //throw new XSLProcessorException(iae); } }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public void warn(XPathContext xctxt, String msg, Object args[]) throws javax.xml.transform.TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = xctxt.getErrorListener(); errHandler.warning(new TransformerException(formattedMsg, (SAXSourceLocator)xctxt.getSAXLocator())); }
// in src/org/apache/xalan/templates/ElemNumber.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_countMatchPattern) m_countMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_format_avt) m_format_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_fromMatchPattern) m_fromMatchPattern.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_groupingSeparator_avt) m_groupingSeparator_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_groupingSize_avt) m_groupingSize_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lang_avt) m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lettervalue_avt) m_lettervalue_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_valueExpr) m_valueExpr.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemNumber.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); String countString = getCountString(transformer, sourceNode); try { transformer.getResultTreeHandler().characters(countString.toCharArray(), 0, countString.length()); } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemNumber.java
int findAncestor( XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, int context, ElemNumber namespaceContext) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); while (DTM.NULL != context) { if (null != fromMatchPattern) { if (fromMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { //context = null; break; } } if (null != countMatchPattern) { if (countMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { break; } } context = dtm.getParent(context); } return context; }
// in src/org/apache/xalan/templates/ElemNumber.java
private int findPrecedingOrAncestorOrSelf( XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, int context, ElemNumber namespaceContext) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); while (DTM.NULL != context) { if (null != fromMatchPattern) { if (fromMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { context = DTM.NULL; break; } } if (null != countMatchPattern) { if (countMatchPattern.getMatchScore(xctxt, context) != XPath.MATCH_SCORE_NONE) { break; } } int prevSibling = dtm.getPreviousSibling(context); if (DTM.NULL == prevSibling) { context = dtm.getParent(context); } else { // Now go down the chain of children of this sibling context = dtm.getLastChild(prevSibling); if (context == DTM.NULL) context = prevSibling; } } return context; }
// in src/org/apache/xalan/templates/ElemNumber.java
XPath getCountMatchPattern(XPathContext support, int contextNode) throws javax.xml.transform.TransformerException { XPath countMatchPattern = m_countMatchPattern; DTM dtm = support.getDTM(contextNode); if (null == countMatchPattern) { switch (dtm.getNodeType(contextNode)) { case DTM.ELEMENT_NODE : MyPrefixResolver resolver; if (dtm.getNamespaceURI(contextNode) == null) { resolver = new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, false); } else { resolver = new MyPrefixResolver(dtm.getNode(contextNode), dtm,contextNode, true); } countMatchPattern = new XPath(dtm.getNodeName(contextNode), this, resolver, XPath.MATCH, support.getErrorListener()); break; case DTM.ATTRIBUTE_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("@"+contextNode.getNodeName(), this); countMatchPattern = new XPath("@" + dtm.getNodeName(contextNode), this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("text()", this); countMatchPattern = new XPath("text()", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.COMMENT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("comment()", this); countMatchPattern = new XPath("comment()", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.DOCUMENT_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("/", this); countMatchPattern = new XPath("/", this, this, XPath.MATCH, support.getErrorListener()); break; case DTM.PROCESSING_INSTRUCTION_NODE : // countMatchPattern = m_stylesheet.createMatchPattern("pi("+contextNode.getNodeName()+")", this); countMatchPattern = new XPath("pi(" + dtm.getNodeName(contextNode) + ")", this, this, XPath.MATCH, support.getErrorListener()); break; default : countMatchPattern = null; } } return countMatchPattern; }
// in src/org/apache/xalan/templates/ElemNumber.java
String getCountString(TransformerImpl transformer, int sourceNode) throws TransformerException { long[] list = null; XPathContext xctxt = transformer.getXPathContext(); CountersTable ctable = transformer.getCountersTable(); if (null != m_valueExpr) { XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this); //According to Errata E24 double d_count = java.lang.Math.floor(countObj.num()+ 0.5); if (Double.isNaN(d_count)) return "NaN"; else if (d_count < 0 && Double.isInfinite(d_count)) return "-Infinity"; else if (Double.isInfinite(d_count)) return "Infinity"; else if (d_count == 0) return "0"; else{ long count = (long)d_count; list = new long[1]; list[0] = count; } } else { if (Constants.NUMBERLEVEL_ANY == m_level) { list = new long[1]; list[0] = ctable.countNode(xctxt, this, sourceNode); } else { NodeVector ancestors = getMatchingAncestors(xctxt, sourceNode, Constants.NUMBERLEVEL_SINGLE == m_level); int lastIndex = ancestors.size() - 1; if (lastIndex >= 0) { list = new long[lastIndex + 1]; for (int i = lastIndex; i >= 0; i--) { int target = ancestors.elementAt(i); list[lastIndex - i] = ctable.countNode(xctxt, this, target); } } } } return (null != list) ? formatNumberList(transformer, list, sourceNode) : ""; }
// in src/org/apache/xalan/templates/ElemNumber.java
public int getPreviousNode(XPathContext xctxt, int pos) throws TransformerException { XPath countMatchPattern = getCountMatchPattern(xctxt, pos); DTM dtm = xctxt.getDTM(pos); if (Constants.NUMBERLEVEL_ANY == m_level) { XPath fromMatchPattern = m_fromMatchPattern; // Do a backwards document-order walk 'till a node is found that matches // the 'from' pattern, or a node is found that matches the 'count' pattern, // or the top of the tree is found. while (DTM.NULL != pos) { // Get the previous sibling, if there is no previous sibling, // then count the parent, but if there is a previous sibling, // dive down to the lowest right-hand (last) child of that sibling. int next = dtm.getPreviousSibling(pos); if (DTM.NULL == next) { next = dtm.getParent(pos); if ((DTM.NULL != next) && ((((null != fromMatchPattern) && (fromMatchPattern.getMatchScore( xctxt, next) != XPath.MATCH_SCORE_NONE))) || (dtm.getNodeType(next) == DTM.DOCUMENT_NODE))) { pos = DTM.NULL; // return null from function. break; // from while loop } } else { // dive down to the lowest right child. int child = next; while (DTM.NULL != child) { child = dtm.getLastChild(next); if (DTM.NULL != child) next = child; } } pos = next; if ((DTM.NULL != pos) && ((null == countMatchPattern) || (countMatchPattern.getMatchScore(xctxt, pos) != XPath.MATCH_SCORE_NONE))) { break; } } } else // NUMBERLEVEL_MULTI or NUMBERLEVEL_SINGLE { while (DTM.NULL != pos) { pos = dtm.getPreviousSibling(pos); if ((DTM.NULL != pos) && ((null == countMatchPattern) || (countMatchPattern.getMatchScore(xctxt, pos) != XPath.MATCH_SCORE_NONE))) { break; } } } return pos; }
// in src/org/apache/xalan/templates/ElemNumber.java
public int getTargetNode(XPathContext xctxt, int sourceNode) throws TransformerException { int target = DTM.NULL; XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode); if (Constants.NUMBERLEVEL_ANY == m_level) { target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } else { target = findAncestor(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } return target; }
// in src/org/apache/xalan/templates/ElemNumber.java
NodeVector getMatchingAncestors( XPathContext xctxt, int node, boolean stopAtFirstFound) throws javax.xml.transform.TransformerException { NodeSetDTM ancestors = new NodeSetDTM(xctxt.getDTMManager()); XPath countMatchPattern = getCountMatchPattern(xctxt, node); DTM dtm = xctxt.getDTM(node); while (DTM.NULL != node) { if ((null != m_fromMatchPattern) && (m_fromMatchPattern.getMatchScore(xctxt, node) != XPath.MATCH_SCORE_NONE)) { // The following if statement gives level="single" different // behavior from level="multiple", which seems incorrect according // to the XSLT spec. For now we are leaving this in to replicate // the same behavior in XT, but, for all intents and purposes we // think this is a bug, or there is something about level="single" // that we still don't understand. if (!stopAtFirstFound) break; } if (null == countMatchPattern) System.out.println( "Programmers error! countMatchPattern should never be null!"); if (countMatchPattern.getMatchScore(xctxt, node) != XPath.MATCH_SCORE_NONE) { ancestors.addElement(node); if (stopAtFirstFound) break; } node = dtm.getParent(node); } return ancestors; }
// in src/org/apache/xalan/templates/ElemNumber.java
Locale getLocale(TransformerImpl transformer, int contextNode) throws TransformerException { Locale locale = null; if (null != m_lang_avt) { XPathContext xctxt = transformer.getXPathContext(); String langValue = m_lang_avt.evaluate(xctxt, contextNode, this); if (null != langValue) { // Not really sure what to do about the country code, so I use the // default from the system. // TODO: fix xml:lang handling. locale = new Locale(langValue.toUpperCase(), ""); //Locale.getDefault().getDisplayCountry()); if (null == locale) { transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode), XSLTErrorResources.WG_LOCALE_NOT_FOUND, new Object[]{ langValue }); //"Warning: Could not find locale for xml:lang="+langValue); locale = Locale.getDefault(); } } } else { locale = Locale.getDefault(); } return locale; }
// in src/org/apache/xalan/templates/ElemNumber.java
private DecimalFormat getNumberFormatter( TransformerImpl transformer, int contextNode) throws TransformerException { // Patch from Steven Serocki // Maybe we really want to do the clone in getLocale() and return // a clone of the default Locale?? Locale locale = (Locale)getLocale(transformer, contextNode).clone(); // Helper to format local specific numbers to strings. DecimalFormat formatter = null; //synchronized (locale) //{ // formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale); //} String digitGroupSepValue = (null != m_groupingSeparator_avt) ? m_groupingSeparator_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; // Validate grouping separator if an AVT was used; otherwise this was // validated statically in XSLTAttributeDef.java. if ((digitGroupSepValue != null) && (!m_groupingSeparator_avt.isSimple()) && (digitGroupSepValue.length() != 1)) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_NAME, m_groupingSeparator_avt.getName()}); } String nDigitsPerGroupValue = (null != m_groupingSize_avt) ? m_groupingSize_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; // TODO: Handle digit-group attributes if ((null != digitGroupSepValue) && (null != nDigitsPerGroupValue) && // Ignore if separation value is empty string (digitGroupSepValue.length() > 0)) { try { formatter = (DecimalFormat) NumberFormat.getNumberInstance(locale); formatter.setGroupingSize( Integer.valueOf(nDigitsPerGroupValue).intValue()); DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols(); symbols.setGroupingSeparator(digitGroupSepValue.charAt(0)); formatter.setDecimalFormatSymbols(symbols); formatter.setGroupingUsed(true); } catch (NumberFormatException ex) { formatter.setGroupingUsed(false); } } return formatter; }
// in src/org/apache/xalan/templates/ElemNumber.java
String formatNumberList( TransformerImpl transformer, long[] list, int contextNode) throws TransformerException { String numStr; FastStringBuffer formattedNumber = StringBufferPool.get(); try { int nNumbers = list.length, numberWidth = 1; char numberType = '1'; String formatToken, lastSepString = null, formatTokenString = null; // If a seperator hasn't been specified, then use "." // as a default separator. // For instance: [2][1][5] with a format value of "1 " // should format to "2.1.5 " (I think). // Otherwise, use the seperator specified in the format string. // For instance: [2][1][5] with a format value of "01-001. " // should format to "02-001-005 ". String lastSep = "."; boolean isFirstToken = true; // true if first token String formatValue = (null != m_format_avt) ? m_format_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; if (null == formatValue) formatValue = "1"; NumberFormatStringTokenizer formatTokenizer = new NumberFormatStringTokenizer(formatValue); // int sepCount = 0; // keep track of seperators // Loop through all the numbers in the list. for (int i = 0; i < nNumbers; i++) { // Loop to the next digit, letter, or separator. if (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); // If the first character of this token is a character or digit, then // it is a number format directive. if (Character.isLetterOrDigit( formatToken.charAt(formatToken.length() - 1))) { numberWidth = formatToken.length(); numberType = formatToken.charAt(numberWidth - 1); } // If there is a number format directive ahead, // then append the formatToken. else if (formatTokenizer.isLetterOrDigitAhead()) { final StringBuffer formatTokenStringBuffer = new StringBuffer(formatToken); // Append the formatToken string... // For instance [2][1][5] with a format value of "1--1. " // should format to "2--1--5. " (I guess). while (formatTokenizer.nextIsSep()) { formatToken = formatTokenizer.nextToken(); formatTokenStringBuffer.append(formatToken); } formatTokenString = formatTokenStringBuffer.toString(); // Record this separator, so it can be used as the // next separator, if the next is the last. // For instance: [2][1][5] with a format value of "1-1 " // should format to "2-1-5 ". if (!isFirstToken) lastSep = formatTokenString; // Since we know the next is a number or digit, we get it now. formatToken = formatTokenizer.nextToken(); numberWidth = formatToken.length(); numberType = formatToken.charAt(numberWidth - 1); } else // only separators left { // Set up the string for the trailing characters after // the last number is formatted (i.e. after the loop). lastSepString = formatToken; // And append any remaining characters to the lastSepString. while (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); lastSepString += formatToken; } } // else } // end if(formatTokenizer.hasMoreTokens()) // if this is the first token and there was a prefix // append the prefix else, append the separator // For instance, [2][1][5] with a format value of "(1-1.) " // should format to "(2-1-5.) " (I guess). if (null != formatTokenString && isFirstToken) { formattedNumber.append(formatTokenString); } else if (null != lastSep &&!isFirstToken) formattedNumber.append(lastSep); getFormattedNumber(transformer, contextNode, numberType, numberWidth, list[i], formattedNumber); isFirstToken = false; // After the first pass, this should be false } // end for loop // Check to see if we finished up the format string... // Skip past all remaining letters or digits while (formatTokenizer.isLetterOrDigitAhead()) { formatTokenizer.nextToken(); } if (lastSepString != null) formattedNumber.append(lastSepString); while (formatTokenizer.hasMoreTokens()) { formatToken = formatTokenizer.nextToken(); formattedNumber.append(formatToken); } numStr = formattedNumber.toString(); } finally { StringBufferPool.free(formattedNumber); } return numStr; }
// in src/org/apache/xalan/templates/ElemNumber.java
private void getFormattedNumber( TransformerImpl transformer, int contextNode, char numberType, int numberWidth, long listElement, FastStringBuffer formattedNumber) throws javax.xml.transform.TransformerException { String letterVal = (m_lettervalue_avt != null) ? m_lettervalue_avt.evaluate( transformer.getXPathContext(), contextNode, this) : null; /** * Wrapper of Chars for converting integers into alpha counts. */ CharArrayWrapper alphaCountTable = null; XResourceBundle thisBundle = null; switch (numberType) { case 'A' : if (null == m_alphaCountTable){ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); } int2alphaCount(listElement, m_alphaCountTable, formattedNumber); break; case 'a' : if (null == m_alphaCountTable){ thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); } FastStringBuffer stringBuf = StringBufferPool.get(); try { int2alphaCount(listElement, m_alphaCountTable, stringBuf); formattedNumber.append( stringBuf.toString().toLowerCase( getLocale(transformer, contextNode))); } finally { StringBufferPool.free(stringBuf); } break; case 'I' : formattedNumber.append(long2roman(listElement, true)); break; case 'i' : formattedNumber.append( long2roman(listElement, true).toLowerCase( getLocale(transformer, contextNode))); break; case 0x3042 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HA")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x3044 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "HI")); if ((letterVal != null) && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x30A2 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "A")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x30A4 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ja", "JP", "I")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) formattedNumber.append( int2singlealphaCount( listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET))); break; } case 0x4E00 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "CN")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) { formattedNumber.append(tradAlphaCount(listElement, thisBundle)); } else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x58F9 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("zh", "TW")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x0E51 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("th", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x05D0 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("he", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x10D0 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("ka", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x03B1 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("el", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } case 0x0430 : { thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, new Locale("cy", "")); if (letterVal != null && letterVal.equals(Constants.ATTRVAL_TRADITIONAL)) formattedNumber.append(tradAlphaCount(listElement, thisBundle)); else //if (m_lettervalue_avt != null && m_lettervalue_avt.equals(Constants.ATTRVAL_ALPHABETIC)) int2alphaCount(listElement, (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET), formattedNumber); break; } default : // "1" DecimalFormat formatter = getNumberFormatter(transformer, contextNode); String padString = formatter == null ? String.valueOf(0) : formatter.format(0); String numString = formatter == null ? String.valueOf(listElement) : formatter.format(listElement); int nPadding = numberWidth - numString.length(); for (int k = 0; k < nPadding; k++) { formattedNumber.append(padString); } formattedNumber.append(numString); } }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplateFast(XPathContext xctxt, int targetNode, int expTypeID, QName mode, int maxImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head; switch (dtm.getNodeType(targetNode)) { case DTM.ELEMENT_NODE : case DTM.ATTRIBUTE_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getLocalNameFromExpandedNameID(expTypeID)); break; case DTM.TEXT_NODE : case DTM.CDATA_SECTION_NODE : head = m_textPatterns; break; case DTM.ENTITY_REFERENCE_NODE : case DTM.ENTITY_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getNodeName(targetNode)); // %REVIEW% I think this is right break; case DTM.PROCESSING_INSTRUCTION_NODE : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getLocalName(targetNode)); break; case DTM.COMMENT_NODE : head = m_commentPatterns; break; case DTM.DOCUMENT_NODE : case DTM.DOCUMENT_FRAGMENT_NODE : head = m_docPatterns; break; case DTM.NOTATION_NODE : default : head = (TemplateSubPatternAssociation) m_patternTable.get( dtm.getNodeName(targetNode)); // %REVIEW% I think this is right } if(null == head) { head = m_wildCardPatterns; if(null == head) return null; } // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); try { do { if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel) ) { continue; } ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode, dtm, expTypeID) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popNamespaceContext(); } return null; }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplate(XPathContext xctxt, int targetNode, QName mode, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head = getHead(xctxt, targetNode, dtm); if (null != head) { // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try { do { ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); } } return null; }
// in src/org/apache/xalan/templates/TemplateList.java
public ElemTemplate getTemplate(XPathContext xctxt, int targetNode, QName mode, int maxImportLevel, int endImportLevel, boolean quietConflictWarnings, DTM dtm) throws TransformerException { TemplateSubPatternAssociation head = getHead(xctxt, targetNode, dtm); if (null != head) { // XSLT functions, such as xsl:key, need to be able to get to // current ElemTemplateElement via a cast to the prefix resolver. // Setting this fixes bug idkey03. xctxt.pushNamespaceContextNull(); xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try { do { if ( (maxImportLevel > -1) && (head.getImportLevel() > maxImportLevel)) { continue; } if (head.getImportLevel()<= maxImportLevel - endImportLevel) return null; ElemTemplate template = head.getTemplate(); xctxt.setNamespaceContext(template); if ((head.m_stepPattern.execute(xctxt, targetNode) != NodeTest.SCORE_NONE) && head.matchMode(mode)) { if (quietConflictWarnings) checkConflicts(head, xctxt, targetNode, mode); return template; } } while (null != (head = head.getNext())); } finally { xctxt.popCurrentNodeAndExpression(); xctxt.popNamespaceContext(); } } return null; }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); String lang = null; String srcURL = null; String scriptSrc = null; if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Register the extension namespace if it has not already been registered. ExtensionNamespaceSupport extNsSpt = null; ExtensionNamespacesManager extNsMgr = sroot.getExtensionNamespacesManager(); if (extNsMgr.namespaceIndex(declNamespace, extNsMgr.getExtensions()) == -1) { if (lang.equals("javaclass")) { if (null == srcURL) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace); } else if (extNsMgr.namespaceIndex(srcURL, extNsMgr.getExtensions()) == -1) { extNsSpt = extNsMgr.defineJavaNamespace(declNamespace, srcURL); } } else // not java { String handler = "org.apache.xalan.extensions.ExtensionHandlerGeneral"; Object [] args = {declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()}; extNsSpt = new ExtensionNamespaceSupport(declNamespace, handler, args); } } if (extNsSpt != null) extNsMgr.registerExtension(extNsSpt); }
// in src/org/apache/xalan/templates/ElemExtensionDecl.java
public void runtimeInit(TransformerImpl transformer) throws TransformerException { /* //System.out.println("ElemExtensionDecl.runtimeInit()"); String lang = null; String srcURL = null; String scriptSrc = null; String prefix = getPrefix(); String declNamespace = getNamespaceForPrefix(prefix); if (null == declNamespace) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_NAMESPACE_DECL, new Object[]{prefix})); //"Prefix " + prefix does not have a corresponding namespace declaration"); for (ElemTemplateElement child = getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { if (Constants.ELEMNAME_EXTENSIONSCRIPT == child.getXSLToken()) { ElemExtensionScript sdecl = (ElemExtensionScript) child; lang = sdecl.getLang(); srcURL = sdecl.getSrc(); ElemTemplateElement childOfSDecl = sdecl.getFirstChildElem(); if (null != childOfSDecl) { if (Constants.ELEMNAME_TEXTLITERALRESULT == childOfSDecl.getXSLToken()) { ElemTextLiteral tl = (ElemTextLiteral) childOfSDecl; char[] chars = tl.getChars(); scriptSrc = new String(chars); if (scriptSrc.trim().length() == 0) scriptSrc = null; } } } } if (null == lang) lang = "javaclass"; if (lang.equals("javaclass") && (scriptSrc != null)) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEM_CONTENT_NOT_ALLOWED, new Object[]{scriptSrc})); //"Element content not allowed for lang=javaclass " + scriptSrc); // Instantiate a handler for this extension namespace. ExtensionsTable etable = transformer.getExtensionsTable(); ExtensionHandler nsh = etable.get(declNamespace); // If we have no prior ExtensionHandler for this namespace, we need to // create one. // If the script element is for javaclass, this is our special compiled java. // Element content is not supported for this so we throw an exception if // it is provided. Otherwise, we look up the srcURL to see if we already have // an ExtensionHandler. if (null == nsh) { if (lang.equals("javaclass")) { if (null == srcURL) { nsh = etable.makeJavaNamespace(declNamespace); } else { nsh = etable.get(srcURL); if (null == nsh) { nsh = etable.makeJavaNamespace(srcURL); } } } else // not java { nsh = new ExtensionHandlerGeneral(declNamespace, this.m_elements, this.m_functions, lang, srcURL, scriptSrc, getSystemId()); // System.out.println("Adding NS Handler: declNamespace = "+ // declNamespace+", lang = "+lang+", srcURL = "+ // srcURL+", scriptSrc="+scriptSrc); } etable.addExtensionNamespace(declNamespace, nsh); }*/ }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); avt.fixupVariables(vnames, cstate.getGlobalsSize()); } } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void resolvePrefixTables() throws TransformerException { super.resolvePrefixTables(); StylesheetRoot stylesheet = getStylesheetRoot(); if ((null != m_namespace) && (m_namespace.length() > 0)) { NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace); if (null != nsa) { m_namespace = nsa.getResultNamespace(); // String resultPrefix = nsa.getResultPrefix(); String resultPrefix = nsa.getStylesheetPrefix(); // As per xsl WG, Mike Kay if ((null != resultPrefix) && (resultPrefix.length() > 0)) m_rawName = resultPrefix + ":" + m_localName; else m_rawName = m_localName; } } if (null != m_avts) { int n = m_avts.size(); for (int i = 0; i < n; i++) { AVT avt = (AVT) m_avts.get(i); // Should this stuff be a method on AVT? String ns = avt.getURI(); if ((null != ns) && (ns.length() > 0)) { NamespaceAlias nsa = stylesheet.getNamespaceAliasComposed(m_namespace); // %REVIEW% ns? if (null != nsa) { String namespace = nsa.getResultNamespace(); // String resultPrefix = nsa.getResultPrefix(); String resultPrefix = nsa.getStylesheetPrefix(); // As per XSL WG String rawName = avt.getName(); if ((null != resultPrefix) && (resultPrefix.length() > 0)) rawName = resultPrefix + ":" + rawName; avt.setURI(namespace); avt.setRawName(rawName); } } } } }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
private boolean excludeResultNSDecl(String prefix, String uri) throws TransformerException { if (null != m_excludeResultPrefixes) { return containsExcludeResultPrefix(prefix, uri); } return false; }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
public void execute(TransformerImpl transformer) throws TransformerException { SerializationHandler rhandler = transformer.getSerializationHandler(); try { if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. rhandler.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } // JJK Bugzilla 3464, test namespace85 -- make sure LRE's // namespace is asserted even if default, since xsl:element // may have changed the context. rhandler.startPrefixMapping(getPrefix(), getNamespace()); // Add namespace declarations. executeNSDecls(transformer); rhandler.startElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { throw new TransformerException(se); } /* * If we make it to here we have done a successful startElement() * we will do an endElement() call for balance, no matter what happens * in the middle. */ // tException remembers if we had an exception "in the middle" TransformerException tException = null; try { // Process any possible attributes from xsl:use-attribute-sets first super.execute(transformer); //xsl:version, excludeResultPrefixes??? // Process the list of avts next if (null != m_avts) { int nAttrs = m_avts.size(); for (int i = (nAttrs - 1); i >= 0; i--) { AVT avt = (AVT) m_avts.get(i); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String stringedValue = avt.evaluate(xctxt, sourceNode, this); if (null != stringedValue) { // Important Note: I'm not going to check for excluded namespace // prefixes here. It seems like it's too expensive, and I'm not // even sure this is right. But I could be wrong, so this needs // to be tested against other implementations. rhandler.addAttribute( avt.getURI(), avt.getName(), avt.getRawName(), "CDATA", stringedValue, false); } } // end for } // Now process all the elements in this subtree // TODO: Process m_extensionElementPrefixes && m_attributeSetsNames transformer.executeChildTemplates(this, true); } catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; } catch (SAXException se) { tException = new TransformerException(se); } try { /* we need to do this endElement() to balance the * successful startElement() call even if * there was an exception in the middle. * Otherwise an exception in the middle could cause a system to hang. */ if (transformer.getDebug()) { // flush any buffered pending processing before // the trace event. //rhandler.flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } rhandler.endElement(getNamespace(), getLocalName(), getRawName()); } catch (SAXException se) { /* we did call endElement(). If thee was an exception * in the middle throw that one, otherwise if there * was an exception from endElement() throw that one. */ if (tException != null) throw tException; else throw new TransformerException(se); } /* If an exception was thrown in the middle but not with startElement() or * or endElement() then its time to let it percolate. */ if (tException != null) throw tException; unexecuteNSDecls(transformer); // JJK Bugzilla 3464, test namespace85 -- balance explicit start. try { rhandler.endPrefixMapping(getPrefix()); } catch (SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/XUnresolvedVariableSimple.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { Expression expr = ((ElemVariable)m_obj).getSelect().getExpression(); XObject xobj = expr.execute(xctxt); xobj.allowDetachToRelease(false); return xobj; }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void execute(TransformerImpl transformer) throws TransformerException { transformer.pushCurrentTemplateRuleIsNull(false); boolean pushMode = false; try { // %REVIEW% Do we need this check?? // if (null != sourceNode) // { // boolean needToTurnOffInfiniteLoopCheck = false; QName mode = transformer.getMode(); if (!m_isDefaultTemplate) { if (((null == mode) && (null != m_mode)) || ((null != mode) &&!mode.equals(m_mode))) { pushMode = true; transformer.pushMode(m_mode); } } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); transformSelectedNodes(transformer); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); if (pushMode) transformer.popMode(); transformer.popCurrentTemplateRuleIsNull(); } }
// in src/org/apache/xalan/templates/ElemApplyTemplates.java
public void transformSelectedNodes(TransformerImpl transformer) throws TransformerException { final XPathContext xctxt = transformer.getXPathContext(); final int sourceNode = xctxt.getCurrentNode(); DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); VariableStack vars = xctxt.getVarStack(); int nParams = getParamElemCount(); int thisframe = vars.getStackFrame(); StackGuard guard = transformer.getStackGuard(); boolean check = (guard.getRecursionLimit() > -1) ? true : false; boolean pushContextNodeListFlag = false; try { xctxt.pushCurrentNode(DTM.NULL); xctxt.pushCurrentExpressionNode(DTM.NULL); xctxt.pushSAXLocatorNull(); transformer.pushElemTemplateElement(null); final Vector keys = (m_sortElems == null) ? null : transformer.processSortKeys(this, sourceNode); // Sort if we need to. if (null != keys) sourceNodes = sortNodes(xctxt, keys, sourceNodes); if (transformer.getDebug()) { transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); } final SerializationHandler rth = transformer.getSerializationHandler(); // ContentHandler chandler = rth.getContentHandler(); final StylesheetRoot sroot = transformer.getStylesheet(); final TemplateList tl = sroot.getTemplateListComposed(); final boolean quiet = transformer.getQuietConflictWarnings(); // Should be able to get this from the iterator but there must be a bug. DTM dtm = xctxt.getDTM(sourceNode); int argsFrame = -1; if(nParams > 0) { // This code will create a section on the stack that is all the // evaluated arguments. These will be copied into the real params // section of each called template. argsFrame = vars.link(nParams); vars.setStackFrame(thisframe); for (int i = 0; i < nParams; i++) { ElemWithParam ewp = m_paramElems[i]; if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(ewp); XObject obj = ewp.getValue(transformer, sourceNode); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(ewp); vars.setLocalVariable(i, obj, argsFrame); } vars.setStackFrame(argsFrame); } xctxt.pushContextNodeList(sourceNodes); pushContextNodeListFlag = true; IntStack currentNodes = xctxt.getCurrentNodeStack(); IntStack currentExpressionNodes = xctxt.getCurrentExpressionNodeStack(); // pushParams(transformer, xctxt); int child; while (DTM.NULL != (child = sourceNodes.nextNode())) { currentNodes.setTop(child); currentExpressionNodes.setTop(child); if(xctxt.getDTM(child) != dtm) { dtm = xctxt.getDTM(child); } final int exNodeType = dtm.getExpandedTypeID(child); final int nodeType = dtm.getNodeType(child); final QName mode = transformer.getMode(); ElemTemplate template = tl.getTemplateFast(xctxt, child, exNodeType, mode, -1, quiet, dtm); // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = sroot.getDefaultRule(); // %OPT% direct faster? break; case DTM.ATTRIBUTE_NODE : case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : // if(rth.m_elemIsPending || rth.m_docPending) // rth.flushPending(true); transformer.pushPairCurrentMatched(sroot.getDefaultTextRule(), child); transformer.setCurrentElement(sroot.getDefaultTextRule()); // dtm.dispatchCharactersEvents(child, chandler, false); dtm.dispatchCharactersEvents(child, rth, false); transformer.popCurrentMatched(); continue; case DTM.DOCUMENT_NODE : template = sroot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. continue; } } else { transformer.setCurrentElement(template); } transformer.pushPairCurrentMatched(template, child); if (check) guard.checkForInfinateLoop(); int currentFrameBottom; // See comment with unlink, below if(template.m_frameSize > 0) { xctxt.pushRTFContext(); currentFrameBottom = vars.getStackFrame(); // See comment with unlink, below vars.link(template.m_frameSize); // You can't do the check for nParams here, otherwise the // xsl:params might not be nulled. if(/* nParams > 0 && */ template.m_inArgsSize > 0) { int paramIndex = 0; for (ElemTemplateElement elem = template.getFirstChildElem(); null != elem; elem = elem.getNextSiblingElem()) { if(Constants.ELEMNAME_PARAMVARIABLE == elem.getXSLToken()) { ElemParam ep = (ElemParam)elem; int i; for (i = 0; i < nParams; i++) { ElemWithParam ewp = m_paramElems[i]; if(ewp.m_qnameID == ep.m_qnameID) { XObject obj = vars.getLocalVariable(i, argsFrame); vars.setLocalVariable(paramIndex, obj); break; } } if(i == nParams) vars.setLocalVariable(paramIndex, null); } else break; paramIndex++; } } } else currentFrameBottom = 0; // Fire a trace event for the template. if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(template); // And execute the child templates. // Loop through the children of the template, calling execute on // each of them. for (ElemTemplateElement t = template.m_firstChild; t != null; t = t.m_nextSibling) { xctxt.setSAXLocator(t); try { transformer.pushElemTemplateElement(t); t.execute(transformer); } finally { transformer.popElemTemplateElement(); } } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(template); if(template.m_frameSize > 0) { // See Frank Weiss bug around 03/19/2002 (no Bugzilla report yet). // While unlink will restore to the proper place, the real position // may have been changed for xsl:with-param, so that variables // can be accessed. // of right now. // More: // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(currentFrameBottom); xctxt.popRTFContext(); } transformer.popCurrentMatched(); } // end while (DTM.NULL != (child = sourceNodes.nextNode())) } catch (SAXException se) { transformer.getErrorListener().fatalError(new TransformerException(se)); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEndEvent(sourceNode, this, "select", new XPath(m_selectExpression), new org.apache.xpath.objects.XNodeSet(sourceNodes)); // Unlink to the original stack frame if(nParams > 0) vars.unlink(thisframe); xctxt.popSAXLocator(); if (pushContextNodeListFlag) xctxt.popContextNodeList(); transformer.popElemTemplateElement(); xctxt.popCurrentExpressionNode(); xctxt.popCurrentNode(); sourceNodes.detach(); } }
// in src/org/apache/xalan/templates/Stylesheet.java
private void readObject(ObjectInputStream stream) throws IOException, TransformerException { // System.out.println("Reading Stylesheet"); try { stream.defaultReadObject(); } catch (ClassNotFoundException cnfe) { throw new TransformerException(cnfe); } // System.out.println("Done reading Stylesheet"); }
// in src/org/apache/xalan/templates/Stylesheet.java
public ElemTemplate getTemplate(int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); return (ElemTemplate) m_templates.elementAt(i); }
// in src/org/apache/xalan/templates/Stylesheet.java
public void replaceTemplate(ElemTemplate v, int i) throws TransformerException { if (null == m_templates) throw new ArrayIndexOutOfBoundsException(); replaceChild(v, (ElemTemplateElement)m_templates.elementAt(i)); m_templates.setElementAt(v, i); v.setStylesheet(this); }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public void recompose(Vector recomposableElements) throws TransformerException { //recomposeImports(); // Calculate the number of this import. //recomposeIncludes(this); // Build the global include list for this stylesheet. // Now add in all of the recomposable elements at this precedence level int n = getIncludeCountComposed(); for (int i = -1; i < n; i++) { Stylesheet included = getIncludeComposed(i); // Add in the output elements int s = included.getOutputCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getOutput(j)); } // Next, add in the attribute-set elements s = included.getAttributeSetCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getAttributeSet(j)); } // Now the decimal-formats s = included.getDecimalFormatCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getDecimalFormat(j)); } // Now the keys s = included.getKeyCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getKey(j)); } // And the namespace aliases s = included.getNamespaceAliasCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getNamespaceAlias(j)); } // Next comes the templates s = included.getTemplateCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getTemplate(j)); } // Then, the variables s = included.getVariableOrParamCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getVariableOrParam(j)); } // And lastly the whitespace preserving and stripping elements s = included.getStripSpaceCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getStripSpace(j)); } s = included.getPreserveSpaceCount(); for (int j = 0; j < s; j++) { recomposableElements.addElement(included.getPreserveSpace(j)); } } }
// in src/org/apache/xalan/templates/StylesheetComposed.java
public void recomposeTemplates(boolean flushFirst) throws TransformerException { /*************************************** KEEP METHOD IN FOR COMPILATION if (flushFirst) m_templateList = new TemplateList(this); recomposeTemplates(); *****************************************/ }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_matchPattern) m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); cstate.resetStackFrameSize(); m_inArgsSize = 0; }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); super.endCompose(sroot); m_frameSize = cstate.getFrameSize(); cstate.resetStackFrameSize(); }
// in src/org/apache/xalan/templates/ElemTemplate.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); transformer.getStackGuard().checkForInfinateLoop(); xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // %REVIEW% commenting out of the code below. // if (null != sourceNode) // { transformer.executeChildTemplates(this, true); // } // else // if(null == sourceNode) // { // transformer.getMsgMgr().error(this, // this, sourceNode, // XSLTErrorResources.ER_NULL_SOURCENODE_HANDLEAPPLYTEMPLATES); // // //"sourceNode is null in handleApplyTemplatesInstruction!"); // } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/FuncKey.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // TransformerImpl transformer = (TransformerImpl)xctxt; TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject(); XNodeSet nodes = null; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocumentRoot(context); if (DTM.NULL == docContext) { // path.error(context, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC); //"context does not have an owner document!"); } String xkeyname = getArg0().execute(xctxt).str(); QName keyname = new QName(xkeyname, xctxt.getNamespaceContext()); XObject arg = getArg1().execute(xctxt); boolean argIsNodeSetDTM = (XObject.CLASS_NODESET == arg.getType()); KeyManager kmgr = transformer.getKeyManager(); // Don't bother with nodeset logic if the thing is only one node. if(argIsNodeSetDTM) { XNodeSet ns = (XNodeSet)arg; ns.setShouldCacheNodes(true); int len = ns.getLength(); if(len <= 1) argIsNodeSetDTM = false; } if (argIsNodeSetDTM) { Hashtable usedrefs = null; DTMIterator ni = arg.iter(); int pos; UnionPathIterator upi = new UnionPathIterator(); upi.exprSetParent(this); while (DTM.NULL != (pos = ni.nextNode())) { dtm = xctxt.getDTM(pos); XMLString ref = dtm.getStringValue(pos); if (null == ref) continue; if (null == usedrefs) usedrefs = new Hashtable(); if (usedrefs.get(ref) != null) { continue; // We already have 'em. } else { // ISTRUE being used as a dummy value. usedrefs.put(ref, ISTRUE); } XNodeSet nl = kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname, ref, xctxt.getNamespaceContext()); nl.setRoot(xctxt.getCurrentNode(), xctxt); // try // { upi.addIterator(nl); // } // catch(CloneNotSupportedException cnse) // { // // will never happen. // } //mnodeset.addNodesInDocOrder(nl, xctxt); needed?? } int current = xctxt.getCurrentNode(); upi.setRoot(current, xctxt); nodes = new XNodeSet(upi); } else { XMLString ref = arg.xstr(); nodes = kmgr.getNodeSetDTMByKey(xctxt, docContext, keyname, ref, xctxt.getNamespaceContext()); nodes.setRoot(xctxt.getCurrentNode(), xctxt); } return nodes; }
// in src/org/apache/xalan/templates/ElemWithParam.java
public void compose(StylesheetRoot sroot) throws TransformerException { // See if we can reduce an RTF to a select with a string expression. if(null == m_selectPattern && sroot.getOptimizer()) { XPath newSelect = ElemVariable.rewriteChildToExpression(this); if(null != newSelect) m_selectPattern = newSelect; } m_qnameID = sroot.getComposeState().getQNameID(m_qname); super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_selectPattern) m_selectPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); // m_index must be resolved by ElemApplyTemplates and ElemCallTemplate! }
// in src/org/apache/xalan/templates/ElemWithParam.java
public XObject getValue(TransformerImpl transformer, int sourceNode) throws TransformerException { XObject var; XPathContext xctxt = transformer.getXPathContext(); xctxt.pushCurrentNode(sourceNode); try { if (null != m_selectPattern) { var = m_selectPattern.execute(xctxt, sourceNode, this); var.allowDetachToRelease(false); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectPattern, var); } else if (null == getFirstChildElem()) { var = XString.EMPTYSTRING; } else { // Use result tree fragment int df = transformer.transformToRTF(this); var = new XRTreeFrag(df, xctxt, this); } } finally { xctxt.popCurrentNode(); } return var; }
// in src/org/apache/xalan/templates/ElemPI.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_name_atv) m_name_atv.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemPI.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); String piName = m_name_atv == null ? null : m_name_atv.evaluate(xctxt, sourceNode, this); // Ignore processing instruction if name is null if (piName == null) return; if (piName.equalsIgnoreCase("xml")) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NAME_CANT_BE_XML, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Only check if an avt was used (ie. this wasn't checked at compose time.) // Ignore processing instruction, if invalid else if ((!m_name_atv.isSimple()) && (!XML11Char.isXML11ValidNCName(piName))) { transformer.getMsgMgr().warn( this, XSLTErrorResources.WG_PROCESSINGINSTRUCTION_NOTVALID_NCNAME, new Object[]{ Constants.ATTRNAME_NAME, piName }); return; } // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); try { transformer.getResultTreeHandler().processingInstruction(piName, data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemSort.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); java.util.Vector vnames = cstate.getVariableNames(); if(null != m_caseorder_avt) m_caseorder_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_dataType_avt) m_dataType_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_lang_avt) m_lang_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_order_avt) m_order_avt.fixupVariables(vnames, cstate.getGlobalsSize()); if(null != m_selectExpression) m_selectExpression.fixupVariables(vnames, cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemAttributeSet.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (transformer.isRecursiveAttrSet(this)) { throw new TransformerException( XSLMessages.createMessage( XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF, new Object[]{ m_qname.getLocalPart() })); //"xsl:attribute-set '"+m_qname.m_localpart+ } transformer.pushElemAttributeSet(this); super.execute(transformer); ElemAttribute attr = (ElemAttribute) getFirstChildElem(); while (null != attr) { attr.execute(transformer); attr = (ElemAttribute) attr.getNextSiblingElem(); } transformer.popElemAttributeSet(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemApplyImport.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.currentTemplateRuleIsNull()) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NO_APPLY_IMPORT_IN_FOR_EACH); //"xsl:apply-imports not allowed in a xsl:for-each"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); if (DTM.NULL != sourceNode) { // supply the current templated (matched, not named) ElemTemplate matchTemplate = transformer.getMatchedTemplate(); transformer.applyTemplateToNode(this, matchTemplate, sourceNode); } else // if(null == sourceNode) { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_NULL_SOURCENODE_APPLYIMPORTS); //"sourceNode is null in xsl:apply-imports!"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void execute(TransformerImpl transformer, XObject[] args) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); // Increment the frame bottom of the variable stack by the // frame size int thisFrame = vars.getStackFrame(); int nextFrame = vars.link(m_frameSize); if (m_inArgsSize < args.length) { throw new TransformerException ("function called with too many args"); } // Set parameters, // have to clear the section of the stack frame that has params. if (m_inArgsSize > 0) { vars.clearLocalSlots(0, m_inArgsSize); if (args.length > 0) { vars.setStackFrame(thisFrame); NodeList children = this.getChildNodes(); for (int i = 0; i < args.length; i ++) { Node child = children.item(i); if (children.item(i) instanceof ElemParam) { ElemParam param = (ElemParam)children.item(i); vars.setLocalVariable(param.getIndex(), args[i], nextFrame); } } vars.setStackFrame(nextFrame); } } // Removed ElemTemplate 'push' and 'pop' of RTFContext, in order to avoid losing the RTF context // before a value can be returned. ElemExsltFunction operates in the scope of the template that called // the function. // xctxt.pushRTFContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); vars.setStackFrame(nextFrame); transformer.executeChildTemplates(this, true); // Reset the stack frame after the function call vars.unlink(thisFrame); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // Following ElemTemplate 'pop' removed -- see above. // xctxt.popRTFContext(); }
// in src/org/apache/xalan/templates/ElemExsltFunction.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Register the function namespace (if not already registered). String namespace = getName().getNamespace(); String handlerClass = sroot.getExtensionHandlerClass(); Object[] args ={namespace, sroot}; ExtensionNamespaceSupport extNsSpt = new ExtensionNamespaceSupport(namespace, handlerClass, args); sroot.getExtensionNamespacesManager().registerExtension(extNsSpt); // Make sure there is a handler for the EXSLT functions namespace // -- for isElementAvailable(). if (!(namespace.equals(Constants.S_EXSLT_FUNCTIONS_URL))) { namespace = Constants.S_EXSLT_FUNCTIONS_URL; args = new Object[]{namespace, sroot}; extNsSpt = new ExtensionNamespaceSupport(namespace, handlerClass, args); sroot.getExtensionNamespacesManager().registerExtension(extNsSpt); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void runtimeInit(TransformerImpl transformer) throws TransformerException{}
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void execute( TransformerImpl transformer) throws TransformerException{}
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void recompose(StylesheetRoot root) throws TransformerException { }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void compose(StylesheetRoot sroot) throws TransformerException { resolvePrefixTables(); ElemTemplateElement t = getFirstChildElem(); m_hasTextLitOnly = ((t != null) && (t.getXSLToken() == Constants.ELEMNAME_TEXTLITERALRESULT) && (t.getNextSiblingElem() == null)); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); cstate.pushStackMark(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); cstate.popStackMark(); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void setPrefixes(NamespaceSupport nsSupport) throws TransformerException { setPrefixes(nsSupport, false); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException { Enumeration decls = nsSupport.getDeclaredPrefixes(); while (decls.hasMoreElements()) { String prefix = (String) decls.nextElement(); if (null == m_declaredPrefixes) m_declaredPrefixes = new ArrayList(); String uri = nsSupport.getURI(prefix); if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL)) continue; // System.out.println("setPrefixes - "+prefix+", "+uri); XMLNSDecl decl = new XMLNSDecl(prefix, uri, false); m_declaredPrefixes.add(decl); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
private boolean excludeResultNSDecl(String prefix, String uri) throws TransformerException { if (uri != null) { if (uri.equals(Constants.S_XSLNAMESPACEURL) || getStylesheet().containsExtensionElementURI(uri)) return true; if (containsExcludeResultPrefix(prefix, uri)) return true; } return false; }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public void resolvePrefixTables() throws TransformerException { // Always start with a fresh prefix table! setPrefixTable(null); // If we have declared declarations, then we look for // a parent that has namespace decls, and add them // to this element's decls. Otherwise we just point // to the parent that has decls. if (null != this.m_declaredPrefixes) { StylesheetRoot stylesheet = this.getStylesheetRoot(); // Add this element's declared prefixes to the // prefix table. int n = m_declaredPrefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_declaredPrefixes.get(i); String prefix = decl.getPrefix(); String uri = decl.getURI(); if(null == uri) uri = ""; boolean shouldExclude = excludeResultNSDecl(prefix, uri); // Create a new prefix table if one has not already been created. if (null == m_prefixTable) setPrefixTable(new ArrayList()); NamespaceAlias nsAlias = stylesheet.getNamespaceAliasComposed(uri); if(null != nsAlias) { // Should I leave the non-aliased element in the table as // an excluded element? // The exclusion should apply to the non-aliased prefix, so // we don't calculate it here. -sb // Use stylesheet prefix, as per xsl WG decl = new XMLNSDecl(nsAlias.getStylesheetPrefix(), nsAlias.getResultNamespace(), shouldExclude); } else decl = new XMLNSDecl(prefix, uri, shouldExclude); m_prefixTable.add(decl); } } ElemTemplateElement parent = this.getParentNodeElem(); if (null != parent) { // The prefix table of the parent should never be null! List prefixes = parent.m_prefixTable; if (null == m_prefixTable && !needToCheckExclude()) { // Nothing to combine, so just use parent's table! setPrefixTable(parent.m_prefixTable); } else { // Add the prefixes from the parent's prefix table. int n = prefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) prefixes.get(i); boolean shouldExclude = excludeResultNSDecl(decl.getPrefix(), decl.getURI()); if (shouldExclude != decl.getIsExcluded()) { decl = new XMLNSDecl(decl.getPrefix(), decl.getURI(), shouldExclude); } //m_prefixTable.addElement(decl); addOrReplaceDecls(decl); } } } else if (null == m_prefixTable) { // Must be stylesheet element without any result prefixes! setPrefixTable(new ArrayList()); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer) throws TransformerException { executeNSDecls(transformer, null); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void executeNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer) throws TransformerException { unexecuteNSDecls(transformer, null); }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
void unexecuteNSDecls(TransformerImpl transformer, String ignorePrefix) throws TransformerException { try { if (null != m_prefixTable) { SerializationHandler rhandler = transformer.getResultTreeHandler(); int n = m_prefixTable.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) { rhandler.endPrefixMapping(decl.getPrefix()); } } } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/templates/ElemTemplateElement.java
public boolean shouldStripWhiteSpace( org.apache.xpath.XPathContext support, org.w3c.dom.Element targetElement) throws TransformerException { StylesheetRoot sroot = this.getStylesheetRoot(); return (null != sroot) ? sroot.shouldStripWhiteSpace(support, targetElement) :false; }
// in src/org/apache/xalan/templates/ElemCopy.java
public void execute( TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); try { int sourceNode = xctxt.getCurrentNode(); xctxt.pushCurrentNode(sourceNode); DTM dtm = xctxt.getDTM(sourceNode); short nodeType = dtm.getNodeType(sourceNode); if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType)) { SerializationHandler rthandler = transformer.getSerializationHandler(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // TODO: Process the use-attribute-sets stuff ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, rthandler, false); if (DTM.ELEMENT_NODE == nodeType) { super.execute(transformer); SerializerUtils.processNSDecls(rthandler, sourceNode, nodeType, dtm); transformer.executeChildTemplates(this, true); String ns = dtm.getNamespaceURI(sourceNode); String localName = dtm.getLocalName(sourceNode); transformer.getResultTreeHandler().endElement(ns, localName, dtm.getNodeName(sourceNode)); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } else { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); super.execute(transformer); transformer.executeChildTemplates(this, true); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { xctxt.popCurrentNode(); } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); // Call compose on each param no matter if this is apply-templates // or call templates. int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.compose(sroot); } if ((null != m_templateName) && (null == m_template)) { m_template = this.getStylesheetRoot().getTemplateComposed(m_templateName); if (null == m_template) { String themsg = XSLMessages.createMessage( XSLTErrorResources.ER_ELEMTEMPLATEELEM_ERR, new Object[] { m_templateName }); throw new TransformerException(themsg, this); //"Could not find template named: '"+templateName+"'"); } length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.m_index = -1; // Find the position of the param in the template being called, // and set the index of the param slot. int etePos = 0; for (ElemTemplateElement ete = m_template.getFirstChildElem(); null != ete; ete = ete.getNextSiblingElem()) { if(ete.getXSLToken() == Constants.ELEMNAME_PARAMVARIABLE) { ElemParam ep = (ElemParam)ete; if(ep.getName().equals(ewp.getName())) { ewp.m_index = etePos; } } else break; etePos++; } } } }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { int length = getParamElemCount(); for (int i = 0; i < length; i++) { ElemWithParam ewp = getParamElem(i); ewp.endCompose(sroot); } super.endCompose(sroot); }
// in src/org/apache/xalan/templates/ElemCallTemplate.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (null != m_template) { XPathContext xctxt = transformer.getXPathContext(); VariableStack vars = xctxt.getVarStack(); int thisframe = vars.getStackFrame(); int nextFrame = vars.link(m_template.m_frameSize); // We have to clear the section of the stack frame that has params // so that the default param evaluation will work correctly. if(m_template.m_inArgsSize > 0) { vars.clearLocalSlots(0, m_template.m_inArgsSize); if(null != m_paramElems) { int currentNode = xctxt.getCurrentNode(); vars.setStackFrame(thisframe); int size = m_paramElems.length; for (int i = 0; i < size; i++) { ElemWithParam ewp = m_paramElems[i]; if(ewp.m_index >= 0) { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(ewp); XObject obj = ewp.getValue(transformer, currentNode); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(ewp); // Note here that the index for ElemWithParam must have been // statically made relative to the xsl:template being called, // NOT this xsl:template. vars.setLocalVariable(ewp.m_index, obj, nextFrame); } } vars.setStackFrame(nextFrame); } } SourceLocator savedLocator = xctxt.getSAXLocator(); try { xctxt.setSAXLocator(m_template); // template.executeChildTemplates(transformer, sourceNode, mode, true); transformer.pushElemTemplateElement(m_template); m_template.execute(transformer); } finally { transformer.popElemTemplateElement(); xctxt.setSAXLocator(savedLocator); // When we entered this function, the current // frame buffer (cfb) index in the variable stack may // have been manually set. If we just call // unlink(), however, it will restore the cfb to the // previous link index from the link stack, rather than // the manually set cfb. So, // the only safe solution is to restore it back // to the same position it was on entry, since we're // really not working in a stack context here. (Bug4218) vars.unlink(thisframe); } } else { transformer.getMsgMgr().error(this, XSLTErrorResources.ER_TEMPLATE_NOT_FOUND, new Object[]{ m_templateName }); //"Could not find template named: '"+templateName+"'"); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemVariable.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); int sourceNode = transformer.getXPathContext().getCurrentNode(); XObject var = getValue(transformer, sourceNode); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemVariable.java
public XObject getValue(TransformerImpl transformer, int sourceNode) throws TransformerException { XObject var; XPathContext xctxt = transformer.getXPathContext(); xctxt.pushCurrentNode(sourceNode); try { if (null != m_selectPattern) { var = m_selectPattern.execute(xctxt, sourceNode, this); var.allowDetachToRelease(false); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectPattern, var); } else if (null == getFirstChildElem()) { var = XString.EMPTYSTRING; } else { // Use result tree fragment. // Global variables may be deferred (see XUnresolvedVariable) and hence // need to be assigned to a different set of DTMs than local variables // so they aren't popped off the stack on return from a template. int df; // Bugzilla 7118: A variable set via an RTF may create local // variables during that computation. To keep them from overwriting // variables at this level, push a new variable stack. ////// PROBLEM: This is provoking a variable-used-before-set ////// problem in parameters. Needs more study. try { //////////xctxt.getVarStack().link(0); if(m_parentNode instanceof Stylesheet) // Global variable df = transformer.transformToGlobalRTF(this); else df = transformer.transformToRTF(this); } finally{ //////////////xctxt.getVarStack().unlink(); } var = new XRTreeFrag(df, xctxt, this); } } finally { xctxt.popCurrentNode(); } return var; }
// in src/org/apache/xalan/templates/ElemVariable.java
public void compose(StylesheetRoot sroot) throws TransformerException { // See if we can reduce an RTF to a select with a string expression. if(null == m_selectPattern && sroot.getOptimizer()) { XPath newSelect = rewriteChildToExpression(this); if(null != newSelect) m_selectPattern = newSelect; } StylesheetRoot.ComposeState cstate = sroot.getComposeState(); // This should be done before addVariableName, so we don't have visibility // to the variable now being defined. java.util.Vector vnames = cstate.getVariableNames(); if(null != m_selectPattern) m_selectPattern.fixupVariables(vnames, cstate.getGlobalsSize()); // Only add the variable if this is not a global. If it is a global, // it was already added by stylesheet root. if(!(m_parentNode instanceof Stylesheet) && m_qname != null) { m_index = cstate.addVariableName(m_qname) - cstate.getGlobalsSize(); } else if (m_parentNode instanceof Stylesheet) { // If this is a global, then we need to treat it as if it's a xsl:template, // and count the number of variables it contains. So we set the count to // zero here. cstate.resetStackFrameSize(); } // This has to be done after the addVariableName, so that the variable // pushed won't be immediately popped again in endCompose. super.compose(sroot); }
// in src/org/apache/xalan/templates/ElemVariable.java
public void endCompose(StylesheetRoot sroot) throws TransformerException { super.endCompose(sroot); if(m_parentNode instanceof Stylesheet) { StylesheetRoot.ComposeState cstate = sroot.getComposeState(); m_frameSize = cstate.getFrameSize(); cstate.resetStackFrameSize(); } }
// in src/org/apache/xalan/templates/ElemVariable.java
static XPath rewriteChildToExpression(ElemTemplateElement varElem) throws TransformerException { ElemTemplateElement t = varElem.getFirstChildElem(); // Down the line this can be done with multiple string objects using // the concat function. if (null != t && null == t.getNextSiblingElem()) { int etype = t.getXSLToken(); if (Constants.ELEMNAME_VALUEOF == etype) { ElemValueOf valueof = (ElemValueOf) t; // %TBD% I'm worried about extended attributes here. if (valueof.getDisableOutputEscaping() == false && valueof.getDOMBackPointer() == null) { varElem.m_firstChild = null; return new XPath(new XRTreeFragSelectWrapper(valueof.getSelect().getExpression())); } } else if (Constants.ELEMNAME_TEXTLITERALRESULT == etype) { ElemTextLiteral lit = (ElemTextLiteral) t; if (lit.getDisableOutputEscaping() == false && lit.getDOMBackPointer() == null) { String str = lit.getNodeValue(); XString xstr = new XString(str); varElem.m_firstChild = null; return new XPath(new XRTreeFragSelectWrapper(xstr)); } } } return null; }
// in src/org/apache/xalan/templates/KeyDeclaration.java
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if(null != m_matchPattern) m_matchPattern.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); if(null != m_use) m_use.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemAttribute.java
protected String resolvePrefix(SerializationHandler rhandler, String prefix, String nodeNamespace) throws TransformerException { if (null != prefix && (prefix.length() == 0 || prefix.equals("xmlns"))) { // Since we can't use default namespace, in this case we try and // see if a prefix has already been defined or this namespace. prefix = rhandler.getPrefix(nodeNamespace); // System.out.println("nsPrefix: "+nsPrefix); if (null == prefix || prefix.length() == 0 || prefix.equals("xmlns")) { if(nodeNamespace.length() > 0) { NamespaceMappings prefixMapping = rhandler.getNamespaceMappings(); prefix = prefixMapping.generateNextPrefix(); } else prefix = ""; } } return prefix; }
// in src/org/apache/xalan/templates/ElemAttribute.java
void constructNode( String nodeName, String prefix, String nodeNamespace, TransformerImpl transformer) throws TransformerException { if(null != nodeName && nodeName.length() > 0) { SerializationHandler rhandler = transformer.getSerializationHandler(); // Evaluate the value of this attribute String val = transformer.transformToString(this); try { // Let the result tree handler add the attribute and its String value. String localName = QName.getLocalPart(nodeName); if(prefix != null && prefix.length() > 0){ rhandler.addAttribute(nodeNamespace, localName, nodeName, "CDATA", val, true); }else{ rhandler.addAttribute("", localName, nodeName, "CDATA", val, true); } } catch (SAXException e) { } } }
// in src/org/apache/xalan/templates/ElemComment.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { // Note the content model is: // <!ENTITY % instructions " // %char-instructions; // | xsl:processing-instruction // | xsl:comment // | xsl:element // | xsl:attribute // "> String data = transformer.transformToString(this); transformer.getResultTreeHandler().comment(data); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); StylesheetRoot.ComposeState cstate = sroot.getComposeState(); m_selectExpression.fixupVariables(cstate.getVariableNames(), cstate.getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemCopyOf.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); XObject value = m_selectExpression.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "select", m_selectExpression, value); SerializationHandler handler = transformer.getSerializationHandler(); if (null != value) { int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); // Copy the tree. DTMTreeWalker tw = new TreeWalker2Result(transformer, handler); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = xctxt.getDTMManager().getDTM(pos); short t = dtm.getNodeType(pos); // If we just copy the whole document, a startDoc and endDoc get // generated, so we need to only walk the child nodes. if (t == DTM.DOCUMENT_NODE) { for (int child = dtm.getFirstChild(pos); child != DTM.NULL; child = dtm.getNextSibling(child)) { tw.traverse(child); } } else if (t == DTM.ATTRIBUTE_NODE) { SerializerUtils.addAttribute(handler, pos); } else { tw.traverse(pos); } } // nl.detach(); break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( handler, value, transformer.getXPathContext()); break; default : s = value.str(); handler.characters(s.toCharArray(), 0, s.length()); break; } } // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endSelect", m_selectExpression, value); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); } }
// in src/org/apache/xalan/templates/ElemExsltFuncResult.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext context = transformer.getXPathContext(); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); // Verify that result has not already been set by another result // element. Recursion is allowed: intermediate results are cleared // in the owner ElemExsltFunction execute(). if (transformer.currentFuncResultSeen()) { throw new TransformerException("An EXSLT function cannot set more than one result!"); } int sourceNode = context.getCurrentNode(); // Set the return value; XObject var = getValue(transformer, sourceNode); transformer.popCurrentFuncResult(); transformer.pushCurrentFuncResult(var); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/ElemIf.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); java.util.Vector vnames = sroot.getComposeState().getVariableNames(); if (null != m_test) m_test.fixupVariables(vnames, sroot.getComposeState().getGlobalsSize()); }
// in src/org/apache/xalan/templates/ElemIf.java
public void execute(TransformerImpl transformer) throws TransformerException { XPathContext xctxt = transformer.getXPathContext(); int sourceNode = xctxt.getCurrentNode(); if (transformer.getDebug()) { XObject test = m_test.execute(xctxt, sourceNode, this); if (transformer.getDebug()) transformer.getTraceManager().fireSelectedEvent(sourceNode, this, "test", m_test, test); // xsl:for-each now fires one trace event + one for every // iteration; changing xsl:if to fire one regardless of true/false if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); if (test.bool()) { transformer.executeChildTemplates(this, true); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); // I don't think we want this. -sb // if (transformer.getDebug()) // transformer.getTraceManager().fireSelectedEvent(sourceNode, this, // "endTest", m_test, test); } else if (m_test.bool(xctxt, sourceNode, this)) { transformer.executeChildTemplates(this, true); } }
// in src/org/apache/xalan/templates/TemplateSubPatternAssociation.java
public boolean matches(XPathContext xctxt, int targetNode, QName mode) throws TransformerException { double score = m_stepPattern.getMatchScore(xctxt, targetNode); return (XPath.MATCH_SCORE_NONE != score) && matchModes(mode, m_template.getMode()); }
// in src/org/apache/xalan/templates/ElemTextLiteral.java
public void execute( TransformerImpl transformer) throws TransformerException { try { SerializationHandler rth = transformer.getResultTreeHandler(); if (transformer.getDebug()) { // flush any pending cached processing before the trace event. rth.flushPending(); transformer.getTraceManager().fireTraceEvent(this); } if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); } rth.characters(m_ch, 0, m_ch.length); if (m_disableOutputEscaping) { rth.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); } } catch(SAXException se) { throw new TransformerException(se); } finally { if (transformer.getDebug()) { try { // flush any pending cached processing before sending the trace event transformer.getResultTreeHandler().flushPending(); transformer.getTraceManager().fireTraceEndEvent(this); } catch (SAXException se) { throw new TransformerException(se); } } } }
// in src/org/apache/xalan/templates/ElemVariablePsuedo.java
public void execute(TransformerImpl transformer) throws TransformerException { // if (TransformerImpl.S_DEBUG) // transformer.getTraceManager().fireTraceEvent(this); // transformer.getXPathContext().getVarStack().pushVariable(m_qname, var); transformer.getXPathContext().getVarStack().setLocalVariable(m_index, m_lazyVar); }
// in src/org/apache/xalan/templates/ElemUnknown.java
private void executeFallbacks( TransformerImpl transformer) throws TransformerException { for (ElemTemplateElement child = m_firstChild; child != null; child = child.m_nextSibling) { if (child.getXSLToken() == Constants.ELEMNAME_FALLBACK) { try { transformer.pushElemTemplateElement(child); ((ElemFallback) child).executeFallback(transformer); } finally { transformer.popElemTemplateElement(); } } } }
// in src/org/apache/xalan/templates/ElemUnknown.java
public void execute(TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); try { if (hasFallbackChildren()) { executeFallbacks(transformer); } else { // do nothing } } catch (TransformerException e) { transformer.getErrorListener().fatalError(e); } if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void recompose(StylesheetRoot root) throws TransformerException { root.recomposeOutput(this); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void compose(StylesheetRoot sroot) throws TransformerException { super.compose(sroot); }
// in src/org/apache/xalan/templates/OutputProperties.java
public void copyFrom(OutputProperties opsrc) throws TransformerException { // Bugzilla 6157: recover from xsl:output statements // checkDuplicates(opsrc); copyFrom(opsrc.getProperties()); }
// in src/org/apache/xalan/templates/ElemMessage.java
public void execute( TransformerImpl transformer) throws TransformerException { if (transformer.getDebug()) transformer.getTraceManager().fireTraceEvent(this); String data = transformer.transformToString(this); transformer.getMsgMgr().message(this, data, m_terminate); if(m_terminate) transformer.getErrorListener().fatalError(new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_STYLESHEET_DIRECTED_TERMINATION, null))); //"Stylesheet directed termination")); if (transformer.getDebug()) transformer.getTraceManager().fireTraceEndEvent(this); }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static void switchSerializerIfHTML( TransformerImpl transformer, String ns, String localName) throws TransformerException { if (null == transformer) return; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)) return; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = transformer.getOutputFormat().getProperties(); // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); try { // Serializer oldSerializer = transformer.getSerializer(); Serializer oldSerializer = null; if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = oldSerializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } // transformer.setSerializer(serializer); ContentHandler ch = serializer.asContentHandler(); transformer.setContentHandler(ch); } } catch (java.io.IOException e) { throw new TransformerException(e); } } }
// in src/org/apache/xalan/transformer/SerializerSwitcher.java
public static Serializer switchSerializerIfHTML( String ns, String localName, Properties props, Serializer oldSerializer) throws TransformerException { Serializer newSerializer = oldSerializer; if (((null == ns) || (ns.length() == 0)) && localName.equalsIgnoreCase("html")) { // System.out.println("transformer.getOutputPropertyNoDefault(OutputKeys.METHOD): "+ // transformer.getOutputPropertyNoDefault(OutputKeys.METHOD)); // Access at level of hashtable to see if the method has been set. if (null != getOutputPropertyNoDefault(OutputKeys.METHOD, props)) return newSerializer; // Getting the output properties this way won't cause a clone of // the properties. Properties prevProperties = props; // We have to make sure we get an output properties with the proper // defaults for the HTML method. The easiest way to do this is to // have the OutputProperties class do it. OutputProperties htmlOutputProperties = new OutputProperties(Method.HTML); htmlOutputProperties.copyFrom(prevProperties, true); Properties htmlProperties = htmlOutputProperties.getProperties(); // try { if (null != oldSerializer) { Serializer serializer = SerializerFactory.getSerializer(htmlProperties); Writer writer = oldSerializer.getWriter(); if (null != writer) serializer.setWriter(writer); else { OutputStream os = serializer.getOutputStream(); if (null != os) serializer.setOutputStream(os); } newSerializer = serializer; } } // catch (java.io.IOException e) // { // throw new TransformerException(e); // } } return newSerializer; }
// in src/org/apache/xalan/transformer/NodeSorter.java
public void sort(DTMIterator v, Vector keys, XPathContext support) throws javax.xml.transform.TransformerException { m_keys = keys; // QuickSort2(v, 0, v.size() - 1 ); int n = v.getLength(); // %OPT% Change mergesort to just take a DTMIterator? // We would also have to adapt DTMIterator to have the function // of NodeCompareElem. // Create a vector of node compare elements // based on the input vector of nodes Vector nodes = new Vector(); for (int i = 0; i < n; i++) { NodeCompareElem elem = new NodeCompareElem(v.item(i)); nodes.addElement(elem); } Vector scratchVector = new Vector(); mergesort(nodes, scratchVector, 0, n - 1, support); // return sorted vector of nodes for (int i = 0; i < n; i++) { v.setItem(((NodeCompareElem) nodes.elementAt(i)).m_node, i); } v.setCurrentPos(0); // old code... //NodeVector scratchVector = new NodeVector(n); //mergesort(v, scratchVector, 0, n - 1, support); }
// in src/org/apache/xalan/transformer/NodeSorter.java
int compare( NodeCompareElem n1, NodeCompareElem n2, int kIndex, XPathContext support) throws TransformerException { int result = 0; NodeSortKey k = (NodeSortKey) m_keys.elementAt(kIndex); if (k.m_treatAsNumbers) { double n1Num, n2Num; if (kIndex == 0) { n1Num = ((Double) n1.m_key1Value).doubleValue(); n2Num = ((Double) n2.m_key1Value).doubleValue(); } else if (kIndex == 1) { n1Num = ((Double) n1.m_key2Value).doubleValue(); n2Num = ((Double) n2.m_key2Value).doubleValue(); } /* Leave this in case we decide to use an array later if (kIndex < maxkey) { double n1Num = (double)n1.m_keyValue[kIndex]; double n2Num = (double)n2.m_keyValue[kIndex]; }*/ else { // Get values dynamically XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node, k.m_namespaceContext); XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node, k.m_namespaceContext); n1Num = r1.num(); // Can't use NaN for compare. They are never equal. Use zero instead. // That way we can keep elements in document order. //n1Num = Double.isNaN(d) ? 0.0 : d; n2Num = r2.num(); //n2Num = Double.isNaN(d) ? 0.0 : d; } if ((n1Num == n2Num) && ((kIndex + 1) < m_keys.size())) { result = compare(n1, n2, kIndex + 1, support); } else { double diff; if (Double.isNaN(n1Num)) { if (Double.isNaN(n2Num)) diff = 0.0; else diff = -1; } else if (Double.isNaN(n2Num)) diff = 1; else diff = n1Num - n2Num; // process order parameter result = (int) ((diff < 0.0) ? (k.m_descending ? 1 : -1) : (diff > 0.0) ? (k.m_descending ? -1 : 1) : 0); } } // end treat as numbers else { CollationKey n1String, n2String; if (kIndex == 0) { n1String = (CollationKey) n1.m_key1Value; n2String = (CollationKey) n2.m_key1Value; } else if (kIndex == 1) { n1String = (CollationKey) n1.m_key2Value; n2String = (CollationKey) n2.m_key2Value; } /* Leave this in case we decide to use an array later if (kIndex < maxkey) { String n1String = (String)n1.m_keyValue[kIndex]; String n2String = (String)n2.m_keyValue[kIndex]; }*/ else { // Get values dynamically XObject r1 = k.m_selectPat.execute(m_execContext, n1.m_node, k.m_namespaceContext); XObject r2 = k.m_selectPat.execute(m_execContext, n2.m_node, k.m_namespaceContext); n1String = k.m_col.getCollationKey(r1.str()); n2String = k.m_col.getCollationKey(r2.str()); } // Use collation keys for faster compare, but note that whitespaces // etc... are treated differently from if we were comparing Strings. result = n1String.compareTo(n2String); //Process caseOrder parameter if (k.m_caseOrderUpper) { String tempN1 = n1String.getSourceString().toLowerCase(); String tempN2 = n2String.getSourceString().toLowerCase(); if (tempN1.equals(tempN2)) { //java defaults to upper case is greater. result = result == 0 ? 0 : -result; } } //Process order parameter if (k.m_descending) { result = -result; } } //end else if (0 == result) { if ((kIndex + 1) < m_keys.size()) { result = compare(n1, n2, kIndex + 1, support); } } if (0 == result) { // I shouldn't have to do this except that there seems to // be a glitch in the mergesort // if(r1.getType() == r1.CLASS_NODESET) // { DTM dtm = support.getDTM(n1.m_node); // %OPT% result = dtm.isNodeAfter(n1.m_node, n2.m_node) ? -1 : 1; // } } return result; }
// in src/org/apache/xalan/transformer/NodeSorter.java
void mergesort(Vector a, Vector b, int l, int r, XPathContext support) throws TransformerException { if ((r - l) > 0) { int m = (r + l) / 2; mergesort(a, b, l, m, support); mergesort(a, b, m + 1, r, support); int i, j, k; for (i = m; i >= l; i--) { // b[i] = a[i]; // Use insert if we need to increment vector size. if (i >= b.size()) b.insertElementAt(a.elementAt(i), i); else b.setElementAt(a.elementAt(i), i); } i = l; for (j = (m + 1); j <= r; j++) { // b[r+m+1-j] = a[j]; if (r + m + 1 - j >= b.size()) b.insertElementAt(a.elementAt(j), r + m + 1 - j); else b.setElementAt(a.elementAt(j), r + m + 1 - j); } j = r; int compVal; for (k = l; k <= r; k++) { // if(b[i] < b[j]) if (i == j) compVal = -1; else compVal = compare((NodeCompareElem) b.elementAt(i), (NodeCompareElem) b.elementAt(j), 0, support); if (compVal < 0) { // a[k]=b[i]; a.setElementAt(b.elementAt(i), k); i++; } else if (compVal > 0) { // a[k]=b[j]; a.setElementAt(b.elementAt(j), k); j--; } } } }
// in src/org/apache/xalan/transformer/StackGuard.java
public void checkForInfinateLoop() throws TransformerException { int nTemplates = m_transformer.getCurrentTemplateElementsCount(); if(nTemplates < m_recursionLimit) return; if(m_recursionLimit <= 0) return; // Safety check. // loop from the top index down to the recursion limit (I don't think // there's any need to go below that). for (int i = (nTemplates - 1); i >= m_recursionLimit; i--) { ElemTemplate template = getNextMatchOrNamedTemplate(i); if(null == template) break; int loopCount = countLikeTemplates(template, i); if (loopCount >= m_recursionLimit) { // throw new TransformerException("Template nesting too deep. nesting = "+loopCount+ // ", template "+((null == template.getName()) ? "name = " : "match = ")+ // ((null != template.getName()) ? template.getName().toString() // : template.getMatch().getPatternString())); String idIs = XSLMessages.createMessage(((null != template.getName()) ? "nameIs" : "matchPatternIs"), null); Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs, ((null != template.getName()) ? template.getName().toString() : template.getMatch().getPatternString()) }; String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs); throw new TransformerException(msg); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
void setExtensionsTable(StylesheetRoot sroot) throws javax.xml.transform.TransformerException { try { if (sroot.getExtensions() != null) m_extensionsTable = new ExtensionsTable(sroot); } catch (javax.xml.transform.TransformerException te) {te.printStackTrace();} }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { return getExtensionsTable().functionAvailable(ns, funcName); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { return getExtensionsTable().elementAvailable(ns, elemName); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException {//System.out.println("TransImpl.extFunction() " + ns + " " + funcName +" " + getExtensionsTable()); return getExtensionsTable().extFunction(ns, funcName, argVec, methodKey, getXPathContext().getExpressionContext()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { return getExtensionsTable().extFunction(extFunction, argVec, getXPathContext().getExpressionContext()); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source) throws TransformerException { transform(source, true); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source source, boolean shouldRelease) throws TransformerException { try { // Patch for bugzilla #13863. If we don't reset the namespaceContext // then we will get a NullPointerException if transformer is reused // (for stylesheets that use xsl:key). Not sure if this should go // here or in reset(). -is if(getXPathContext().getNamespaceContext() == null){ getXPathContext().setNamespaceContext(getStylesheet()); } String base = source.getSystemId(); // If no systemID of the source, use the base of the stylesheet. if(null == base) { base = m_stylesheetRoot.getBaseIdentifier(); } // As a last resort, use the current user dir. if(null == base) { String currentDir = ""; try { currentDir = System.getProperty("user.dir"); } catch (SecurityException se) {}// user.dir not accessible from applet if (currentDir.startsWith(java.io.File.separator)) base = "file://" + currentDir; else base = "file:///" + currentDir; base = base + java.io.File.separatorChar + source.getClass().getName(); } setBaseURLOfSource(base); DTMManager mgr = m_xcontext.getDTMManager(); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e) { fatalError(e); } } DTM dtm = mgr.getDTM(source, false, this, true, true); dtm.setDocumentBaseURI(base); boolean hardDelete = true; // %REVIEW% I have to think about this. -sb try { // NOTE: This will work because this is _NOT_ a shared DTM, and thus has // only a single Document node. If it could ever be an RTF or other // shared DTM, look at dtm.getDocumentRoot(nodeHandle). this.transformNode(dtm.getDocument()); } finally { if (shouldRelease) mgr.release(dtm, hardDelete); } // Kick off the parse. When the ContentHandler gets // the startDocument event, it will call transformNode( node ). // reader.parse( xmlSource ); // This has to be done to catch exceptions thrown from // the transform thread spawned by the STree handler. Exception e = getExceptionThrown(); if (null != e) { if (e instanceof javax.xml.transform.TransformerException) { throw (javax.xml.transform.TransformerException) e; } else if (e instanceof org.apache.xml.utils.WrappedRuntimeException) { fatalError( ((org.apache.xml.utils.WrappedRuntimeException) e).getException()); } else { throw new javax.xml.transform.TransformerException(e); } } else if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); } // Patch attributed to David Eisenberg <david@catcode.com> catch (org.xml.sax.SAXParseException spe) { fatalError(spe); } catch (org.xml.sax.SAXException se) { m_errorHandler.fatalError(new TransformerException(se)); } finally { m_hasTransformThreadErrorCatcher = false; // This looks to be redundent to the one done in TransformNode. reset(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
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)); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler(Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget, getOutputFormat()); return xoh; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public SerializationHandler createSerializationHandler( Result outputTarget, OutputProperties format) throws TransformerException { SerializationHandler xoh; // If the Result object contains a Node, then create // a ContentHandler that will add nodes to the input node. org.w3c.dom.Node outputNode = null; if (outputTarget instanceof DOMResult) { outputNode = ((DOMResult) outputTarget).getNode(); org.w3c.dom.Node nextSibling = ((DOMResult)outputTarget).getNextSibling(); org.w3c.dom.Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (org.w3c.dom.Node.DOCUMENT_NODE == type) ? (org.w3c.dom.Document) outputNode : outputNode.getOwnerDocument(); } else { boolean isSecureProcessing = m_stylesheetRoot.isSecureProcessing(); doc = org.apache.xml.utils.DOMHelper.createDocument(isSecureProcessing); outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder handler = (org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (org.w3c.dom.DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) handler.setNextSibling(nextSibling); String encoding = format.getProperty(OutputKeys.ENCODING); xoh = new ToXMLSAXHandler(handler, (LexicalHandler)handler, encoding); } else if (outputTarget instanceof SAXResult) { ContentHandler handler = ((SAXResult) outputTarget).getHandler(); if (null == handler) throw new IllegalArgumentException( "handler can not be null for a SAXResult"); LexicalHandler lexHandler; if (handler instanceof LexicalHandler) lexHandler = (LexicalHandler) handler; else lexHandler = null; String encoding = format.getProperty(OutputKeys.ENCODING); String method = format.getProperty(OutputKeys.METHOD); ToXMLSAXHandler toXMLSAXHandler = new ToXMLSAXHandler(handler, lexHandler, encoding); toXMLSAXHandler.setShouldOutputNSAttr(false); xoh = toXMLSAXHandler; String publicID = format.getProperty(OutputKeys.DOCTYPE_PUBLIC); String systemID = format.getProperty(OutputKeys.DOCTYPE_SYSTEM); if (systemID != null) xoh.setDoctypeSystem(systemID); if (publicID != null) xoh.setDoctypePublic(publicID); if (handler instanceof TransformerClient) { XalanTransformState state = new XalanTransformState(); ((TransformerClient)handler).setTransformState(state); ((ToSAXHandler)xoh).setTransformState(state); } } // Otherwise, create a ContentHandler that will serialize the // result tree to either a stream or a writer. else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { SerializationHandler serializer = (SerializationHandler) SerializerFactory.getSerializer(format.getProperties()); if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) fileURL = fileURL.substring(8); else fileURL = fileURL.substring(7); } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) fileURL = fileURL.substring(6); else fileURL = fileURL.substring(5); } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); xoh = serializer; } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); // handler = serializer.asContentHandler(); // this.setSerializer(serializer); xoh = serializer; } // catch (UnsupportedEncodingException uee) // { // throw new TransformerException(uee); // } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " //+ outputTarget.getClass().getName() //+ "!"); } // 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; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source xmlSource, Result outputTarget) throws TransformerException { transform(xmlSource, outputTarget, true); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transform(Source xmlSource, Result outputTarget, boolean shouldRelease) throws TransformerException { synchronized (m_reentryGuard) { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transform(xmlSource, shouldRelease); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transformNode(int node, Result outputTarget) throws TransformerException { SerializationHandler xoh = createSerializationHandler(outputTarget); this.setSerializationHandler(xoh); m_outputTarget = outputTarget; transformNode(node); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void transformNode(int node) throws TransformerException { //dml setExtensionsTable(getStylesheet()); // Make sure we're not writing to the same output content handler. synchronized (m_serializationHandler) { m_hasBeenReset = false; XPathContext xctxt = getXPathContext(); DTM dtm = xctxt.getDTM(node); try { pushGlobalVars(node); // ========== // Give the top-level templates a chance to pass information into // the context (this is mainly for setting up tables for extensions). StylesheetRoot stylesheet = this.getStylesheet(); int n = stylesheet.getGlobalImportCount(); for (int i = 0; i < n; i++) { StylesheetComposed imported = stylesheet.getGlobalImport(i); int includedCount = imported.getIncludeCountComposed(); for (int j = -1; j < includedCount; j++) { Stylesheet included = imported.getIncludeComposed(j); included.runtimeInit(this); for (ElemTemplateElement child = included.getFirstChildElem(); child != null; child = child.getNextSiblingElem()) { child.runtimeInit(this); } } } // =========== // System.out.println("Calling applyTemplateToNode - "+Thread.currentThread().getName()); DTMIterator dtmIter = new org.apache.xpath.axes.SelfIteratorNoPredicate(); dtmIter.setRoot(node, xctxt); xctxt.pushContextNodeList(dtmIter); try { this.applyTemplateToNode(null, null, node); } finally { xctxt.popContextNodeList(); } // m_stylesheetRoot.getStartRule().execute(this); // System.out.println("Done with applyTemplateToNode - "+Thread.currentThread().getName()); if (null != m_serializationHandler) { m_serializationHandler.endDocument(); } } catch (Exception se) { // System.out.println(Thread.currentThread().getName()+" threw an exception! " // +se.getMessage()); // If an exception was thrown, we need to make sure that any waiting // handlers can terminate, which I guess is best done by sending // an endDocument. // SAXSourceLocator while(se instanceof org.apache.xml.utils.WrappedRuntimeException) { Exception e = ((org.apache.xml.utils.WrappedRuntimeException)se).getException(); if(null != e) se = e; } if (null != m_serializationHandler) { try { if(se instanceof org.xml.sax.SAXParseException) m_serializationHandler.fatalError((org.xml.sax.SAXParseException)se); else if(se instanceof TransformerException) { TransformerException te = ((TransformerException)se); SAXSourceLocator sl = new SAXSourceLocator( te.getLocator() ); m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(te.getMessage(), sl, te)); } else { m_serializationHandler.fatalError(new org.xml.sax.SAXParseException(se.getMessage(), new SAXSourceLocator(), se)); } } catch (Exception e){} } if(se instanceof TransformerException) { m_errorHandler.fatalError((TransformerException)se); } else if(se instanceof org.xml.sax.SAXParseException) { m_errorHandler.fatalError(new TransformerException(se.getMessage(), new SAXSourceLocator((org.xml.sax.SAXParseException)se), se)); } else { m_errorHandler.fatalError(new TransformerException(se)); } } finally { this.reset(); } } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
protected void pushGlobalVars(int contextNode) throws TransformerException { XPathContext xctxt = m_xcontext; VariableStack vs = xctxt.getVarStack(); StylesheetRoot sr = getStylesheet(); Vector vars = sr.getVariablesAndParamsComposed(); int i = vars.size(); vs.link(i); while (--i >= 0) { ElemVariable v = (ElemVariable) vars.elementAt(i); // XObject xobj = v.getValue(this, contextNode); XObject xobj = new XUnresolvedVariable(v, contextNode, this, vs.getStackFrame(), 0, true); if(null == vs.elementAt(i)) vs.setGlobalVariable(i, xobj); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public int transformToRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public int transformToGlobalRTF(ElemTemplateElement templateParent) throws TransformerException { // Retrieve a DTM to contain the RTF. At this writing, this may be a // multi-document DTM (SAX2RTFDTM). DTM dtmFrag = m_xcontext.getGlobalRTFDTM(); return transformToRTF(templateParent,dtmFrag); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
private int transformToRTF(ElemTemplateElement templateParent,DTM dtmFrag) throws TransformerException { XPathContext xctxt = m_xcontext; ContentHandler rtfHandler = dtmFrag.getContentHandler(); // Obtain the ResultTreeFrag's root node. // NOTE: In SAX2RTFDTM, this value isn't available until after // the startDocument has been issued, so assignment has been moved // down a bit in the code. int resultFragment; // not yet reliably = dtmFrag.getDocument(); // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // And make a new handler for the RTF. ToSAXHandler h = new ToXMLSAXHandler(); h.setContentHandler(rtfHandler); h.setTransformer(this); // Replace the old handler (which was already saved) m_serializationHandler = h; // use local variable for the current handler SerializationHandler rth = m_serializationHandler; try { rth.startDocument(); // startDocument is "bottlenecked" in RTH. We need it acted upon immediately, // to set the DTM's state as in-progress, so that if the xsl:variable's body causes // further RTF activity we can keep that from bashing this DTM. rth.flushPending(); try { // Do the transformation of the child elements. executeChildTemplates(templateParent, true); // Make sure everything is flushed! rth.flushPending(); // Get the document ID. May not exist until the RTH has not only // received, but flushed, the startDocument, and may be invalid // again after the document has been closed (still debating that) // ... so waiting until just before the end seems simplest/safest. resultFragment = dtmFrag.getDocument(); } finally { rth.endDocument(); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { // Restore the previous result tree handler. this.m_serializationHandler = savedRTreeHandler; } return resultFragment; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public String transformToString(ElemTemplateElement elem) throws TransformerException { ElemTemplateElement firstChild = elem.getFirstChildElem(); if(null == firstChild) return ""; if(elem.hasTextLitOnly() && m_optimizer) { return ((ElemTextLiteral)firstChild).getNodeValue(); } // Save the current result tree handler. SerializationHandler savedRTreeHandler = this.m_serializationHandler; // Create a Serializer object that will handle the SAX events // and build the ResultTreeFrag nodes. StringWriter sw = (StringWriter) m_stringWriterObjectPool.getInstance(); m_serializationHandler = (ToTextStream) m_textResultHandlerObjectPool.getInstance(); if (null == m_serializationHandler) { // if we didn't get one from the pool, go make a new one Serializer serializer = org.apache.xml.serializer.SerializerFactory.getSerializer( m_textformat.getProperties()); m_serializationHandler = (SerializationHandler) serializer; } m_serializationHandler.setTransformer(this); m_serializationHandler.setWriter(sw); String result; try { /* Don't call startDocument, the SerializationHandler will * generate its own internal startDocument call anyways */ // this.m_serializationHandler.startDocument(); // Do the transformation of the child elements. executeChildTemplates(elem, true); this.m_serializationHandler.endDocument(); result = sw.toString(); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { sw.getBuffer().setLength(0); try { sw.close(); } catch (Exception ioe){} m_stringWriterObjectPool.freeInstance(sw); m_serializationHandler.reset(); m_textResultHandlerObjectPool.freeInstance(m_serializationHandler); // Restore the previous result tree handler. m_serializationHandler = savedRTreeHandler; } return result; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public boolean applyTemplateToNode(ElemTemplateElement xslInstruction, // xsl:apply-templates or xsl:for-each ElemTemplate template, int child) throws TransformerException { DTM dtm = m_xcontext.getDTM(child); short nodeType = dtm.getNodeType(child); boolean isDefaultTextRule = false; boolean isApplyImports = false; isApplyImports = ((xslInstruction == null) ? false : xslInstruction.getXSLToken() == Constants.ELEMNAME_APPLY_IMPORTS); if (null == template || isApplyImports) { int maxImportLevel, endImportLevel=0; if (isApplyImports) { maxImportLevel = template.getStylesheetComposed().getImportCountComposed() - 1; endImportLevel = template.getStylesheetComposed().getEndImportCountComposed(); } else { maxImportLevel = -1; } // If we're trying an xsl:apply-imports at the top level (ie there are no // imported stylesheets), we need to indicate that there is no matching template. // The above logic will calculate a maxImportLevel of -1 which indicates // that we should find any template. This is because a value of -1 for // maxImportLevel has a special meaning. But we don't want that. // We want to match -no- templates. See bugzilla bug 1170. if (isApplyImports && (maxImportLevel == -1)) { template = null; } else { // Find the XSL template that is the best match for the // element. XPathContext xctxt = m_xcontext; try { xctxt.pushNamespaceContext(xslInstruction); QName mode = this.getMode(); if (isApplyImports) template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, maxImportLevel, endImportLevel, m_quietConflictWarnings, dtm); else template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, m_quietConflictWarnings, dtm); } finally { xctxt.popNamespaceContext(); } } // If that didn't locate a node, fall back to a default template rule. // See http://www.w3.org/TR/xslt#built-in-rule. if (null == template) { switch (nodeType) { case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.ELEMENT_NODE : template = m_stylesheetRoot.getDefaultRule(); break; case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : case DTM.ATTRIBUTE_NODE : template = m_stylesheetRoot.getDefaultTextRule(); isDefaultTextRule = true; break; case DTM.DOCUMENT_NODE : template = m_stylesheetRoot.getDefaultRootRule(); break; default : // No default rules for processing instructions and the like. return false; } } } // If we are processing the default text rule, then just clone // the value directly to the result tree. try { pushElemTemplateElement(template); m_xcontext.pushCurrentNode(child); pushPairCurrentMatched(template, child); // Fix copy copy29 test. if (!isApplyImports) { DTMIterator cnl = new org.apache.xpath.NodeSetDTM(child, m_xcontext.getDTMManager()); m_xcontext.pushContextNodeList(cnl); } if (isDefaultTextRule) { switch (nodeType) { case DTM.CDATA_SECTION_NODE : case DTM.TEXT_NODE : ClonerToResultTree.cloneToResultTree(child, nodeType, dtm, getResultTreeHandler(), false); break; case DTM.ATTRIBUTE_NODE : dtm.dispatchCharactersEvents(child, getResultTreeHandler(), false); break; } } else { // Fire a trace event for the template. if (m_debug) getTraceManager().fireTraceEvent(template); // And execute the child templates. // 9/11/00: If template has been compiled, hand off to it // since much (most? all?) of the processing has been inlined. // (It would be nice if there was a single entry point that // worked for both... but the interpretive system works by // having the Tranformer execute the children, while the // compiled obviously has to run its own code. It's // also unclear that "execute" is really the right name for // that entry point.) m_xcontext.setSAXLocator(template); // m_xcontext.getVarStack().link(); m_xcontext.getVarStack().link(template.m_frameSize); executeChildTemplates(template, true); if (m_debug) getTraceManager().fireTraceEndEvent(template); } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } finally { if (!isDefaultTextRule) m_xcontext.getVarStack().unlink(); m_xcontext.popCurrentNode(); if (!isApplyImports) { m_xcontext.popContextNodeList(); } popCurrentMatched(); popElemTemplateElement(); } return true; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, ContentHandler handler) throws TransformerException { XPathContext xctxt = m_xcontext; try { if(null != mode) pushMode(mode); xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler); } finally { xctxt.popCurrentNode(); // I'm not sure where or why this was here. It is clearly in // error though, without a corresponding pushMode(). if (null != mode) popMode(); } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, boolean shouldAddAttrs) throws TransformerException { // Does this element have any children? ElemTemplateElement t = elem.getFirstChildElem(); if (null == t) return; if(elem.hasTextLitOnly() && m_optimizer) { char[] chars = ((ElemTextLiteral)t).getChars(); try { // Have to push stuff on for tooling... this.pushElemTemplateElement(t); m_serializationHandler.characters(chars, 0, chars.length); } catch(SAXException se) { throw new TransformerException(se); } finally { this.popElemTemplateElement(); } return; } // // Check for infinite loops if we have to. // boolean check = (m_stackGuard.m_recursionLimit > -1); // // if (check) // getStackGuard().push(elem, xctxt.getCurrentNode()); XPathContext xctxt = m_xcontext; xctxt.pushSAXLocatorNull(); int currentTemplateElementsTop = m_currentTemplateElements.size(); m_currentTemplateElements.push(null); try { // Loop through the children of the template, calling execute on // each of them. for (; t != null; t = t.getNextSiblingElem()) { if (!shouldAddAttrs && t.getXSLToken() == Constants.ELEMNAME_ATTRIBUTE) continue; xctxt.setSAXLocator(t); m_currentTemplateElements.setElementAt(t,currentTemplateElementsTop); t.execute(this); } } catch(RuntimeException re) { TransformerException te = new TransformerException(re); te.setLocator(t); throw te; } finally { m_currentTemplateElements.pop(); xctxt.popSAXLocator(); } // Check for infinite loops if we have to // if (check) // getStackGuard().pop(); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeChildTemplates( ElemTemplateElement elem, ContentHandler handler) throws TransformerException { SerializationHandler xoh = this.getSerializationHandler(); // These may well not be the same! In this case when calling // the Redirect extension, it has already set the ContentHandler // in the Transformer. SerializationHandler savedHandler = xoh; try { xoh.flushPending(); // %REVIEW% Make sure current node is being pushed. LexicalHandler lex = null; if (handler instanceof LexicalHandler) { lex = (LexicalHandler) handler; } m_serializationHandler = new ToXMLSAXHandler(handler, lex, savedHandler.getEncoding()); m_serializationHandler.setTransformer(this); executeChildTemplates(elem, true); } catch (TransformerException e) { throw e; } catch (SAXException se) { throw new TransformerException(se); } finally { m_serializationHandler = savedHandler; } }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public Vector processSortKeys(ElemForEach foreach, int sourceNodeContext) throws TransformerException { Vector keys = null; XPathContext xctxt = m_xcontext; int nElems = foreach.getSortElemCount(); if (nElems > 0) keys = new Vector(); // March backwards, collecting the sort keys. for (int i = 0; i < nElems; i++) { ElemSort sort = foreach.getSortElem(i); if (m_debug) getTraceManager().fireTraceEvent(sort); String langString = (null != sort.getLang()) ? sort.getLang().evaluate(xctxt, sourceNodeContext, foreach) : null; String dataTypeString = sort.getDataType().evaluate(xctxt, sourceNodeContext, foreach); if (dataTypeString.indexOf(":") >= 0) System.out.println( "TODO: Need to write the hooks for QNAME sort data type"); else if (!(dataTypeString.equalsIgnoreCase(Constants.ATTRVAL_DATATYPE_TEXT)) &&!(dataTypeString.equalsIgnoreCase( Constants.ATTRVAL_DATATYPE_NUMBER))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_DATATYPE, dataTypeString }); boolean treatAsNumbers = ((null != dataTypeString) && dataTypeString.equals( Constants.ATTRVAL_DATATYPE_NUMBER)) ? true : false; String orderString = sort.getOrder().evaluate(xctxt, sourceNodeContext, foreach); if (!(orderString.equalsIgnoreCase(Constants.ATTRVAL_ORDER_ASCENDING)) &&!(orderString.equalsIgnoreCase( Constants.ATTRVAL_ORDER_DESCENDING))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_ORDER, orderString }); boolean descending = ((null != orderString) && orderString.equals( Constants.ATTRVAL_ORDER_DESCENDING)) ? true : false; AVT caseOrder = sort.getCaseOrder(); boolean caseOrderUpper; if (null != caseOrder) { String caseOrderString = caseOrder.evaluate(xctxt, sourceNodeContext, foreach); if (!(caseOrderString.equalsIgnoreCase(Constants.ATTRVAL_CASEORDER_UPPER)) &&!(caseOrderString.equalsIgnoreCase( Constants.ATTRVAL_CASEORDER_LOWER))) foreach.error(XSLTErrorResources.ER_ILLEGAL_ATTRIBUTE_VALUE, new Object[]{ Constants.ATTRNAME_CASEORDER, caseOrderString }); caseOrderUpper = ((null != caseOrderString) && caseOrderString.equals( Constants.ATTRVAL_CASEORDER_UPPER)) ? true : false; } else { caseOrderUpper = false; } keys.addElement(new NodeSortKey(this, sort.getSelect(), treatAsNumbers, descending, langString, caseOrderUpper, foreach)); if (m_debug) getTraceManager().fireTraceEndEvent(sort); } return keys; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
public void executeFromSnapshot(TransformSnapshot ts) throws TransformerException { ElemTemplateElement template = getMatchedTemplate(); int child = getMatchedNode(); pushElemTemplateElement(template); //needed?? m_xcontext.pushCurrentNode(child); //needed?? this.executeChildTemplates(template, true); // getResultTreeHandler()); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void message(SourceLocator srcLctr, String msg, boolean terminate) throws TransformerException { ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) { errHandler.warning(new TransformerException(msg, srcLctr)); } else { if (terminate) throw new TransformerException(msg, srcLctr); else System.out.println(msg); } }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, String msg) throws TransformerException { warn(srcLctr, null, null, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, String msg, Object[] args) throws TransformerException { warn(srcLctr, null, null, msg, args); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg) throws TransformerException { warn(srcLctr, styleNode, sourceNode, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void warn(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createWarning(msg, args); ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.warning(new TransformerException(formattedMsg, srcLctr)); else System.out.println(formattedMsg); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg) throws TransformerException { error(srcLctr, null, null, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object[] args) throws TransformerException { error(srcLctr, null, null, msg, args); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Exception e) throws TransformerException { error(srcLctr, msg, null, e); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, String msg, Object args[], Exception e) throws TransformerException { //msg = (null == msg) ? XSLTErrorResources.ER_PROCESSOR_ERROR : msg; String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg) throws TransformerException { error(srcLctr, styleNode, sourceNode, msg, null); }
// in src/org/apache/xalan/transformer/MsgMgr.java
public void error(SourceLocator srcLctr, Node styleNode, Node sourceNode, String msg, Object args[]) throws TransformerException { String formattedMsg = XSLMessages.createMessage(msg, args); // Locator locator = m_stylesheetLocatorStack.isEmpty() // ? null : // ((Locator)m_stylesheetLocatorStack.peek()); // Locator locator = null; ErrorListener errHandler = m_transformer.getErrorListener(); if (null != errHandler) errHandler.fatalError(new TransformerException(formattedMsg, srcLctr)); else throw new TransformerException(formattedMsg, srcLctr); }
// in src/org/apache/xalan/transformer/ClonerToResultTree.java
public static void cloneToResultTree(int node, int nodeType, DTM dtm, SerializationHandler rth, boolean shouldCloneAttributes) throws TransformerException { try { switch (nodeType) { case DTM.TEXT_NODE : dtm.dispatchCharactersEvents(node, rth, false); break; case DTM.DOCUMENT_FRAGMENT_NODE : case DTM.DOCUMENT_NODE : // Can't clone a document, but refrain from throwing an error // so that copy-of will work break; case DTM.ELEMENT_NODE : { // Note: SAX apparently expects "no namespace" to be // represented as "" rather than null. String ns = dtm.getNamespaceURI(node); if (ns==null) ns=""; String localName = dtm.getLocalName(node); // rth.startElement(ns, localName, dtm.getNodeNameX(node), null); // don't call a real SAX startElement (as commented out above), // call a SAX-like startElement, to be able to add attributes after this call rth.startElement(ns, localName, dtm.getNodeNameX(node)); // If outputting attrs as separate events, they must // _follow_ the startElement event. (Think of the // xsl:attribute directive.) if (shouldCloneAttributes) { SerializerUtils.addAttributes(rth, node); SerializerUtils.processNSDecls(rth, node, nodeType, dtm); } } break; case DTM.CDATA_SECTION_NODE : rth.startCDATA(); dtm.dispatchCharactersEvents(node, rth, false); rth.endCDATA(); break; case DTM.ATTRIBUTE_NODE : SerializerUtils.addAttribute(rth, node); break; case DTM.NAMESPACE_NODE: // %REVIEW% Normally, these should have been handled with element. // It's possible that someone may write a stylesheet that tries to // clone them explicitly. If so, we need the equivalent of // rth.addAttribute(). SerializerUtils.processNSDecls(rth,node,DTM.NAMESPACE_NODE,dtm); break; case DTM.COMMENT_NODE : XMLString xstr = dtm.getStringValue (node); xstr.dispatchAsComment(rth); break; case DTM.ENTITY_REFERENCE_NODE : rth.entityReference(dtm.getNodeNameX(node)); break; case DTM.PROCESSING_INSTRUCTION_NODE : { // %REVIEW% Is the node name the same as the "target"? rth.processingInstruction(dtm.getNodeNameX(node), dtm.getNodeValue(node)); } break; default : //"Can not create item in result tree: "+node.getNodeName()); throw new TransformerException( "Can't clone node: "+dtm.getNodeName(node)); } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/transformer/CountersTable.java
public int countNode(XPathContext support, ElemNumber numberElem, int node) throws TransformerException { int count = 0; Vector counters = getCounters(numberElem); int nCounters = counters.size(); // XPath countMatchPattern = numberElem.getCountMatchPattern(support, node); // XPath fromMatchPattern = numberElem.m_fromMatchPattern; int target = numberElem.getTargetNode(support, node); if (DTM.NULL != target) { for (int i = 0; i < nCounters; i++) { Counter counter = (Counter) counters.elementAt(i); count = counter.getPreviouslyCounted(support, target); if (count > 0) return count; } // In the loop below, we collect the nodes in backwards doc order, so // we don't have to do inserts, but then we store the nodes in forwards // document order, so we don't have to insert nodes into that list, // so that's what the appendBtoFList stuff is all about. In cases // of forward counting by one, this will mean a single node copy from // the backwards list (m_newFound) to the forwards list (counter.m_countNodes). count = 0; if (m_newFound == null) m_newFound = new NodeSetDTM(support.getDTMManager()); for (; DTM.NULL != target; target = numberElem.getPreviousNode(support, target)) { // First time in, we should not have to check for previous counts, // since the original target node was already checked in the // block above. if (0 != count) { for (int i = 0; i < nCounters; i++) { Counter counter = (Counter) counters.elementAt(i); int cacheLen = counter.m_countNodes.size(); if ((cacheLen > 0) && (counter.m_countNodes.elementAt(cacheLen - 1) == target)) { count += (cacheLen + counter.m_countNodesStartCount); if (cacheLen > 0) appendBtoFList(counter.m_countNodes, m_newFound); m_newFound.removeAllElements(); return count; } } } m_newFound.addElement(target); count++; } // If we got to this point, then we didn't find a counter, so make // one and add it to the list. Counter counter = new Counter(numberElem, new NodeSetDTM(support.getDTMManager())); m_countersMade++; // for diagnostics appendBtoFList(counter.m_countNodes, m_newFound); m_newFound.removeAllElements(); counters.addElement(counter); } return count; }
// in src/org/apache/xalan/transformer/KeyManager.java
public XNodeSet getNodeSetDTMByKey( XPathContext xctxt, int doc, QName name, XMLString ref, PrefixResolver nscontext) throws javax.xml.transform.TransformerException { XNodeSet nl = null; ElemTemplateElement template = (ElemTemplateElement) nscontext; // yuck -sb if ((null != template) && null != template.getStylesheetRoot().getKeysComposed()) { boolean foundDoc = false; if (null == m_key_tables) { m_key_tables = new Vector(4); } else { int nKeyTables = m_key_tables.size(); for (int i = 0; i < nKeyTables; i++) { KeyTable kt = (KeyTable) m_key_tables.elementAt(i); if (kt.getKeyTableName().equals(name) && doc == kt.getDocKey()) { nl = kt.getNodeSetDTMByKey(name, ref); if (nl != null) { foundDoc = true; break; } } } } if ((null == nl) &&!foundDoc /* && m_needToBuildKeysTable */) { KeyTable kt = new KeyTable(doc, nscontext, name, template.getStylesheetRoot().getKeysComposed(), xctxt); m_key_tables.addElement(kt); if (doc == kt.getDocKey()) { foundDoc = true; nl = kt.getNodeSetDTMByKey(name, ref); } } } return nl; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
private void createResultContentHandler(Result outputTarget) throws TransformerException { if (outputTarget instanceof SAXResult) { SAXResult saxResult = (SAXResult) outputTarget; m_resultContentHandler = saxResult.getHandler(); m_resultLexicalHandler = saxResult.getLexicalHandler(); if (m_resultContentHandler instanceof Serializer) { // Dubious but needed, I think. m_serializer = (Serializer) m_resultContentHandler; } } else if (outputTarget instanceof DOMResult) { DOMResult domResult = (DOMResult) outputTarget; Node outputNode = domResult.getNode(); Node nextSibling = domResult.getNextSibling(); Document doc; short type; if (null != outputNode) { type = outputNode.getNodeType(); doc = (Node.DOCUMENT_NODE == type) ? (Document) outputNode : outputNode.getOwnerDocument(); } else { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); if (m_isSecureProcessing) { try { dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException pce) {} } DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.newDocument(); } catch (ParserConfigurationException pce) { throw new TransformerException(pce); } outputNode = doc; type = outputNode.getNodeType(); ((DOMResult) outputTarget).setNode(outputNode); } DOMBuilder domBuilder = (Node.DOCUMENT_FRAGMENT_NODE == type) ? new DOMBuilder(doc, (DocumentFragment) outputNode) : new DOMBuilder(doc, outputNode); if (nextSibling != null) domBuilder.setNextSibling(nextSibling); m_resultContentHandler = domBuilder; m_resultLexicalHandler = domBuilder; } else if (outputTarget instanceof StreamResult) { StreamResult sresult = (StreamResult) outputTarget; try { Serializer serializer = SerializerFactory.getSerializer(m_outputFormat.getProperties()); m_serializer = serializer; if (null != sresult.getWriter()) serializer.setWriter(sresult.getWriter()); else if (null != sresult.getOutputStream()) serializer.setOutputStream(sresult.getOutputStream()); else if (null != sresult.getSystemId()) { String fileURL = sresult.getSystemId(); if (fileURL.startsWith("file:///")) { if (fileURL.substring(8).indexOf(":") >0) { fileURL = fileURL.substring(8); } else { fileURL = fileURL.substring(7); } } else if (fileURL.startsWith("file:/")) { if (fileURL.substring(6).indexOf(":") >0) { fileURL = fileURL.substring(6); } else { fileURL = fileURL.substring(5); } } m_outputStream = new java.io.FileOutputStream(fileURL); serializer.setOutputStream(m_outputStream); } else throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!"); m_resultContentHandler = serializer.asContentHandler(); } catch (IOException ioe) { throw new TransformerException(ioe); } } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_TO_RESULT_TYPE, new Object[]{outputTarget.getClass().getName()})); //"Can't transform to a Result of type " // + outputTarget.getClass().getName() // + "!"); } if (m_resultContentHandler instanceof DTDHandler) m_resultDTDHandler = (DTDHandler) m_resultContentHandler; if (m_resultContentHandler instanceof DeclHandler) m_resultDeclHandler = (DeclHandler) m_resultContentHandler; if (m_resultContentHandler instanceof LexicalHandler) m_resultLexicalHandler = (LexicalHandler) m_resultContentHandler; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void transform(Source source, Result outputTarget) throws TransformerException { createResultContentHandler(outputTarget); /* * According to JAXP1.2, new SAXSource()/StreamSource() * should create an empty input tree, with a default root node. * new DOMSource()creates an empty document using DocumentBuilder. * newDocument(); Use DocumentBuilder.newDocument() for all 3 situations, * since there is no clear spec. how to create an empty tree when * both SAXSource() and StreamSource() are used. */ if ((source instanceof StreamSource && source.getSystemId()==null && ((StreamSource)source).getInputStream()==null && ((StreamSource)source).getReader()==null)|| (source instanceof SAXSource && ((SAXSource)source).getInputSource()==null && ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ try { DocumentBuilderFactory builderF = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); // Copy system ID from original, empty Source to new Source if (systemID != null) { source.setSystemId(systemID); } } catch (ParserConfigurationException e){ throw new TransformerException(e.getMessage()); } } try { if (source instanceof DOMSource) { DOMSource dsource = (DOMSource) source; m_systemID = dsource.getSystemId(); Node dNode = dsource.getNode(); if (null != dNode) { try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.startDocument(); try { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) { String data = dNode.getNodeValue(); char[] chars = data.toCharArray(); characters(chars, 0, chars.length); } else { org.apache.xml.serializer.TreeWalker walker; walker = new org.apache.xml.serializer.TreeWalker(this, m_systemID); walker.traverse(dNode); } } finally { if(dNode.getNodeType() == Node.ATTRIBUTE_NODE) this.endDocument(); } } catch (SAXException se) { throw new TransformerException(se); } return; } else { String messageStr = XSLMessages.createMessage( XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null); throw new IllegalArgumentException(messageStr); } } InputSource xmlSource = SAXSource.sourceToInputSource(source); if (null == xmlSource) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_TRANSFORM_SOURCE_TYPE, new Object[]{source.getClass().getName()})); //"Can't transform a Source of type " //+ source.getClass().getName() + "!"); } if (null != xmlSource.getSystemId()) m_systemID = xmlSource.getSystemId(); XMLReader reader = null; boolean managedReader = false; try { if (source instanceof SAXSource) { reader = ((SAXSource) source).getXMLReader(); } if (null == reader) { try { reader = XMLReaderManager.getInstance().getXMLReader(); managedReader = true; } catch (SAXException se) { throw new TransformerException(se); } } else { try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // We don't care. } } // Get the input content handler, which will handle the // parse events and create the source tree. ContentHandler inputHandler = this; reader.setContentHandler(inputHandler); if (inputHandler instanceof org.xml.sax.DTDHandler) reader.setDTDHandler((org.xml.sax.DTDHandler) inputHandler); try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/properties/lexical-handler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty( "http://xml.org/sax/properties/declaration-handler", inputHandler); } catch (org.xml.sax.SAXException se){} try { if (inputHandler instanceof org.xml.sax.ext.LexicalHandler) reader.setProperty("http://xml.org/sax/handlers/LexicalHandler", inputHandler); if (inputHandler instanceof org.xml.sax.ext.DeclHandler) reader.setProperty("http://xml.org/sax/handlers/DeclHandler", inputHandler); } catch (org.xml.sax.SAXNotRecognizedException snre){} reader.parse(xmlSource); } catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } catch (IOException ioe) { throw new TransformerException(ioe); } finally { if (managedReader) { XMLReaderManager.getInstance().releaseXMLReader(reader); } } } finally { if(null != m_outputStream) { try { m_outputStream.close(); } catch(IOException ioe){} m_outputStream = null; } } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void addAttribute(SerializationHandler handler, int attr) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(attr); if (SerializerUtils.isDefinedNSDecl(handler, attr, dtm)) return; String ns = dtm.getNamespaceURI(attr); if (ns == null) ns = ""; // %OPT% ...can I just store the node handle? try { handler.addAttribute( ns, dtm.getLocalName(attr), dtm.getNodeName(attr), "CDATA", dtm.getNodeValue(attr), false); } catch (SAXException e) { // do something? } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void addAttributes(SerializationHandler handler, int src) throws TransformerException { TransformerImpl transformer = (TransformerImpl) handler.getTransformer(); DTM dtm = transformer.getXPathContext().getDTM(src); for (int node = dtm.getFirstAttribute(src); DTM.NULL != node; node = dtm.getNextAttribute(node)) { addAttribute(handler, node); } }
// in src/org/apache/xalan/serialize/SerializerUtils.java
public static void processNSDecls( SerializationHandler handler, int src, int type, DTM dtm) throws TransformerException { try { if (type == DTM.ELEMENT_NODE) { for (int namespace = dtm.getFirstNamespaceNode(src, true); DTM.NULL != namespace; namespace = dtm.getNextNamespaceNode(src, namespace, true)) { // String prefix = dtm.getPrefix(namespace); String prefix = dtm.getNodeNameX(namespace); String desturi = handler.getNamespaceURIFromPrefix(prefix); // String desturi = getURI(prefix); String srcURI = dtm.getNodeValue(namespace); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } else if (type == DTM.NAMESPACE_NODE) { String prefix = dtm.getNodeNameX(src); // Brian M. - some changes here to get desturi String desturi = handler.getNamespaceURIFromPrefix(prefix); String srcURI = dtm.getNodeValue(src); if (!srcURI.equalsIgnoreCase(desturi)) { handler.startPrefixMapping(prefix, srcURI, false); } } } catch (org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEvent( int sourceNode, ElemTemplateElement styleNode, String attributeName, XPath xpath, XObject selection) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { Node source = getDOMNodeFromDTM(sourceNode); fireSelectedEvent(new SelectionEvent(m_transformer, source, styleNode, attributeName, xpath, selection)); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEndEvent( int sourceNode, ElemTemplateElement styleNode, String attributeName, XPath xpath, XObject selection) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { Node source = getDOMNodeFromDTM(sourceNode); fireSelectedEndEvent(new EndSelectionEvent(m_transformer, source, styleNode, attributeName, xpath, selection)); } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEndEvent(EndSelectionEvent se) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { int nListeners = m_traceListeners.size(); for (int i = 0; i < nListeners; i++) { TraceListener tl = (TraceListener) m_traceListeners.elementAt(i); if(tl instanceof TraceListenerEx) ((TraceListenerEx)tl).selectEnd(se); } } }
// in src/org/apache/xalan/trace/TraceManager.java
public void fireSelectedEvent(SelectionEvent se) throws javax.xml.transform.TransformerException { if (hasTraceListeners()) { int nListeners = m_traceListeners.size(); for (int i = 0; i < nListeners; i++) { TraceListener tl = (TraceListener) m_traceListeners.elementAt(i); tl.selected(se); } } }
// in src/org/apache/xalan/trace/PrintTraceListener.java
public void selected(SelectionEvent ev) throws javax.xml.transform.TransformerException { 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); } if (locator != null) m_pw.println( "Selected source node '" + sourceNode.getNodeName() + "', at " + locator); else m_pw.println( "Selected source node '" + sourceNode.getNodeName() + "'"); if (ev.m_styleNode.getLineNumber() == 0) { // You may not have line numbers if the selection is occuring from a // default template. ElemTemplateElement parent = (ElemTemplateElement) ete.getParentElem(); if (parent == ete.getStylesheetRoot().getDefaultRootRule()) { m_pw.print("(default root rule) "); } else if ( parent == ete.getStylesheetRoot().getDefaultTextRule()) { m_pw.print("(default text rule) "); } else if (parent == ete.getStylesheetRoot().getDefaultRule()) { m_pw.print("(default rule) "); } m_pw.print( ete.getNodeName() + ", " + ev.m_attributeName + "='" + ev.m_xpath.getPatternString() + "': "); } else { m_pw.print( ev.m_styleNode.getSystemId() + " Line #" + ev.m_styleNode.getLineNumber() + ", " + "Column #" + ev.m_styleNode.getColumnNumber() + ": " + ete.getNodeName() + ", " + ev.m_attributeName + "='" + ev.m_xpath.getPatternString() + "': "); } if (ev.m_selection.getType() == ev.m_selection.CLASS_NODESET) { m_pw.println(); org.apache.xml.dtm.DTMIterator nl = ev.m_selection.iter(); // The following lines are added to fix bug#16222. // The main cause is that the following loop change the state of iterator, which is shared // with the transformer. The fix is that we record the initial state before looping, then // restore the state when we finish it, which is done in the following lines added. int currentPos = DTM.NULL; currentPos = nl.getCurrentPos(); nl.setShouldCacheNodes(true); // This MUST be done before we clone the iterator! org.apache.xml.dtm.DTMIterator clone = null; // End of block try { clone = nl.cloneWithReset(); } catch (CloneNotSupportedException cnse) { m_pw.println( " [Can't trace nodelist because it it threw a CloneNotSupportedException]"); return; } int pos = clone.nextNode(); if (DTM.NULL == pos) { m_pw.println(" [empty node list]"); } else { while (DTM.NULL != pos) { // m_pw.println(" " + ev.m_processor.getXPathContext().getDTM(pos).getNode(pos)); DTM dtm = ev.m_processor.getXPathContext().getDTM(pos); m_pw.print(" "); m_pw.print(Integer.toHexString(pos)); m_pw.print(": "); m_pw.println(dtm.getNodeName(pos)); pos = clone.nextNode(); } } // Restore the initial state of the iterator, part of fix for bug#16222. nl.runTo(-1); nl.setCurrentPos(currentPos); // End of fix for bug#16222 } else { m_pw.println(ev.m_selection.str()); } } }
// in src/org/apache/xalan/trace/PrintTraceListener.java
public void selectEnd(EndSelectionEvent ev) throws javax.xml.transform.TransformerException { // Nothing for right now. }
// in src/org/apache/xalan/lib/PipeDocument.java
public void pipeDocument(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, TransformerConfigurationException, SAXException, IOException, FileNotFoundException { SAXTransformerFactory saxTFactory = (SAXTransformerFactory) TransformerFactory.newInstance(); // XML doc to transform. String source = elem.getAttribute("source", context.getContextNode(), context.getTransformer()); TransformerImpl transImpl = context.getTransformer(); //Base URI for input doc, so base for relative URI to XML doc to transform. String baseURLOfSource = transImpl.getBaseURLOfSource(); // Absolute URI for XML doc to transform. String absSourceURL = SystemIDResolver.getAbsoluteURI(source, baseURLOfSource); // Transformation target String target = elem.getAttribute("target", context.getContextNode(), context.getTransformer()); XPathContext xctxt = context.getTransformer().getXPathContext(); int xt = xctxt.getDTMHandleFromNode(context.getContextNode()); // Get System Id for stylesheet; to be used to resolve URIs to other stylesheets. String sysId = elem.getSystemId(); NodeList ssNodes = null; NodeList paramNodes = null; Node ssNode = null; Node paramNode = null; if (elem.hasChildNodes()) { ssNodes = elem.getChildNodes(); // Vector to contain TransformerHandler for each stylesheet. Vector vTHandler = new Vector(ssNodes.getLength()); // The child nodes of an extension element node are instances of // ElemLiteralResult, which requires does not fully support the standard // Node interface. Accordingly, some special handling is required (see below) // to get attribute values. for (int i = 0; i < ssNodes.getLength(); i++) { ssNode = ssNodes.item(i); if (ssNode.getNodeType() == Node.ELEMENT_NODE && ((Element)ssNode).getTagName().equals("stylesheet") && ssNode instanceof ElemLiteralResult) { AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href"); String href = avt.evaluate(xctxt,xt, elem); String absURI = SystemIDResolver.getAbsoluteURI(href, sysId); Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI)); TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl); Transformer trans = tHandler.getTransformer(); // AddTransformerHandler to vector vTHandler.addElement(tHandler); paramNodes = ssNode.getChildNodes(); for (int j = 0; j < paramNodes.getLength(); j++) { paramNode = paramNodes.item(j); if (paramNode.getNodeType() == Node.ELEMENT_NODE && ((Element)paramNode).getTagName().equals("param") && paramNode instanceof ElemLiteralResult) { avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("name"); String pName = avt.evaluate(xctxt,xt, elem); avt = ((ElemLiteralResult)paramNode).getLiteralResultAttribute("value"); String pValue = avt.evaluate(xctxt,xt, elem); trans.setParameter(pName, pValue); } } } } usePipe(vTHandler, absSourceURL, target); } }
// in src/org/apache/xalan/lib/PipeDocument.java
public void usePipe(Vector vTHandler, String source, String target) throws TransformerException, TransformerConfigurationException, FileNotFoundException, IOException, SAXException, SAXNotRecognizedException { XMLReader reader = XMLReaderFactory.createXMLReader(); TransformerHandler tHFirst = (TransformerHandler)vTHandler.firstElement(); reader.setContentHandler(tHFirst); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHFirst); for (int i = 1; i < vTHandler.size(); i++) { TransformerHandler tHFrom = (TransformerHandler)vTHandler.elementAt(i-1); TransformerHandler tHTo = (TransformerHandler)vTHandler.elementAt(i); tHFrom.setResult(new SAXResult(tHTo)); } TransformerHandler tHLast = (TransformerHandler)vTHandler.lastElement(); Transformer trans = tHLast.getTransformer(); Properties outputProps = trans.getOutputProperties(); Serializer serializer = SerializerFactory.getSerializer(outputProps); FileOutputStream out = new FileOutputStream(target); try { serializer.setOutputStream(out); tHLast.setResult(new SAXResult(serializer.asContentHandler())); reader.parse(source); } finally { // Always clean up the FileOutputStream, // even if an exception was thrown in the try block if (out != null) out.close(); } }
// in src/org/apache/xalan/lib/Redirect.java
public void open(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flistener = m_formatterListeners.get(fileName); if(null == flistener) { String mkdirsExpr = elem.getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_OPEN; Object ignored = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } }
// in src/org/apache/xalan/lib/Redirect.java
public void write(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object flObject = m_formatterListeners.get(fileName); ContentHandler formatter; boolean inTable = false; if(null == flObject) { String mkdirsExpr = ((ElemExtensionCall)elem).getAttribute ("mkdirs", context.getContextNode(), context.getTransformer()); boolean mkdirs = (mkdirsExpr != null) ? (mkdirsExpr.equals("true") || mkdirsExpr.equals("yes")) : true; // Whether to append to existing files or not, <jpvdm@iafrica.com> String appendExpr = elem.getAttribute("append", context.getContextNode(), context.getTransformer()); boolean append = (appendExpr != null) ? (appendExpr.equals("true") || appendExpr.equals("yes")) : DEFAULT_APPEND_WRITE; formatter = makeFormatterListener(context, elem, fileName, true, mkdirs, append); } else { inTable = true; formatter = (ContentHandler)flObject; } TransformerImpl transf = context.getTransformer(); startRedirection(transf, formatter); // for tracing only transf.executeChildTemplates(elem, context.getContextNode(), context.getMode(), formatter); endRedirection(transf); // for tracing only if(!inTable) { OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { try { formatter.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } ostream.close(); m_outputStreams.remove(fileName); m_formatterListeners.remove(fileName); } } }
// in src/org/apache/xalan/lib/Redirect.java
public void close(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName = getFilename(context, elem); Object formatterObj = m_formatterListeners.get(fileName); if(null != formatterObj) { ContentHandler fl = (ContentHandler)formatterObj; try { fl.endDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } OutputStream ostream = (OutputStream)m_outputStreams.get(fileName); if(null != ostream) { ostream.close(); m_outputStreams.remove(fileName); } m_formatterListeners.remove(fileName); } }
// in src/org/apache/xalan/lib/Redirect.java
private String getFilename(XSLProcessorContext context, ElemExtensionCall elem) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { String fileName; String fileNameExpr = ((ElemExtensionCall)elem).getAttribute ("select", context.getContextNode(), context.getTransformer()); if(null != fileNameExpr) { org.apache.xpath.XPathContext xctxt = context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0)) { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } } else { fileName = elem.getAttribute ("file", context.getContextNode(), context.getTransformer()); } if(null == fileName) { context.getTransformer().getMsgMgr().error(elem, elem, context.getContextNode(), XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME); //"Redirect extension: Could not get filename - file or select attribute must return vald string."); } return fileName; }
// in src/org/apache/xalan/lib/Redirect.java
private ContentHandler makeFormatterListener(XSLProcessorContext context, ElemExtensionCall elem, String fileName, boolean shouldPutInTable, boolean mkdirs, boolean append) throws java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException, javax.xml.transform.TransformerException { File file = new File(fileName); TransformerImpl transformer = context.getTransformer(); String base; // Base URI to use for relative paths if(!file.isAbsolute()) { // This code is attributed to Jon Grov <jon@linpro.no>. A relative file name // is relative to the Result used to kick off the transform. If no such // Result was supplied, the filename is relative to the source document. // When transforming with a SAXResult or DOMResult, call // TransformerImpl.setOutputTarget() to set the desired Result base. // String base = urlToFileName(elem.getStylesheet().getSystemId()); Result outputTarget = transformer.getOutputTarget(); if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != null) ) { base = urlToFileName(base); } else { base = urlToFileName(transformer.getBaseURLOfSource()); } if(null != base) { File baseFile = new File(base); file = new File(baseFile.getParent(), fileName); } // System.out.println("file is: "+file.toString()); } if(mkdirs) { String dirStr = file.getParent(); if((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } } // This should be worked on so that the output format can be // defined by a first child of the redirect element. OutputProperties format = transformer.getOutputFormat(); // FileOutputStream ostream = new FileOutputStream(file); // Patch from above line to below by <jpvdm@iafrica.com> // Note that in JDK 1.2.2 at least, FileOutputStream(File) // is implemented as a call to // FileOutputStream(File.getPath, append), thus this should be // the equivalent instead of getAbsolutePath() FileOutputStream ostream = new FileOutputStream(file.getPath(), append); try { SerializationHandler flistener = createSerializationHandler(transformer, ostream, file, format); try { flistener.startDocument(); } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } if(shouldPutInTable) { m_outputStreams.put(fileName, ostream); m_formatterListeners.put(fileName, flistener); } return flistener; } catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); } }
// in src/org/apache/xalan/lib/Redirect.java
public SerializationHandler createSerializationHandler( TransformerImpl transformer, FileOutputStream ostream, File file, OutputProperties format) throws java.io.IOException, TransformerException { SerializationHandler serializer = transformer.createSerializationHandler( new StreamResult(ostream), format); return serializer; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.equals("new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = null; if (methodKey != null) c = (Constructor) getFromCache(methodKey, null, methodArgs); if (c != null && !trans.getDebug()) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } c = MethodResolver.getConstructor(m_classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else { int resolveType; Object targetObject = null; methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = null; if (methodKey != null) m = (Method) getFromCache(methodKey, null, methodArgs); if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); if (Modifier.isStatic(m.getModifiers())) return m.invoke(null, convertedArgs[0]); else { // This is tricky. We get the actual number of target arguments (excluding any // ExpressionContext). If we passed in the same number, we need the implied object. int nTargetArgs = convertedArgs[0].length; if (ExpressionContext.class.isAssignableFrom(paramTypes[0])) nTargetArgs--; if (methodArgs.length <= nTargetArgs) return m.invoke(m_defaultInstance, convertedArgs[0]); else { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); return m.invoke(targetObject, convertedArgs[0]); } } } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } if (args.size() > 0) { targetObject = methodArgs[0]; if (targetObject instanceof XObject) targetObject = ((XObject) targetObject).object(); if (m_classObj.isAssignableFrom(targetObject.getClass())) resolveType = MethodResolver.DYNAMIC; else resolveType = MethodResolver.STATIC_AND_INSTANCE; } else { targetObject = null; resolveType = MethodResolver.STATIC_AND_INSTANCE; } m = MethodResolver.getMethod(m_classObj, funcName, methodArgs, convertedArgs, exprContext, resolveType); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (MethodResolver.DYNAMIC == resolveType) { // First argument was object type if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } else // First arg was not object. See if we need the implied object. { if (Modifier.isStatic(m.getModifiers())) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { if (null == m_defaultInstance) { if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, m_defaultInstance, convertedArgs[0]); Object result; try { result = m.invoke(m_defaultInstance, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, convertedArgs[0]); } return result; } else return m.invoke(m_defaultInstance, convertedArgs[0]); } } } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaClass.java
public void processElement(String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { m = MethodResolver.getElementMethod(m_classObj, localPart); if ( (null == m_defaultInstance) && !Modifier.isStatic(m.getModifiers()) ) { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent( new ExtensionEvent(transformer, m_classObj)); try { m_defaultInstance = m_classObj.newInstance(); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent( new ExtensionEvent(transformer, m_classObj)); } } else m_defaultInstance = m_classObj.newInstance(); } } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, m_defaultInstance, new Object[] {xpc, element}); try { result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, m_defaultInstance, new Object[] {xpc, element}); } } else result = m.invoke(m_defaultInstance, new Object[] {xpc, element}); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); if (targetException instanceof TransformerException) throw (TransformerException)targetException; else if (targetException != null) throw new TransformerException (targetException.getMessage (), targetException); else throw new TransformerException (e.getMessage (), e); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e.getMessage (), e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionNamespaceSupport.java
public ExtensionHandler launch() throws TransformerException { ExtensionHandler handler = null; try { Class cl = ExtensionHandler.getClassForName(m_handlerClass); Constructor con = null; //System.out.println("class " + cl + " " + m_args + " " + m_args.length + " " + m_sig); if (m_sig != null) con = cl.getConstructor(m_sig); else // Pick the constructor based on number of args. { Constructor[] cons = cl.getConstructors(); for (int i = 0; i < cons.length; i ++) { if (cons[i].getParameterTypes().length == m_args.length) { con = cons[i]; break; } } } // System.out.println("constructor " + con); if (con != null) handler = (ExtensionHandler)con.newInstance(m_args); else throw new TransformerException("ExtensionHandler constructor not found"); } catch (Exception e) { throw new TransformerException(e); } return handler; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { boolean isAvailable = false; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (extNS != null) isAvailable = extNS.isFunctionAvailable(funcName); } return isAvailable; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { boolean isAvailable = false; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (extNS != null) // defensive isAvailable = extNS.isElementAvailable(elemName); } return isAvailable; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction (String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { String className; String methodName; Class classObj; Object targetObject; int lastDot = funcName.lastIndexOf('.'); Object[] methodArgs; Object[][] convertedArgs; Class[] paramTypes; try { TransformerImpl trans = (exprContext != null) ? (TransformerImpl)exprContext.getXPathContext().getOwnerObject() : null; if (funcName.endsWith(".new")) { // Handle constructor call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Constructor c = (methodKey != null) ? (Constructor) getFromCache(methodKey, null, methodArgs) : null; if (c != null) { try { paramTypes = c.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return c.newInstance(convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } c = MethodResolver.getConstructor(classObj, methodArgs, convertedArgs, exprContext); if (methodKey != null) putToCache(methodKey, null, methodArgs, c); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(new ExtensionEvent(trans, c, convertedArgs[0])); Object result; try { result = c.newInstance(convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(new ExtensionEvent(trans, c, convertedArgs[0])); } return result; } else return c.newInstance(convertedArgs[0]); } else if (-1 != lastDot) { // Handle static method call methodArgs = new Object[args.size()]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, null, methodArgs) : null; if (m != null && !trans.getDebug()) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(null, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } className = m_className + funcName.substring(0, lastDot); methodName = funcName.substring(lastDot + 1); try { classObj = getClassForName(className); } catch (ClassNotFoundException e) { throw new TransformerException(e); } m = MethodResolver.getMethod(classObj, methodName, methodArgs, convertedArgs, exprContext, MethodResolver.STATIC_ONLY); if (methodKey != null) putToCache(methodKey, null, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, null, convertedArgs[0]); Object result; try { result = m.invoke(null, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, null, convertedArgs[0]); } return result; } else return m.invoke(null, convertedArgs[0]); } else { // Handle instance method call if (args.size() < 1) { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INSTANCE_MTHD_CALL_REQUIRES, new Object[]{funcName })); //"Instance method call to method " + funcName //+ " requires an Object instance as first argument"); } targetObject = args.get(0); if (targetObject instanceof XObject) // Next level down for XObjects targetObject = ((XObject) targetObject).object(); methodArgs = new Object[args.size() - 1]; convertedArgs = new Object[1][]; for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = args.get(i+1); } Method m = (methodKey != null) ? (Method) getFromCache(methodKey, targetObject, methodArgs) : null; if (m != null) { try { paramTypes = m.getParameterTypes(); MethodResolver.convertParams(methodArgs, convertedArgs, paramTypes, exprContext); return m.invoke(targetObject, convertedArgs[0]); } catch (InvocationTargetException ite) { throw ite; } catch(Exception e) { // Must not have been the right one } } classObj = targetObject.getClass(); m = MethodResolver.getMethod(classObj, funcName, methodArgs, convertedArgs, exprContext, MethodResolver.INSTANCE_ONLY); if (methodKey != null) putToCache(methodKey, targetObject, methodArgs, m); if (trans != null && trans.getDebug()) { trans.getTraceManager().fireExtensionEvent(m, targetObject, convertedArgs[0]); Object result; try { result = m.invoke(targetObject, convertedArgs[0]); } catch (Exception e) { throw e; } finally { trans.getTraceManager().fireExtensionEndEvent(m, targetObject, convertedArgs[0]); } return result; } else return m.invoke(targetObject, convertedArgs[0]); } } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace(); throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerJavaPackage.java
public void processElement (String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; Class classObj; Method m = (Method) getFromCache(methodKey, null, null); if (null == m) { try { String fullName = m_className + localPart; int lastDot = fullName.lastIndexOf('.'); if (lastDot < 0) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_INVALID_ELEMENT_NAME, new Object[]{fullName })); //"Invalid element name specified " + fullName); try { classObj = getClassForName(fullName.substring(0, lastDot)); } catch (ClassNotFoundException e) { throw new TransformerException(e); } localPart = fullName.substring(lastDot + 1); m = MethodResolver.getElementMethod(classObj, localPart); if (!Modifier.isStatic(m.getModifiers())) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_ELEMENT_NAME_METHOD_STATIC, new Object[]{fullName })); //"Element name method must be static " + fullName); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } putToCache(methodKey, null, null, m); } XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { if (transformer.getDebug()) { transformer.getTraceManager().fireExtensionEvent(m, null, new Object[] {xpc, element}); try { result = m.invoke(null, new Object[] {xpc, element}); } catch (Exception e) { throw e; } finally { transformer.getTraceManager().fireExtensionEndEvent(m, null, new Object[] {xpc, element}); } } else result = m.invoke(null, new Object[] {xpc, element}); } catch (InvocationTargetException ite) { Throwable resultException = ite; Throwable targetException = ite.getTargetException(); if (targetException instanceof TransformerException) throw ((TransformerException)targetException); else if (targetException != null) resultException = targetException; throw new TransformerException(resultException); } catch (Exception e) { // e.printStackTrace (); throw new TransformerException (e); } if (result != null) { xpc.outputToResultTree (stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { Object[] argArray; try { argArray = new Object[args.size()]; for (int i = 0; i < argArray.length; i++) { Object o = args.get(i); argArray[i] = (o instanceof XObject) ? ((XObject) o).object() : o; o = argArray[i]; if(null != o && o instanceof DTMIterator) { argArray[i] = new DTMNodeList((DTMIterator)o); } } if (m_engineCall == null) { m_engineCall = m_engine.getClass().getMethod("call", new Class[]{ Object.class, String.class, Object[].class }); } return m_engineCall.invoke(m_engine, new Object[]{ null, funcName, argArray }); } catch (Exception e) { e.printStackTrace(); String msg = e.getMessage(); if (null != msg) { if (msg.startsWith("Stopping after fatal error:")) { msg = msg.substring("Stopping after fatal error:".length()); } // System.out.println("Call to extension function failed: "+msg); throw new TransformerException(e); } else { // Should probably make a TRaX Extension Exception. throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_CREATE_EXTENSN, new Object[]{funcName, e })); //"Could not create extension: " + funcName //+ " because of: " + e); } } }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { return callFunction(extFunction.getFunctionName(), args, extFunction.getMethodKey(), exprContext); }
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException { Object result = null; XSLProcessorContext xpc = new XSLProcessorContext(transformer, stylesheetTree); try { Vector argv = new Vector(2); argv.add(xpc); argv.add(element); result = callFunction(localPart, argv, methodKey, transformer.getXPathContext().getExpressionContext()); } catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); } if (result != null) { xpc.outputToResultTree(stylesheetTree, result); } }
// in src/org/apache/xalan/extensions/XSLProcessorContext.java
public void outputToResultTree(Stylesheet stylesheetTree, Object obj) throws TransformerException, java.net.MalformedURLException, java.io.FileNotFoundException, java.io.IOException { try { SerializationHandler rtreeHandler = transformer.getResultTreeHandler(); XPathContext xctxt = transformer.getXPathContext(); XObject value; // Make the return object into an XObject because it // will be easier below. One of the reasons to do this // is to keep all the conversion functionality in the // XObject classes. if (obj instanceof XObject) { value = (XObject) obj; } else if (obj instanceof String) { value = new XString((String) obj); } else if (obj instanceof Boolean) { value = new XBoolean(((Boolean) obj).booleanValue()); } else if (obj instanceof Double) { value = new XNumber(((Double) obj).doubleValue()); } else if (obj instanceof DocumentFragment) { int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); value = new XRTreeFrag(handle, xctxt); } else if (obj instanceof DTM) { DTM dtm = (DTM)obj; DTMIterator iterator = new DescendantIterator(); // %%ISSUE%% getDocument may not be valid for DTMs shared by multiple // document trees, eg RTFs. But in that case, we shouldn't be trying // to iterate over the whole DTM; we should be iterating over // dtm.getDocumentRoot(rootNodeHandle), and folks should have told us // this by passing a more appropriate type. iterator.setRoot(dtm.getDocument(), xctxt); value = new XNodeSet(iterator); } else if (obj instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)obj; DTMIterator iterator = new OneStepIterator(iter, -1); value = new XNodeSet(iterator); } else if (obj instanceof DTMIterator) { value = new XNodeSet((DTMIterator) obj); } else if (obj instanceof NodeIterator) { value = new XNodeSet(new org.apache.xpath.NodeSetDTM(((NodeIterator)obj), xctxt)); } else if (obj instanceof org.w3c.dom.Node) { value = new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager()); } else { value = new XString(obj.toString()); } int type = value.getType(); String s; switch (type) { case XObject.CLASS_BOOLEAN : case XObject.CLASS_NUMBER : case XObject.CLASS_STRING : s = value.str(); rtreeHandler.characters(s.toCharArray(), 0, s.length()); break; case XObject.CLASS_NODESET : // System.out.println(value); DTMIterator nl = value.iter(); int pos; while (DTM.NULL != (pos = nl.nextNode())) { DTM dtm = nl.getDTM(pos); int top = pos; while (DTM.NULL != pos) { rtreeHandler.flushPending(); ClonerToResultTree.cloneToResultTree(pos, dtm.getNodeType(pos), dtm, rtreeHandler, true); int nextNode = dtm.getFirstChild(pos); while (DTM.NULL == nextNode) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } if (top == pos) break; nextNode = dtm.getNextSibling(pos); if (DTM.NULL == nextNode) { pos = dtm.getParent(pos); if (top == pos) { if (DTM.ELEMENT_NODE == dtm.getNodeType(pos)) { rtreeHandler.endElement("", "", dtm.getNodeName(pos)); } nextNode = DTM.NULL; break; } } } pos = nextNode; } } break; case XObject.CLASS_RTREEFRAG : SerializerUtils.outputResultTreeFragment( rtreeHandler, value, transformer.getXPathContext()); // rtreeHandler.outputResultTreeFragment(value, // transformer.getXPathContext()); break; } } catch(org.xml.sax.SAXException se) { throw new TransformerException(se); } }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public void processElement( String localPart, ElemTemplateElement element, TransformerImpl transformer, Stylesheet stylesheetTree, Object methodKey) throws TransformerException, IOException {}
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction( String funcName, Vector args, Object methodKey, ExpressionContext exprContext) throws TransformerException { throw new TransformerException("This method should not be called."); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
public Object callFunction(FuncExtFunction extFunction, Vector args, ExpressionContext exprContext) throws TransformerException { // Find the template which invokes this EXSLT function. ExpressionNode parent = extFunction.exprGetParent(); while (parent != null && !(parent instanceof ElemTemplate)) { parent = parent.exprGetParent(); } ElemTemplate callerTemplate = (parent != null) ? (ElemTemplate)parent: null; XObject[] methodArgs; methodArgs = new XObject[args.size()]; try { for (int i = 0; i < methodArgs.length; i++) { methodArgs[i] = XObject.create(args.get(i)); } ElemExsltFunction elemFunc = getFunction(extFunction.getFunctionName()); if (null != elemFunc) { XPathContext context = exprContext.getXPathContext(); TransformerImpl transformer = (TransformerImpl)context.getOwnerObject(); transformer.pushCurrentFuncResult(null); elemFunc.execute(transformer, methodArgs); XObject val = (XObject)transformer.popCurrentFuncResult(); return (val == null) ? new XString("") // value if no result element. : val; } else { throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_FUNCTION_NOT_FOUND, new Object[] {extFunction.getFunctionName()})); } } catch (TransformerException e) { throw e; } catch (Exception e) { throw new TransformerException(e); } }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Constructor getConstructor(Class classObj, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext) throws NoSuchMethodException, SecurityException, TransformerException { Constructor bestConstructor = null; Class[] bestParamTypes = null; Constructor[] constructors = classObj.getConstructors(); int nMethods = constructors.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Constructor ctor = constructors[i]; Class[] paramTypes = ctor.getParameterTypes(); int numberMethodParams = paramTypes.length; int paramStart = 0; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); if(numberMethodParams == (argsIn.length+1)) { Class javaClass = paramTypes[0]; // System.out.println("first javaClass: "+javaClass.getName()); if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; paramStart++; // System.out.println("Incrementing paramStart: "+paramStart); } else continue; } else scoreStart = 1000; if(argsIn.length == (numberMethodParams - paramStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, paramStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best ctor: "+ctor); bestConstructor = ctor; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } if(null == bestConstructor) { throw new NoSuchMethodException(errString("function", "constructor", classObj, "", 0, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_CONSTRUCTOR, new Object[]{classObj.getName()})); //"More than one best match for constructor for " + classObj.getName()); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestConstructor; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getMethod(Class classObj, String name, Object[] argsIn, Object[][] argsOut, ExpressionContext exprContext, int searchMethod) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for method: "+name); // System.out.println("---> classObj: "+classObj); if (name.indexOf("-")>0) name = replaceDash(name); Method bestMethod = null; Class[] bestParamTypes = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScore = Integer.MAX_VALUE; int bestScoreCount = 0; boolean isStatic; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); int xsltParamStart = 0; if(method.getName().equals(name)) { isStatic = Modifier.isStatic(method.getModifiers()); switch(searchMethod) { case STATIC_ONLY: if (!isStatic) { continue; } break; case INSTANCE_ONLY: if (isStatic) { continue; } break; case STATIC_AND_INSTANCE: break; case DYNAMIC: if (!isStatic) xsltParamStart = 1; } int javaParamStart = 0; Class[] paramTypes = method.getParameterTypes(); int numberMethodParams = paramTypes.length; boolean isFirstExpressionContext = false; int scoreStart; // System.out.println("numberMethodParams: "+numberMethodParams); // System.out.println("argsIn.length: "+argsIn.length); // System.out.println("exprContext: "+exprContext); int argsLen = (null != argsIn) ? argsIn.length : 0; if(numberMethodParams == (argsLen-xsltParamStart+1)) { Class javaClass = paramTypes[0]; if(ExpressionContext.class.isAssignableFrom(javaClass)) { isFirstExpressionContext = true; scoreStart = 0; javaParamStart++; } else { continue; } } else scoreStart = 1000; if((argsLen - xsltParamStart) == (numberMethodParams - javaParamStart)) { // then we have our candidate. int score = scoreMatch(paramTypes, javaParamStart, argsIn, scoreStart); // System.out.println("score: "+score); if(-1 == score) continue; if(score < bestScore) { // System.out.println("Assigning best method: "+method); bestMethod = method; bestParamTypes = paramTypes; bestScore = score; bestScoreCount = 1; } else if (score == bestScore) bestScoreCount++; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("function", "method", classObj, name, searchMethod, argsIn)); } /*** This is commented out until we can do a better object -> object scoring else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_METHOD, new Object[]{name})); //"More than one best match for method " + name); ***/ else convertParams(argsIn, argsOut, bestParamTypes, exprContext); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static Method getElementMethod(Class classObj, String name) throws NoSuchMethodException, SecurityException, TransformerException { // System.out.println("---> Looking for element method: "+name); // System.out.println("---> classObj: "+classObj); Method bestMethod = null; Method[] methods = classObj.getMethods(); int nMethods = methods.length; int bestScoreCount = 0; for(int i = 0; i < nMethods; i++) { Method method = methods[i]; // System.out.println("looking at method: "+method); if(method.getName().equals(name)) { Class[] paramTypes = method.getParameterTypes(); if ( (paramTypes.length == 2) && paramTypes[1].isAssignableFrom(org.apache.xalan.templates.ElemExtensionCall.class) && paramTypes[0].isAssignableFrom(org.apache.xalan.extensions.XSLProcessorContext.class) ) { if ( ++bestScoreCount == 1 ) bestMethod = method; else break; } } } if (null == bestMethod) { throw new NoSuchMethodException(errString("element", "method", classObj, name, 0, null)); } else if (bestScoreCount > 1) throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_MORE_MATCH_ELEMENT, new Object[]{name})); //"More than one best match for element method " + name); return bestMethod; }
// in src/org/apache/xalan/extensions/MethodResolver.java
public static void convertParams(Object[] argsIn, Object[][] argsOut, Class[] paramTypes, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { // System.out.println("In convertParams"); if (paramTypes == null) argsOut[0] = null; else { int nParams = paramTypes.length; argsOut[0] = new Object[nParams]; int paramIndex = 0; if((nParams > 0) && ExpressionContext.class.isAssignableFrom(paramTypes[0])) { argsOut[0][0] = exprContext; // System.out.println("Incrementing paramIndex in convertParams: "+paramIndex); paramIndex++; } if (argsIn != null) { for(int i = argsIn.length - nParams + paramIndex ; paramIndex < nParams; i++, paramIndex++) { // System.out.println("paramTypes[i]: "+paramTypes[i]); argsOut[0][paramIndex] = convert(argsIn[i], paramTypes[paramIndex]); } } } }
// in src/org/apache/xalan/extensions/MethodResolver.java
static Object convert(Object xsltObj, Class javaClass) throws javax.xml.transform.TransformerException { if(xsltObj instanceof XObject) { XObject xobj = ((XObject)xsltObj); int xsltClassType = xobj.getType(); switch(xsltClassType) { case XObject.CLASS_NULL: return null; case XObject.CLASS_BOOLEAN: { if(javaClass == java.lang.String.class) return xobj.str(); else return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } // break; Unreachable case XObject.CLASS_NUMBER: { if(javaClass == java.lang.String.class) return xobj.str(); else if(javaClass == Boolean.TYPE) return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; else { return convertDoubleToNumber(xobj.num(), javaClass); } } // break; Unreachable case XObject.CLASS_STRING: { if((javaClass == java.lang.String.class) || (javaClass == java.lang.Object.class)) return xobj.str(); else if(javaClass == Character.TYPE) { String str = xobj.str(); if(str.length() > 0) return new Character(str.charAt(0)); else return null; // ?? } else if(javaClass == Boolean.TYPE) return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; else { return convertDoubleToNumber(xobj.num(), javaClass); } } // break; Unreachable case XObject.CLASS_RTREEFRAG: { // GLP: I don't see the reason for the isAssignableFrom call // instead of an == test as is used everywhere else. // Besides, if the javaClass is a subclass of NodeIterator // the condition will be true and we'll create a NodeIterator // which may not match the javaClass, causing a RuntimeException. // if((NodeIterator.class.isAssignableFrom(javaClass)) || if ( (javaClass == NodeIterator.class) || (javaClass == java.lang.Object.class) ) { DTMIterator dtmIter = ((XRTreeFrag) xobj).asNodeIterator(); return new DTMNodeIterator(dtmIter); } else if (javaClass == NodeList.class) { return ((XRTreeFrag) xobj).convertToNodeset(); } // Same comment as above // else if(Node.class.isAssignableFrom(javaClass)) else if(javaClass == Node.class) { DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator(); int rootHandle = iter.nextNode(); DTM dtm = iter.getDTM(rootHandle); return dtm.getNode(dtm.getFirstChild(rootHandle)); } else if(javaClass == java.lang.String.class) { return xobj.str(); } else if(javaClass == Boolean.TYPE) { return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } else if(javaClass.isPrimitive()) { return convertDoubleToNumber(xobj.num(), javaClass); } else { DTMIterator iter = ((XRTreeFrag) xobj).asNodeIterator(); int rootHandle = iter.nextNode(); DTM dtm = iter.getDTM(rootHandle); Node child = dtm.getNode(dtm.getFirstChild(rootHandle)); if(javaClass.isAssignableFrom(child.getClass())) return child; else return null; } } // break; Unreachable case XObject.CLASS_NODESET: { // GLP: I don't see the reason for the isAssignableFrom call // instead of an == test as is used everywhere else. // Besides, if the javaClass is a subclass of NodeIterator // the condition will be true and we'll create a NodeIterator // which may not match the javaClass, causing a RuntimeException. // if((NodeIterator.class.isAssignableFrom(javaClass)) || if ( (javaClass == NodeIterator.class) || (javaClass == java.lang.Object.class) ) { return xobj.nodeset(); } // Same comment as above // else if(NodeList.class.isAssignableFrom(javaClass)) else if(javaClass == NodeList.class) { return xobj.nodelist(); } // Same comment as above // else if(Node.class.isAssignableFrom(javaClass)) else if(javaClass == Node.class) { // Xalan ensures that iter() always returns an // iterator positioned at the beginning. DTMIterator ni = xobj.iter(); int handle = ni.nextNode(); if (handle != DTM.NULL) return ni.getDTM(handle).getNode(handle); // may be null. else return null; } else if(javaClass == java.lang.String.class) { return xobj.str(); } else if(javaClass == Boolean.TYPE) { return xobj.bool() ? Boolean.TRUE : Boolean.FALSE; } else if(javaClass.isPrimitive()) { return convertDoubleToNumber(xobj.num(), javaClass); } else { DTMIterator iter = xobj.iter(); int childHandle = iter.nextNode(); DTM dtm = iter.getDTM(childHandle); Node child = dtm.getNode(childHandle); if(javaClass.isAssignableFrom(child.getClass())) return child; else return null; } } // break; Unreachable // No default:, fall-through on purpose } // end switch xsltObj = xobj.object(); } // end if if(xsltObj instanceof XObject) // At this point, we have a raw java object, not an XObject. if (null != xsltObj) { if(javaClass == java.lang.String.class) { return xsltObj.toString(); } else if(javaClass.isPrimitive()) { // Assume a number conversion XString xstr = new XString(xsltObj.toString()); double num = xstr.num(); return convertDoubleToNumber(num, javaClass); } else if(javaClass == java.lang.Class.class) { return xsltObj.getClass(); } else { // Just pass the object directly, and hope for the best. return xsltObj; } } else { // Just pass the object directly, and hope for the best. return xsltObj; } }
// in src/org/apache/xpath/XPath.java
public XObject execute( XPathContext xctxt, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { return execute( xctxt, xctxt.getDTMHandleFromNode(contextNode), namespaceContext); }
// in src/org/apache/xpath/XPath.java
public XObject execute( XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { xctxt.pushNamespaceContext(namespaceContext); xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XObject xobj = null; try { xobj = m_mainExp.execute(xctxt); } catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; } catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; } finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } return xobj; }
// in src/org/apache/xpath/XPath.java
public boolean bool( XPathContext xctxt, int contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { xctxt.pushNamespaceContext(namespaceContext); xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); try { return m_mainExp.bool(xctxt); } catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; } catch (Exception e) { while (e instanceof org.apache.xml.utils.WrappedRuntimeException) { e = ((org.apache.xml.utils.WrappedRuntimeException) e).getException(); } // e.printStackTrace(); String msg = e.getMessage(); if (msg == null || msg.length() == 0) { msg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null); } TransformerException te = new TransformerException(msg, getLocator(), e); ErrorListener el = xctxt.getErrorListener(); // te.printStackTrace(); if(null != el) // defensive, should never happen. { el.fatalError(te); } else throw te; } finally { xctxt.popNamespaceContext(); xctxt.popCurrentNodeAndExpression(); } return false; }
// in src/org/apache/xpath/XPath.java
public double getMatchScore(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { xctxt.pushCurrentNode(context); xctxt.pushCurrentExpressionNode(context); try { XObject score = m_mainExp.execute(xctxt); if (DEBUG_MATCHES) { DTM dtm = xctxt.getDTM(context); System.out.println("score: " + score.num() + " for " + dtm.getNodeName(context) + " for xpath " + this.getPatternString()); } return score.num(); } finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); } // return XPath.MATCH_SCORE_NONE; }
// in src/org/apache/xpath/XPath.java
public void warn( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, (SAXSourceLocator)xctxt.getSAXLocator())); } }
// in src/org/apache/xpath/XPath.java
public void error( XPathContext xctxt, int sourceNode, String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = xctxt.getErrorListener(); if (null != ehandler) { 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()); } }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(int index, int frame) throws TransformerException { index += frame; XObject val = _stackFrames[index]; return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getLocalVariable(XPathContext xctxt, int index, boolean destructiveOK) throws TransformerException { index += _currentFrameBottom; XObject val = _stackFrames[index]; if(null == val) throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VARIABLE_ACCESSED_BEFORE_BIND, null), xctxt.getSAXLocator()); // "Variable accessed before it is bound!", xctxt.getSAXLocator()); // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public boolean isLocalSet(int index) throws TransformerException { return (_stackFrames[index + _currentFrameBottom] != null); }
// in src/org/apache/xpath/VariableStack.java
public XObject getGlobalVariable(XPathContext xctxt, final int index) throws TransformerException { XObject val = _stackFrames[index]; // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return val; }
// in src/org/apache/xpath/VariableStack.java
public XObject getGlobalVariable(XPathContext xctxt, final int index, boolean destructiveOK) throws TransformerException { XObject val = _stackFrames[index]; // Lazy execution of variables. if (val.getType() == XObject.CLASS_UNRESOLVEDVARIABLE) return (_stackFrames[index] = val.execute(xctxt)); return destructiveOK ? val : val.getFresh(); }
// in src/org/apache/xpath/VariableStack.java
public XObject getVariableOrParam( XPathContext xctxt, org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver prefixResolver = xctxt.getNamespaceContext(); // Get the current ElemTemplateElement, which must be pushed in as the // prefix resolver, and then walk backwards in document order, searching // for an xsl:param element or xsl:variable element that matches our // qname. If we reach the top level, use the StylesheetRoot's composed // list of top level variables and parameters. if (prefixResolver instanceof org.apache.xalan.templates.ElemTemplateElement) { org.apache.xalan.templates.ElemVariable vvar; org.apache.xalan.templates.ElemTemplateElement prev = (org.apache.xalan.templates.ElemTemplateElement) prefixResolver; if (!(prev instanceof org.apache.xalan.templates.Stylesheet)) { while ( !(prev.getParentNode() instanceof org.apache.xalan.templates.Stylesheet) ) { org.apache.xalan.templates.ElemTemplateElement savedprev = prev; while (null != (prev = prev.getPreviousSiblingElem())) { if (prev instanceof org.apache.xalan.templates.ElemVariable) { vvar = (org.apache.xalan.templates.ElemVariable) prev; if (vvar.getName().equals(qname)) return getLocalVariable(xctxt, vvar.getIndex()); } } prev = savedprev.getParentElem(); } } vvar = prev.getStylesheetRoot().getVariableOrParamComposed(qname); if (null != vvar) return getGlobalVariable(xctxt, vvar.getIndex()); } throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{qname.toString()})); //"Variable not resolvable: " + qname); }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression compile(int opPos) throws TransformerException { int op = getOp(opPos); Expression expr = null; // System.out.println(getPatternString()+"op: "+op); switch (op) { case OpCodes.OP_XPATH : expr = compile(opPos + 2); break; case OpCodes.OP_OR : expr = or(opPos); break; case OpCodes.OP_AND : expr = and(opPos); break; case OpCodes.OP_NOTEQUALS : expr = notequals(opPos); break; case OpCodes.OP_EQUALS : expr = equals(opPos); break; case OpCodes.OP_LTE : expr = lte(opPos); break; case OpCodes.OP_LT : expr = lt(opPos); break; case OpCodes.OP_GTE : expr = gte(opPos); break; case OpCodes.OP_GT : expr = gt(opPos); break; case OpCodes.OP_PLUS : expr = plus(opPos); break; case OpCodes.OP_MINUS : expr = minus(opPos); break; case OpCodes.OP_MULT : expr = mult(opPos); break; case OpCodes.OP_DIV : expr = div(opPos); break; case OpCodes.OP_MOD : expr = mod(opPos); break; // case OpCodes.OP_QUO : // expr = quo(opPos); break; case OpCodes.OP_NEG : expr = neg(opPos); break; case OpCodes.OP_STRING : expr = string(opPos); break; case OpCodes.OP_BOOL : expr = bool(opPos); break; case OpCodes.OP_NUMBER : expr = number(opPos); break; case OpCodes.OP_UNION : expr = union(opPos); break; case OpCodes.OP_LITERAL : expr = literal(opPos); break; case OpCodes.OP_VARIABLE : expr = variable(opPos); break; case OpCodes.OP_GROUP : expr = group(opPos); break; case OpCodes.OP_NUMBERLIT : expr = numberlit(opPos); break; case OpCodes.OP_ARGUMENT : expr = arg(opPos); break; case OpCodes.OP_EXTFUNCTION : expr = compileExtension(opPos); break; case OpCodes.OP_FUNCTION : expr = compileFunction(opPos); break; case OpCodes.OP_LOCATIONPATH : expr = locationPath(opPos); break; case OpCodes.OP_PREDICATE : expr = null; break; // should never hit this here. case OpCodes.OP_MATCHPATTERN : expr = matchPattern(opPos + 2); break; case OpCodes.OP_LOCATIONPATHPATTERN : expr = locationPathPattern(opPos); break; case OpCodes.OP_QUO: error(XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ "quo" }); //"ERROR! Unknown op code: "+m_opMap[opPos]); break; default : error(XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ Integer.toString(getOp(opPos)) }); //"ERROR! Unknown op code: "+m_opMap[opPos]); } // if(null != expr) // expr.setSourceLocator(m_locator); return expr; }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileOperation(Operation operation, int opPos) throws TransformerException { int leftPos = getFirstChildPos(opPos); int rightPos = getNextOpPos(leftPos); operation.setLeftRight(compile(leftPos), compile(rightPos)); return operation; }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileUnary(UnaryOperation unary, int opPos) throws TransformerException { int rightPos = getFirstChildPos(opPos); unary.setRight(compile(rightPos)); return unary; }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression or(int opPos) throws TransformerException { return compileOperation(new Or(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression and(int opPos) throws TransformerException { return compileOperation(new And(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression notequals(int opPos) throws TransformerException { return compileOperation(new NotEquals(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression equals(int opPos) throws TransformerException { return compileOperation(new Equals(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression lte(int opPos) throws TransformerException { return compileOperation(new Lte(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression lt(int opPos) throws TransformerException { return compileOperation(new Lt(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression gte(int opPos) throws TransformerException { return compileOperation(new Gte(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression gt(int opPos) throws TransformerException { return compileOperation(new Gt(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression plus(int opPos) throws TransformerException { return compileOperation(new Plus(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression minus(int opPos) throws TransformerException { return compileOperation(new Minus(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression mult(int opPos) throws TransformerException { return compileOperation(new Mult(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression div(int opPos) throws TransformerException { return compileOperation(new Div(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression mod(int opPos) throws TransformerException { return compileOperation(new Mod(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression neg(int opPos) throws TransformerException { return compileUnary(new Neg(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression string(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.String(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression bool(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.Bool(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression number(int opPos) throws TransformerException { return compileUnary(new org.apache.xpath.operations.Number(), opPos); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression variable(int opPos) throws TransformerException { Variable var = new Variable(); opPos = getFirstChildPos(opPos); int nsPos = getOp(opPos); java.lang.String namespace = (OpCodes.EMPTY == nsPos) ? null : (java.lang.String) getTokenQueue().elementAt(nsPos); java.lang.String localname = (java.lang.String) getTokenQueue().elementAt(getOp(opPos+1)); QName qname = new QName(namespace, localname); var.setQName(qname); return var; }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression group(int opPos) throws TransformerException { // no-op return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression arg(int opPos) throws TransformerException { // no-op return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression union(int opPos) throws TransformerException { locPathDepth++; try { return UnionPathIterator.createUnionIterator(this, opPos); } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression locationPath(int opPos) throws TransformerException { locPathDepth++; try { DTMIterator iter = WalkerFactory.newDTMIterator(this, opPos, (locPathDepth == 0)); return (Expression)iter; // cast OK, I guess. } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression predicate(int opPos) throws TransformerException { return compile(opPos + 2); }
// in src/org/apache/xpath/compiler/Compiler.java
protected Expression matchPattern(int opPos) throws TransformerException { locPathDepth++; try { // First, count... int nextOpPos = opPos; int i; for (i = 0; getOp(nextOpPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++) { nextOpPos = getNextOpPos(nextOpPos); } if (i == 1) return compile(opPos); UnionPattern up = new UnionPattern(); StepPattern[] patterns = new StepPattern[i]; for (i = 0; getOp(opPos) == OpCodes.OP_LOCATIONPATHPATTERN; i++) { nextOpPos = getNextOpPos(opPos); patterns[i] = (StepPattern) compile(opPos); opPos = nextOpPos; } up.setPatterns(patterns); return up; } finally { locPathDepth--; } }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression locationPathPattern(int opPos) throws TransformerException { opPos = getFirstChildPos(opPos); return stepPattern(opPos, 0, null); }
// in src/org/apache/xpath/compiler/Compiler.java
protected StepPattern stepPattern( int opPos, int stepCount, StepPattern ancestorPattern) throws TransformerException { int startOpPos = opPos; int stepType = getOp(opPos); if (OpCodes.ENDOP == stepType) { return null; } boolean addMagicSelf = true; int endStep = getNextOpPos(opPos); // int nextStepType = getOpMap()[endStep]; StepPattern pattern; // boolean isSimple = ((OpCodes.ENDOP == nextStepType) && (stepCount == 0)); int argLen; switch (stepType) { case OpCodes.OP_FUNCTION : if(DEBUG) System.out.println("MATCH_FUNCTION: "+m_currentPattern); addMagicSelf = false; argLen = getOp(opPos + OpMap.MAPINDEX_LENGTH); pattern = new FunctionPattern(compileFunction(opPos), Axis.PARENT, Axis.CHILD); break; case OpCodes.FROM_ROOT : if(DEBUG) System.out.println("FROM_ROOT, "+m_currentPattern); addMagicSelf = false; argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, Axis.PARENT, Axis.CHILD); break; case OpCodes.MATCH_ATTRIBUTE : if(DEBUG) System.out.println("MATCH_ATTRIBUTE: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(DTMFilter.SHOW_ATTRIBUTE, getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.PARENT, Axis.ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : if(DEBUG) System.out.println("MATCH_ANY_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); int what = getWhatToShow(startOpPos); // bit-o-hackery, but this code is due for the morgue anyway... if(0x00000500 == what) addMagicSelf = false; pattern = new StepPattern(getWhatToShow(startOpPos), getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.ANCESTOR, Axis.CHILD); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : if(DEBUG) System.out.println("MATCH_IMMEDIATE_ANCESTOR: "+getStepLocalName(startOpPos)+", "+m_currentPattern); argLen = getArgLengthOfStep(opPos); opPos = getFirstChildPosOfStep(opPos); pattern = new StepPattern(getWhatToShow(startOpPos), getStepNS(startOpPos), getStepLocalName(startOpPos), Axis.PARENT, Axis.CHILD); break; default : error(XPATHErrorResources.ER_UNKNOWN_MATCH_OPERATION, null); //"unknown match operation!"); return null; } pattern.setPredicates(getCompiledPredicates(opPos + argLen)); if(null == ancestorPattern) { // This is the magic and invisible "." at the head of every // match pattern, and corresponds to the current node in the context // list, from where predicates are counted. // So, in order to calculate "foo[3]", it has to count from the // current node in the context list, so, from that current node, // the full pattern is really "self::node()/child::foo[3]". If you // translate this to a select pattern from the node being tested, // which is really how we're treating match patterns, it works out to // self::foo/parent::node[child::foo[3]]", or close enough. /* if(addMagicSelf && pattern.getPredicateCount() > 0) { StepPattern selfPattern = new StepPattern(DTMFilter.SHOW_ALL, Axis.PARENT, Axis.CHILD); // We need to keep the new nodetest from affecting the score... XNumber score = pattern.getStaticScore(); pattern.setRelativePathPattern(selfPattern); pattern.setStaticScore(score); selfPattern.setStaticScore(score); }*/ } else { // System.out.println("Setting "+ancestorPattern+" as relative to "+pattern); pattern.setRelativePathPattern(ancestorPattern); } StepPattern relativePathPattern = stepPattern(endStep, stepCount + 1, pattern); return (null != relativePathPattern) ? relativePathPattern : pattern; }
// in src/org/apache/xpath/compiler/Compiler.java
public Expression[] getCompiledPredicates(int opPos) throws TransformerException { int count = countPredicates(opPos); if (count > 0) { Expression[] predicates = new Expression[count]; compilePredicates(opPos, predicates); return predicates; } return null; }
// in src/org/apache/xpath/compiler/Compiler.java
public int countPredicates(int opPos) throws TransformerException { int count = 0; while (OpCodes.OP_PREDICATE == getOp(opPos)) { count++; opPos = getNextOpPos(opPos); } return count; }
// in src/org/apache/xpath/compiler/Compiler.java
private void compilePredicates(int opPos, Expression[] predicates) throws TransformerException { for (int i = 0; OpCodes.OP_PREDICATE == getOp(opPos); i++) { predicates[i] = predicate(opPos); opPos = getNextOpPos(opPos); } }
// in src/org/apache/xpath/compiler/Compiler.java
Expression compileFunction(int opPos) throws TransformerException { int endFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); int funcID = getOp(opPos); opPos++; if (-1 != funcID) { Function func = m_functionTable.getFunction(funcID); /** * It is a trick for function-available. Since the function table is an * instance field, insert this table at compilation time for later usage */ if (func instanceof FuncExtFunctionAvailable) ((FuncExtFunctionAvailable) func).setFunctionTable(m_functionTable); func.postCompileStep(this); try { int i = 0; for (int p = opPos; p < endFunc; p = getNextOpPos(p), i++) { // System.out.println("argPos: "+ p); // System.out.println("argCode: "+ m_opMap[p]); func.setArg(compile(p), i); } func.checkNumberArgs(i); } catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); } return func; } else { error(XPATHErrorResources.ER_FUNCTION_TOKEN_NOT_FOUND, null); //"function token not found."); return null; } }
// in src/org/apache/xpath/compiler/Compiler.java
private Expression compileExtension(int opPos) throws TransformerException { int endExtFunc = opPos + getOp(opPos + 1) - 1; opPos = getFirstChildPos(opPos); java.lang.String ns = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; java.lang.String funcName = (java.lang.String) getTokenQueue().elementAt(getOp(opPos)); opPos++; // We create a method key to uniquely identify this function so that we // can cache the object needed to invoke it. This way, we only pay the // reflection overhead on the first call. Function extension = new FuncExtFunction(ns, funcName, String.valueOf(getNextMethodId())); try { int i = 0; while (opPos < endExtFunc) { int nextOpPos = getNextOpPos(opPos); extension.setArg(this.compile(opPos), i); opPos = nextOpPos; i++; } } catch (WrongNumberArgsException wnae) { ; // should never happen } return extension; }
// in src/org/apache/xpath/compiler/Compiler.java
public void warn(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != m_errorHandler) { m_errorHandler.warning(new TransformerException(fmsg, m_locator)); } else { System.out.println(fmsg +"; file "+m_locator.getSystemId() +"; line "+m_locator.getLineNumber() +"; column "+m_locator.getColumnNumber()); } }
// in src/org/apache/xpath/compiler/Compiler.java
public void error(String msg, Object[] args) throws TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != m_errorHandler) { m_errorHandler.fatalError(new TransformerException(fmsg, m_locator)); } else { // System.out.println(te.getMessage() // +"; file "+te.getSystemId() // +"; line "+te.getLineNumber() // +"; column "+te.getColumnNumber()); throw new TransformerException(fmsg, (SAXSourceLocator)m_locator); } }
// in src/org/apache/xpath/compiler/FunctionTable.java
Function getFunction(int which) throws javax.xml.transform.TransformerException { try{ if (which < NUM_BUILT_IN_FUNCS) return (Function) m_functions[which].newInstance(); else return (Function) m_functions_customer[ which-NUM_BUILT_IN_FUNCS].newInstance(); }catch (IllegalAccessException ex){ throw new TransformerException(ex.getMessage()); }catch (InstantiationException ex){ throw new TransformerException(ex.getMessage()); } }
// in src/org/apache/xpath/compiler/XPathParser.java
public void initXPath( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compiler, namespaceContext, this); lexer.tokenize(expression); m_ops.setOp(0,OpCodes.OP_XPATH); m_ops.setOp(OpMap.MAPINDEX_LENGTH,2); // Patch for Christine's gripe. She wants her errorHandler to return from // a fatal error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. // // %REVIEW% Is there a better way of doing this? // %REVIEW% Are there any other cases which need the safety net? // (and if so do we care right now, or should we rewrite the XPath // grammar engine and can fix it at that time?) try { nextToken(); Expr(); if (null != m_token) { String extraTokens = ""; while (null != m_token) { extraTokens += "'" + m_token + "'"; nextToken(); if (null != m_token) extraTokens += ", "; } error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS, new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens); } } catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; } compiler.shrink(); }
// in src/org/apache/xpath/compiler/XPathParser.java
public void initMatchPattern( Compiler compiler, String expression, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { m_ops = compiler; m_namespaceContext = namespaceContext; m_functionTable = compiler.getFunctionTable(); Lexer lexer = new Lexer(compiler, namespaceContext, this); lexer.tokenize(expression); m_ops.setOp(0, OpCodes.OP_MATCHPATTERN); m_ops.setOp(OpMap.MAPINDEX_LENGTH, 2); nextToken(); Pattern(); if (null != m_token) { String extraTokens = ""; while (null != m_token) { extraTokens += "'" + m_token + "'"; nextToken(); if (null != m_token) extraTokens += ", "; } error(XPATHErrorResources.ER_EXTRA_ILLEGAL_TOKENS, new Object[]{ extraTokens }); //"Extra illegal tokens: "+extraTokens); } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH)+1); m_ops.shrink(); }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(String expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected, m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
void warn(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHWarning(msg, args); ErrorListener ehandler = this.getErrorListener(); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.warning(new TransformerException(fmsg, m_sourceLocator)); } else { // Should never happen. System.err.println(fmsg); } }
// in src/org/apache/xpath/compiler/XPathParser.java
void error(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = this.getErrorListener(); TransformerException te = new TransformerException(fmsg, m_sourceLocator); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.fatalError(te); } else { // System.err.println(fmsg); throw te; } }
// in src/org/apache/xpath/compiler/XPathParser.java
void errorForDOM3(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = this.getErrorListener(); TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.fatalError(te); } else { // System.err.println(fmsg); throw te; } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Expr() throws javax.xml.transform.TransformerException { OrExpr(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void OrExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); AndExpr(); if ((null != m_token) && tokenIs("or")) { nextToken(); insertOp(opPos, 2, OpCodes.OP_OR); OrExpr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void AndExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); EqualityExpr(-1); if ((null != m_token) && tokenIs("and")) { nextToken(); insertOp(opPos, 2, OpCodes.OP_AND); AndExpr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int EqualityExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; RelationalExpr(-1); if (null != m_token) { if (tokenIs('!') && lookahead('=', 1)) { nextToken(); nextToken(); insertOp(addPos, 2, OpCodes.OP_NOTEQUALS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = EqualityExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_EQUALS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = EqualityExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int RelationalExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; AdditiveExpr(-1); if (null != m_token) { if (tokenIs('<')) { nextToken(); if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_LTE); } else { insertOp(addPos, 2, OpCodes.OP_LT); } int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = RelationalExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('>')) { nextToken(); if (tokenIs('=')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_GTE); } else { insertOp(addPos, 2, OpCodes.OP_GT); } int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = RelationalExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int AdditiveExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; MultiplicativeExpr(-1); if (null != m_token) { if (tokenIs('+')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_PLUS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = AdditiveExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs('-')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MINUS); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = AdditiveExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int MultiplicativeExpr(int addPos) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (-1 == addPos) addPos = opPos; UnaryExpr(); if (null != m_token) { if (tokenIs('*')) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MULT); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("div")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_DIV); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("mod")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_MOD); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } else if (tokenIs("quo")) { nextToken(); insertOp(addPos, 2, OpCodes.OP_QUO); int opPlusLeftHandLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - addPos; addPos = MultiplicativeExpr(addPos); m_ops.setOp(addPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(addPos + opPlusLeftHandLen + 1) + opPlusLeftHandLen); addPos += 2; } } return addPos; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void UnaryExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean isNeg = false; if (m_tokenChar == '-') { nextToken(); appendOp(2, OpCodes.OP_NEG); isNeg = true; } UnionExpr(); if (isNeg) m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void StringExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_STRING); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void BooleanExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_BOOL); Expr(); int opLen = m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos; if (opLen == 2) { error(XPATHErrorResources.ER_BOOLEAN_ARG_NO_LONGER_OPTIONAL, null); //"boolean(...) argument is no longer optional with 19990709 XPath draft."); } m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, opLen); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void NumberExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_NUMBER); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void UnionExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean continueOrLoop = true; boolean foundUnion = false; do { PathExpr(); if (tokenIs('|')) { if (false == foundUnion) { foundUnion = true; insertOp(opPos, 2, OpCodes.OP_UNION); } nextToken(); } else { break; } // this.m_testForDocOrder = true; } while (continueOrLoop); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void PathExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int filterExprMatch = FilterExpr(); if (filterExprMatch != FILTER_MATCH_FAILED) { // If FilterExpr had Predicates, a OP_LOCATIONPATH opcode would already // have been inserted. boolean locationPathStarted = (filterExprMatch==FILTER_MATCH_PREDICATES); if (tokenIs('/')) { nextToken(); if (!locationPathStarted) { // int locationPathOpPos = opPos; insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH); locationPathStarted = true; } if (!RelativeLocationPath()) { // "Relative location path expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_REL_LOC_PATH, null); } } // Terminate for safety. if (locationPathStarted) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } } else { LocationPath(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int FilterExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int filterMatch; if (PrimaryExpr()) { if (tokenIs('[')) { // int locationPathOpPos = opPos; insertOp(opPos, 2, OpCodes.OP_LOCATIONPATH); while (tokenIs('[')) { Predicate(); } filterMatch = FILTER_MATCH_PREDICATES; } else { filterMatch = FILTER_MATCH_PRIMARY; } } else { filterMatch = FILTER_MATCH_FAILED; } return filterMatch; /* * if(tokenIs('[')) * { * Predicate(); * m_ops.m_opMap[opPos + OpMap.MAPINDEX_LENGTH] = m_ops.m_opMap[OpMap.MAPINDEX_LENGTH] - opPos; * } */ }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean PrimaryExpr() throws javax.xml.transform.TransformerException { boolean matchFound; int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if ((m_tokenChar == '\'') || (m_tokenChar == '"')) { appendOp(2, OpCodes.OP_LITERAL); Literal(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (m_tokenChar == '$') { nextToken(); // consume '$' appendOp(2, OpCodes.OP_VARIABLE); QName(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (m_tokenChar == '(') { nextToken(); appendOp(2, OpCodes.OP_GROUP); Expr(); consumeExpected(')'); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if ((null != m_token) && ((('.' == m_tokenChar) && (m_token.length() > 1) && Character.isDigit( m_token.charAt(1))) || Character.isDigit(m_tokenChar))) { appendOp(2, OpCodes.OP_NUMBERLIT); Number(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); matchFound = true; } else if (lookahead('(', 1) || (lookahead(':', 1) && lookahead('(', 3))) { matchFound = FunctionCall(); } else { matchFound = false; } return matchFound; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Argument() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_ARGUMENT); Expr(); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean FunctionCall() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); if (lookahead(':', 1)) { appendOp(4, OpCodes.OP_EXTFUNCTION); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_queueMark - 1); nextToken(); consumeExpected(':'); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 2, m_queueMark - 1); nextToken(); } else { int funcTok = getFunctionToken(m_token); if (-1 == funcTok) { error(XPATHErrorResources.ER_COULDNOT_FIND_FUNCTION, new Object[]{ m_token }); //"Could not find function: "+m_token+"()"); } switch (funcTok) { case OpCodes.NODETYPE_PI : case OpCodes.NODETYPE_COMMENT : case OpCodes.NODETYPE_TEXT : case OpCodes.NODETYPE_NODE : // Node type tests look like function calls, but they're not return false; default : appendOp(3, OpCodes.OP_FUNCTION); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, funcTok); } nextToken(); } consumeExpected('('); while (!tokenIs(')') && m_token != null) { if (tokenIs(',')) { error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_PRECEDING_ARG, null); //"Found ',' but no preceding argument!"); } Argument(); if (!tokenIs(')')) { consumeExpected(','); if (tokenIs(')')) { error(XPATHErrorResources.ER_FOUND_COMMA_BUT_NO_FOLLOWING_ARG, null); //"Found ',' but no following argument!"); } } } consumeExpected(')'); // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void LocationPath() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); // int locationPathOpPos = opPos; appendOp(2, OpCodes.OP_LOCATIONPATH); boolean seenSlash = tokenIs('/'); if (seenSlash) { appendOp(4, OpCodes.FROM_ROOT); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT); nextToken(); } else if (m_token == null) { error(XPATHErrorResources.ER_EXPECTED_LOC_PATH_AT_END_EXPR, null); } if (m_token != null) { if (!RelativeLocationPath() && !seenSlash) { // Neither a '/' nor a RelativeLocationPath - i.e., matched nothing // "Location path expected, but found "+m_token+" was encountered." error(XPATHErrorResources.ER_EXPECTED_LOC_PATH, new Object [] {m_token}); } } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean RelativeLocationPath() throws javax.xml.transform.TransformerException { if (!Step()) { return false; } while (tokenIs('/')) { nextToken(); if (!Step()) { // RelativeLocationPath can't end with a trailing '/' // "Location step expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null); } } return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean Step() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); boolean doubleSlash = tokenIs('/'); // At most a single '/' before each Step is consumed by caller; if the // first thing is a '/', that means we had '//' and the Step must not // be empty. if (doubleSlash) { nextToken(); appendOp(2, OpCodes.FROM_DESCENDANTS_OR_SELF); // Have to fix up for patterns such as '//@foo' or '//attribute::foo', // which translate to 'descendant-or-self::node()/attribute::foo'. // notice I leave the '/' on the queue, so the next will be processed // by a regular step pattern. // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODETYPE_NODE); m_ops.setOp(OpMap.MAPINDEX_LENGTH,m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); // Tell how long the step is with the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); } if (tokenIs(".")) { nextToken(); if (tokenIs('[')) { error(XPATHErrorResources.ER_PREDICATE_ILLEGAL_SYNTAX, null); //"'..[predicate]' or '.[predicate]' is illegal syntax. Use 'self::node()[predicate]' instead."); } appendOp(4, OpCodes.FROM_SELF); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE); } else if (tokenIs("..")) { nextToken(); appendOp(4, OpCodes.FROM_PARENT); // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2,4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_NODE); } // There is probably a better way to test for this // transition... but it gets real hairy if you try // to do it in basis(). else if (tokenIs('*') || tokenIs('@') || tokenIs('_') || (m_token!= null && Character.isLetter(m_token.charAt(0)))) { Basis(); while (tokenIs('[')) { Predicate(); } // Tell how long the entire step is. m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); } else { // No Step matched - that's an error if previous thing was a '//' if (doubleSlash) { // "Location step expected following '/' or '//'" error(XPATHErrorResources.ER_EXPECTED_LOC_STEP, null); } return false; } return true; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Basis() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int axesType; // The next blocks guarantee that a FROM_XXX will be added. if (lookahead("::", 1)) { axesType = AxisName(); nextToken(); nextToken(); } else if (tokenIs('@')) { axesType = OpCodes.FROM_ATTRIBUTES; appendOp(2, axesType); nextToken(); } else { axesType = OpCodes.FROM_CHILDREN; appendOp(2, axesType); } // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); NodeTest(axesType); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected int AxisName() throws javax.xml.transform.TransformerException { Object val = Keywords.getAxisName(m_token); if (null == val) { error(XPATHErrorResources.ER_ILLEGAL_AXIS_NAME, new Object[]{ m_token }); //"illegal axis name: "+m_token); } int axesType = ((Integer) val).intValue(); appendOp(2, axesType); return axesType; }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void NodeTest(int axesType) throws javax.xml.transform.TransformerException { if (lookahead('(', 1)) { Object nodeTestOp = Keywords.getNodeType(m_token); if (null == nodeTestOp) { error(XPATHErrorResources.ER_UNKNOWN_NODETYPE, new Object[]{ m_token }); //"Unknown nodetype: "+m_token); } else { nextToken(); int nt = ((Integer) nodeTestOp).intValue(); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), nt); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); consumeExpected('('); if (OpCodes.NODETYPE_PI == nt) { if (!tokenIs(')')) { Literal(); } } consumeExpected(')'); } } else { // Assume name of attribute or element. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.NODENAME); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); if (lookahead(':', 1)) { if (tokenIs('*')) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); // Minimalist check for an NCName - just check first character // to distinguish from other possible tokens if (!Character.isLetter(m_tokenChar) && !tokenIs('_')) { // "Node test that matches either NCName:* or QName was expected." error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null); } } nextToken(); consumeExpected(':'); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY); } m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); if (tokenIs('*')) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ELEMWILDCARD); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); // Minimalist check for an NCName - just check first character // to distinguish from other possible tokens if (!Character.isLetter(m_tokenChar) && !tokenIs('_')) { // "Node test that matches either NCName:* or QName was expected." error(XPATHErrorResources.ER_EXPECTED_NODE_TEST, null); } } m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Predicate() throws javax.xml.transform.TransformerException { if (tokenIs('[')) { nextToken(); PredicateExpr(); consumeExpected(']'); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void PredicateExpr() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); appendOp(2, OpCodes.OP_PREDICATE); Expr(); // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void QName() throws javax.xml.transform.TransformerException { // Namespace if(lookahead(':', 1)) { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); consumeExpected(':'); } else { m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.EMPTY); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); } // Local name m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Literal() throws javax.xml.transform.TransformerException { int last = m_token.length() - 1; char c0 = m_tokenChar; char cX = m_token.charAt(last); if (((c0 == '\"') && (cX == '\"')) || ((c0 == '\'') && (cX == '\''))) { // Mutate the token to remove the quotes and have the XString object // already made. int tokenQueuePos = m_queueMark - 1; m_ops.m_tokenQueue.setElementAt(null,tokenQueuePos); Object obj = new XString(m_token.substring(1, last)); m_ops.m_tokenQueue.setElementAt(obj,tokenQueuePos); // lit = m_token.substring(1, last); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), tokenQueuePos); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } else { error(XPATHErrorResources.ER_PATTERN_LITERAL_NEEDS_BE_QUOTED, new Object[]{ m_token }); //"Pattern literal ("+m_token+") needs to be quoted!"); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Number() throws javax.xml.transform.TransformerException { if (null != m_token) { // Mutate the token to remove the quotes and have the XNumber object // already made. double num; try { // XPath 1.0 does not support number in exp notation if ((m_token.indexOf('e') > -1)||(m_token.indexOf('E') > -1)) throw new NumberFormatException(); num = Double.valueOf(m_token).doubleValue(); } catch (NumberFormatException nfe) { num = 0.0; // to shut up compiler. error(XPATHErrorResources.ER_COULDNOT_BE_FORMATTED_TO_NUMBER, new Object[]{ m_token }); //m_token+" could not be formatted to a number!"); } m_ops.m_tokenQueue.setElementAt(new XNumber(num),m_queueMark - 1); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), m_queueMark - 1); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); nextToken(); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void Pattern() throws javax.xml.transform.TransformerException { while (true) { LocationPathPattern(); if (tokenIs('|')) { nextToken(); } else { break; } } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void LocationPathPattern() throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); final int RELATIVE_PATH_NOT_PERMITTED = 0; final int RELATIVE_PATH_PERMITTED = 1; final int RELATIVE_PATH_REQUIRED = 2; int relativePathStatus = RELATIVE_PATH_NOT_PERMITTED; appendOp(2, OpCodes.OP_LOCATIONPATHPATTERN); if (lookahead('(', 1) && (tokenIs(Keywords.FUNC_ID_STRING) || tokenIs(Keywords.FUNC_KEY_STRING))) { IdKeyPattern(); if (tokenIs('/')) { nextToken(); if (tokenIs('/')) { appendOp(4, OpCodes.MATCH_ANY_ANCESTOR); nextToken(); } else { appendOp(4, OpCodes.MATCH_IMMEDIATE_ANCESTOR); } // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_FUNCTEST); relativePathStatus = RELATIVE_PATH_REQUIRED; } } else if (tokenIs('/')) { if (lookahead('/', 1)) { appendOp(4, OpCodes.MATCH_ANY_ANCESTOR); // Added this to fix bug reported by Myriam for match="//x/a" // patterns. If you don't do this, the 'x' step will think it's part // of a '//' pattern, and so will cause 'a' to be matched when it has // any ancestor that is 'x'. nextToken(); relativePathStatus = RELATIVE_PATH_REQUIRED; } else { appendOp(4, OpCodes.FROM_ROOT); relativePathStatus = RELATIVE_PATH_PERMITTED; } // Tell how long the step is without the predicate m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 2, 4); m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH) - 1, OpCodes.NODETYPE_ROOT); nextToken(); } else { relativePathStatus = RELATIVE_PATH_REQUIRED; } if (relativePathStatus != RELATIVE_PATH_NOT_PERMITTED) { if (!tokenIs('|') && (null != m_token)) { RelativePathPattern(); } else if (relativePathStatus == RELATIVE_PATH_REQUIRED) { // "A relative path pattern was expected." error(XPATHErrorResources.ER_EXPECTED_REL_PATH_PATTERN, null); } } // Terminate for safety. m_ops.setOp(m_ops.getOp(OpMap.MAPINDEX_LENGTH), OpCodes.ENDOP); m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void IdKeyPattern() throws javax.xml.transform.TransformerException { FunctionCall(); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected void RelativePathPattern() throws javax.xml.transform.TransformerException { // Caller will have consumed any '/' or '//' preceding the // RelativePathPattern, so let StepPattern know it can't begin with a '/' boolean trailingSlashConsumed = StepPattern(false); while (tokenIs('/')) { nextToken(); // StepPattern() may consume first slash of pair in "a//b" while // processing StepPattern "a". On next iteration, let StepPattern know // that happened, so it doesn't match ill-formed patterns like "a///b". trailingSlashConsumed = StepPattern(!trailingSlashConsumed); } }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean StepPattern(boolean isLeadingSlashPermitted) throws javax.xml.transform.TransformerException { return AbbreviatedNodeTestStep(isLeadingSlashPermitted); }
// in src/org/apache/xpath/compiler/XPathParser.java
protected boolean AbbreviatedNodeTestStep(boolean isLeadingSlashPermitted) throws javax.xml.transform.TransformerException { int opPos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); int axesType; // The next blocks guarantee that a MATCH_XXX will be added. int matchTypePos = -1; if (tokenIs('@')) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); nextToken(); } else if (this.lookahead("::", 1)) { if (tokenIs("attribute")) { axesType = OpCodes.MATCH_ATTRIBUTE; appendOp(2, axesType); } else if (tokenIs("child")) { matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } else { axesType = -1; this.error(XPATHErrorResources.ER_AXES_NOT_ALLOWED, new Object[]{ this.m_token }); } nextToken(); nextToken(); } else if (tokenIs('/')) { if (!isLeadingSlashPermitted) { // "A step was expected in the pattern, but '/' was encountered." error(XPATHErrorResources.ER_EXPECTED_STEP_PATTERN, null); } axesType = OpCodes.MATCH_ANY_ANCESTOR; appendOp(2, axesType); nextToken(); } else { matchTypePos = m_ops.getOp(OpMap.MAPINDEX_LENGTH); axesType = OpCodes.MATCH_IMMEDIATE_ANCESTOR; appendOp(2, axesType); } // Make room for telling how long the step is without the predicate m_ops.setOp(OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) + 1); NodeTest(axesType); // Tell how long the step is without the predicate m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH + 1, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); while (tokenIs('[')) { Predicate(); } boolean trailingSlashConsumed; // For "a//b", where "a" is current step, we need to mark operation of // current step as "MATCH_ANY_ANCESTOR". Then we'll consume the first // slash and subsequent step will be treated as a MATCH_IMMEDIATE_ANCESTOR // (unless it too is followed by '//'.) // // %REVIEW% Following is what happens today, but I'm not sure that's // %REVIEW% correct behaviour. Perhaps no valid case could be constructed // %REVIEW% where it would matter? // // If current step is on the attribute axis (e.g., "@x//b"), we won't // change the current step, and let following step be marked as // MATCH_ANY_ANCESTOR on next call instead. if ((matchTypePos > -1) && tokenIs('/') && lookahead('/', 1)) { m_ops.setOp(matchTypePos, OpCodes.MATCH_ANY_ANCESTOR); nextToken(); trailingSlashConsumed = true; } else { trailingSlashConsumed = false; } // Tell how long the entire step is. m_ops.setOp(opPos + OpMap.MAPINDEX_LENGTH, m_ops.getOp(OpMap.MAPINDEX_LENGTH) - opPos); return trailingSlashConsumed; }
// in src/org/apache/xpath/compiler/OpMap.java
public int getFirstPredicateOpPos(int opPos) throws javax.xml.transform.TransformerException { int stepType = m_opMap.elementAt(opPos); if ((stepType >= OpCodes.AXES_START_TYPES) && (stepType <= OpCodes.AXES_END_TYPES)) { return opPos + m_opMap.elementAt(opPos + 2); } else if ((stepType >= OpCodes.FIRST_NODESET_OP) && (stepType <= OpCodes.LAST_NODESET_OP)) { return opPos + m_opMap.elementAt(opPos + 1); } else if(-2 == stepType) { return -2; } else { error(org.apache.xpath.res.XPATHErrorResources.ER_UNKNOWN_OPCODE, new Object[]{ String.valueOf(stepType) }); //"ERROR! Unknown op code: "+m_opMap[opPos]); return -1; } }
// in src/org/apache/xpath/compiler/OpMap.java
public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = org.apache.xalan.res.XSLMessages.createXPATHMessage(msg, args); throw new javax.xml.transform.TransformerException(fmsg); }
// in src/org/apache/xpath/compiler/Lexer.java
void tokenize(String pat) throws javax.xml.transform.TransformerException { tokenize(pat, null); }
// in src/org/apache/xpath/compiler/Lexer.java
void tokenize(String pat, Vector targetStrings) throws javax.xml.transform.TransformerException { m_compiler.m_currentPattern = pat; m_patternMapSize = 0; // This needs to grow too. Use a conservative estimate that the OpMapVector // needs about five time the length of the input path expression - to a // maximum of MAXTOKENQUEUESIZE*5. If the OpMapVector needs to grow, grow // it freely (second argument to constructor). int initTokQueueSize = ((pat.length() < OpMap.MAXTOKENQUEUESIZE) ? pat.length() : OpMap.MAXTOKENQUEUESIZE) * 5; m_compiler.m_opMap = new OpMapVector(initTokQueueSize, OpMap.BLOCKTOKENQUEUESIZE * 5, OpMap.MAPINDEX_LENGTH); int nChars = pat.length(); int startSubstring = -1; int posOfNSSep = -1; boolean isStartOfPat = true; boolean isAttrName = false; boolean isNum = false; // Nesting of '[' so we can know if the given element should be // counted inside the m_patternMap. int nesting = 0; // char[] chars = pat.toCharArray(); for (int i = 0; i < nChars; i++) { char c = pat.charAt(i); switch (c) { case '\"' : { if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\"'); i++); if (c == '\"' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_DOUBLE_QUOTE, null); //"misquoted literal... expected double quote!"); } } break; case '\'' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } } startSubstring = i; for (i++; (i < nChars) && ((c = pat.charAt(i)) != '\''); i++); if (c == '\'' && i < nChars) { addToTokenQueue(pat.substring(startSubstring, i + 1)); startSubstring = -1; } else { m_processor.error(XPATHErrorResources.ER_EXPECTED_SINGLE_QUOTE, null); //"misquoted literal... expected single quote!"); } break; case 0x0A : case 0x0D : case ' ' : case '\t' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } break; case '@' : isAttrName = true; // fall-through on purpose case '-' : if ('-' == c) { if (!(isNum || (startSubstring == -1))) { break; } isNum = false; } // fall-through on purpose case '(' : case '[' : case ')' : case ']' : case '|' : case '/' : case '*' : case '+' : case '=' : case ',' : case '\\' : // Unused at the moment case '^' : // Unused at the moment case '!' : // Unused at the moment case '$' : case '<' : case '>' : if (startSubstring != -1) { isNum = false; isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; if (-1 != posOfNSSep) { posOfNSSep = mapNSTokens(pat, startSubstring, posOfNSSep, i); } else { addToTokenQueue(pat.substring(startSubstring, i)); } startSubstring = -1; } else if (('/' == c) && isStartOfPat) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); } else if ('*' == c) { isStartOfPat = mapPatternElemPos(nesting, isStartOfPat, isAttrName); isAttrName = false; } if (0 == nesting) { if ('|' == c) { if (null != targetStrings) { recordTokenString(targetStrings); } isStartOfPat = true; } } if ((')' == c) || (']' == c)) { nesting--; } else if (('(' == c) || ('[' == c)) { nesting++; } addToTokenQueue(pat.substring(i, i + 1)); break; case ':' : if (i>0) { if (posOfNSSep == (i - 1)) { if (startSubstring != -1) { if (startSubstring < (i - 1)) addToTokenQueue(pat.substring(startSubstring, i - 1)); } isNum = false; isAttrName = false; startSubstring = -1; posOfNSSep = -1; addToTokenQueue(pat.substring(i - 1, i + 1)); break; } else { posOfNSSep = i; } } // fall through on purpose default : if (-1 == startSubstring) { startSubstring = i; isNum = Character.isDigit(c); } else if (isNum) { isNum = Character.isDigit(c); } }
// in src/org/apache/xpath/compiler/Lexer.java
private int mapNSTokens(String pat, int startSubstring, int posOfNSSep, int posOfScan) throws javax.xml.transform.TransformerException { String prefix = ""; if ((startSubstring >= 0) && (posOfNSSep >= 0)) { prefix = pat.substring(startSubstring, posOfNSSep); } String uName; if ((null != m_namespaceContext) &&!prefix.equals("*") &&!prefix.equals("xmlns")) { try { if (prefix.length() > 0) uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); else { // Assume last was wildcard. This is not legal according // to the draft. Set the below to true to make namespace // wildcards work. if (false) { addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); return -1; } else { uName = ((PrefixResolver) m_namespaceContext).getNamespaceForPrefix( prefix); } } } catch (ClassCastException cce) { uName = m_namespaceContext.getNamespaceForPrefix(prefix); } } else { uName = prefix; } if ((null != uName) && (uName.length() > 0)) { addToTokenQueue(uName); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); } else { // To older XPath code it doesn't matter if // error() is called or errorForDOM3(). m_processor.errorForDOM3(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; /** old code commented out 17-Sep-2004 // error("Could not locate namespace for prefix: "+prefix); // m_processor.error(XPATHErrorResources.ER_PREFIX_MUST_RESOLVE, // new String[] {prefix}); //"Prefix must resolve to a namespace: {0}"; */ /*** Old code commented out 10-Jan-2001 addToTokenQueue(prefix); addToTokenQueue(":"); String s = pat.substring(posOfNSSep + 1, posOfScan); if (s.length() > 0) addToTokenQueue(s); ***/ } return -1; }
// in src/org/apache/xpath/objects/XObject.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return this; }
// in src/org/apache/xpath/objects/XObject.java
public double num() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number"); return 0.0; }
// in src/org/apache/xpath/objects/XObject.java
public double numWithSideEffects() throws javax.xml.transform.TransformerException { return num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean bool() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a number"); return false; }
// in src/org/apache/xpath/objects/XObject.java
public boolean boolWithSideEffects() throws javax.xml.transform.TransformerException { return bool(); }
// in src/org/apache/xpath/objects/XObject.java
public DTMIterator iter() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeList!"); return null; }
// in src/org/apache/xpath/objects/XObject.java
public NodeSetDTM mutableNodeset() throws javax.xml.transform.TransformerException { error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST, new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeSetDTM!"); return (NodeSetDTM) m_obj; }
// in src/org/apache/xpath/objects/XObject.java
public Object castToType(int t, XPathContext support) throws javax.xml.transform.TransformerException { Object result; switch (t) { case CLASS_STRING : result = str(); break; case CLASS_NUMBER : result = new Double(num()); break; case CLASS_NODESET : result = iter(); break; case CLASS_BOOLEAN : result = bool() ? Boolean.TRUE : Boolean.FALSE; break; case CLASS_UNKNOWN : result = m_obj; break; // %TBD% What to do here? // case CLASS_RTREEFRAG : // result = rtree(support); // break; default : error(XPATHErrorResources.ER_CANT_CONVERT_TO_TYPE, new Object[]{ getTypeString(), Integer.toString(t) }); //"Can not convert "+getTypeString()+" to a type#"+t); result = null; } return result; }
// in src/org/apache/xpath/objects/XObject.java
public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.greaterThan(this); return this.num() < obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.greaterThanOrEqual(this); return this.num() <= obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.lessThan(this); return this.num() > obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean greaterThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. Because the arguments // are backwards, we call the opposite comparison // function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.lessThanOrEqual(this); return this.num() >= obj2.num(); }
// in src/org/apache/xpath/objects/XObject.java
public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.notEquals(this); return !equals(obj2); }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg) throws javax.xml.transform.TransformerException { error(msg, null); }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR, // m_support.ERROR, // null, // null, fmsg, 0, 0); // if(shouldThrow) { throw new XPathException(fmsg, this); } }
// in src/org/apache/xpath/objects/XNumber.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_val; }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject m_selected; m_selected = ((Expression)m_obj).execute(xctxt); m_selected.allowDetachToRelease(m_allowRelease); if (m_selected.getType() == CLASS_STRING) return m_selected; else return new XString(m_selected.str()); }
// in src/org/apache/xpath/objects/XRTreeFragSelectWrapper.java
public double num() throws javax.xml.transform.TransformerException { throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NUM_NOT_SUPPORTED_XRTREEFRAGSELECTWRAPPER, null)); //"num() not supported by XRTreeFragSelectWrapper!"); }
// in src/org/apache/xpath/objects/XNodeSetForDOM.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { return (m_origObj instanceof NodeIterator) ? (NodeIterator)m_origObj : super.nodeset(); }
// in src/org/apache/xpath/objects/XNodeSetForDOM.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { return (m_origObj instanceof NodeList) ? (NodeList)m_origObj : super.nodelist(); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
public double num() throws javax.xml.transform.TransformerException { XMLString s = xstr(); return s.toDouble(); }
// in src/org/apache/xpath/objects/XNodeSet.java
public NodeIterator nodeset() throws javax.xml.transform.TransformerException { return new org.apache.xml.dtm.ref.DTMNodeIterator(iter()); }
// in src/org/apache/xpath/objects/XNodeSet.java
public NodeList nodelist() throws javax.xml.transform.TransformerException { org.apache.xml.dtm.ref.DTMNodeList nodelist = new org.apache.xml.dtm.ref.DTMNodeList(this); // Creating a DTMNodeList has the side-effect that it will create a clone // XNodeSet with cache and run m_iter to the end. You cannot get any node // from m_iter after this call. As a fix, we call SetVector() on the clone's // cache. See Bugzilla 14406. XNodeSet clone = (XNodeSet)nodelist.getDTMIterator(); SetVector(clone.getVector()); return nodelist; }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean compare(XObject obj2, Comparator comparator) throws javax.xml.transform.TransformerException { boolean result = false; int type = obj2.getType(); if (XObject.CLASS_NODESET == type) { // %OPT% This should be XMLString based instead of string based... // From http://www.w3.org/TR/xpath: // If both objects to be compared are node-sets, then the comparison // will be true if and only if there is a node in the first node-set // and a node in the second node-set such that the result of performing // the comparison on the string-values of the two nodes is true. // Note this little gem from the draft: // NOTE: If $x is bound to a node-set, then $x="foo" // does not mean the same as not($x!="foo"): the former // is true if and only if some node in $x has the string-value // foo; the latter is true if and only if all nodes in $x have // the string-value foo. DTMIterator list1 = iterRaw(); DTMIterator list2 = ((XNodeSet) obj2).iterRaw(); int node1; java.util.Vector node2Strings = null; while (DTM.NULL != (node1 = list1.nextNode())) { XMLString s1 = getStringFromNode(node1); if (null == node2Strings) { int node2; while (DTM.NULL != (node2 = list2.nextNode())) { XMLString s2 = getStringFromNode(node2); if (comparator.compareStrings(s1, s2)) { result = true; break; } if (null == node2Strings) node2Strings = new java.util.Vector(); node2Strings.addElement(s2); } } else { int n = node2Strings.size(); for (int i = 0; i < n; i++) { if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i))) { result = true; break; } } } } list1.reset(); list2.reset(); } else if (XObject.CLASS_BOOLEAN == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a boolean, // then the comparison will be true if and only if the result of // performing the comparison on the boolean and on the result of // converting the node-set to a boolean using the boolean function // is true. double num1 = bool() ? 1.0 : 0.0; double num2 = obj2.num(); result = comparator.compareNumbers(num1, num2); } else if (XObject.CLASS_NUMBER == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a number, // then the comparison will be true if and only if there is a // node in the node-set such that the result of performing the // comparison on the number to be compared and on the result of // converting the string-value of that node to a number using // the number function is true. DTMIterator list1 = iterRaw(); double num2 = obj2.num(); int node; while (DTM.NULL != (node = list1.nextNode())) { double num1 = getNumberFromNode(node); if (comparator.compareNumbers(num1, num2)) { result = true; break; } } list1.reset(); } else if (XObject.CLASS_RTREEFRAG == type) { XMLString s2 = obj2.xstr(); DTMIterator list1 = iterRaw(); int node; while (DTM.NULL != (node = list1.nextNode())) { XMLString s1 = getStringFromNode(node); if (comparator.compareStrings(s1, s2)) { result = true; break; } } list1.reset(); } else if (XObject.CLASS_STRING == type) { // From http://www.w3.org/TR/xpath: // If one object to be compared is a node-set and the other is a // string, then the comparison will be true if and only if there // is a node in the node-set such that the result of performing // the comparison on the string-value of the node and the other // string is true. XMLString s2 = obj2.xstr(); DTMIterator list1 = iterRaw(); int node; while (DTM.NULL != (node = list1.nextNode())) { XMLString s1 = getStringFromNode(node); if (comparator.compareStrings(s1, s2)) { result = true; break; } } list1.reset(); } else { result = comparator.compareNumbers(this.num(), obj2.num()); } return result; }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean lessThan(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_LT); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean lessThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_LTE); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean greaterThan(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_GT); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean greaterThanOrEqual(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_GTE); }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean notEquals(XObject obj2) throws javax.xml.transform.TransformerException { return compare(obj2, S_NEQ); }
// in src/org/apache/xpath/XPathContext.java
private void assertion(boolean b, String msg) throws javax.xml.transform.TransformerException { if (!b) { ErrorListener errorHandler = getErrorListener(); if (errorHandler != null) { errorHandler.fatalError( new TransformerException( XSLMessages.createMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ msg }), (SAXSourceLocator)this.getSAXLocator())); } } }
// in src/org/apache/xpath/XPathContext.java
public final XObject getVariableOrParam(org.apache.xml.utils.QName qname) throws javax.xml.transform.TransformerException { return m_variableStacks.getVariableOrParam(XPathContext.this, qname); }
// in src/org/apache/xpath/functions/FuncUnparsedEntityURI.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String name = m_arg0.execute(xctxt).str(); int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int doc = dtm.getDocument(); String uri = dtm.getUnparsedEntityURI(name); return new XString(uri); }
// in src/org/apache/xpath/functions/FuncExtFunctionAvailable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String prefix; String namespace; String methName; String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); if (indexOfNSSep < 0) { prefix = ""; namespace = Constants.S_XSLNAMESPACEURL; methName = fullName; } else { prefix = fullName.substring(0, indexOfNSSep); namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); if (null == namespace) return XBoolean.S_FALSE; methName = fullName.substring(indexOfNSSep + 1); } if (namespace.equals(Constants.S_XSLNAMESPACEURL)) { try { if (null == m_functionTable) m_functionTable = new FunctionTable(); return m_functionTable.functionAvailable(methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } catch (Exception e) { return XBoolean.S_FALSE; } } else { //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); return extProvider.functionAvailable(namespace, methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
// in src/org/apache/xpath/functions/FuncNumber.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(getArg0AsNumber(xctxt)); }
// in src/org/apache/xpath/functions/FuncTranslate.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String theFirstString = m_arg0.execute(xctxt).str(); String theSecondString = m_arg1.execute(xctxt).str(); String theThirdString = m_arg2.execute(xctxt).str(); int theFirstStringLength = theFirstString.length(); int theThirdStringLength = theThirdString.length(); // A vector to contain the new characters. We'll use it to construct // the result string. StringBuffer sbuffer = new StringBuffer(); for (int i = 0; i < theFirstStringLength; i++) { char theCurrentChar = theFirstString.charAt(i); int theIndex = theSecondString.indexOf(theCurrentChar); if (theIndex < 0) { // Didn't find the character in the second string, so it // is not translated. sbuffer.append(theCurrentChar); } else if (theIndex < theThirdStringLength) { // OK, there's a corresponding character in the // third string, so do the translation... sbuffer.append(theThirdString.charAt(theIndex)); } else { // There's no corresponding character in the // third string, since it's shorter than the // second string. In this case, the character // is removed from the output string, so don't // do anything. } } return new XString(sbuffer.toString()); }
// in src/org/apache/xpath/functions/FuncSubstringBefore.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : new XString(s1.substring(0, index)); }
// in src/org/apache/xpath/functions/FuncString.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (XString)getArg0AsString(xctxt); }
// in src/org/apache/xpath/functions/FuncTrue.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return XBoolean.S_TRUE; }
// in src/org/apache/xpath/functions/FuncExtElementAvailable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String prefix; String namespace; String methName; String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); if (indexOfNSSep < 0) { prefix = ""; namespace = Constants.S_XSLNAMESPACEURL; methName = fullName; } else { prefix = fullName.substring(0, indexOfNSSep); namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); if (null == namespace) return XBoolean.S_FALSE; methName= fullName.substring(indexOfNSSep + 1); } if (namespace.equals(Constants.S_XSLNAMESPACEURL) || namespace.equals(Constants.S_BUILTIN_EXTENSIONS_URL)) { try { TransformerImpl transformer = (TransformerImpl) xctxt.getOwnerObject(); return transformer.getStylesheet().getAvailableElements().containsKey( new QName(namespace, methName)) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } catch (Exception e) { return XBoolean.S_FALSE; } } else { //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); return extProvider.elementAvailable(namespace, methName) ? XBoolean.S_TRUE : XBoolean.S_FALSE; } }
// in src/org/apache/xpath/functions/Function.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // Programmer's assert. (And, no, I don't want the method to be abstract). System.out.println("Error! Function.execute should not be called!"); return null; }
// in src/org/apache/xpath/functions/FuncStringLength.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(getArg0AsString(xctxt).length()); }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = getArg0AsString(xctxt); return (XString)s1.fixWhiteSpace(true, true, false); }
// in src/org/apache/xpath/functions/FuncNormalizeSpace.java
public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { if(Arg0IsNodesetExpr()) { int node = getArg0AsNode(xctxt); if(DTM.NULL != node) { DTM dtm = xctxt.getDTM(node); dtm.dispatchCharactersEvents(node, handler, true); } } else { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); } }
// in src/org/apache/xpath/functions/FuncSubstring.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); double start = m_arg1.execute(xctxt).num(); int lenOfS1 = s1.length(); XMLString substr; if (lenOfS1 <= 0) return XString.EMPTYSTRING; else { int startIndex; if (Double.isNaN(start)) { // Double.MIN_VALUE doesn't work with math below // so just use a big number and hope I never get caught. start = -1000000; startIndex = 0; } else { start = Math.round(start); startIndex = (start > 0) ? (int) start - 1 : 0; } if (null != m_arg2) { double len = m_arg2.num(xctxt); int end = (int) (Math.round(len) + start) - 1; // Normalize end index. if (end < 0) end = 0; else if (end > lenOfS1) end = lenOfS1; if (startIndex > lenOfS1) startIndex = lenOfS1; substr = s1.substring(startIndex, end); } else { if (startIndex > lenOfS1) startIndex = lenOfS1; substr = s1.substring(startIndex); } } return (XString)substr; // cast semi-safe }
// in src/org/apache/xpath/functions/FuncBoolean.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncRound.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { final XObject obj = m_arg0.execute(xctxt); final double val= obj.num(); if (val >= -0.5 && val < 0) return new XNumber(-0.0); if (val == 0.0) return new XNumber(val); return new XNumber(java.lang.Math.floor(val + 0.5)); }
// in src/org/apache/xpath/functions/FuncLang.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String lang = m_arg0.execute(xctxt).str(); int parent = xctxt.getCurrentNode(); boolean isLang = false; DTM dtm = xctxt.getDTM(parent); while (DTM.NULL != parent) { if (DTM.ELEMENT_NODE == dtm.getNodeType(parent)) { int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang"); if (DTM.NULL != langAttr) { String langVal = dtm.getNodeValue(langAttr); // %OPT% if (langVal.toLowerCase().startsWith(lang.toLowerCase())) { int valLen = lang.length(); if ((langVal.length() == valLen) || (langVal.charAt(valLen) == '-')) { isLang = true; } } break; } } parent = dtm.getParent(parent); } return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncCount.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { // DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); // // We should probably make a function on the iterator for this, // // as a given implementation could optimize. // int i = 0; // // while (DTM.NULL != nl.nextNode()) // { // i++; // } // nl.detach(); DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); int i = nl.getLength(); nl.detach(); return new XNumber((double) i); }
// in src/org/apache/xpath/functions/FuncFalse.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String fullName = m_arg0.execute(xctxt).str(); int indexOfNSSep = fullName.indexOf(':'); String result; String propName = ""; // List of properties where the name of the // property argument is to be looked for. Properties xsltInfo = new Properties(); loadPropertyFile(XSLT_PROPERTIES, xsltInfo); if (indexOfNSSep > 0) { String prefix = (indexOfNSSep >= 0) ? fullName.substring(0, indexOfNSSep) : ""; String namespace; namespace = xctxt.getNamespaceContext().getNamespaceForPrefix(prefix); propName = (indexOfNSSep < 0) ? fullName : fullName.substring(indexOfNSSep + 1); if (namespace.startsWith("http://www.w3.org/XSL/Transform") || namespace.equals("http://www.w3.org/1999/XSL/Transform")) { result = xsltInfo.getProperty(propName); if (null == result) { warn(xctxt, XPATHErrorResources.WG_PROPERTY_NOT_SUPPORTED, new Object[]{ fullName }); //"XSL Property not supported: "+fullName); return XString.EMPTYSTRING; } } else { warn(xctxt, XPATHErrorResources.WG_DONT_DO_ANYTHING_WITH_NS, new Object[]{ namespace, fullName }); //"Don't currently do anything with namespace "+namespace+" in property: "+fullName); try { result = System.getProperty(propName); if (null == result) { // result = System.getenv(propName); return XString.EMPTYSTRING; } } catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; } } } else { try { result = System.getProperty(fullName); if (null == result) { // result = System.getenv(fullName); return XString.EMPTYSTRING; } } catch (SecurityException se) { warn(xctxt, XPATHErrorResources.WG_SECURITY_EXCEPTION, new Object[]{ fullName }); //"SecurityException when trying to access XSL system property: "+fullName); return XString.EMPTYSTRING; } } if (propName.equals("version") && result.length() > 0) { try { // Needs to return the version number of the spec we conform to. return new XString("1.0"); } catch (Exception ex) { return new XString(result); } } else return new XString(result); }
// in src/org/apache/xpath/functions/FuncDoclocation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int whereNode = getArg0AsNode(xctxt); String fileLocation = null; if (DTM.NULL != whereNode) { DTM dtm = xctxt.getDTM(whereNode); // %REVIEW% if (DTM.DOCUMENT_FRAGMENT_NODE == dtm.getNodeType(whereNode)) { whereNode = dtm.getFirstChild(whereNode); } if (DTM.NULL != whereNode) { fileLocation = dtm.getDocumentBaseURI(); // int owner = dtm.getDocument(); // fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner); } } return new XString((null != fileLocation) ? fileLocation : ""); }
// in src/org/apache/xpath/functions/FuncCurrent.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
// in src/org/apache/xpath/functions/FuncStartsWith.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).xstr().startsWith(m_arg1.execute(xctxt).xstr()) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncSum.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); double sum = 0.0; int pos; while (DTM.NULL != (pos = nodes.nextNode())) { DTM dtm = nodes.getDTM(pos); XMLString s = dtm.getStringValue(pos); if (null != s) sum += s.toDouble(); } nodes.detach(); return new XNumber(sum); }
// in src/org/apache/xpath/functions/FuncLocalPart.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); if(DTM.NULL == context) return XString.EMPTYSTRING; DTM dtm = xctxt.getDTM(context); String s = (context != DTM.NULL) ? dtm.getLocalName(context) : ""; if(s.startsWith("#") || s.equals("xmlns")) return XString.EMPTYSTRING; return new XString(s); }
// in src/org/apache/xpath/functions/FuncGenerateId.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int which = getArg0AsNode(xctxt); if (DTM.NULL != which) { // Note that this is a different value than in previous releases // of Xalan. It's sensitive to the exact encoding of the node // handle anyway, so fighting to maintain backward compatability // really didn't make sense; it may change again as we continue // to experiment with balancing document and node numbers within // that value. return new XString("N" + Integer.toHexString(which).toUpperCase()); } else return XString.EMPTYSTRING; }
// in src/org/apache/xpath/functions/FuncId.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int docContext = dtm.getDocument(); if (DTM.NULL == docContext) error(xctxt, XPATHErrorResources.ER_CONTEXT_HAS_NO_OWNERDOC, null); XObject arg = m_arg0.execute(xctxt); int argType = arg.getType(); XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM nodeSet = nodes.mutableNodeset(); if (XObject.CLASS_NODESET == argType) { DTMIterator ni = arg.iter(); StringVector usedrefs = null; int pos = ni.nextNode(); while (DTM.NULL != pos) { DTM ndtm = ni.getDTM(pos); String refval = ndtm.getStringValue(pos).toString(); pos = ni.nextNode(); usedrefs = getNodesByID(xctxt, docContext, refval, usedrefs, nodeSet, DTM.NULL != pos); } // ni.detach(); } else if (XObject.CLASS_NULL == argType) { return nodes; } else { String refval = arg.str(); getNodesByID(xctxt, docContext, refval, null, nodeSet, false); } return nodes; }
// in src/org/apache/xpath/functions/FuncContains.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { String s1 = m_arg0.execute(xctxt).str(); String s2 = m_arg1.execute(xctxt).str(); // Add this check for JDK consistency for empty strings. if (s1.length() == 0 && s2.length() == 0) return XBoolean.S_TRUE; int index = s1.indexOf(s2); return (index > -1) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/functions/FuncQname.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); XObject val; if (DTM.NULL != context) { DTM dtm = xctxt.getDTM(context); String qname = dtm.getNodeNameX(context); val = (null == qname) ? XString.EMPTYSTRING : new XString(qname); } else { val = XString.EMPTYSTRING; } return val; }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected int getArg0AsNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (null == m_arg0) ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected XMLString getArg0AsString(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(null == m_arg0) { int currentNode = xctxt.getCurrentNode(); if(DTM.NULL == currentNode) return XString.EMPTYSTRING; else { DTM dtm = xctxt.getDTM(currentNode); return dtm.getStringValue(currentNode); } } else return m_arg0.execute(xctxt).xstr(); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected double getArg0AsNumber(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(null == m_arg0) { int currentNode = xctxt.getCurrentNode(); if(DTM.NULL == currentNode) return 0; else { DTM dtm = xctxt.getDTM(currentNode); XMLString str = dtm.getStringValue(currentNode); return str.toDouble(); } } else return m_arg0.execute(xctxt).num(); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.isSecureProcessing()) throw new javax.xml.transform.TransformerException( XPATHMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] {toString()})); XObject result; Vector argVec = new Vector(); int nArgs = m_argVec.size(); for (int i = 0; i < nArgs; i++) { Expression arg = (Expression) m_argVec.elementAt(i); XObject xobj = arg.execute(xctxt); /* * Should cache the arguments for func:function */ xobj.allowDetachToRelease(false); argVec.addElement(xobj); } //dml ExtensionsProvider extProvider = (ExtensionsProvider)xctxt.getOwnerObject(); Object val = extProvider.extFunction(this, argVec); if (null != val) { result = XObject.create(val, xctxt); } else { result = new XNull(); } return result; }
// in src/org/apache/xpath/functions/FuncConcat.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { StringBuffer sb = new StringBuffer(); // Compiler says we must have at least two arguments. sb.append(m_arg0.execute(xctxt).str()); sb.append(m_arg1.execute(xctxt).str()); if (null != m_arg2) sb.append(m_arg2.execute(xctxt).str()); if (null != m_args) { for (int i = 0; i < m_args.length; i++) { sb.append(m_args[i].execute(xctxt).str()); } } return new XString(sb.toString()); }
// in src/org/apache/xpath/functions/FuncNot.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE; }
// in src/org/apache/xpath/functions/FuncCeiling.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(Math.ceil(m_arg0.execute(xctxt).num())); }
// in src/org/apache/xpath/functions/FuncNamespace.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = getArg0AsNode(xctxt); String s; if(context != DTM.NULL) { DTM dtm = xctxt.getDTM(context); int t = dtm.getNodeType(context); if(t == DTM.ELEMENT_NODE) { s = dtm.getNamespaceURI(context); } else if(t == DTM.ATTRIBUTE_NODE) { // This function always returns an empty string for namespace nodes. // We check for those here. Fix inspired by Davanum Srinivas. s = dtm.getNodeName(context); if(s.startsWith("xmlns:") || s.equals("xmlns")) return XString.EMPTYSTRING; s = dtm.getNamespaceURI(context); } else return XString.EMPTYSTRING; } else return XString.EMPTYSTRING; return ((null == s) ? XString.EMPTYSTRING : new XString(s)); }
// in src/org/apache/xpath/functions/FuncSubstringAfter.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XMLString s1 = m_arg0.execute(xctxt).xstr(); XMLString s2 = m_arg1.execute(xctxt).xstr(); int index = s1.indexOf(s2); return (-1 == index) ? XString.EMPTYSTRING : (XString)s1.substring(index + s2.length()); }
// in src/org/apache/xpath/functions/FuncFloor.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num())); }
// in src/org/apache/xpath/functions/FuncLast.java
public int getCountOfContextNodeList(XPathContext xctxt) throws javax.xml.transform.TransformerException { // assert(null != m_contextNodeList, "m_contextNodeList must be non-null"); // If we're in a predicate, then this will return non-null. SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList(); // System.out.println("iter: "+iter); if (null != iter) return iter.getLastPos(xctxt); DTMIterator cnl = xctxt.getContextNodeList(); int count; if(null != cnl) { count = cnl.getLength(); // System.out.println("count: "+count); } else count = 0; return count; }
// in src/org/apache/xpath/functions/FuncLast.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNumber xnum = new XNumber((double) getCountOfContextNodeList(xctxt)); // System.out.println("last: "+xnum.num()); return xnum; }
// in src/org/apache/xpath/functions/FuncPosition.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { double pos = (double) getPositionInContextNodeList(xctxt); return new XNumber(pos); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object eval(Object item, QName returnType) throws javax.xml.transform.TransformerException { XObject resultObject = eval ( item ); return getResultAsType( resultObject, returnType ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private XObject eval ( Object contextItem ) throws javax.xml.transform.TransformerException { org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); XObject xobj = null; Node contextNode = (Node)contextItem; // We always need to have a ContextNode with Xalan XPath implementation // To allow simple expression evaluation like 1+1 we are setting // dummy Document as Context Node if ( contextNode == null ) { contextNode = getDummyDocument(); } xobj = xpath.execute(xpathSupport, contextNode, prefixResolver ); return xobj; }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } // If isSupported check is already done then the execution path // shouldn't come here. Being defensive String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException ( fmsg ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean functionAvailable(String ns, String funcName) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, 0 ); if ( xpathFunction == null ) { return false; } return true; } catch ( Exception e ) { return false; } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public boolean elementAvailable(String ns, String elemName) throws javax.xml.transform.TransformerException { return false; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPVariableStack.java
public XObject getVariableOrParam(XPathContext xctxt, QName qname) throws TransformerException,IllegalArgumentException { if ( qname == null ) { //JAXP 1.3 spec says that if variable name is null then // we need to through IllegalArgumentException String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Variable qname"} ); throw new IllegalArgumentException( fmsg ); } javax.xml.namespace.QName name = new javax.xml.namespace.QName( qname.getNamespace(), qname.getLocalPart()); Object varValue = resolver.resolveVariable( name ); if ( varValue == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_RESOLVE_VARIABLE_RETURNS_NULL, new Object[] { name.toString()} ); throw new TransformerException( fmsg ); } return XObject.create( varValue, xctxt ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private XObject eval(String expression, Object contextItem) throws javax.xml.transform.TransformerException { org.apache.xpath.XPath xpath = new org.apache.xpath.XPath( expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } XObject xobj = null; xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); // If item is null, then we will create a a Dummy contextNode if ( contextItem instanceof Node ) { xobj = xpath.execute (xpathSupport, (Node)contextItem, prefixResolver ); } else { xobj = xpath.execute ( xpathSupport, DTM.NULL, prefixResolver ); } return xobj; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
private Object getResultAsType( XObject resultObject, QName returnType ) throws javax.xml.transform.TransformerException { // XPathConstants.STRING if ( returnType.equals( XPathConstants.STRING ) ) { return resultObject.str(); } // XPathConstants.NUMBER if ( returnType.equals( XPathConstants.NUMBER ) ) { return new Double ( resultObject.num()); } // XPathConstants.BOOLEAN if ( returnType.equals( XPathConstants.BOOLEAN ) ) { return resultObject.bool() ? Boolean.TRUE : Boolean.FALSE; } // XPathConstants.NODESET ---ORdered, UNOrdered??? if ( returnType.equals( XPathConstants.NODESET ) ) { return resultObject.nodelist(); } // XPathConstants.NODE if ( returnType.equals( XPathConstants.NODE ) ) { NodeIterator ni = resultObject.nodeset(); //Return the first node, or null return ni.nextNode(); } String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString()}); throw new IllegalArgumentException( fmsg ); }
// in src/org/apache/xpath/SourceTreeManager.java
public Source resolveURI( String base, String urlString, SourceLocator locator) throws TransformerException, IOException { Source source = null; if (null != m_uriResolver) { source = m_uriResolver.resolve(urlString, base); } if (null == source) { String uri = SystemIDResolver.getAbsoluteURI(urlString, base); source = new StreamSource(uri); } return source; }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree( String base, String urlString, SourceLocator locator, XPathContext xctxt) throws TransformerException { // System.out.println("getSourceTree"); try { Source source = this.resolveURI(base, urlString, locator); // System.out.println("getSourceTree - base: "+base+", urlString: "+urlString+", source: "+source.getSystemId()); return getSourceTree(source, locator, xctxt); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), locator, ioe); } /* catch (TransformerException te) { throw new TransformerException(te.getMessage(), locator, te); }*/ }
// in src/org/apache/xpath/SourceTreeManager.java
public int getSourceTree(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { int n = getNode(source); if (DTM.NULL != n) return n; n = parseToNode(source, locator, xctxt); if (DTM.NULL != n) putDocumentInCache(n, source); return n; }
// in src/org/apache/xpath/SourceTreeManager.java
public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt) throws TransformerException { try { Object xowner = xctxt.getOwnerObject(); DTM dtm; if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter) { dtm = xctxt.getDTM(source, false, (org.apache.xml.dtm.DTMWSFilter)xowner, false, true); } else { dtm = xctxt.getDTM(source, false, null, false, true); } return dtm.getDocument(); } catch (Exception e) { //e.printStackTrace(); throw new TransformerException(e.getMessage(), locator, e); } }
// in src/org/apache/xpath/SourceTreeManager.java
public static XMLReader getXMLReader(Source inputSource, SourceLocator locator) throws TransformerException { try { XMLReader reader = (inputSource instanceof SAXSource) ? ((SAXSource) inputSource).getXMLReader() : null; if (null == reader) { try { javax.xml.parsers.SAXParserFactory factory= javax.xml.parsers.SAXParserFactory.newInstance(); factory.setNamespaceAware( true ); javax.xml.parsers.SAXParser jaxpParser= factory.newSAXParser(); reader=jaxpParser.getXMLReader(); } catch( javax.xml.parsers.ParserConfigurationException ex ) { throw new org.xml.sax.SAXException( ex ); } catch( javax.xml.parsers.FactoryConfigurationError ex1 ) { throw new org.xml.sax.SAXException( ex1.toString() ); } catch( NoSuchMethodError ex2 ) { } catch (AbstractMethodError ame){} if(null == reader) reader = XMLReaderFactory.createXMLReader(); } try { reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true); } catch (org.xml.sax.SAXException se) { // What can we do? // TODO: User diagnostics. } return reader; } catch (org.xml.sax.SAXException se) { throw new TransformerException(se.getMessage(), locator, se); } }
// in src/org/apache/xpath/XPathAPI.java
public static Node selectSingleNode(Node contextNode, String str) throws TransformerException { return selectSingleNode(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static Node selectSingleNode( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Have the XObject return its result as a NodeSetDTM. NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode); // Return the first node, or null return nl.nextNode(); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeIterator selectNodeIterator(Node contextNode, String str) throws TransformerException { return selectNodeIterator(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeList selectNodeList(Node contextNode, String str) throws TransformerException { return selectNodeList(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static NodeList selectNodeList( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Return a NodeList. return list.nodelist(); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval(Node contextNode, String str) throws TransformerException { return eval(contextNode, str, contextNode); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval(Node contextNode, String str, Node namespaceNode) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Create an object to resolve namespace prefixes. // XPath namespaces are resolved from the input context node's document element // if it is a root node, or else the current context node (for lack of a better // resolution space, given the simplicity of this sample code). PrefixResolverDefault prefixResolver = new PrefixResolverDefault( (namespaceNode.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) namespaceNode).getDocumentElement() : namespaceNode); // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Execute the XPath, and have it return the result // return xpath.execute(xpathSupport, contextNode, prefixResolver); int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/XPathAPI.java
public static XObject eval( Node contextNode, String str, PrefixResolver prefixResolver) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Execute the XPath, and have it return the result int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
public static LocPathIterator createUnionIterator(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { // For the moment, I'm going to first create a full UnionPathIterator, and // then see if I can reduce it to a UnionChildIterator. It would obviously // be more effecient to just test for the conditions for a UnionChildIterator, // and then create that directly. UnionPathIterator upi = new UnionPathIterator(compiler, opPos); int nPaths = upi.m_exprs.length; boolean isAllChildIterators = true; for(int i = 0; i < nPaths; i++) { LocPathIterator lpi = upi.m_exprs[i]; if(lpi.getAxis() != Axis.CHILD) { isAllChildIterators = false; break; } else { // check for positional predicates or position function, which won't work. if(HasPositionalPredChecker.check(lpi)) { isAllChildIterators = false; break; } } } if(isAllChildIterators) { UnionChildIterator uci = new UnionChildIterator(); for(int i = 0; i < nPaths; i++) { PredicatedNodeTest lpi = upi.m_exprs[i]; // I could strip the lpi down to a pure PredicatedNodeTest, but // I don't think it's worth it. Note that the test can be used // as a static object... so it doesn't have to be cloned. uci.addNodeTest(lpi); } return uci; } else return upi; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
protected LocPathIterator createDTMIterator( Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { LocPathIterator lpi = (LocPathIterator)WalkerFactory.newDTMIterator(compiler, opPos, (compiler.getLocationPathDepth() <= 0)); return lpi; }
// in src/org/apache/xpath/axes/UnionPathIterator.java
protected void loadLocationPaths(Compiler compiler, int opPos, int count) throws javax.xml.transform.TransformerException { // TODO: Handle unwrapped FilterExpr int steptype = compiler.getOp(opPos); if (steptype == OpCodes.OP_LOCATIONPATH) { loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); m_exprs[count] = createDTMIterator(compiler, opPos); m_exprs[count].exprSetParent(this); } else { // Have to check for unwrapped functions, which the LocPathIterator // doesn't handle. switch (steptype) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : loadLocationPaths(compiler, compiler.getNextOpPos(opPos), count + 1); WalkingIterator iter = new WalkingIterator(compiler.getNamespaceContext()); iter.exprSetParent(this); if(compiler.getLocationPathDepth() <= 0) iter.setIsTopLevel(true); iter.m_firstWalker = new org.apache.xpath.axes.FilterExprWalker(iter); iter.m_firstWalker.init(compiler, opPos, steptype); m_exprs[count] = iter; break; default : m_exprs = new LocPathIterator[count]; } } }
// in src/org/apache/xpath/axes/FilterExprWalker.java
public void init(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { super.init(compiler, opPos, stepType); // Smooth over an anomily in the opcode map... switch (stepType) { case OpCodes.OP_FUNCTION : case OpCodes.OP_EXTFUNCTION : m_mustHardReset = true; case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : m_expr = compiler.compile(opPos); m_expr.exprSetParent(this); //if((OpCodes.OP_FUNCTION == stepType) && (m_expr instanceof org.apache.xalan.templates.FuncKey)) if(m_expr instanceof org.apache.xpath.operations.Variable) { // hack/temp workaround m_canDetachNodeset = false; } break; default : m_expr = compiler.compile(opPos + 2); m_expr.exprSetParent(this); } // if(m_expr instanceof WalkingIterator) // { // WalkingIterator wi = (WalkingIterator)m_expr; // if(wi.getFirstWalker() instanceof FilterExprWalker) // { // FilterExprWalker fw = (FilterExprWalker)wi.getFirstWalker(); // if(null == fw.getNextWalker()) // { // m_expr = fw.m_expr; // m_expr.exprSetParent(this); // } // } // // } }
// in src/org/apache/xpath/axes/AxesWalker.java
public void init(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { initPredicateInfo(compiler, opPos); // int testType = compiler.getOp(nodeTestOpPos); }
// in src/org/apache/xpath/axes/LocPathIterator.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_clones = new IteratorPool(this); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public void executeCharsToContentHandler( XPathContext xctxt, org.xml.sax.ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { LocPathIterator clone = (LocPathIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); clone.setRoot(current, xctxt); int node = clone.nextNode(); DTM dtm = clone.getDTM(node); clone.detach(); if(node != DTM.NULL) { dtm.dispatchCharactersEvents(node, handler, false); } }
// in src/org/apache/xpath/axes/LocPathIterator.java
public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = (DTMIterator)m_clones.getInstance(); int current = xctxt.getCurrentNode(); iter.setRoot(current, xctxt); int next = iter.nextNode(); // m_clones.freeInstance(iter); iter.detach(); return next; }
// in src/org/apache/xpath/axes/LocPathIterator.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (asNode(xctxt) != DTM.NULL); }
// in src/org/apache/xpath/axes/ChildIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { int current = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(current); return dtm.getFirstChild(current); }
// in src/org/apache/xpath/axes/SelfIteratorNoPredicate.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return xctxt.getCurrentNode(); }
// in src/org/apache/xpath/axes/WalkerFactory.java
static AxesWalker loadOneWalker( WalkingIterator lpi, Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { AxesWalker firstWalker = null; int stepType = compiler.getOp(stepOpCodePos); if (stepType != OpCodes.ENDOP) { // m_axesWalkers = new AxesWalker[1]; // As we unwind from the recursion, create the iterators. firstWalker = createDefaultWalker(compiler, stepType, lpi, 0); firstWalker.init(compiler, stepOpCodePos, stepType); } return firstWalker; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static AxesWalker loadWalkers( WalkingIterator lpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; AxesWalker firstWalker = null; AxesWalker walker, prevWalker = null; int analysis = analyze(compiler, stepOpCodePos, stepIndex); while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { walker = createDefaultWalker(compiler, stepOpCodePos, lpi, analysis); walker.init(compiler, stepOpCodePos, stepType); walker.exprSetParent(lpi); // walker.setAnalysis(analysis); if (null == firstWalker) { firstWalker = walker; } else { prevWalker.setNextWalker(walker); walker.setPrevWalker(prevWalker); } prevWalker = walker; stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } return firstWalker; }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static DTMIterator newDTMIterator( Compiler compiler, int opPos, boolean isTopLevel) throws javax.xml.transform.TransformerException { int firstStepPos = OpMap.getFirstChildPos(opPos); int analysis = analyze(compiler, firstStepPos, 0); boolean isOneStep = isOneStep(analysis); DTMIterator iter; // Is the iteration a one-step attribute pattern (i.e. select="@foo")? if (isOneStep && walksSelfOnly(analysis) && isWild(analysis) && !hasPredicate(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("SelfIteratorNoPredicate", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new SelfIteratorNoPredicate(compiler, opPos, analysis); } // Is the iteration exactly one child step? else if (walksChildrenOnly(analysis) && isOneStep) { // Does the pattern specify *any* child with no predicate? (i.e. select="child::node()". if (isWild(analysis) && !hasPredicate(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("ChildIterator", analysis, compiler); // Use simple child iteration without any test. iter = new ChildIterator(compiler, opPos, analysis); } else { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("ChildTestIterator", analysis, compiler); // Else use simple node test iteration with predicate test. iter = new ChildTestIterator(compiler, opPos, analysis); } } // Is the iteration a one-step attribute pattern (i.e. select="@foo")? else if (isOneStep && walksAttributes(analysis)) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("AttributeIterator", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new AttributeIterator(compiler, opPos, analysis); } else if(isOneStep && !walksFilteredList(analysis)) { if( !walksNamespaces(analysis) && (walksInDocOrder(analysis) || isSet(analysis, BIT_PARENT))) { if (false || DEBUG_ITERATOR_CREATION) diagnoseIterator("OneStepIteratorForward", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new OneStepIteratorForward(compiler, opPos, analysis); } else { if (false || DEBUG_ITERATOR_CREATION) diagnoseIterator("OneStepIterator", analysis, compiler); // Then use a simple iteration of the attributes, with node test // and predicate testing. iter = new OneStepIterator(compiler, opPos, analysis); } } // Analysis of "//center": // bits: 1001000000001010000000000000011 // count: 3 // root // child:node() // BIT_DESCENDANT_OR_SELF // It's highly possible that we should have a seperate bit set for // "//foo" patterns. // For at least the time being, we can't optimize patterns like // "//table[3]", because this has to be analyzed as // "/descendant-or-self::node()/table[3]" in order for the indexes // to work right. else if (isOptimizableForDescendantIterator(compiler, firstStepPos, 0) // && getStepCount(analysis) <= 3 // && walksDescendants(analysis) // && walksSubtreeOnlyFromRootOrContext(analysis) ) { if (DEBUG_ITERATOR_CREATION) diagnoseIterator("DescendantIterator", analysis, compiler); iter = new DescendantIterator(compiler, opPos, analysis); } else { if(isNaturalDocOrder(compiler, firstStepPos, 0, analysis)) { if (false || DEBUG_ITERATOR_CREATION) { diagnoseIterator("WalkingIterator", analysis, compiler); } iter = new WalkingIterator(compiler, opPos, analysis, true); } else { // if (DEBUG_ITERATOR_CREATION) // diagnoseIterator("MatchPatternIterator", analysis, compiler); // // return new MatchPatternIterator(compiler, opPos, analysis); if (DEBUG_ITERATOR_CREATION) diagnoseIterator("WalkingIteratorSorted", analysis, compiler); iter = new WalkingIteratorSorted(compiler, opPos, analysis, true); } } if(iter instanceof LocPathIterator) ((LocPathIterator)iter).setIsTopLevel(isTopLevel); return iter; }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static int getAxisFromStep( Compiler compiler, int stepOpCodePos) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(stepOpCodePos); switch (stepType) { case OpCodes.FROM_FOLLOWING : return Axis.FOLLOWING; case OpCodes.FROM_FOLLOWING_SIBLINGS : return Axis.FOLLOWINGSIBLING; case OpCodes.FROM_PRECEDING : return Axis.PRECEDING; case OpCodes.FROM_PRECEDING_SIBLINGS : return Axis.PRECEDINGSIBLING; case OpCodes.FROM_PARENT : return Axis.PARENT; case OpCodes.FROM_NAMESPACE : return Axis.NAMESPACE; case OpCodes.FROM_ANCESTORS : return Axis.ANCESTOR; case OpCodes.FROM_ANCESTORS_OR_SELF : return Axis.ANCESTORORSELF; case OpCodes.FROM_ATTRIBUTES : return Axis.ATTRIBUTE; case OpCodes.FROM_ROOT : return Axis.ROOT; case OpCodes.FROM_CHILDREN : return Axis.CHILD; case OpCodes.FROM_DESCENDANTS_OR_SELF : return Axis.DESCENDANTORSELF; case OpCodes.FROM_DESCENDANTS : return Axis.DESCENDANT; case OpCodes.FROM_SELF : return Axis.SELF; case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.OP_VARIABLE : return Axis.FILTEREDLIST; } throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); }
// in src/org/apache/xpath/axes/WalkerFactory.java
public static boolean mightBeProximate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { boolean mightBeProximate = false; int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen = compiler.getArgLength(opPos); break; default : argLen = compiler.getArgLengthOfStep(opPos); } int predPos = compiler.getFirstPredicateOpPos(opPos); int count = 0; while (OpCodes.OP_PREDICATE == compiler.getOp(predPos)) { count++; int innerExprOpPos = predPos+2; int predOp = compiler.getOp(innerExprOpPos); switch(predOp) { case OpCodes.OP_VARIABLE: return true; // Would need more smarts to tell if this could be a number or not! case OpCodes.OP_LOCATIONPATH: // OK. break; case OpCodes.OP_NUMBER: case OpCodes.OP_NUMBERLIT: return true; // that's all she wrote! case OpCodes.OP_FUNCTION: boolean isProx = functionProximateOrContainsProximate(compiler, innerExprOpPos); if(isProx) return true; break; case OpCodes.OP_GT: case OpCodes.OP_GTE: case OpCodes.OP_LT: case OpCodes.OP_LTE: case OpCodes.OP_EQUALS: int leftPos = OpMap.getFirstChildPos(innerExprOpPos); int rightPos = compiler.getNextOpPos(leftPos); isProx = isProximateInnerExpr(compiler, leftPos); if(isProx) return true; isProx = isProximateInnerExpr(compiler, rightPos); if(isProx) return true; break; default: return true; // be conservative... } predPos = compiler.getNextOpPos(predPos); } return mightBeProximate; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isOptimizableForDescendantIterator( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; boolean foundDorDS = false; boolean foundSelf = false; boolean foundDS = false; int nodeTestType = OpCodes.NODETYPE_NODE; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { // The DescendantIterator can only do one node test. If there's more // than one, use another iterator. if(nodeTestType != OpCodes.NODETYPE_NODE && nodeTestType != OpCodes.NODETYPE_ROOT) return false; stepCount++; if(stepCount > 3) return false; boolean mightBeProximate = mightBeProximate(compiler, stepOpCodePos, stepType); if(mightBeProximate) return false; switch (stepType) { case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : return false; case OpCodes.FROM_ROOT : if(1 != stepCount) return false; break; case OpCodes.FROM_CHILDREN : if(!foundDS && !(foundDorDS && foundSelf)) return false; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : foundDS = true; case OpCodes.FROM_DESCENDANTS : if(3 == stepCount) return false; foundDorDS = true; break; case OpCodes.FROM_SELF : if(1 != stepCount) return false; foundSelf = true; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } nodeTestType = compiler.getStepTestType(stepOpCodePos); int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; if(OpCodes.ENDOP != compiler.getOp(nextStepOpCodePos)) { if(compiler.countPredicates(stepOpCodePos) > 0) { return false; } } stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static int analyze( Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { int stepType; int stepCount = 0; int analysisResult = 0x00000000; // 32 bits of analysis while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; // String namespace = compiler.getStepNS(stepOpCodePos); // boolean isNSWild = (null != namespace) // ? namespace.equals(NodeTest.WILD) : false; // String localname = compiler.getStepLocalName(stepOpCodePos); // boolean isWild = (null != localname) ? localname.equals(NodeTest.WILD) : false; boolean predAnalysis = analyzePredicate(compiler, stepOpCodePos, stepType); if (predAnalysis) analysisResult |= BIT_PREDICATE; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : analysisResult |= BIT_FILTER; break; case OpCodes.FROM_ROOT : analysisResult |= BIT_ROOT; break; case OpCodes.FROM_ANCESTORS : analysisResult |= BIT_ANCESTOR; break; case OpCodes.FROM_ANCESTORS_OR_SELF : analysisResult |= BIT_ANCESTOR_OR_SELF; break; case OpCodes.FROM_ATTRIBUTES : analysisResult |= BIT_ATTRIBUTE; break; case OpCodes.FROM_NAMESPACE : analysisResult |= BIT_NAMESPACE; break; case OpCodes.FROM_CHILDREN : analysisResult |= BIT_CHILD; break; case OpCodes.FROM_DESCENDANTS : analysisResult |= BIT_DESCENDANT; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : // Use a special bit to to make sure we get the right analysis of "//foo". if (2 == stepCount && BIT_ROOT == analysisResult) { analysisResult |= BIT_ANY_DESCENDANT_FROM_ROOT; } analysisResult |= BIT_DESCENDANT_OR_SELF; break; case OpCodes.FROM_FOLLOWING : analysisResult |= BIT_FOLLOWING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : analysisResult |= BIT_FOLLOWING_SIBLING; break; case OpCodes.FROM_PRECEDING : analysisResult |= BIT_PRECEDING; break; case OpCodes.FROM_PRECEDING_SIBLINGS : analysisResult |= BIT_PRECEDING_SIBLING; break; case OpCodes.FROM_PARENT : analysisResult |= BIT_PARENT; break; case OpCodes.FROM_SELF : analysisResult |= BIT_SELF; break; case OpCodes.MATCH_ATTRIBUTE : analysisResult |= (BIT_MATCH_PATTERN | BIT_ATTRIBUTE); break; case OpCodes.MATCH_ANY_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_ANCESTOR); break; case OpCodes.MATCH_IMMEDIATE_ANCESTOR : analysisResult |= (BIT_MATCH_PATTERN | BIT_PARENT); break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if (OpCodes.NODETYPE_NODE == compiler.getOp(stepOpCodePos + 3)) // child::node() { analysisResult |= BIT_NODETEST_ANY; } stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } analysisResult |= (stepCount & BITS_COUNT); return analysisResult; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static StepPattern loadSteps( MatchPatternIterator mpi, Compiler compiler, int stepOpCodePos, int stepIndex) throws javax.xml.transform.TransformerException { if (DEBUG_PATTERN_CREATION) { System.out.println("================"); System.out.println("loadSteps for: "+compiler.getPatternString()); } int stepType; StepPattern step = null; StepPattern firstStep = null, prevStep = null; int analysis = analyze(compiler, stepOpCodePos, stepIndex); while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { step = createDefaultStepPattern(compiler, stepOpCodePos, mpi, analysis, firstStep, prevStep); if (null == firstStep) { firstStep = step; } else { //prevStep.setNextWalker(step); step.setRelativePathPattern(prevStep); } prevStep = step; stepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (stepOpCodePos < 0) break; } int axis = Axis.SELF; int paxis = Axis.SELF; StepPattern tail = step; for (StepPattern pat = step; null != pat; pat = pat.getRelativePathPattern()) { int nextAxis = pat.getAxis(); //int nextPaxis = pat.getPredicateAxis(); pat.setAxis(axis); // The predicate axis can't be moved!!! Test Axes103 // pat.setPredicateAxis(paxis); // If we have an attribute or namespace axis that went up, then // it won't find the attribute in the inverse, since the select-to-match // axes are not invertable (an element is a parent of an attribute, but // and attribute is not a child of an element). // If we don't do the magic below, then "@*/ancestor-or-self::*" gets // inverted for match to "self::*/descendant-or-self::@*/parent::node()", // which obviously won't work. // So we will rewrite this as: // "self::*/descendant-or-self::*/attribute::*/parent::node()" // Child has to be rewritten a little differently: // select: "@*/parent::*" // inverted match: "self::*/child::@*/parent::node()" // rewrite: "self::*/attribute::*/parent::node()" // Axes that go down in the select, do not have to have special treatment // in the rewrite. The following inverted match will still not select // anything. // select: "@*/child::*" // inverted match: "self::*/parent::@*/parent::node()" // Lovely business, this. // -sb int whatToShow = pat.getWhatToShow(); if(whatToShow == DTMFilter.SHOW_ATTRIBUTE || whatToShow == DTMFilter.SHOW_NAMESPACE) { int newAxis = (whatToShow == DTMFilter.SHOW_ATTRIBUTE) ? Axis.ATTRIBUTE : Axis.NAMESPACE; if(isDownwardAxisOfMany(axis)) { StepPattern attrPat = new StepPattern(whatToShow, pat.getNamespace(), pat.getLocalName(), //newAxis, pat.getPredicateAxis); newAxis, 0); // don't care about the predicate axis XNumber score = pat.getStaticScore(); pat.setNamespace(null); pat.setLocalName(NodeTest.WILD); attrPat.setPredicates(pat.getPredicates()); pat.setPredicates(null); pat.setWhatToShow(DTMFilter.SHOW_ELEMENT); StepPattern rel = pat.getRelativePathPattern(); pat.setRelativePathPattern(attrPat); attrPat.setRelativePathPattern(rel); attrPat.setStaticScore(score); // This is needed to inverse a following pattern, because of the // wacky Xalan rules for following from an attribute. See axes108. // By these rules, following from an attribute is not strictly // inverseable. if(Axis.PRECEDING == pat.getAxis()) pat.setAxis(Axis.PRECEDINGANDANCESTOR); else if(Axis.DESCENDANT == pat.getAxis()) pat.setAxis(Axis.DESCENDANTORSELF); pat = attrPat; } else if(Axis.CHILD == pat.getAxis()) { // In this case just change the axis. // pat.setWhatToShow(whatToShow); pat.setAxis(Axis.ATTRIBUTE); } } axis = nextAxis; //paxis = nextPaxis; tail = pat; } if(axis < Axis.ALL) { StepPattern selfPattern = new ContextMatchStepPattern(axis, paxis); // We need to keep the new nodetest from affecting the score... XNumber score = tail.getStaticScore(); tail.setRelativePathPattern(selfPattern); tail.setStaticScore(score); selfPattern.setStaticScore(score); } if (DEBUG_PATTERN_CREATION) { System.out.println("Done loading steps: "+step.toString()); System.out.println(""); } return step; // start from last pattern?? //firstStep; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static StepPattern createDefaultStepPattern( Compiler compiler, int opPos, MatchPatternIterator mpi, int analysis, StepPattern tail, StepPattern head) throws javax.xml.transform.TransformerException { int stepType = compiler.getOp(opPos); boolean simpleInit = false; boolean prevIsOneStepDown = true; int whatToShow = compiler.getWhatToShow(opPos); StepPattern ai = null; int axis, predicateAxis; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : prevIsOneStepDown = false; Expression expr; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : expr = compiler.compile(opPos); break; default : expr = compiler.compile(opPos + 2); } axis = Axis.FILTEREDLIST; predicateAxis = Axis.FILTEREDLIST; ai = new FunctionPattern(expr, axis, predicateAxis); simpleInit = true; break; case OpCodes.FROM_ROOT : whatToShow = DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT; axis = Axis.ROOT; predicateAxis = Axis.ROOT; ai = new StepPattern(DTMFilter.SHOW_DOCUMENT | DTMFilter.SHOW_DOCUMENT_FRAGMENT, axis, predicateAxis); break; case OpCodes.FROM_ATTRIBUTES : whatToShow = DTMFilter.SHOW_ATTRIBUTE; axis = Axis.PARENT; predicateAxis = Axis.ATTRIBUTE; // ai = new StepPattern(whatToShow, Axis.SELF, Axis.SELF); break; case OpCodes.FROM_NAMESPACE : whatToShow = DTMFilter.SHOW_NAMESPACE; axis = Axis.PARENT; predicateAxis = Axis.NAMESPACE; // ai = new StepPattern(whatToShow, axis, predicateAxis); break; case OpCodes.FROM_ANCESTORS : axis = Axis.DESCENDANT; predicateAxis = Axis.ANCESTOR; break; case OpCodes.FROM_CHILDREN : axis = Axis.PARENT; predicateAxis = Axis.CHILD; break; case OpCodes.FROM_ANCESTORS_OR_SELF : axis = Axis.DESCENDANTORSELF; predicateAxis = Axis.ANCESTORORSELF; break; case OpCodes.FROM_SELF : axis = Axis.SELF; predicateAxis = Axis.SELF; break; case OpCodes.FROM_PARENT : axis = Axis.CHILD; predicateAxis = Axis.PARENT; break; case OpCodes.FROM_PRECEDING_SIBLINGS : axis = Axis.FOLLOWINGSIBLING; predicateAxis = Axis.PRECEDINGSIBLING; break; case OpCodes.FROM_PRECEDING : axis = Axis.FOLLOWING; predicateAxis = Axis.PRECEDING; break; case OpCodes.FROM_FOLLOWING_SIBLINGS : axis = Axis.PRECEDINGSIBLING; predicateAxis = Axis.FOLLOWINGSIBLING; break; case OpCodes.FROM_FOLLOWING : axis = Axis.PRECEDING; predicateAxis = Axis.FOLLOWING; break; case OpCodes.FROM_DESCENDANTS_OR_SELF : axis = Axis.ANCESTORORSELF; predicateAxis = Axis.DESCENDANTORSELF; break; case OpCodes.FROM_DESCENDANTS : axis = Axis.ANCESTOR; predicateAxis = Axis.DESCENDANT; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " //+ stepType); } if(null == ai) { whatToShow = compiler.getWhatToShow(opPos); // %REVIEW% ai = new StepPattern(whatToShow, compiler.getStepNS(opPos), compiler.getStepLocalName(opPos), axis, predicateAxis); } if (false || DEBUG_PATTERN_CREATION) { System.out.print("new step: "+ ai); System.out.print(", axis: " + Axis.getNames(ai.getAxis())); System.out.print(", predAxis: " + Axis.getNames(ai.getAxis())); System.out.print(", what: "); System.out.print(" "); ai.debugWhatToShow(ai.getWhatToShow()); } int argLen = compiler.getFirstPredicateOpPos(opPos); ai.setPredicates(compiler.getCompiledPredicates(argLen)); return ai; }
// in src/org/apache/xpath/axes/WalkerFactory.java
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen = compiler.getArgLength(opPos); break; default : argLen = compiler.getArgLengthOfStep(opPos); } int pos = compiler.getFirstPredicateOpPos(opPos); int nPredicates = compiler.countPredicates(pos); return (nPredicates > 0) ? true : false; }
// in src/org/apache/xpath/axes/WalkerFactory.java
private static boolean isNaturalDocOrder( Compiler compiler, int stepOpCodePos, int stepIndex, int analysis) throws javax.xml.transform.TransformerException { if(canCrissCross(analysis)) return false; // Namespaces can present some problems, so just punt if we're looking for // these. if(isSet(analysis, BIT_NAMESPACE)) return false; // The following, preceding, following-sibling, and preceding sibling can // be found in doc order if we get to this point, but if they occur // together, they produce // duplicates, so it's better for us to eliminate this case so we don't // have to check for duplicates during runtime if we're using a // WalkingIterator. if(isSet(analysis, BIT_FOLLOWING | BIT_FOLLOWING_SIBLING) && isSet(analysis, BIT_PRECEDING | BIT_PRECEDING_SIBLING)) return false; // OK, now we have to check for select="@*/axis::*" patterns, which // can also cause duplicates to happen. But select="axis*/@::*" patterns // are OK, as are select="@foo/axis::*" patterns. // Unfortunately, we can't do this just via the analysis bits. int stepType; int stepCount = 0; boolean foundWildAttribute = false; // Steps that can traverse anything other than down a // subtree or that can produce duplicates when used in // combonation are counted with this variable. int potentialDuplicateMakingStepCount = 0; while (OpCodes.ENDOP != (stepType = compiler.getOp(stepOpCodePos))) { stepCount++; switch (stepType) { case OpCodes.FROM_ATTRIBUTES : case OpCodes.MATCH_ATTRIBUTE : if(foundWildAttribute) // Maybe not needed, but be safe. return false; // This doesn't seem to work as a test for wild card. Hmph. // int nodeTestType = compiler.getStepTestType(stepOpCodePos); String localName = compiler.getStepLocalName(stepOpCodePos); // System.err.println("localName: "+localName); if(localName.equals("*")) { foundWildAttribute = true; } break; case OpCodes.FROM_FOLLOWING : case OpCodes.FROM_FOLLOWING_SIBLINGS : case OpCodes.FROM_PRECEDING : case OpCodes.FROM_PRECEDING_SIBLINGS : case OpCodes.FROM_PARENT : case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : case OpCodes.FROM_NAMESPACE : case OpCodes.FROM_ANCESTORS : case OpCodes.FROM_ANCESTORS_OR_SELF : case OpCodes.MATCH_ANY_ANCESTOR : case OpCodes.MATCH_IMMEDIATE_ANCESTOR : case OpCodes.FROM_DESCENDANTS_OR_SELF : case OpCodes.FROM_DESCENDANTS : if(potentialDuplicateMakingStepCount > 0) return false; potentialDuplicateMakingStepCount++; case OpCodes.FROM_ROOT : case OpCodes.FROM_CHILDREN : case OpCodes.FROM_SELF : if(foundWildAttribute) return false; break; default : throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NULL_ERROR_HANDLER, new Object[]{Integer.toString(stepType)})); //"Programmer's assertion: unknown opcode: " // + stepType); } int nextStepOpCodePos = compiler.getNextStepPos(stepOpCodePos); if (nextStepOpCodePos < 0) break; stepOpCodePos = nextStepOpCodePos; } return true; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, javax.xml.transform.TransformerException { try { stream.defaultReadObject(); m_predicateIndex = -1; resetProximityPositions(); } catch (ClassNotFoundException cnfe) { throw new javax.xml.transform.TransformerException(cnfe); } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
protected void initPredicateInfo(Compiler compiler, int opPos) throws javax.xml.transform.TransformerException { int pos = compiler.getFirstPredicateOpPos(opPos); if(pos > 0) { m_predicates = compiler.getCompiledPredicates(pos); if(null != m_predicates) { for(int i = 0; i < m_predicates.length; i++) { m_predicates[i].exprSetParent(this); } } } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public void initProximityPosition(int i) throws javax.xml.transform.TransformerException { m_proximityPositions[i] = 0; }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
boolean executePredicates(int context, XPathContext xctxt) throws javax.xml.transform.TransformerException { int nPredicates = getPredicateCount(); // System.out.println("nPredicates: "+nPredicates); if (nPredicates == 0) return true; PrefixResolver savedResolver = xctxt.getNamespaceContext(); try { m_predicateIndex = 0; xctxt.pushSubContextList(this); xctxt.pushNamespaceContext(m_lpi.getPrefixResolver()); xctxt.pushCurrentNode(context); for (int i = 0; i < nPredicates; i++) { // System.out.println("Executing predicate expression - waiting count: "+m_lpi.getWaitingCount()); XObject pred = m_predicates[i].execute(xctxt); // System.out.println("\nBack from executing predicate expression - waiting count: "+m_lpi.getWaitingCount()); // System.out.println("pred.getType(): "+pred.getType()); if (XObject.CLASS_NUMBER == pred.getType()) { if (DEBUG_PREDICATECOUNTING) { System.out.flush(); System.out.println("\n===== start predicate count ========"); System.out.println("m_predicateIndex: " + m_predicateIndex); // System.out.println("getProximityPosition(m_predicateIndex): " // + getProximityPosition(m_predicateIndex)); System.out.println("pred.num(): " + pred.num()); } int proxPos = this.getProximityPosition(m_predicateIndex); int predIndex = (int) pred.num(); if (proxPos != predIndex) { if (DEBUG_PREDICATECOUNTING) { System.out.println("\nnode context: "+nodeToString(context)); System.out.println("index predicate is false: "+proxPos); System.out.println("\n===== end predicate count ========"); } return false; } else if (DEBUG_PREDICATECOUNTING) { System.out.println("\nnode context: "+nodeToString(context)); System.out.println("index predicate is true: "+proxPos); System.out.println("\n===== end predicate count ========"); } // If there is a proximity index that will not change during the // course of itteration, then we know there can be no more true // occurances of this predicate, so flag that we're done after // this. // // bugzilla 14365 // We can't set m_foundLast = true unless we're sure that -all- // remaining parameters are stable, or else last() fails. Fixed so // only sets m_foundLast if on the last predicate if(m_predicates[i].isStableNumber() && i == nPredicates - 1) { m_foundLast = true; } } else if (!pred.bool()) return false; countProximityPosition(++m_predicateIndex); } } finally { xctxt.popCurrentNode(); xctxt.popNamespaceContext(); xctxt.popSubContextList(); m_predicateIndex = -1; } return true; }
// in src/org/apache/xpath/axes/DescendantIterator.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { if(getPredicateCount() > 0) return super.asNode(xctxt); int current = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(current); DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis); String localName = getLocalName(); String namespace = getNamespace(); int what = m_whatToShow; // System.out.print(" (DescendantIterator) "); // System.out.println("what: "); // NodeTest.debugWhatToShow(what); if(DTMFilter.SHOW_ALL == what || localName == NodeTest.WILD || namespace == NodeTest.WILD) { return traverser.first(current); } else { int type = getNodeTypeTest(what); int extendedType = dtm.getExpandedTypeID(namespace, localName, type); return traverser.first(current, extendedType); } }
// in src/org/apache/xpath/operations/Variable.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, false); }
// in src/org/apache/xpath/operations/Variable.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { org.apache.xml.utils.PrefixResolver xprefixResolver = xctxt.getNamespaceContext(); XObject result; // Is the variable fetched always the same? // XObject result = xctxt.getVariable(m_qname); if(m_fixUpWasCalled) { if(m_isGlobal) result = xctxt.getVarStack().getGlobalVariable(xctxt, m_index, destructiveOK); else result = xctxt.getVarStack().getLocalVariable(xctxt, m_index, destructiveOK); } else { result = xctxt.getVarStack().getVariableOrParam(xctxt,m_qname); } if (null == result) { // This should now never happen... warn(xctxt, XPATHErrorResources.WG_ILLEGAL_VARIABLE_REFERENCE, new Object[]{ m_qname.getLocalPart() }); //"VariableReference given for variable out "+ // (new RuntimeException()).printStackTrace(); // error(xctxt, XPATHErrorResources.ER_COULDNOT_GET_VAR_NAMED, // new Object[]{ m_qname.getLocalPart() }); //"Could not get variable named "+varName); result = new XNodeSet(xctxt.getDTMManager()); } return result; // } // else // { // // Hack city... big time. This is needed to evaluate xpaths from extensions, // // pending some bright light going off in my head. Some sort of callback? // synchronized(this) // { // org.apache.xalan.templates.ElemVariable vvar= getElemVariable(); // if(null != vvar) // { // m_index = vvar.getIndex(); // m_isGlobal = vvar.getIsTopLevel(); // m_fixUpWasCalled = true; // return execute(xctxt); // } // } // throw new javax.xml.transform.TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_VAR_NOT_RESOLVABLE, new Object[]{m_qname.toString()})); //"Variable not resolvable: "+m_qname); // } }
// in src/org/apache/xpath/operations/Div.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() / right.num()); }
// in src/org/apache/xpath/operations/Div.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) / m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Bool.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_BOOLEAN == right.getType()) return right; else return right.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Bool.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.bool(xctxt); }
// in src/org/apache/xpath/operations/NotEquals.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return (left.notEquals(right)) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Minus.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() - right.num()); }
// in src/org/apache/xpath/operations/Minus.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) - m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Quo.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber((int) (left.num() / right.num())); }
// in src/org/apache/xpath/operations/Lte.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.lessThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Number.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { if (XObject.CLASS_NUMBER == right.getType()) return right; else return new XNumber(right.num()); }
// in src/org/apache/xpath/operations/Number.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.num(xctxt); }
// in src/org/apache/xpath/operations/String.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return (XString)right.xstr(); // semi-safe cast. }
// in src/org/apache/xpath/operations/UnaryOperation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return operate(m_right.execute(xctxt)); }
// in src/org/apache/xpath/operations/Operation.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); XObject result = operate(left, right); left.detach(); right.detach(); return result; }
// in src/org/apache/xpath/operations/Operation.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return null; // no-op }
// in src/org/apache/xpath/operations/Lt.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.lessThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/VariableSafeAbsRef.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK); DTMManager dtmMgr = xctxt.getDTMManager(); int context = xctxt.getContextNode(); if(dtmMgr.getDTM(xns.getRoot()).getDocument() != dtmMgr.getDTM(context).getDocument()) { Expression expr = (Expression)xns.getContainedIter(); xns = (XNodeSet)expr.asIterator(xctxt, context); } return xns; }
// in src/org/apache/xpath/operations/Neg.java
public XObject operate(XObject right) throws javax.xml.transform.TransformerException { return new XNumber(-right.num()); }
// in src/org/apache/xpath/operations/Neg.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return -(m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Gte.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.greaterThanOrEqual(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Mult.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() * right.num()); }
// in src/org/apache/xpath/operations/Mult.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) * m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Mod.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() % right.num()); }
// in src/org/apache/xpath/operations/Mod.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.num(xctxt) % m_right.num(xctxt)); }
// in src/org/apache/xpath/operations/Or.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject expr1 = m_left.execute(xctxt); if (!expr1.bool()) { XObject expr2 = m_right.execute(xctxt); return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; } else return XBoolean.S_TRUE; }
// in src/org/apache/xpath/operations/Or.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.bool(xctxt) || m_right.bool(xctxt)); }
// in src/org/apache/xpath/operations/And.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject expr1 = m_left.execute(xctxt); if (expr1.bool()) { XObject expr2 = m_right.execute(xctxt); return expr2.bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; } else return XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/And.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.bool(xctxt) && m_right.bool(xctxt)); }
// in src/org/apache/xpath/operations/Equals.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.equals(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/operations/Equals.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject left = m_left.execute(xctxt, true); XObject right = m_right.execute(xctxt, true); boolean result = left.equals(right) ? true : false; left.detach(); right.detach(); return result; }
// in src/org/apache/xpath/operations/Plus.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return new XNumber(left.num() + right.num()); }
// in src/org/apache/xpath/operations/Plus.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_right.num(xctxt) + m_left.num(xctxt)); }
// in src/org/apache/xpath/operations/Gt.java
public XObject operate(XObject left, XObject right) throws javax.xml.transform.TransformerException { return left.greaterThan(right) ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } // nl.detach(); } nl.detach(); return score; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws javax.xml.transform.TransformerException { DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } nl.detach(); } return score; }
// in src/org/apache/xpath/patterns/FunctionPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { int context = xctxt.getCurrentNode(); DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE; if (null != nl) { int n; while (DTM.NULL != (n = nl.nextNode())) { score = (n == context) ? SCORE_OTHER : SCORE_NONE; if (score == SCORE_OTHER) { context = n; break; } } nl.detach(); } return score; }
// in src/org/apache/xpath/patterns/UnionPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XObject bestScore = null; int n = m_patterns.length; for (int i = 0; i < n; i++) { XObject score = m_patterns[i].execute(xctxt); if (score != NodeTest.SCORE_NONE) { if (null == bestScore) bestScore = score; else if (score.num() > bestScore.num()) bestScore = score; } } if (null == bestScore) { bestScore = NodeTest.SCORE_NONE; } return bestScore; }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(currentNode); if (dtm != null) { int expType = dtm.getExpandedTypeID(currentNode); return execute(xctxt, currentNode, dtm, expType); } return NodeTest.SCORE_NONE; }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, xctxt.getCurrentNode()); }
// in src/org/apache/xpath/patterns/StepPattern.java
public XObject execute( XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException { if (m_whatToShow == NodeTest.SHOW_BYFUNCTION) { if (null != m_relativePathPattern) { return m_relativePathPattern.execute(xctxt); } else return NodeTest.SCORE_NONE; } XObject score; score = super.execute(xctxt, currentNode, dtm, expType); if (score == NodeTest.SCORE_NONE) return NodeTest.SCORE_NONE; if (getPredicateCount() != 0) { if (!executePredicates(xctxt, dtm, currentNode)) return NodeTest.SCORE_NONE; } if (null != m_relativePathPattern) return m_relativePathPattern.executeRelativePathPattern(xctxt, dtm, currentNode); return score; }
// in src/org/apache/xpath/patterns/StepPattern.java
protected final XObject executeRelativePathPattern( XPathContext xctxt, DTM dtm, int currentNode) throws javax.xml.transform.TransformerException { XObject score = NodeTest.SCORE_NONE; int context = currentNode; DTMAxisTraverser traverser; traverser = dtm.getAxisTraverser(m_axis); for (int relative = traverser.first(context); DTM.NULL != relative; relative = traverser.next(context, relative)) { try { xctxt.pushCurrentNode(relative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) break; } finally { xctxt.popCurrentNode(); } } return score; }
// in src/org/apache/xpath/patterns/StepPattern.java
protected final boolean executePredicates( XPathContext xctxt, DTM dtm, int currentNode) throws javax.xml.transform.TransformerException { boolean result = true; boolean positionAlreadySeen = false; int n = getPredicateCount(); try { xctxt.pushSubContextList(this); for (int i = 0; i < n; i++) { xctxt.pushPredicatePos(i); try { XObject pred = m_predicates[i].execute(xctxt); try { if (XObject.CLASS_NUMBER == pred.getType()) { int pos = (int) pred.num(); if (positionAlreadySeen) { result = (pos == 1); break; } else { positionAlreadySeen = true; if (!checkProximityPosition(xctxt, i, dtm, currentNode, pos)) { result = false; break; } } } else if (!pred.boolWithSideEffects()) { result = false; break; } } finally { pred.detach(); } } finally { xctxt.popPredicatePos(); } } } finally { xctxt.popSubContextList(); } return result; }
// in src/org/apache/xpath/patterns/StepPattern.java
public double getMatchScore(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { xctxt.pushCurrentNode(context); xctxt.pushCurrentExpressionNode(context); try { XObject score = execute(xctxt); return score.num(); } finally { xctxt.popCurrentNode(); xctxt.popCurrentExpressionNode(); } // return XPath.MATCH_SCORE_NONE; }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { if (xctxt.getIteratorRoot() == xctxt.getCurrentNode()) return getStaticScore(); else return this.SCORE_NONE; }
// in src/org/apache/xpath/patterns/ContextMatchStepPattern.java
public XObject executeRelativePathPattern( XPathContext xctxt, StepPattern prevStep) throws javax.xml.transform.TransformerException { XObject score = NodeTest.SCORE_NONE; int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); if (null != dtm) { int predContext = xctxt.getCurrentNode(); DTMAxisTraverser traverser; int axis = m_axis; boolean needToTraverseAttrs = WalkerFactory.isDownwardAxisOfMany(axis); boolean iterRootIsAttr = (dtm.getNodeType(xctxt.getIteratorRoot()) == DTM.ATTRIBUTE_NODE); if((Axis.PRECEDING == axis) && iterRootIsAttr) { axis = Axis.PRECEDINGANDANCESTOR; } traverser = dtm.getAxisTraverser(axis); for (int relative = traverser.first(context); DTM.NULL != relative; relative = traverser.next(context, relative)) { try { xctxt.pushCurrentNode(relative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) { //score = executePredicates( xctxt, prevStep, SCORE_OTHER, // predContext, relative); if (executePredicates(xctxt, dtm, context)) return score; score = NodeTest.SCORE_NONE; } if(needToTraverseAttrs && iterRootIsAttr && (DTM.ELEMENT_NODE == dtm.getNodeType(relative))) { int xaxis = Axis.ATTRIBUTE; for (int i = 0; i < 2; i++) { DTMAxisTraverser atraverser = dtm.getAxisTraverser(xaxis); for (int arelative = atraverser.first(relative); DTM.NULL != arelative; arelative = atraverser.next(relative, arelative)) { try { xctxt.pushCurrentNode(arelative); score = execute(xctxt); if (score != NodeTest.SCORE_NONE) { //score = executePredicates( xctxt, prevStep, SCORE_OTHER, // predContext, arelative); if (score != NodeTest.SCORE_NONE) return score; } } finally { xctxt.popCurrentNode(); } } xaxis = Axis.NAMESPACE; } } } finally { xctxt.popCurrentNode(); } } } return score; }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt, int context) throws javax.xml.transform.TransformerException { DTM dtm = xctxt.getDTM(context); short nodeType = dtm.getNodeType(context); if (m_whatToShow == DTMFilter.SHOW_ALL) return m_score; int nodeBit = (m_whatToShow & (0x00000001 << (nodeType - 1))); switch (nodeBit) { case DTMFilter.SHOW_DOCUMENT_FRAGMENT : case DTMFilter.SHOW_DOCUMENT : return SCORE_OTHER; case DTMFilter.SHOW_COMMENT : return m_score; case DTMFilter.SHOW_CDATA_SECTION : case DTMFilter.SHOW_TEXT : // was: // return (!xctxt.getDOMHelper().shouldStripSourceNode(context)) // ? m_score : SCORE_NONE; return m_score; case DTMFilter.SHOW_PROCESSING_INSTRUCTION : return subPartMatch(dtm.getNodeName(context), m_name) ? m_score : SCORE_NONE; // From the draft: "Two expanded names are equal if they // have the same local part, and either both have no URI or // both have the same URI." // "A node test * is true for any node of the principal node type. // For example, child::* will select all element children of the // context node, and attribute::* will select all attributes of // the context node." // "A node test can have the form NCName:*. In this case, the prefix // is expanded in the same way as with a QName using the context // namespace declarations. The node test will be true for any node // of the principal type whose expanded name has the URI to which // the prefix expands, regardless of the local part of the name." case DTMFilter.SHOW_NAMESPACE : { String ns = dtm.getLocalName(context); return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE; } case DTMFilter.SHOW_ATTRIBUTE : case DTMFilter.SHOW_ELEMENT : { return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name))) ? m_score : SCORE_NONE; } default : return SCORE_NONE; } // end switch(testType) }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt, int context, DTM dtm, int expType) throws javax.xml.transform.TransformerException { if (m_whatToShow == DTMFilter.SHOW_ALL) return m_score; int nodeBit = (m_whatToShow & (0x00000001 << ((dtm.getNodeType(context)) - 1))); switch (nodeBit) { case DTMFilter.SHOW_DOCUMENT_FRAGMENT : case DTMFilter.SHOW_DOCUMENT : return SCORE_OTHER; case DTMFilter.SHOW_COMMENT : return m_score; case DTMFilter.SHOW_CDATA_SECTION : case DTMFilter.SHOW_TEXT : // was: // return (!xctxt.getDOMHelper().shouldStripSourceNode(context)) // ? m_score : SCORE_NONE; return m_score; case DTMFilter.SHOW_PROCESSING_INSTRUCTION : return subPartMatch(dtm.getNodeName(context), m_name) ? m_score : SCORE_NONE; // From the draft: "Two expanded names are equal if they // have the same local part, and either both have no URI or // both have the same URI." // "A node test * is true for any node of the principal node type. // For example, child::* will select all element children of the // context node, and attribute::* will select all attributes of // the context node." // "A node test can have the form NCName:*. In this case, the prefix // is expanded in the same way as with a QName using the context // namespace declarations. The node test will be true for any node // of the principal type whose expanded name has the URI to which // the prefix expands, regardless of the local part of the name." case DTMFilter.SHOW_NAMESPACE : { String ns = dtm.getLocalName(context); return (subPartMatch(ns, m_name)) ? m_score : SCORE_NONE; } case DTMFilter.SHOW_ATTRIBUTE : case DTMFilter.SHOW_ELEMENT : { return (m_isTotallyWild || (subPartMatchNS(dtm.getNamespaceURI(context), m_namespace) && subPartMatch(dtm.getLocalName(context), m_name))) ? m_score : SCORE_NONE; } default : return SCORE_NONE; } // end switch(testType) }
// in src/org/apache/xpath/patterns/NodeTest.java
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt, xctxt.getCurrentNode()); }
// in src/org/apache/xpath/CachedXPathAPI.java
public Node selectSingleNode(Node contextNode, String str) throws TransformerException { return selectSingleNode(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public Node selectSingleNode( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Have the XObject return its result as a NodeSetDTM. NodeIterator nl = selectNodeIterator(contextNode, str, namespaceNode); // Return the first node, or null return nl.nextNode(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeIterator selectNodeIterator(Node contextNode, String str) throws TransformerException { return selectNodeIterator(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeIterator selectNodeIterator( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Have the XObject return its result as a NodeSetDTM. return list.nodeset(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeList selectNodeList(Node contextNode, String str) throws TransformerException { return selectNodeList(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public NodeList selectNodeList( Node contextNode, String str, Node namespaceNode) throws TransformerException { // Execute the XPath, and have it return the result XObject list = eval(contextNode, str, namespaceNode); // Return a NodeList. return list.nodelist(); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval(Node contextNode, String str) throws TransformerException { return eval(contextNode, str, contextNode); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval(Node contextNode, String str, Node namespaceNode) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create an object to resolve namespace prefixes. // XPath namespaces are resolved from the input context node's document element // if it is a root node, or else the current context node (for lack of a better // resolution space, given the simplicity of this sample code). PrefixResolverDefault prefixResolver = new PrefixResolverDefault( (namespaceNode.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) namespaceNode).getDocumentElement() : namespaceNode); // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Execute the XPath, and have it return the result // return xpath.execute(xpathSupport, contextNode, prefixResolver); int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/CachedXPathAPI.java
public XObject eval( Node contextNode, String str, PrefixResolver prefixResolver) throws TransformerException { // Since we don't have a XML Parser involved here, install some default support // for things like namespaces, etc. // (Changed from: XPathContext xpathSupport = new XPathContext(); // because XPathContext is weak in a number of areas... perhaps // XPathContext should be done away with.) // Create the XPath object. XPath xpath = new XPath(str, null, prefixResolver, XPath.SELECT, null); // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 expressions. XPathContext xpathSupport = new XPathContext(false); // Execute the XPath, and have it return the result int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); return xpath.execute(xpathSupport, ctxtNode, prefixResolver); }
// in src/org/apache/xpath/Expression.java
public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException { // For now, the current node is already pushed. return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public XObject execute( XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException { // For now, the current node is already pushed. return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { return execute(xctxt); }
// in src/org/apache/xpath/Expression.java
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).num(); }
// in src/org/apache/xpath/Expression.java
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).bool(); }
// in src/org/apache/xpath/Expression.java
public XMLString xstr(XPathContext xctxt) throws javax.xml.transform.TransformerException { return execute(xctxt).xstr(); }
// in src/org/apache/xpath/Expression.java
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { DTMIterator iter = execute(xctxt).iter(); return iter.nextNode(); }
// in src/org/apache/xpath/Expression.java
public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
// in src/org/apache/xpath/Expression.java
public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XNodeSet nodeset = (XNodeSet)execute(xctxt); return nodeset.iterRaw(); } finally { xctxt.popCurrentNodeAndExpression(); } }
// in src/org/apache/xpath/Expression.java
public void executeCharsToContentHandler( XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException { XObject obj = execute(xctxt); obj.dispatchCharactersEvents(handler); obj.detach(); }
// in src/org/apache/xpath/Expression.java
public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHWarning(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); // TO DO: Need to get stylesheet Locator from here. eh.warning(new TransformerException(fmsg, xctxt.getSAXLocator())); } }
// in src/org/apache/xpath/Expression.java
public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException { java.lang.String fmsg = XSLMessages.createXPATHMessage(msg, args); if (null != xctxt) { ErrorListener eh = xctxt.getErrorListener(); TransformerException te = new TransformerException(fmsg, this); eh.fatalError(te); } }
110
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/xsltc/dom/DocumentCache.java
catch (TransformerException te) { // ignore }
// in src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
catch (TransformerException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { _result = null; }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { // nada }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException te) { // well, we tried. }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e2) { new TransformerConfigurationException(e2); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { // Falls through }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored - transformation cannot be continued }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { // ignored - transformation cannot be continued }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransformerException e) { if (_errorListener != null) postErrorToListener("File not found: " + e.getMessage()); return(null); }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch( TransformerException e2) { new TransformerConfigurationException(e2); }
// in src/org/apache/xalan/processor/ProcessorOutputElem.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/ProcessorInclude.java
catch(TransformerException te) { handler.error(te.getMessage(), te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/templates/ElemExtensionCall.java
catch(TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
// in src/org/apache/xalan/templates/ElemLiteralResult.java
catch (TransformerException te) { // thrown in finally to prevent original exception consumed by subsequent exceptions tException = te; }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException se) { // Ignore this for right now }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/templates/ElemUnknown.java
catch (TransformerException e) { transformer.getErrorListener().fatalError(e); }
// in src/org/apache/xalan/transformer/KeyIterator.java
catch (TransformerException se) { // TODO: What to do? }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (javax.xml.transform.TransformerException te) {te.printStackTrace();}
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException se) { return DTMWSFilter.INHERIT; }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return Double.NaN; }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { return new XNodeSet(xctxt.getDTMManager()); }
// in src/org/apache/xalan/lib/ExsltDynamic.java
catch (TransformerException e) { xctxt.popCurrentNode(); xctxt.popContextNodeList(); return new NodeSet(); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
87
            
// in src/org/apache/xml/utils/StylesheetPIHandler.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xml/serializer/ToXMLStream.java
catch (TransformerException e){ // A user defined error handler, errHandler, may throw // a TransformerException if it chooses to, and if it does // we will wrap it with a SAXException and re-throw. // Of course if the handler throws another type of // exception, like a RuntimeException, then that is OK too. SAXException se = new SAXException(e); throw se; }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { // What the hell are we supposed to do with this??? throw new IllegalArgumentException(e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerHandlerImpl.java
catch (TransformerException e) { throw new SAXException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerException e) { throw new TransformerConfigurationException(e); }
// in src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
catch (TransformerConfigurationException e1) { if (_errorListener != null) { try { _errorListener.fatalError(e1); return null; } catch (TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/xsltc/trax/SmartTransformerFactoryImpl.java
catch(TransformerConfigurationException e1) { if (_xsltcFactory == null) { createXSLTCTransformerFactory(); } ErrorListener errorListener = _xsltcFactory.getErrorListener(); if(errorListener != null) { try { errorListener.fatalError(e1); return null; } catch( TransformerException e2) { new TransformerConfigurationException(e2); } } throw e1; }
// in src/org/apache/xalan/processor/ProcessorCharacters.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorTemplateElem.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/ProcessorLRE.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), se); //"processFromNode failed", se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); } catch (TransformerConfigurationException ex) { throw ex; } catch (TransformerException ex) { throw new TransformerConfigurationException(ex); } return null; } else { // Should remove this later... but right now diagnostics from // TransformerConfigurationException are not good. // se.printStackTrace(); throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_PROCESSFROMNODE_FAILED, null), e); //"processFromNode failed", //e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex) { throw new TransformerConfigurationException(ex); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch (TransformerConfigurationException ex1 ) { throw ex1; } catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1 ) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerConfigurationException ex ) { if( m_errorListener != null ) { try { m_errorListener.fatalError( ex ); return null; } catch( TransformerConfigurationException ex1 ) { throw ex1; } catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); } } throw ex; }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch( TransformerException ex1 ) { throw new TransformerConfigurationException( ex1 ); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (org.xml.sax.SAXException se) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(se)); } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(se.getMessage(), se); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (Exception e) { if (m_errorListener != null) { try { m_errorListener.fatalError(new TransformerException(e)); return null; } catch (TransformerConfigurationException ex1) { throw ex1; } catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); } } else { throw new TransformerConfigurationException(e.getMessage(), e); } }
// in src/org/apache/xalan/processor/TransformerFactoryImpl.java
catch (TransformerException ex1) { throw new TransformerConfigurationException(ex1); }
// in src/org/apache/xalan/processor/ProcessorAttributeSet.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { // thrown by AVT constructor throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/XSLTAttributeDef.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/processor/StylesheetHandler.java
catch (TransformerException te) { throw new org.xml.sax.SAXParseException(te.getMessage(), locator, te); }
// in src/org/apache/xalan/processor/ProcessorStylesheetElement.java
catch(TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch(TransformerException te) { throw new TransformerException(te); }
// in src/org/apache/xalan/templates/StylesheetRoot.java
catch (TransformerException se) { throw new TransformerConfigurationException(XSLMessages.createMessage(XSLTErrorResources.ER_CANNOT_INIT_DEFAULT_TEMPLATES, null), se); //"Can't init default templates!", se); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch (javax.xml.transform.TransformerException te) { throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set"); }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TransformerHandlerImpl.java
catch(javax.xml.transform.TransformerException te) { throw e; }
// in src/org/apache/xalan/transformer/TreeWalker2Result.java
catch(javax.xml.transform.TransformerException te) { throw new org.xml.sax.SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te.getMessage(), te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch(TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new SAXException(te); }
// in src/org/apache/xalan/lib/Redirect.java
catch(TransformerException te) { throw new javax.xml.transform.TransformerException(te); }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
catch (javax.xml.transform.TransformerException e) { throw e; }
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
// in src/org/apache/xalan/extensions/ExtensionHandlerExsltFunction.java
catch (TransformerException e) { throw e; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/XPath.java
catch (TransformerException te) { te.setLocator(this.getLocator()); ErrorListener el = xctxt.getErrorListener(); if(null != el) // defensive, should never happen. { el.error(te); } else throw te; }
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/MatchPatternIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/FilterExprWalker.java
catch (javax.xml.transform.TransformerException se) { throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/axes/UnionChildIterator.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix this. throw new RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
// in src/org/apache/xpath/patterns/StepPattern.java
catch (javax.xml.transform.TransformerException se) { // TODO: should keep throw sax exception... throw new java.lang.RuntimeException(se.getMessage()); }
8
unknown (Lib) TransformerFactoryConfigurationError 0 0 0 1
            
// in src/org/apache/xalan/xslt/Process.java
catch (TransformerFactoryConfigurationError pfe) { pfe.printStackTrace(dumpWriter); // "XSL Process was not successful."); msg = XSLMessages.createMessage( XSLTErrorResources.ER_NOT_SUCCESSFUL, null); diagnosticsWriter.println(msg); tfactory = null; // shut up compiler doExit(msg); }
0 0
unknown (Domain) TransletException
public final class TransletException extends SAXException {
    static final long serialVersionUID = -878916829521217293L;

    public TransletException() {
	super("Translet error");
    }
    
    public TransletException(Exception e) {
	super(e.toString());
    }
    
    public TransletException(String message) {
	super(message);
    }
}
12
            
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename, boolean append) throws TransletException { try { final TransletOutputHandlerFactory factory = TransletOutputHandlerFactory.newInstance(); String dirStr = new File(filename).getParent(); if ((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } factory.setEncoding(_encoding); factory.setOutputMethod(_method); factory.setWriter(new FileWriter(filename, append)); factory.setOutputType(TransletOutputHandlerFactory.STREAM); final SerializationHandler handler = factory.getSerializationHandler(); transferOutputSettings(handler); handler.startDocument(); return handler; } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void characters(final String string, SerializationHandler handler) throws TransletException { if (string != null) { //final int length = string.length(); try { handler.characters(string); } catch (Exception e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { int nodeID = getNodeIdent(node); if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) { boolean escapeBit = false; boolean oldEscapeSetting = false; try { for (int i = 0; i < _size; i++) { if (_dontEscape != null) { escapeBit = _dontEscape.getBit(i); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } handler.characters(_textArray[i]); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } } } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
private static DTMAxisIterator document(String uri, String base, AbstractTranslet translet, DOM dom, boolean cacheDOM) throws Exception { try { final String originalUri = uri; MultiDOM multiplexer = (MultiDOM)dom; // Prepend URI base to URI (from context) if (base != null && base.length() != 0) { uri = SystemIDResolver.getAbsoluteURI(uri, base); } // Return an empty iterator if the URI is clearly invalid // (to prevent some unncessary MalformedURL exceptions). if (uri == null || uri.length() == 0) { return(EmptyIterator.getInstance()); } // Check if this DOM has already been added to the multiplexer int mask = multiplexer.getDocumentMask(uri); if (mask != -1) { DOM newDom = ((DOMAdapter)multiplexer.getDOMAdapter(uri)) .getDOMImpl(); if (newDom instanceof DOMEnhancedForDTM) { return new SingletonIterator(((DOMEnhancedForDTM)newDom) .getDocument(), true); } } // Check if we can get the DOM from a DOMCache DOMCache cache = translet.getDOMCache(); DOM newdom; mask = multiplexer.nextMask(); // peek if (cache != null) { newdom = cache.retrieveDocument(base, originalUri, translet); if (newdom == null) { final Exception e = new FileNotFoundException(originalUri); throw new TransletException(e); } } else { // Parse the input document and construct DOM object // Trust the DTMManager to pick the right parser and // set up the DOM correctly. XSLTCDTMManager dtmManager = (XSLTCDTMManager)multiplexer .getDTMManager(); DOMEnhancedForDTM enhancedDOM = (DOMEnhancedForDTM) dtmManager.getDTM(new StreamSource(uri), false, null, true, false, translet.hasIdCall(), cacheDOM); newdom = enhancedDOM; // Cache the stylesheet DOM in the Templates object if (cacheDOM) { TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); if (templates != null) { templates.setStylesheetDOM(enhancedDOM); } } translet.prepassDocument(enhancedDOM); enhancedDOM.setDocumentURI(uri); } // Wrap the DOM object in a DOM adapter and add to multiplexer final DOMAdapter domAdapter = translet.makeDOMAdapter(newdom); multiplexer.addDOMAdapter(domAdapter); // Create index for any key elements translet.buildKeys(domAdapter, null, null, newdom.getDocument()); // Return a singleton iterator containing the root node return new SingletonIterator(newdom.getDocument(), true); } catch (Exception e) { throw e; } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { try { dispatchCharactersEvents(node, handler, false); } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private final void copy(final int node, SerializationHandler handler, boolean isChild) throws TransletException { int nodeID = makeNodeIdentity(node); int eType = _exptype2(nodeID); int type = _exptype2Type(eType); try { switch(type) { case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: for(int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } break; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); break; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); break; case DTM.TEXT_NODE: boolean oldEscapeSetting = false; boolean escapeBit = false; if (_dontEscape != null) { escapeBit = _dontEscape.getBit(getNodeIdent(node)); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } copyTextNode(nodeID, handler); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } break; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, eType, handler); break; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); break; default: if (type == DTM.ELEMENT_NODE) { // Start element definition final String name = copyElement(nodeID, eType, handler); //if(isChild) => not to copy any namespaces from parents // else copy all namespaces in scope copyNS(nodeID, handler,!isChild); copyAttributes(nodeID, handler); // Copy element children for (int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } // Close element definition handler.endElement(name); } // Shallow copy of attribute to output handler else { final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); } break; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void copyPI(final int node, SerializationHandler handler) throws TransletException { final String target = getNodeName(node); final String value = getStringValueX(node); try { handler.processingInstruction(target, value); } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { int nodeID = makeNodeIdentity(node); int exptype = _exptype2(nodeID); int type = _exptype2Type(exptype); try { switch(type) { case DTM.ELEMENT_NODE: final String name = copyElement(nodeID, exptype, handler); copyNS(nodeID, handler, true); return name; case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: return EMPTYSTRING; case DTM.TEXT_NODE: copyTextNode(nodeID, handler); return null; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); return null; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); return null; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); return null; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, exptype, handler); return null; default: final String uri1 = getNamespaceName(node); if (uri1.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri1); } handler.addAttribute(getNodeName(node), getNodeValue(node)); return null; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
public final void initialize(int node, int last, DOM dom, SortSettings settings) throws TransletException { _dom = dom; _node = node; _last = last; _settings = settings; int levels = settings.getSortOrders().length; _values = new Object[levels]; // -- W. Eliot Kimber (eliot@isogen.com) String colFactClassname = System.getProperty("org.apache.xalan.xsltc.COLLATOR_FACTORY"); if (colFactClassname != null) { try { Object candObj = ObjectFactory.findProviderClass( colFactClassname, ObjectFactory.findClassLoader(), true); _collatorFactory = (CollatorFactory)candObj; } catch (ClassNotFoundException e) { throw new TransletException(e); } Locale[] locales = settings.getLocales(); _collators = new Collator[levels]; for (int i = 0; i < levels; i++){ _collators[i] = _collatorFactory.getCollator(locales[i]); } _collator = _collators[0]; } else { _collators = settings.getCollators(); _collator = _collators[0]; } }
11
            
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (SAXException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
catch (Exception e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
catch (ClassNotFoundException e) { throw new TransletException(e); }
40
            
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final DOMAdapter makeDOMAdapter(DOM dom) throws TransletException { setRootForKeys(dom.getDocument()); return new DOMAdapter(dom, namesArray, urisArray, typesArray, namespaceArray); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public void buildKeys(DOM document, DTMAxisIterator iterator, SerializationHandler handler, int root) throws TransletException { }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename, boolean append) throws TransletException { try { final TransletOutputHandlerFactory factory = TransletOutputHandlerFactory.newInstance(); String dirStr = new File(filename).getParent(); if ((null != dirStr) && (dirStr.length() > 0)) { File dir = new File(dirStr); dir.mkdirs(); } factory.setEncoding(_encoding); factory.setOutputMethod(_method); factory.setWriter(new FileWriter(filename, append)); factory.setOutputType(TransletOutputHandlerFactory.STREAM); final SerializationHandler handler = factory.getSerializationHandler(); transferOutputSettings(handler); handler.startDocument(); return handler; } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public SerializationHandler openOutputHandler(String filename) throws TransletException { return openOutputHandler(filename, false); }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void transform(DOM document, SerializationHandler handler) throws TransletException { try { transform(document, document.getIterator(), handler); } finally { _keyIndexes = null; } }
// in src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java
public final void characters(final String string, SerializationHandler handler) throws TransletException { if (string != null) { //final int length = string.length(); try { handler.characters(string); } catch (Exception e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { characters(node, handler); }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { characters(node, handler); return null; }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { int nodeID = getNodeIdent(node); if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) { boolean escapeBit = false; boolean oldEscapeSetting = false; try { for (int i = 0; i < _size; i++) { if (_dontEscape != null) { escapeBit = _dontEscape.getBit(i); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } handler.characters(_textArray[i]); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } } } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SimpleResultTreeImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { return null; }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg1, DTMAxisIterator arg2, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { String baseURI = null; final int arg2FirstNode = arg2.next(); if (arg2FirstNode == DTMAxisIterator.END) { // the second argument node-set is empty return EmptyIterator.getInstance(); } else { //System.err.println("arg2FirstNode name: " // + dom.getNodeName(arg2FirstNode )+"[" // +Integer.toHexString(arg2FirstNode )+"]"); baseURI = dom.getDocumentURI(arg2FirstNode); if (!SystemIDResolver.isAbsoluteURI(baseURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(baseURI); } try { if (arg1 instanceof String) { if (((String)arg1).length() == 0) { return document(xslURI, "", translet, dom); } else { return document((String)arg1, baseURI, translet, dom); } } else if (arg1 instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg1, baseURI, translet, dom); } else { final String err = "document("+arg1.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/LoadDocument.java
public static DTMAxisIterator documentF(Object arg, String xslURI, AbstractTranslet translet, DOM dom) throws TransletException { try { if (arg instanceof String) { if (xslURI == null ) xslURI = ""; String baseURI = xslURI; if (!SystemIDResolver.isAbsoluteURI(xslURI)) baseURI = SystemIDResolver.getAbsoluteURIFromRelative(xslURI); String href = (String)arg; if (href.length() == 0) { href = ""; // %OPT% Optimization to cache the stylesheet DOM. // The stylesheet DOM is built once and cached // in the Templates object. TemplatesImpl templates = (TemplatesImpl)translet.getTemplates(); DOM sdom = null; if (templates != null) { sdom = templates.getStylesheetDOM(); } // If the cached dom exists, we need to migrate it // to the new DTMManager and create a DTMAxisIterator // for the document. if (sdom != null) { return document(sdom, translet, dom); } else { return document(href, baseURI, translet, dom, true); } } else { return document(href, baseURI, translet, dom); } } else if (arg instanceof DTMAxisIterator) { return document((DTMAxisIterator)arg, null, translet, dom); } else { final String err = "document("+arg.toString()+")"; throw new IllegalArgumentException(err); } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void copy(final int node, SerializationHandler handler) throws TransletException { _dom.copy(node, handler); }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void copy(DTMAxisIterator nodes,SerializationHandler handler) throws TransletException { _dom.copy(nodes, handler); }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (_enhancedDOM != null) { return _enhancedDOM.shallowCopy(node, handler); } else { return _dom.shallowCopy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public void characters(final int textNode, SerializationHandler handler) throws TransletException { if (_enhancedDOM != null) { _enhancedDOM.characters(textNode, handler); } else { _dom.characters(textNode, handler); } }
// in src/org/apache/xalan/xsltc/dom/DOMAdapter.java
public String lookupNamespace(int node, String prefix) throws TransletException { return _dom.lookupNamespace(node, prefix); }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.copy(node, handler); } else { super.copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.copy(nodes, handler); } else { super.copy(nodes, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { return _dom.shallowCopy(node, handler); } else { return super.shallowCopy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (_dom != null) { _dom.characters(node, handler); } else { super.characters(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/AdaptiveResultTreeImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { if (_dom != null) { return _dom.lookupNamespace(node, prefix); } else { return super.lookupNamespace(node, prefix); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String lookupNamespace(int node, String prefix) throws TransletException { int anode, nsnode; final AncestorIterator ancestors = new AncestorIterator(); if (isElement(node)) { ancestors.includeSelf(); } ancestors.setStartNode(node); while ((anode = ancestors.next()) != DTM.NULL) { final NamespaceIterator namespaces = new NamespaceIterator(); namespaces.setStartNode(anode); while ((nsnode = namespaces.next()) != DTM.NULL) { if (getLocalName(nsnode).equals(prefix)) { return getNodeValue(nsnode); } } } BasisLibrary.runTimeError(BasisLibrary.NAMESPACE_PREFIX_ERR, prefix); return null; }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void characters(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { try { dispatchCharactersEvents(node, handler, false); } catch (SAXException e) { throw new TransletException(e); } } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(SerializationHandler handler) throws TransletException { copy(getDocument(), handler); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public void copy(final int node, SerializationHandler handler) throws TransletException { copy(node, handler, false ); }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private final void copy(final int node, SerializationHandler handler, boolean isChild) throws TransletException { int nodeID = makeNodeIdentity(node); int eType = _exptype2(nodeID); int type = _exptype2Type(eType); try { switch(type) { case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: for(int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } break; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); break; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); break; case DTM.TEXT_NODE: boolean oldEscapeSetting = false; boolean escapeBit = false; if (_dontEscape != null) { escapeBit = _dontEscape.getBit(getNodeIdent(node)); if (escapeBit) { oldEscapeSetting = handler.setEscaping(false); } } copyTextNode(nodeID, handler); if (escapeBit) { handler.setEscaping(oldEscapeSetting); } break; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, eType, handler); break; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); break; default: if (type == DTM.ELEMENT_NODE) { // Start element definition final String name = copyElement(nodeID, eType, handler); //if(isChild) => not to copy any namespaces from parents // else copy all namespaces in scope copyNS(nodeID, handler,!isChild); copyAttributes(nodeID, handler); // Copy element children for (int c = _firstch2(nodeID); c != DTM.NULL; c = _nextsib2(c)) { copy(makeNodeHandle(c), handler, true); } // Close element definition handler.endElement(name); } // Shallow copy of attribute to output handler else { final String uri = getNamespaceName(node); if (uri.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri); } handler.addAttribute(getNodeName(node), getNodeValue(node)); } break; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
private void copyPI(final int node, SerializationHandler handler) throws TransletException { final String target = getNodeName(node); final String value = getStringValueX(node); try { handler.processingInstruction(target, value); } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/SAXImpl.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { int nodeID = makeNodeIdentity(node); int exptype = _exptype2(nodeID); int type = _exptype2Type(exptype); try { switch(type) { case DTM.ELEMENT_NODE: final String name = copyElement(nodeID, exptype, handler); copyNS(nodeID, handler, true); return name; case DTM.ROOT_NODE: case DTM.DOCUMENT_NODE: return EMPTYSTRING; case DTM.TEXT_NODE: copyTextNode(nodeID, handler); return null; case DTM.PROCESSING_INSTRUCTION_NODE: copyPI(node, handler); return null; case DTM.COMMENT_NODE: handler.comment(getStringValueX(node)); return null; case DTM.NAMESPACE_NODE: handler.namespaceAfterStartElement(getNodeNameX(node), getNodeValue(node)); return null; case DTM.ATTRIBUTE_NODE: copyAttribute(nodeID, exptype, handler); return null; default: final String uri1 = getNamespaceName(node); if (uri1.length() != 0) { final String prefix = getPrefix(node); handler.namespaceAfterStartElement(prefix, uri1); } handler.addAttribute(getNodeName(node), getNodeValue(node)); return null; } } catch (Exception e) { throw new TransletException(e); } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecord.java
public final void initialize(int node, int last, DOM dom, SortSettings settings) throws TransletException { _dom = dom; _node = node; _last = last; _settings = settings; int levels = settings.getSortOrders().length; _values = new Object[levels]; // -- W. Eliot Kimber (eliot@isogen.com) String colFactClassname = System.getProperty("org.apache.xalan.xsltc.COLLATOR_FACTORY"); if (colFactClassname != null) { try { Object candObj = ObjectFactory.findProviderClass( colFactClassname, ObjectFactory.findClassLoader(), true); _collatorFactory = (CollatorFactory)candObj; } catch (ClassNotFoundException e) { throw new TransletException(e); } Locale[] locales = settings.getLocales(); _collators = new Collator[levels]; for (int i = 0; i < levels; i++){ _collators[i] = _collatorFactory.getCollator(locales[i]); } _collator = _collators[0]; } else { _collators = settings.getCollators(); _collator = _collators[0]; } }
// in src/org/apache/xalan/xsltc/dom/NodeSortRecordFactory.java
public NodeSortRecord makeNodeSortRecord(int node, int last) throws ExceptionInInitializerError, LinkageError, IllegalAccessException, InstantiationException, SecurityException, TransletException { final NodeSortRecord sortRecord = (NodeSortRecord)_class.newInstance(); sortRecord.initialize(node, last, _dom, _sortSettings); return sortRecord; }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void copy(final int node, SerializationHandler handler) throws TransletException { if (node != DTM.NULL) { _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void copy(DTMAxisIterator nodes, SerializationHandler handler) throws TransletException { int node; while ((node = nodes.next()) != DTM.NULL) { _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].copy(node, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public String shallowCopy(final int node, SerializationHandler handler) throws TransletException { if (node == DTM.NULL) { return ""; } return _adapters[node >>> DTMManager.IDENT_DTM_NODE_BITS].shallowCopy(node, handler); }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public void characters(final int textNode, SerializationHandler handler) throws TransletException { if (textNode != DTM.NULL) { _adapters[textNode >>> DTMManager.IDENT_DTM_NODE_BITS].characters(textNode, handler); } }
// in src/org/apache/xalan/xsltc/dom/MultiDOM.java
public String lookupNamespace(int node, String prefix) throws TransletException { return _main.lookupNamespace(node, prefix); }
2
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (TransletException e) { if (_debug) e.printStackTrace(); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ e.getMessage()); }
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (TransletException e) { if (_errorListener != null) postErrorToListener(e.getMessage()); throw new TransformerException(e); }
0
checked (Domain) TypeCheckError
public class TypeCheckError extends Exception {
    static final long serialVersionUID = 3246224233917854640L;
    ErrorMsg _error = null;
    SyntaxTreeNode _node = null;
	
    public TypeCheckError(SyntaxTreeNode node) {
	super();
	_node = node;
    }

    public TypeCheckError(ErrorMsg error) {
	super();
	_error = error;
    }
	
    public TypeCheckError(String code, Object param) {
	super();
	_error = new ErrorMsg(code, param);
    }

    public TypeCheckError(String code, Object param1, Object param2) {
	super();
	_error = new ErrorMsg(code, param1, param2);
    }

    public ErrorMsg getErrorMsg() {
        return _error;
    }

    public String getMessage() {
        return toString();
    }

    public String toString() {
	String result;

	if (_error == null) {
            if (_node != null) {
                _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_ERR,
                                      _node.toString());
	    } else {
	        _error = new ErrorMsg(ErrorMsg.TYPE_CHECK_UNK_LOC_ERR);
	    }
        }

	return _error.toString();
    }
}
34
            
// in src/org/apache/xalan/xsltc/compiler/DocumentCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // At least one argument - two at most final int ac = argumentCount(); if ((ac < 1) || (ac > 2)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } if (getStylesheet() == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } // Parse the first argument _arg1 = argument(0); if (_arg1 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } _arg1Type = _arg1.typeCheck(stable); if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) { _arg1 = new CastExpr(_arg1, Type.String); } // Parse the second argument if (ac == 2) { _arg2 = argument(1); if (_arg2 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } final Type arg2Type = _arg2.typeCheck(stable); if (arg2Type.identicalTo(Type.Node)) { _arg2 = new CastExpr(_arg2, Type.NodeSet); } else if (arg2Type.identicalTo(Type.NodeSet)) { // falls through } else { ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argument() instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "element-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) { return _type; } if (_arg instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "function-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/NameBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check the argument type (if any) switch(argumentCount()) { case 0: _paramType = Type.Node; break; case 1: _paramType = _param.typeCheck(stable); break; default: throw new TypeCheckError(this); } // The argument has to be a node, a node-set or a node reference if ((_paramType != Type.NodeSet) && (_paramType != Type.Node) && (_paramType != Type.Reference)) { throw new TypeCheckError(this); } return (_type = Type.String); }
// in src/org/apache/xalan/xsltc/compiler/ForEach.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType || _type instanceof NodeType) { _select = new CastExpr(_select, Type.NodeSet); typeCheckContents(stable); return Type.Void; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); return Type.Void; } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ref != null) { final String name = _variableName.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR, name, this); } if ((_ref = resolve(getParser(), stable)) != null) { return (_type = _ref.typeCheck(stable)); } throw new TypeCheckError(reportError()); }
// in src/org/apache/xalan/xsltc/compiler/CastExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.getType(); if (tleft == null) { tleft = _left.typeCheck(stable); } if (tleft instanceof NodeType) { tleft = Type.Node; // multiple instances } else if (tleft instanceof ResultTreeType) { tleft = Type.ResultTree; // multiple instances } if (InternalTypeMap.maps(tleft, _type) != null) { return _type; } // throw new TypeCheckError(this); throw new TypeCheckError(new ErrorMsg( ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString())); }
// in src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); //bug fix # 2838, cast to reals if both are result tree fragments if (tleft instanceof ResultTreeType && tright instanceof ResultTreeType ) { _right = new CastExpr(_right, Type.Real); _left = new CastExpr(_left, Type.Real); return _type = Type.Boolean; } // If one is of reference type, then convert the other too if (hasReferenceArgs()) { Type type = null; Type typeL = null; Type typeR = null; if (tleft instanceof ReferenceType) { if (_left instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_left; VariableBase var = ref.getVariable(); typeL = var.getType(); } } if (tright instanceof ReferenceType) { if (_right instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_right; VariableBase var = ref.getVariable(); typeR = var.getType(); } } // bug fix # 2838 if (typeL == null) type = typeR; else if (typeR == null) type = typeL; else { type = Type.Real; } if (type == null) type = Type.Real; _right = new CastExpr(_right, type); _left = new CastExpr(_left, type); return _type = Type.Boolean; } if (hasNodeSetArgs()) { // Ensure that the node-set is the left argument if (tright instanceof NodeSetType) { final Expression temp = _right; _right = _left; _left = temp; _op = (_op == Operators.GT) ? Operators.LT : (_op == Operators.LT) ? Operators.GT : (_op == Operators.GE) ? Operators.LE : Operators.GE; tright = _right.getType(); } // Promote nodes to node sets if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // Promote integer to doubles to have fewer compares if (tright instanceof IntType) { _right = new CastExpr(_right, Type.Real); } // Promote result-trees to strings if (tright instanceof ResultTreeType) { _right = new CastExpr(_right, Type.String); } return _type = Type.Boolean; } // In the node-boolean case, convert node to boolean first if (hasNodeArgs()) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); tright = Type.Boolean; } if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); tleft = Type.Boolean; } } // Lookup the table of primops to find the best match MethodType ptype = lookupPrimop(stable, Operators.getOpNames(_op), new MethodType(Type.Void, tleft, tright)); if (ptype != null) { Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); throw new TypeCheckError(err); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError { _fname.clearNamespace(); // HACK!!! final int n = _arguments.size(); final Vector argsType = typeCheckArgs(stable); final MethodType args = new MethodType(Type.Void, argsType); final MethodType ptype = lookupPrimop(stable, _fname.getLocalPart(), args); if (ptype != null) { for (int i = 0; i < n; i++) { final Type argType = (Type) ptype.argsType().elementAt(i); final Expression exp = (Expression)_arguments.elementAt(i); if (!argType.identicalTo(exp.getType())) { try { _arguments.setElementAt(new CastExpr(exp, argType), i); } catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion } } } _chosenMethodType = ptype; return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{ final Vector constructors = findConstructors(); if (constructors == null) { // Constructor not found in this class throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND, _className); } final int nConstructors = constructors.size(); final int nArgs = _arguments.size(); final Vector argsType = typeCheckArgs(stable); // Try all constructors int bestConstrDistance = Integer.MAX_VALUE; _type = null; // reset for (int j, i = 0; i < nConstructors; i++) { // Check if all parameters to this constructor can be converted final Constructor constructor = (Constructor)constructors.elementAt(i); final Class[] paramTypes = constructor.getParameterTypes(); Class extType = null; int currConstrDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currConstrDistance += ((JavaType)match).distance; } else if (intType instanceof ObjectType) { ObjectType objectType = (ObjectType)intType; if (objectType.getJavaClass() == extType) continue; else if (extType.isAssignableFrom(objectType.getJavaClass())) currConstrDistance += 1; else { currConstrDistance = Integer.MAX_VALUE; break; } } else { // no mapping available currConstrDistance = Integer.MAX_VALUE; break; } } if (j == nArgs && currConstrDistance < bestConstrDistance ) { _chosenConstructor = constructor; _isExtConstructor = true; bestConstrDistance = currConstrDistance; _type = (_clazz != null) ? Type.newObjectType(_clazz) : Type.newObjectType(_className); } } if (_type != null) { return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError { int nArgs = _arguments.size(); final String name = _fname.getLocalPart(); // check if function is a contructor 'new' if (_fname.getLocalPart().equals("new")) { return typeCheckConstructor(stable); } // check if we are calling an instance method else { boolean hasThisArgument = false; if (nArgs == 0) _isStatic = true; if (!_isStatic) { if (_namespace_format == NAMESPACE_FORMAT_JAVA || _namespace_format == NAMESPACE_FORMAT_PACKAGE) hasThisArgument = true; Expression firstArg = (Expression)_arguments.elementAt(0); Type firstArgType = (Type)firstArg.typeCheck(stable); if (_namespace_format == NAMESPACE_FORMAT_CLASS && firstArgType instanceof ObjectType && _clazz != null && _clazz.isAssignableFrom(((ObjectType)firstArgType).getJavaClass())) hasThisArgument = true; if (hasThisArgument) { _thisArgument = (Expression) _arguments.elementAt(0); _arguments.remove(0); nArgs--; if (firstArgType instanceof ObjectType) { _className = ((ObjectType) firstArgType).getJavaClassName(); } else throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, name); } } else if (_className.length() == 0) { /* * Warn user if external function could not be resolved. * Warning will _NOT_ be issued is the call is properly * wrapped in an <xsl:if> or <xsl:when> element. For details * see If.parserContents() and When.parserContents() */ final Parser parser = getParser(); if (parser != null) { reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR, _fname.toString()); } unresolvedExternal = true; return _type = Type.Int; // use "Int" as "unknown" } } final Vector methods = findMethods(); if (methods == null) { // Method not found in this class throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name); } Class extType = null; final int nMethods = methods.size(); final Vector argsType = typeCheckArgs(stable); // Try all methods to identify the best fit int bestMethodDistance = Integer.MAX_VALUE; _type = null; // reset internal type for (int j, i = 0; i < nMethods; i++) { // Check if all paramteters to this method can be converted final Method method = (Method)methods.elementAt(i); final Class[] paramTypes = method.getParameterTypes(); int currMethodDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currMethodDistance += ((JavaType)match).distance; } else { // no mapping available // // Allow a Reference type to match any external (Java) type at // the moment. The real type checking is performed at runtime. if (intType instanceof ReferenceType) { currMethodDistance += 1; } else if (intType instanceof ObjectType) { ObjectType object = (ObjectType)intType; if (extType.getName().equals(object.getJavaClassName())) currMethodDistance += 0; else if (extType.isAssignableFrom(object.getJavaClass())) currMethodDistance += 1; else { currMethodDistance = Integer.MAX_VALUE; break; } } else { currMethodDistance = Integer.MAX_VALUE; break; } } } if (j == nArgs) { // Check if the return type can be converted extType = method.getReturnType(); _type = (Type) _java2Internal.get(extType); if (_type == null) { _type = Type.newObjectType(extType); } // Use this method if all parameters & return type match if (_type != null && currMethodDistance < bestMethodDistance) { _chosenMethod = method; bestMethodDistance = currMethodDistance; } } } // It is an error if the chosen method is an instance menthod but we don't // have a this argument. if (_chosenMethod != null && _thisArgument == null && !Modifier.isStatic(_chosenMethod.getModifiers())) { throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, getMethodSignature(argsType)); } if (_type != null) { if (_type == Type.NodeSet) { getXSLTC().setMultiDocument(true); } return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type ftype = _filterExpr.typeCheck(stable); if (ftype instanceof NodeSetType == false) { if (ftype instanceof ReferenceType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } /* else if (ftype instanceof ResultTreeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } */ else if (ftype instanceof NodeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Wrap single node path in a node set final Type ptype = _path.typeCheck(stable); if (!(ptype instanceof NodeSetType)) { _path = new CastExpr(_path, Type.NodeSet); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/StringCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int argc = argumentCount(); if (argc > 1) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(err); } if (argc > 0) { argument().typeCheck(stable); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, Ops[_op], new MethodType(Type.Void, tleft, tright)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } final Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/CastCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this)); } // The first argument must be a literal String Expression exp = argument(0); if (exp instanceof LiteralExpr) { _className = ((LiteralExpr) exp).getValue(); _type = Type.newObjectType(_className); } else { throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, getName(), this)); } // Second argument must be of type reference or object _right = argument(1); Type tright = _right.typeCheck(stable); if (tright != Type.Reference && tright instanceof ObjectType == false) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR, tright, _type, this)); } return _type; }
// in src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, "u-", new MethodType(Type.Void, tleft)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/CallTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Template template = stable.lookupTemplate(_name); if (template != null) { typeCheckContents(stable); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this); throw new TypeCheckError(err); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof NodeType || _type instanceof ReferenceType) { _select = new CastExpr(_select, Type.NodeSet); _type = Type.NodeSet; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); // with-params return Type.Void; } throw new TypeCheckError(this); } else { typeCheckContents(stable); // with-params return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/FilterExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ContainsCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Get the left and right operand types Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); // Check if the operator supports the two operand types MethodType wantType = new MethodType(Type.Void, tleft, tright); MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); // Yes, the operation is supported if (haveType != null) { // Check if left-hand side operand must be type casted Type arg1 = (Type)haveType.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) _left = new CastExpr(_left, arg1); // Check if right-hand side operand must be type casted Type arg2 = (Type) haveType.argsType().elementAt(1); if (!arg2.identicalTo(tright)) _right = new CastExpr(_right, arg1); // Return the result type for the operator we will use return _type = haveType.resultType(); } throw new TypeCheckError(this); }
1
            
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
90
            
// in src/org/apache/xalan/xsltc/compiler/DocumentCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // At least one argument - two at most final int ac = argumentCount(); if ((ac < 1) || (ac > 2)) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } if (getStylesheet() == null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(msg); } // Parse the first argument _arg1 = argument(0); if (_arg1 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } _arg1Type = _arg1.typeCheck(stable); if ((_arg1Type != Type.NodeSet) && (_arg1Type != Type.String)) { _arg1 = new CastExpr(_arg1, Type.String); } // Parse the second argument if (ac == 2) { _arg2 = argument(1); if (_arg2 == null) {// should not happened ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } final Type arg2Type = _arg2.typeCheck(stable); if (arg2Type.identicalTo(Type.Node)) { _arg2 = new CastExpr(_arg2, Type.NodeSet); } else if (arg2Type.identicalTo(Type.NodeSet)) { // falls through } else { ErrorMsg msg = new ErrorMsg(ErrorMsg.DOCUMENT_ARG_ERR, this); throw new TypeCheckError(msg); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argument() instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "element-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/Comment.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.String; }
// in src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) { return _type; } if (_arg instanceof LiteralExpr) { return _type = Type.Boolean; } ErrorMsg err = new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, "function-available", this); throw new TypeCheckError(err); }
// in src/org/apache/xalan/xsltc/compiler/NameBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check the argument type (if any) switch(argumentCount()) { case 0: _paramType = Type.Node; break; case 1: _paramType = _param.typeCheck(stable); break; default: throw new TypeCheckError(this); } // The argument has to be a node, a node-set or a node reference if ((_paramType != Type.NodeSet) && (_paramType != Type.Node) && (_paramType != Type.Reference)) { throw new TypeCheckError(this); } return (_type = Type.String); }
// in src/org/apache/xalan/xsltc/compiler/DecimalFormatting.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/XslAttribute.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (!_ignore) { _name.typeCheck(stable); if (_namespace != null) { _namespace.typeCheck(stable); } typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Variable.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check the 'select' expression if present if (_select != null) { _type = _select.typeCheck(stable); } // Type check the element contents otherwise else if (hasContents()) { typeCheckContents(stable); _type = Type.ResultTree; } else { _type = Type.Reference; } // The return type is void as the variable element does not leave // anything on the JVM's stack. The '_type' global will be returned // by the references to this variable, and not by the variable itself. return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ForEach.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType || _type instanceof NodeType) { _select = new CastExpr(_select, Type.NodeSet); typeCheckContents(stable); return Type.Void; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); return Type.Void; } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/When.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check the test expression if (_test.typeCheck(stable) instanceof BooleanType == false) { _test = new CastExpr(_test, Type.Boolean); } // Type-check the contents (if necessary) if (!_ignore) { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/VariableRefBase.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Returned cached type if available if (_type != null) return _type; // Find nearest closure to add a variable reference if (_variable.isLocal()) { SyntaxTreeNode node = getParent(); do { if (node instanceof Closure) { _closure = (Closure) node; break; } if (node instanceof TopLevelElement) { break; // way up in the tree } node = node.getParent(); } while (node != null); if (_closure != null) { _closure.addVariable(this); } } // Attempt to get the cached variable type _type = _variable.getType(); // If that does not work we must force a type-check (this is normally // only needed for globals in included/imported stylesheets if (_type == null) { _variable.typeCheck(stable); _type = _variable.getType(); } // If in a top-level element, create dependency to the referenced var addParentDependency(); // Return the type of the referenced variable return _type; }
// in src/org/apache/xalan/xsltc/compiler/AncestorPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_left != null) { _left.typeCheck(stable); } return _right.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/AbsoluteLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_path != null) { final Type ptype = _path.typeCheck(stable); if (ptype instanceof NodeType) { // promote to node-set _path = new CastExpr(_path, Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ParentPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _left.typeCheck(stable); return _right.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/BooleanCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _arg.typeCheck(stable); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Fallback.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_active) { return(typeCheckContents(stable)); } else { return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/StepPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (hasPredicates()) { // Type check all the predicates (e -> position() = e) final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Predicate pred = (Predicate)_predicates.elementAt(i); pred.typeCheck(stable); } // Analyze context cases _contextCase = analyzeCases(); Step step = null; // Create an instance of Step to do the translation if (_contextCase == SIMPLE_CONTEXT) { Predicate pred = (Predicate)_predicates.elementAt(0); if (pred.isNthPositionFilter()) { _contextCase = GENERAL_CONTEXT; step = new Step(_axis, _nodeType, _predicates); } else { step = new Step(_axis, _nodeType, null); } } else if (_contextCase == GENERAL_CONTEXT) { final int len = _predicates.size(); for (int i = 0; i < len; i++) { ((Predicate)_predicates.elementAt(i)).dontOptimize(); } step = new Step(_axis, _nodeType, _predicates); } if (step != null) { step.setParser(getParser()); step.typeCheck(stable); _step = step; } } return _axis == Axis.CHILD ? Type.Element : Type.Attribute; }
// in src/org/apache/xalan/xsltc/compiler/AlternativePattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _left.typeCheck(stable); _right.typeCheck(stable); return null; }
// in src/org/apache/xalan/xsltc/compiler/LangCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _langType = _lang.typeCheck(stable); if (!(_langType instanceof StringType)) { _lang = new CastExpr(_lang, Type.String); } return Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Param.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof ReferenceType == false && !(_type instanceof ObjectType)) { _select = new CastExpr(_select, Type.Reference); } } else if (hasContents()) { typeCheckContents(stable); } _type = Type.Reference; // This element has no type (the parameter does, but the parameter // element itself does not). return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/XslElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (!_ignore) { _name.typeCheck(stable); if (_namespace != null) { _namespace.typeCheck(stable); } } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnresolvedRef.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ref != null) { final String name = _variableName.toString(); ErrorMsg err = new ErrorMsg(ErrorMsg.CIRCULAR_VARIABLE_ERR, name, this); } if ((_ref = resolve(getParser(), stable)) != null) { return (_type = _ref.typeCheck(stable)); } throw new TypeCheckError(reportError()); }
// in src/org/apache/xalan/xsltc/compiler/LiteralExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/CastExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.getType(); if (tleft == null) { tleft = _left.typeCheck(stable); } if (tleft instanceof NodeType) { tleft = Type.Node; // multiple instances } else if (tleft instanceof ResultTreeType) { tleft = Type.ResultTree; // multiple instances } if (InternalTypeMap.maps(tleft, _type) != null) { return _type; } // throw new TypeCheckError(this); throw new TypeCheckError(new ErrorMsg( ErrorMsg.DATA_CONVERSION_ERR, tleft.toString(), _type.toString())); }
// in src/org/apache/xalan/xsltc/compiler/ParentLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { stype = _step.typeCheck(stable); _path.typeCheck(stable); if (_axisMismatch) enableNodeOrdering(); return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/FormatNumberCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Inform stylesheet to instantiate a DecimalFormat object getStylesheet().numberFormattingUsed(); final Type tvalue = _value.typeCheck(stable); if (tvalue instanceof RealType == false) { _value = new CastExpr(_value, Type.Real); } final Type tformat = _format.typeCheck(stable); if (tformat instanceof StringType == false) { _format = new CastExpr(_format, Type.String); } if (argumentCount() == 3) { final Type tname = _name.typeCheck(stable); if (_name instanceof LiteralExpr) { final LiteralExpr literal = (LiteralExpr) _name; _resolvedQName = getParser().getQNameIgnoreDefaultNs(literal.getValue()); } else if (tname instanceof StringType == false) { _name = new CastExpr(_name, Type.String); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/Import.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnionPathExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int length = _components.length; for (int i = 0; i < length; i++) { if (_components[i].typeCheck(stable) != Type.NodeSet) { _components[i] = new CastExpr(_components[i], Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/NamespaceAlias.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Whitespace.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; // We don't return anything. }
// in src/org/apache/xalan/xsltc/compiler/AttributeSet.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_ignore) return (Type.Void); // _mergeSet Point to any previous definition of this attribute set _mergeSet = stable.addAttributeSet(this); _method = AttributeSetPrefix + getXSLTC().nextAttributeSetSerial(); if (_useSets != null) _useSets.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Stylesheet.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int count = _globals.size(); for (int i = 0; i < count; i++) { final VariableBase var = (VariableBase)_globals.elementAt(i); var.typeCheck(stable); } return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/NumberCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (argumentCount() > 0) { argument().typeCheck(stable); } return _type = Type.Real; }
// in src/org/apache/xalan/xsltc/compiler/UnsupportedElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_fallbacks != null) { int count = _fallbacks.size(); for (int i = 0; i < count; i++) { Fallback fallback = (Fallback)_fallbacks.elementAt(i); fallback.typeCheck(stable); } } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Copy.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_useSets != null) { _useSets.typeCheck(stable); } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/SyntaxTreeNode.java
protected Type typeCheckContents(SymbolTable stable) throws TypeCheckError { final int n = elementCount(); for (int i = 0; i < n; i++) { SyntaxTreeNode item = (SyntaxTreeNode)_contents.elementAt(i); item.typeCheck(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Key.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type check match pattern _match.typeCheck(stable); // Cast node values to string values (except for nodesets) _useType = _use.typeCheck(stable); if (_useType instanceof StringType == false && _useType instanceof NodeSetType == false) { _use = new CastExpr(_use, Type.String); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilteredAbsoluteLocationPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_path != null) { final Type ptype = _path.typeCheck(stable); if (ptype instanceof NodeType) { // promote to node-set _path = new CastExpr(_path, Type.NodeSet); } } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/RelationalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); //bug fix # 2838, cast to reals if both are result tree fragments if (tleft instanceof ResultTreeType && tright instanceof ResultTreeType ) { _right = new CastExpr(_right, Type.Real); _left = new CastExpr(_left, Type.Real); return _type = Type.Boolean; } // If one is of reference type, then convert the other too if (hasReferenceArgs()) { Type type = null; Type typeL = null; Type typeR = null; if (tleft instanceof ReferenceType) { if (_left instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_left; VariableBase var = ref.getVariable(); typeL = var.getType(); } } if (tright instanceof ReferenceType) { if (_right instanceof VariableRefBase) { VariableRefBase ref = (VariableRefBase)_right; VariableBase var = ref.getVariable(); typeR = var.getType(); } } // bug fix # 2838 if (typeL == null) type = typeR; else if (typeR == null) type = typeL; else { type = Type.Real; } if (type == null) type = Type.Real; _right = new CastExpr(_right, type); _left = new CastExpr(_left, type); return _type = Type.Boolean; } if (hasNodeSetArgs()) { // Ensure that the node-set is the left argument if (tright instanceof NodeSetType) { final Expression temp = _right; _right = _left; _left = temp; _op = (_op == Operators.GT) ? Operators.LT : (_op == Operators.LT) ? Operators.GT : (_op == Operators.GE) ? Operators.LE : Operators.GE; tright = _right.getType(); } // Promote nodes to node sets if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // Promote integer to doubles to have fewer compares if (tright instanceof IntType) { _right = new CastExpr(_right, Type.Real); } // Promote result-trees to strings if (tright instanceof ResultTreeType) { _right = new CastExpr(_right, Type.String); } return _type = Type.Boolean; } // In the node-boolean case, convert node to boolean first if (hasNodeArgs()) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); tright = Type.Boolean; } if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); tleft = Type.Boolean; } } // Lookup the table of primops to find the best match MethodType ptype = lookupPrimop(stable, Operators.getOpNames(_op), new MethodType(Type.Void, tleft, tright)); if (ptype != null) { Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/ApplyImports.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); // with-params return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Sort.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tselect = _select.typeCheck(stable); // If the sort data-type is not set we use the natural data-type // of the data we will sort if (!(tselect instanceof StringType)) { _select = new CastExpr(_select, Type.String); } _order.typeCheck(stable); _caseOrder.typeCheck(stable); _dataType.typeCheck(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/AbsolutePathPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _left == null ? Type.Root : _left.typeCheck(stable); }
// in src/org/apache/xalan/xsltc/compiler/Number.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_value != null) { Type tvalue = _value.typeCheck(stable); if (tvalue instanceof RealType == false) { _value = new CastExpr(_value, Type.Real); } } if (_count != null) { _count.typeCheck(stable); } if (_from != null) { _from.typeCheck(stable); } if (_format != null) { _format.typeCheck(stable); } if (_lang != null) { _lang.typeCheck(stable); } if (_letterValue != null) { _letterValue.typeCheck(stable); } if (_groupingSeparator != null) { _groupingSeparator.typeCheck(stable); } if (_groupingSize != null) { _groupingSize.typeCheck(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Predicate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type texp = _exp.typeCheck(stable); // We need explicit type information for reference types - no good! if (texp instanceof ReferenceType) { _exp = new CastExpr(_exp, texp = Type.Real); } // A result tree fragment should not be cast directly to a number type, // but rather to a boolean value, and then to a numer (0 or 1). // Ref. section 11.2 of the XSLT 1.0 spec if (texp instanceof ResultTreeType) { _exp = new CastExpr(_exp, Type.Boolean); _exp = new CastExpr(_exp, Type.Real); texp = _exp.typeCheck(stable); } // Numerical types will be converted to a position filter if (texp instanceof NumberType) { // Cast any numerical types to an integer if (texp instanceof IntType == false) { _exp = new CastExpr(_exp, Type.Int); } if (_canOptimize) { // Nth position optimization. Expression must not depend on context _nthPositionFilter = !_exp.hasLastCall() && !_exp.hasPositionCall(); // _nthDescendant optimization - only if _nthPositionFilter is on if (_nthPositionFilter) { SyntaxTreeNode parent = getParent(); _nthDescendant = (parent instanceof Step) && (parent.getParent() instanceof AbsoluteLocationPath); return _type = Type.NodeSet; } } // Reset optimization flags _nthPositionFilter = _nthDescendant = false; // Otherwise, expand [e] to [position() = e] final QName position = getParser().getQNameIgnoreDefaultNs("position"); final PositionCall positionCall = new PositionCall(position); positionCall.setParser(getParser()); positionCall.setParent(this); _exp = new EqualityExpr(Operators.EQ, positionCall, _exp); if (_exp.typeCheck(stable) != Type.Boolean) { _exp = new CastExpr(_exp, Type.Boolean); } return _type = Type.Boolean; } else { // All other types will be handled as boolean values if (texp instanceof BooleanType == false) { _exp = new CastExpr(_exp, Type.Boolean); } return _type = Type.Boolean; } }
// in src/org/apache/xalan/xsltc/compiler/StartsWithCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); throw new TypeCheckError(err); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Template.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_pattern != null) { _pattern.typeCheck(stable); } return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/BooleanExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _type = Type.Boolean; return _type; }
// in src/org/apache/xalan/xsltc/compiler/AttributeValueTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Vector contents = getContents(); final int n = contents.size(); for (int i = 0; i < n; i++) { final Expression exp = (Expression)contents.elementAt(i); if (!exp.typeCheck(stable).identicalTo(Type.String)) { contents.setElementAt(new CastExpr(exp, Type.String), i); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_type != null) return _type; final String namespace = _fname.getNamespace(); String local = _fname.getLocalPart(); if (isExtension()) { _fname = new QName(null, null, local); return typeCheckStandard(stable); } else if (isStandard()) { return typeCheckStandard(stable); } // Handle extension functions (they all have a namespace) else { try { _className = getClassNameFromUri(namespace); final int pos = local.lastIndexOf('.'); if (pos > 0) { _isStatic = true; if (_className != null && _className.length() > 0) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; _className = _className + "." + local.substring(0, pos); } else { _namespace_format = NAMESPACE_FORMAT_JAVA; _className = local.substring(0, pos); } _fname = new QName(namespace, null, local.substring(pos + 1)); } else { if (_className != null && _className.length() > 0) { try { _clazz = ObjectFactory.findProviderClass( _className, ObjectFactory.findClassLoader(), true); _namespace_format = NAMESPACE_FORMAT_CLASS; } catch (ClassNotFoundException e) { _namespace_format = NAMESPACE_FORMAT_PACKAGE; } } else _namespace_format = NAMESPACE_FORMAT_JAVA; if (local.indexOf('-') > 0) { local = replaceDash(local); } String extFunction = (String)_extensionFunctionTable.get(namespace + ":" + local); if (extFunction != null) { _fname = new QName(null, null, extFunction); return typeCheckStandard(stable); } else _fname = new QName(namespace, null, local); } return typeCheckExternal(stable); } catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; } } }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError { _fname.clearNamespace(); // HACK!!! final int n = _arguments.size(); final Vector argsType = typeCheckArgs(stable); final MethodType args = new MethodType(Type.Void, argsType); final MethodType ptype = lookupPrimop(stable, _fname.getLocalPart(), args); if (ptype != null) { for (int i = 0; i < n; i++) { final Type argType = (Type) ptype.argsType().elementAt(i); final Expression exp = (Expression)_arguments.elementAt(i); if (!argType.identicalTo(exp.getType())) { try { _arguments.setElementAt(new CastExpr(exp, argType), i); } catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion } } } _chosenMethodType = ptype; return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError{ final Vector constructors = findConstructors(); if (constructors == null) { // Constructor not found in this class throw new TypeCheckError(ErrorMsg.CONSTRUCTOR_NOT_FOUND, _className); } final int nConstructors = constructors.size(); final int nArgs = _arguments.size(); final Vector argsType = typeCheckArgs(stable); // Try all constructors int bestConstrDistance = Integer.MAX_VALUE; _type = null; // reset for (int j, i = 0; i < nConstructors; i++) { // Check if all parameters to this constructor can be converted final Constructor constructor = (Constructor)constructors.elementAt(i); final Class[] paramTypes = constructor.getParameterTypes(); Class extType = null; int currConstrDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currConstrDistance += ((JavaType)match).distance; } else if (intType instanceof ObjectType) { ObjectType objectType = (ObjectType)intType; if (objectType.getJavaClass() == extType) continue; else if (extType.isAssignableFrom(objectType.getJavaClass())) currConstrDistance += 1; else { currConstrDistance = Integer.MAX_VALUE; break; } } else { // no mapping available currConstrDistance = Integer.MAX_VALUE; break; } } if (j == nArgs && currConstrDistance < bestConstrDistance ) { _chosenConstructor = constructor; _isExtConstructor = true; bestConstrDistance = currConstrDistance; _type = (_clazz != null) ? Type.newObjectType(_clazz) : Type.newObjectType(_className); } } if (_type != null) { return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError { int nArgs = _arguments.size(); final String name = _fname.getLocalPart(); // check if function is a contructor 'new' if (_fname.getLocalPart().equals("new")) { return typeCheckConstructor(stable); } // check if we are calling an instance method else { boolean hasThisArgument = false; if (nArgs == 0) _isStatic = true; if (!_isStatic) { if (_namespace_format == NAMESPACE_FORMAT_JAVA || _namespace_format == NAMESPACE_FORMAT_PACKAGE) hasThisArgument = true; Expression firstArg = (Expression)_arguments.elementAt(0); Type firstArgType = (Type)firstArg.typeCheck(stable); if (_namespace_format == NAMESPACE_FORMAT_CLASS && firstArgType instanceof ObjectType && _clazz != null && _clazz.isAssignableFrom(((ObjectType)firstArgType).getJavaClass())) hasThisArgument = true; if (hasThisArgument) { _thisArgument = (Expression) _arguments.elementAt(0); _arguments.remove(0); nArgs--; if (firstArgType instanceof ObjectType) { _className = ((ObjectType) firstArgType).getJavaClassName(); } else throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, name); } } else if (_className.length() == 0) { /* * Warn user if external function could not be resolved. * Warning will _NOT_ be issued is the call is properly * wrapped in an <xsl:if> or <xsl:when> element. For details * see If.parserContents() and When.parserContents() */ final Parser parser = getParser(); if (parser != null) { reportWarning(this, parser, ErrorMsg.FUNCTION_RESOLVE_ERR, _fname.toString()); } unresolvedExternal = true; return _type = Type.Int; // use "Int" as "unknown" } } final Vector methods = findMethods(); if (methods == null) { // Method not found in this class throw new TypeCheckError(ErrorMsg.METHOD_NOT_FOUND_ERR, _className + "." + name); } Class extType = null; final int nMethods = methods.size(); final Vector argsType = typeCheckArgs(stable); // Try all methods to identify the best fit int bestMethodDistance = Integer.MAX_VALUE; _type = null; // reset internal type for (int j, i = 0; i < nMethods; i++) { // Check if all paramteters to this method can be converted final Method method = (Method)methods.elementAt(i); final Class[] paramTypes = method.getParameterTypes(); int currMethodDistance = 0; for (j = 0; j < nArgs; j++) { // Convert from internal (translet) type to external (Java) type extType = paramTypes[j]; final Type intType = (Type)argsType.elementAt(j); Object match = _internal2Java.maps(intType, extType); if (match != null) { currMethodDistance += ((JavaType)match).distance; } else { // no mapping available // // Allow a Reference type to match any external (Java) type at // the moment. The real type checking is performed at runtime. if (intType instanceof ReferenceType) { currMethodDistance += 1; } else if (intType instanceof ObjectType) { ObjectType object = (ObjectType)intType; if (extType.getName().equals(object.getJavaClassName())) currMethodDistance += 0; else if (extType.isAssignableFrom(object.getJavaClass())) currMethodDistance += 1; else { currMethodDistance = Integer.MAX_VALUE; break; } } else { currMethodDistance = Integer.MAX_VALUE; break; } } } if (j == nArgs) { // Check if the return type can be converted extType = method.getReturnType(); _type = (Type) _java2Internal.get(extType); if (_type == null) { _type = Type.newObjectType(extType); } // Use this method if all parameters & return type match if (_type != null && currMethodDistance < bestMethodDistance) { _chosenMethod = method; bestMethodDistance = currMethodDistance; } } } // It is an error if the chosen method is an instance menthod but we don't // have a this argument. if (_chosenMethod != null && _thisArgument == null && !Modifier.isStatic(_chosenMethod.getModifiers())) { throw new TypeCheckError(ErrorMsg.NO_JAVA_FUNCT_THIS_REF, getMethodSignature(argsType)); } if (_type != null) { if (_type == Type.NodeSet) { getXSLTC().setMultiDocument(true); } return _type; } throw new TypeCheckError(ErrorMsg.ARGUMENT_CONVERSION_ERR, getMethodSignature(argsType)); }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
public Vector typeCheckArgs(SymbolTable stable) throws TypeCheckError { final Vector result = new Vector(); final Enumeration e = _arguments.elements(); while (e.hasMoreElements()) { final Expression exp = (Expression)e.nextElement(); result.addElement(exp.typeCheck(stable)); } return result; }
// in src/org/apache/xalan/xsltc/compiler/EqualityExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); if (tleft.isSimple() && tright.isSimple()) { if (tleft != tright) { if (tleft instanceof BooleanType) { _right = new CastExpr(_right, Type.Boolean); } else if (tright instanceof BooleanType) { _left = new CastExpr(_left, Type.Boolean); } else if (tleft instanceof NumberType || tright instanceof NumberType) { _left = new CastExpr(_left, Type.Real); _right = new CastExpr(_right, Type.Real); } else { // both compared as strings _left = new CastExpr(_left, Type.String); _right = new CastExpr(_right, Type.String); } } } else if (tleft instanceof ReferenceType) { _right = new CastExpr(_right, Type.Reference); } else if (tright instanceof ReferenceType) { _left = new CastExpr(_left, Type.Reference); } // the following 2 cases optimize @attr|.|.. = 'string' else if (tleft instanceof NodeType && tright == Type.String) { _left = new CastExpr(_left, Type.String); } else if (tleft == Type.String && tright instanceof NodeType) { _right = new CastExpr(_right, Type.String); } // optimize node/node else if (tleft instanceof NodeType && tright instanceof NodeType) { _left = new CastExpr(_left, Type.String); _right = new CastExpr(_right, Type.String); } else if (tleft instanceof NodeType && tright instanceof NodeSetType) { // compare(Node, NodeSet) will be invoked } else if (tleft instanceof NodeSetType && tright instanceof NodeType) { swapArguments(); // for compare(Node, NodeSet) } else { // At least one argument is of type node, node-set or result-tree // Promote an expression of type node to node-set if (tleft instanceof NodeType) { _left = new CastExpr(_left, Type.NodeSet); } if (tright instanceof NodeType) { _right = new CastExpr(_right, Type.NodeSet); } // If one arg is a node-set then make it the left one if (tleft.isSimple() || tleft instanceof ResultTreeType && tright instanceof NodeSetType) { swapArguments(); } // Promote integers to doubles to have fewer compares if (_right.getType() instanceof IntType) { _right = new CastExpr(_right, Type.Real); } } return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/Message.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilterParentPath.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type ftype = _filterExpr.typeCheck(stable); if (ftype instanceof NodeSetType == false) { if (ftype instanceof ReferenceType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } /* else if (ftype instanceof ResultTreeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } */ else if (ftype instanceof NodeType) { _filterExpr = new CastExpr(_filterExpr, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Wrap single node path in a node set final Type ptype = _path.typeCheck(stable); if (!(ptype instanceof NodeSetType)) { _path = new CastExpr(_path, Type.NodeSet); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/Instruction.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/If.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check the "test" expression if (_test.typeCheck(stable) instanceof BooleanType == false) { _test = new CastExpr(_test, Type.Boolean); } // Type check the element contents if (!_ignore) { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/TopLevelElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
// in src/org/apache/xalan/xsltc/compiler/UseAttributeSets.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/SimpleAttributeValue.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/StringCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final int argc = argumentCount(); if (argc > 1) { ErrorMsg err = new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, this); throw new TypeCheckError(err); } if (argc > 0) { argument().typeCheck(stable); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/IntExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.Int; }
// in src/org/apache/xalan/xsltc/compiler/KeyCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type returnType = super.typeCheck(stable); // Run type check on the key name (first argument) - must be a string, // and if it is not it must be converted to one using string() rules. if (_name != null) { final Type nameType = _name.typeCheck(stable); if (_name instanceof LiteralExpr) { final LiteralExpr literal = (LiteralExpr) _name; _resolvedQName = getParser().getQNameIgnoreDefaultNs(literal.getValue()); } else if (nameType instanceof StringType == false) { _name = new CastExpr(_name, Type.String); } } // Run type check on the value for this key. This value can be of // any data type, so this should never cause any type-check errors. // If the value is a reference, then we have to defer the decision // of how to process it until run-time. // If the value is known not to be a node-set, then it should be // converted to a string before the lookup is done. If the value is // known to be a node-set then this process (convert to string, then // do lookup) should be applied to every node in the set, and the // result from all lookups should be added to the resulting node-set. _valueType = _value.typeCheck(stable); if (_valueType != Type.NodeSet && _valueType != Type.Reference && _valueType != Type.String) { _value = new CastExpr(_value, Type.String); _valueType = _value.typeCheck(stable); } // If in a top-level element, create dependency to the referenced key addParentDependency(); return returnType; }
// in src/org/apache/xalan/xsltc/compiler/CopyOf.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tselect = _select.typeCheck(stable); if (tselect instanceof NodeType || tselect instanceof NodeSetType || tselect instanceof ReferenceType || tselect instanceof ResultTreeType) { // falls through } else { _select = new CastExpr(_select, Type.String); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ProcessingInstruction.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _name.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ConcatCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { for (int i = 0; i < argumentCount(); i++) { final Expression exp = argument(i); if (!exp.typeCheck(stable).identicalTo(Type.String)) { setArgument(i, new CastExpr(exp, Type.String)); } } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/IdKeyPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/LocationPathPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; // TODO }
// in src/org/apache/xalan/xsltc/compiler/BinOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final Type tright = _right.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, Ops[_op], new MethodType(Type.Void, tleft, tright)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } final Type arg2 = (Type) ptype.argsType().elementAt(1); if (!arg2.identicalTo(tright)) { _right = new CastExpr(_right, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/Otherwise.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/CastCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this)); } // The first argument must be a literal String Expression exp = argument(0); if (exp instanceof LiteralExpr) { _className = ((LiteralExpr) exp).getValue(); _type = Type.newObjectType(_className); } else { throw new TypeCheckError(new ErrorMsg(ErrorMsg.NEED_LITERAL_ERR, getName(), this)); } // Second argument must be of type reference or object _right = argument(1); Type tright = _right.typeCheck(stable); if (tright != Type.Reference && tright instanceof ObjectType == false) { throw new TypeCheckError(new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR, tright, _type, this)); } return _type; }
// in src/org/apache/xalan/xsltc/compiler/LiteralElement.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Type-check all attributes if (_attributeElements != null) { final int count = _attributeElements.size(); for (int i = 0; i < count; i++) { SyntaxTreeNode node = (SyntaxTreeNode)_attributeElements.elementAt(i); node.typeCheck(stable); } } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/Step.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Save this value for later - important for testing for special // combinations of steps and patterns than can be optimised _hadPredicates = hasPredicates(); // Special case for '.' // in the case where '.' has a context such as book/. // or .[false()] we can not optimize the nodeset to a single node. if (isAbbreviatedDot()) { _type = (hasParentPattern() || hasPredicates() ) ? Type.NodeSet : Type.Node; } else { _type = Type.NodeSet; } // Type check all predicates (expressions applied to the step) if (_predicates != null) { final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Expression pred = (Expression)_predicates.elementAt(i); pred.typeCheck(stable); } } // Return either Type.Node or Type.NodeSet return _type; }
// in src/org/apache/xalan/xsltc/compiler/TransletOutput.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type type = _filename.typeCheck(stable); if (type instanceof StringType == false) { _filename = new CastExpr(_filename, Type.String); } typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/UnaryOpExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type tleft = _left.typeCheck(stable); final MethodType ptype = lookupPrimop(stable, "u-", new MethodType(Type.Void, tleft)); if (ptype != null) { final Type arg1 = (Type) ptype.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) { _left = new CastExpr(_left, arg1); } return _type = ptype.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/ProcessingInstructionPattern.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (hasPredicates()) { // Type check all the predicates (e -> position() = e) final int n = _predicates.size(); for (int i = 0; i < n; i++) { final Predicate pred = (Predicate)_predicates.elementAt(i); pred.typeCheck(stable); } } return Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/ValueOf.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type type = _select.typeCheck(stable); // Prefer to handle the value as a node; fall back to String, otherwise if (type != null && !type.identicalTo(Type.Node)) { /*** *** %HZ% Would like to treat result-tree fragments in the same *** %HZ% way as node sets for value-of, but that's running into *** %HZ% some snags. Instead, they'll be converted to String if (type.identicalTo(Type.ResultTree)) { _select = new CastExpr(new CastExpr(_select, Type.NodeSet), Type.Node); } else ***/ if (type.identicalTo(Type.NodeSet)) { _select = new CastExpr(_select, Type.Node); } else { _isString = true; if (!type.identicalTo(Type.String)) { _select = new CastExpr(_select, Type.String); } _isString = true; } } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/RealExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return _type = Type.Real; }
// in src/org/apache/xalan/xsltc/compiler/Include.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/WithParam.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { final Type tselect = _select.typeCheck(stable); if (tselect instanceof ReferenceType == false) { _select = new CastExpr(_select, Type.Reference); } } else { typeCheckContents(stable); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/CallTemplate.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Template template = stable.lookupTemplate(_name); if (template != null) { typeCheckContents(stable); } else { ErrorMsg err = new ErrorMsg(ErrorMsg.TEMPLATE_UNDEF_ERR,_name,this); throw new TypeCheckError(err); } return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/ApplyTemplates.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { if (_select != null) { _type = _select.typeCheck(stable); if (_type instanceof NodeType || _type instanceof ReferenceType) { _select = new CastExpr(_select, Type.NodeSet); _type = Type.NodeSet; } if (_type instanceof NodeSetType||_type instanceof ResultTreeType) { typeCheckContents(stable); // with-params return Type.Void; } throw new TypeCheckError(this); } else { typeCheckContents(stable); // with-params return Type.Void; } }
// in src/org/apache/xalan/xsltc/compiler/LiteralAttribute.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { _value.typeCheck(stable); typeCheckContents(stable); return Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FilterExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { Type ptype = _primary.typeCheck(stable); boolean canOptimize = _primary instanceof KeyCall; if (ptype instanceof NodeSetType == false) { if (ptype instanceof ReferenceType) { _primary = new CastExpr(_primary, Type.NodeSet); } else { throw new TypeCheckError(this); } } // Type check predicates and turn all optimizations off if appropriate int n = _predicates.size(); for (int i = 0; i < n; i++) { Predicate pred = (Predicate) _predicates.elementAt(i); if (!canOptimize) { pred.dontOptimize(); } pred.typeCheck(stable); } return _type = Type.NodeSet; }
// in src/org/apache/xalan/xsltc/compiler/UnparsedEntityUriCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type entity = _entity.typeCheck(stable); if (entity instanceof StringType == false) { _entity = new CastExpr(_entity, Type.String); } return _type = Type.String; }
// in src/org/apache/xalan/xsltc/compiler/ContainsCall.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Check that the function was passed exactly two arguments if (argumentCount() != 2) { throw new TypeCheckError(ErrorMsg.ILLEGAL_ARG_ERR, getName(), this); } // The first argument must be a String, or cast to a String _base = argument(0); Type baseType = _base.typeCheck(stable); if (baseType != Type.String) _base = new CastExpr(_base, Type.String); // The second argument must also be a String, or cast to a String _token = argument(1); Type tokenType = _token.typeCheck(stable); if (tokenType != Type.String) _token = new CastExpr(_token, Type.String); return _type = Type.Boolean; }
// in src/org/apache/xalan/xsltc/compiler/LogicalExpr.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { // Get the left and right operand types Type tleft = _left.typeCheck(stable); Type tright = _right.typeCheck(stable); // Check if the operator supports the two operand types MethodType wantType = new MethodType(Type.Void, tleft, tright); MethodType haveType = lookupPrimop(stable, Ops[_op], wantType); // Yes, the operation is supported if (haveType != null) { // Check if left-hand side operand must be type casted Type arg1 = (Type)haveType.argsType().elementAt(0); if (!arg1.identicalTo(tleft)) _left = new CastExpr(_left, arg1); // Check if right-hand side operand must be type casted Type arg2 = (Type) haveType.argsType().elementAt(1); if (!arg2.identicalTo(tright)) _right = new CastExpr(_right, arg1); // Return the result type for the operator we will use return _type = haveType.resultType(); } throw new TypeCheckError(this); }
// in src/org/apache/xalan/xsltc/compiler/Expression.java
public Type typeCheck(SymbolTable stable) throws TypeCheckError { return typeCheckContents(stable); }
6
            
// in src/org/apache/xalan/xsltc/compiler/Choose.java
catch (TypeCheckError e) { // handled later! }
// in src/org/apache/xalan/xsltc/compiler/Parser.java
catch (TypeCheckError e) { reportError(ERROR, new ErrorMsg(e)); }
// in src/org/apache/xalan/xsltc/compiler/Sort.java
catch (TypeCheckError e) { val = "text"; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { ErrorMsg errorMsg = e.getErrorMsg(); if (errorMsg == null) { final String name = _fname.getLocalPart(); errorMsg = new ErrorMsg(ErrorMsg.METHOD_NOT_FOUND_ERR, name); } getParser().reportError(ERROR, errorMsg); return _type = Type.Void; }
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
// in src/org/apache/xalan/xsltc/compiler/Step.java
catch (TypeCheckError e) { }
1
            
// in src/org/apache/xalan/xsltc/compiler/FunctionCall.java
catch (TypeCheckError e) { throw new TypeCheckError(this); // invalid conversion }
0
unknown (Lib) UnknownHostException 0 0 0 1
            
// in src/org/apache/xalan/xsltc/cmdline/Transform.java
catch (UnknownHostException e) { if (_debug) e.printStackTrace(); ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, _fileName); System.err.println(new ErrorMsg(ErrorMsg.RUNTIME_ERROR_KEY)+ err.toString()); }
0 0
unknown (Lib) UnknownServiceException 0 0 0 1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
1
            
// in src/org/apache/xalan/xsltc/trax/TransformerImpl.java
catch (UnknownServiceException e) { throw new TransformerException(e); }
0
unknown (Lib) UnsupportedEncodingException 1
            
// in src/org/apache/xml/serializer/Encodings.java
static Writer getWriter(OutputStream output, String encoding) throws UnsupportedEncodingException { for (int i = 0; i < _encodings.length; ++i) { if (_encodings[i].name.equalsIgnoreCase(encoding)) { try { String javaName = _encodings[i].javaName; OutputStreamWriter osw = new OutputStreamWriter(output,javaName); return osw; } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying } catch (UnsupportedEncodingException usee) { // keep trying } } } try { return new OutputStreamWriter(output, encoding); } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); } }
1
            
// in src/org/apache/xml/serializer/Encodings.java
catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); }
1
            
// in src/org/apache/xml/serializer/Encodings.java
static Writer getWriter(OutputStream output, String encoding) throws UnsupportedEncodingException { for (int i = 0; i < _encodings.length; ++i) { if (_encodings[i].name.equalsIgnoreCase(encoding)) { try { String javaName = _encodings[i].javaName; OutputStreamWriter osw = new OutputStreamWriter(output,javaName); return osw; } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { // keep trying } catch (UnsupportedEncodingException usee) { // keep trying } } } try { return new OutputStreamWriter(output, encoding); } catch (java.lang.IllegalArgumentException iae) // java 1.1.8 { throw new UnsupportedEncodingException(encoding); } }
21
            
// in src/org/apache/xml/utils/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ref/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/dtm/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/CharInfo.java
catch (UnsupportedEncodingException e) { reader = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xml/serializer/ToStream.java
catch (UnsupportedEncodingException uee) { osw = null; }
// in src/org/apache/xml/serializer/ToStream.java
catch (UnsupportedEncodingException e) { // We can't really get here, UTF-8 is always supported // This try-catch exists to make the compiler happy e.printStackTrace(); }
// in src/org/apache/xml/serializer/Encodings.java
catch (UnsupportedEncodingException usee) { // keep trying }
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
// in src/org/apache/xml/serializer/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/runtime/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/Output.java
catch (java.io.UnsupportedEncodingException e) { ErrorMsg msg = new ErrorMsg(ErrorMsg.UNSUPPORTED_ENCODING, _encoding, this); parser.reportError(Constants.WARNING, msg); }
// in src/org/apache/xalan/xsltc/compiler/util/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/compiler/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/dom/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/cmdline/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xsltc/trax/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/xslt/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/sql/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/lib/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xalan/extensions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
// in src/org/apache/xpath/functions/ObjectFactory.java
catch (java.io.UnsupportedEncodingException e) { rd = new BufferedReader(new InputStreamReader(is)); }
1
            
// in src/org/apache/xml/serializer/dom3/LSSerializerImpl.java
catch( UnsupportedEncodingException ue) { String msg = Utils.messages .createMessage( MsgKey.ER_UNSUPPORTED_ENCODING, null); if (fDOMErrorHandler != null) { fDOMErrorHandler.handleError(new DOMErrorImpl( DOMError.SEVERITY_FATAL_ERROR, msg, MsgKey.ER_UNSUPPORTED_ENCODING, ue)); } throw (LSException) createLSException(LSException.SERIALIZE_ERR, ue).fillInStackTrace(); }
0
runtime (Lib) UnsupportedOperationException 1
            
// in src/org/apache/xalan/extensions/ExtensionNamespaceContext.java
public void remove() { throw new UnsupportedOperationException(); }
0 0 0 0 0
runtime (Domain) WrappedRuntimeException
public class WrappedRuntimeException extends RuntimeException
{
    static final long serialVersionUID = 7140414456714658073L;

  /** Primary checked exception.
   *  @serial          */
  private Exception m_exception;

  /**
   * Construct a WrappedRuntimeException from a
   * checked exception.
   *
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(Exception e)
  {

    super(e.getMessage());

    m_exception = e;
  }

  /**
   * Constructor WrappedRuntimeException
   *
   *
   * @param msg Exception information.
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(String msg, Exception e)
  {

    super(msg);

    m_exception = e;
  }
  
  /**
   * Get the checked exception that this runtime exception wraps.
   *
   * @return The primary checked exception
   */
  public Exception getException()
  {
    return m_exception;
  }
}public final class WrappedRuntimeException extends RuntimeException
{
    static final long serialVersionUID = 7140414456714658073L;

  /** Primary checked exception.
   *  @serial          */
  private Exception m_exception;

  /**
   * Construct a WrappedRuntimeException from a
   * checked exception.
   *
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(Exception e)
  {

    super(e.getMessage());

    m_exception = e;
  }

  /**
   * Constructor WrappedRuntimeException
   *
   *
   * @param msg Exception information.
   * @param e Primary checked exception
   */
  public WrappedRuntimeException(String msg, Exception e)
  {

    super(msg);

    m_exception = e;
  }
  
  /**
   * Get the checked exception that this runtime exception wraps.
   *
   * @return The primary checked exception
   */
  public Exception getException()
  {
    return m_exception;
  }
}
49
            
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
public DTMAxisIterator cloneIterator() { try { final DTMAxisIteratorBase clone = (DTMAxisIteratorBase) super.clone(); clone._isRestartable = false; // return clone.reset(); return clone; } catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
// in src/org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces.java
public static void main(String args[]) { System.out.println("Starting..."); CoroutineManager co = new CoroutineManager(); int appCoroutineID = co.co_joinCoroutineSet(-1); if (appCoroutineID == -1) { System.out.println("ERROR: Couldn't allocate coroutine number.\n"); return; } IncrementalSAXSource parser= createIncrementalSAXSource(); // Use a serializer as our sample output org.apache.xml.serialize.XMLSerializer trace; trace=new org.apache.xml.serialize.XMLSerializer(System.out,null); parser.setContentHandler(trace); parser.setLexicalHandler(trace); // Tell coroutine to begin parsing, run while parsing is in progress for(int arg=0;arg<args.length;++arg) { try { InputSource source = new InputSource(args[arg]); Object result=null; boolean more=true; parser.startParse(source); for(result = parser.deliverMoreNodes(more); result==Boolean.TRUE; result = parser.deliverMoreNodes(more)) { System.out.println("\nSome parsing successful, trying more.\n"); // Special test: Terminate parsing early. if(arg+1<args.length && "!".equals(args[arg+1])) { ++arg; more=false; } } if (result instanceof Boolean && ((Boolean)result)==Boolean.FALSE) { System.out.println("\nParser ended (EOF or on request).\n"); } else if (result == null) { System.out.println("\nUNEXPECTED: Parser says shut down prematurely.\n"); } else if (result instanceof Exception) { throw new org.apache.xml.utils.WrappedRuntimeException((Exception)result); // System.out.println("\nParser threw exception:"); // ((Exception)result).printStackTrace(); } } catch(SAXException e) { e.printStackTrace(); } } }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
synchronized public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing) { if(DEBUG && null != source) System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId() ); XMLStringFactory xstringFactory = m_xsf; int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { DOM2DTM dtm = new DOM2DTM(this, (DOMSource) source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); addDTM(dtm, dtmPos, 0); // if (DUMPTREE) // { // dtm.dumpDTM(); // } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader = null; SAX2DTM dtm; try { InputSource xmlSource; if (null == source) { xmlSource = null; } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } if (source==null && unique && !incremental && !doIndexing) { // Special case to support RTF construction into shared DTM. // It should actually still work for other uses, // but may be slightly deoptimized relative to the base // to allow it to deal with carrying multiple documents. // // %REVIEW% This is a sloppy way to request this mode; // we need to consider architectural improvements. dtm = new SAX2RTFDTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } /************************************************************** // EXPERIMENTAL 3/22/02 else if(JKESS_XNI_EXPERIMENT && m_incremental) { dtm = new XNI2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } **************************************************************/ // Create the basic SAX2DTM. else { dtm = new SAX2DTM(this, source, documentID, whiteSpaceFilter, xstringFactory, doIndexing); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); boolean haveXercesParser = (null != reader) && (reader.getClass() .getName() .equals("org.apache.xerces.parsers.SAXParser") ); if (haveXercesParser) { incremental = true; // No matter what. %REVIEW% } // If the reader is null, but they still requested an incremental // build, then we still want to set up the IncrementalSAXSource stuff. if (m_incremental && incremental /* || ((null == reader) && incremental) */) { IncrementalSAXSource coParser=null; if (haveXercesParser) { // IncrementalSAXSource_Xerces to avoid threading. try { coParser =(IncrementalSAXSource) Class.forName("org.apache.xml.dtm.ref.IncrementalSAXSource_Xerces").newInstance(); } catch( Exception ex ) { ex.printStackTrace(); coParser=null; } } if (coParser==null ) { // Create a IncrementalSAXSource to run on the secondary thread. if (null == reader) { coParser = new IncrementalSAXSource_Filter(); } else { IncrementalSAXSource_Filter filter = new IncrementalSAXSource_Filter(); filter.setXMLReader(reader); coParser=filter; } } /************************************************************** // EXPERIMENTAL 3/22/02 if (JKESS_XNI_EXPERIMENT && m_incremental && dtm instanceof XNI2DTM && coParser instanceof IncrementalSAXSource_Xerces) { org.apache.xerces.xni.parser.XMLPullParserConfiguration xpc= ((IncrementalSAXSource_Xerces)coParser) .getXNIParserConfiguration(); if (xpc!=null) { // Bypass SAX; listen to the XNI stream ((XNI2DTM)dtm).setIncrementalXNISource(xpc); } else { // Listen to the SAX stream (will fail, diagnostically...) dtm.setIncrementalSAXSource(coParser); } } else ***************************************************************/ // Have the DTM set itself up as IncrementalSAXSource's listener. dtm.setIncrementalSAXSource(coParser); if (null == xmlSource) { // Then the user will construct it themselves. return dtm; } if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } reader.setDTDHandler(dtm); try { // Launch parsing coroutine. Launches a second thread, // if we're using IncrementalSAXSource.filter(). coParser.startParse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } else { if (null == reader) { // Then the user will construct it themselves. return dtm; } // not incremental reader.setContentHandler(dtm); reader.setDTDHandler(dtm); if (null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty( "http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { dtm.clearCoRoutine(); throw re; } catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } finally { // Reset the ContentHandler, DTDHandler, ErrorHandler to the DefaultHandler // after creating the DTM. if (reader != null && !(m_incremental && incremental)) { reader.setContentHandler(m_defaultHandler); reader.setDTDHandler(m_defaultHandler); reader.setErrorHandler(m_defaultHandler); // Reset the LexicalHandler to null after creating the DTM. try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", null); } catch (Exception e) {} } releaseXMLReader(reader); } } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); //"Not supported: " + source); } } }
// in src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
protected boolean nextNode() { if (null == m_incrementalSAXSource) return false; if (m_endDocumentOccured) { clearCoRoutine(); return false; } Object gotMore = m_incrementalSAXSource.deliverMoreNodes(true); // gotMore may be a Boolean (TRUE if still parsing, FALSE if // EOF) or an exception if IncrementalSAXSource malfunctioned // (code error rather than user error). // // %REVIEW% Currently the ErrorHandlers sketched herein are // no-ops, so I'm going to initially leave this also as a // no-op. if (!(gotMore instanceof Boolean)) { if(gotMore instanceof RuntimeException) { throw (RuntimeException)gotMore; } else if(gotMore instanceof Exception) { throw new WrappedRuntimeException((Exception)gotMore); } // for now... clearCoRoutine(); return false; // %TBD% } if (gotMore != Boolean.TRUE) { // EOF reached without satisfying the request clearCoRoutine(); // Drop connection, stop trying // %TBD% deregister as its listener? } return true; }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
static public final Properties getDefaultMethodProperties(String method) { String fileName = null; Properties defaultProperties = null; // According to this article : Double-check locking does not work // http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html try { synchronized (m_synch_object) { if (null == m_xml_properties) // double check { fileName = PROP_FILE_XML; m_xml_properties = loadPropertiesFile(fileName, null); } } if (method.equals(Method.XML)) { defaultProperties = m_xml_properties; } else if (method.equals(Method.HTML)) { if (null == m_html_properties) // double check { fileName = PROP_FILE_HTML; m_html_properties = loadPropertiesFile(fileName, m_xml_properties); } defaultProperties = m_html_properties; } else if (method.equals(Method.TEXT)) { if (null == m_text_properties) // double check { fileName = PROP_FILE_TEXT; m_text_properties = loadPropertiesFile(fileName, m_xml_properties); if (null == m_text_properties.getProperty(OutputKeys.ENCODING)) { String mimeEncoding = Encodings.getMimeEncoding(null); m_text_properties.put( OutputKeys.ENCODING, mimeEncoding); } } defaultProperties = m_text_properties; } else if (method.equals(Method.UNKNOWN)) { if (null == m_unknown_properties) // double check { fileName = PROP_FILE_UNKNOWN; m_unknown_properties = loadPropertiesFile(fileName, m_xml_properties); } defaultProperties = m_unknown_properties; } else { // TODO: Calculate res file from name. defaultProperties = m_xml_properties; } } catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); } // wrap these cached defaultProperties in a new Property object just so // that the caller of this method can't modify the default values return new Properties(defaultProperties); }
// in src/org/apache/xml/serializer/CharInfo.java
static CharInfo getCharInfo(String entitiesFileName, String method) { CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName); if (charInfo != null) { return mutableCopyOf(charInfo); } // try to load it internally - cache try { charInfo = getCharInfoBasedOnPrivilege(entitiesFileName, method, true); // Put the common copy of charInfo in the cache, but return // a copy of it. m_getCharInfoCache.put(entitiesFileName, charInfo); return mutableCopyOf(charInfo); } catch (Exception e) {} // try to load it externally - do not cache try { return getCharInfoBasedOnPrivilege(entitiesFileName, method, false); } catch (Exception e) {} String absoluteEntitiesFileName; if (entitiesFileName.indexOf(':') < 0) { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName); } else { try { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null); } catch (TransformerException te) { throw new WrappedRuntimeException(te); } } return getCharInfoBasedOnPrivilege(entitiesFileName, method, false); }
// in src/org/apache/xml/serializer/SerializerFactory.java
public static Serializer getSerializer(Properties format) { Serializer ser; try { String method = format.getProperty(OutputKeys.METHOD); if (method == null) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputKeys.METHOD}); throw new IllegalArgumentException(msg); } String className = format.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { // Missing Content Handler property, load default using OutputPropertiesFactory Properties methodDefaults = OutputPropertiesFactory.getDefaultMethodProperties(method); className = methodDefaults.getProperty(OutputPropertiesFactory.S_KEY_CONTENT_HANDLER); if (null == className) { String msg = Utils.messages.createMessage( MsgKey.ER_FACTORY_PROPERTY_MISSING, new Object[] { OutputPropertiesFactory.S_KEY_CONTENT_HANDLER}); throw new IllegalArgumentException(msg); } } ClassLoader loader = ObjectFactory.findClassLoader(); Class cls = ObjectFactory.findProviderClass(className, loader, true); // _serializers.put(method, cls); Object obj = cls.newInstance(); if (obj instanceof SerializationHandler) { // this is one of the supplied serializers ser = (Serializer) cls.newInstance(); ser.setOutputFormat(format); } else { /* * This must be a user defined Serializer. * It had better implement ContentHandler. */ if (obj instanceof ContentHandler) { /* * The user defined serializer defines ContentHandler, * but we need to wrap it with ToXMLSAXHandler which * will collect SAX-like events and emit true * SAX ContentHandler events to the users handler. */ className = SerializerConstants.DEFAULT_SAX_SERIALIZER; cls = ObjectFactory.findProviderClass(className, loader, true); SerializationHandler sh = (SerializationHandler) cls.newInstance(); sh.setContentHandler( (ContentHandler) obj); sh.setOutputFormat(format); ser = sh; } else { // user defined serializer does not implement // ContentHandler, ... very bad throw new Exception( Utils.messages.createMessage( MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER, new Object[] { className})); } } } catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); } // If we make it to here ser is not null. return ser; }
// in src/org/apache/xml/serializer/ToStream.java
public void serialize(Node node) throws IOException { try { TreeWalker walker = new TreeWalker(this); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xml/serializer/Encodings.java
private static EncodingInfo[] loadEncodingInfo() { try { final InputStream is; is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(), ENCODINGS_FILE); Properties props = new Properties(); if (is != null) { props.load(is); is.close(); } else { // Seems to be no real need to force failure here, let the // system do its best... The issue is not really very critical, // and the output will be in any case _correct_ though maybe not // always human-friendly... :) // But maybe report/log the resource problem? // Any standard ways to report/log errors (in static context)? } int totalEntries = props.size(); List encodingInfo_list = new ArrayList(); Enumeration keys = props.keys(); for (int i = 0; i < totalEntries; ++i) { String javaName = (String) keys.nextElement(); String val = props.getProperty(javaName); int len = lengthOfMimeNames(val); String mimeName; char highChar; if (len == 0) { // There is no property value, only the javaName, so try and recover mimeName = javaName; highChar = '\u0000'; // don't know the high code point, will need to test every character } else { try { // Get the substring after the Mime names final String highVal = val.substring(len).trim(); highChar = (char) Integer.decode(highVal).intValue(); } catch( NumberFormatException e) { highChar = 0; } String mimeNames = val.substring(0, len); StringTokenizer st = new StringTokenizer(mimeNames, ","); for (boolean first = true; st.hasMoreTokens(); first = false) { mimeName = st.nextToken(); EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar); encodingInfo_list.add(ei); _encodingTableKeyMime.put(mimeName.toUpperCase(), ei); if (first) _encodingTableKeyJava.put(javaName.toUpperCase(), ei); } } } // Convert the Vector of EncodingInfo objects into an array of them, // as that is the kind of thing this method returns. EncodingInfo[] ret_ei = new EncodingInfo[encodingInfo_list.size()]; encodingInfo_list.toArray(ret_ei); return ret_ei; } catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); } catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); } }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
public void serializeDOM3(Node node) throws IOException { try { DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler, fErrorHandler, fSerializerFilter, fNewLine); walker.traverse(node); } catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); } }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
public DTM getDTM(Source source, boolean unique, DTMWSFilter whiteSpaceFilter, boolean incremental, boolean doIndexing, boolean hasUserReader, int size, boolean buildIdIndex, boolean newNameTable) { if(DEBUG && null != source) { System.out.println("Starting "+ (unique ? "UNIQUE" : "shared")+ " source: "+source.getSystemId()); } int dtmPos = getFirstFreeDTMID(); int documentID = dtmPos << IDENT_DTM_NODE_BITS; if ((null != source) && source instanceof DOMSource) { final DOMSource domsrc = (DOMSource) source; final org.w3c.dom.Node node = domsrc.getNode(); final DOM2SAX dom2sax = new DOM2SAX(node); SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } dtm.setDocumentURI(source.getSystemId()); addDTM(dtm, dtmPos, 0); dom2sax.setContentHandler(dtm); try { dom2sax.parse(); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return dtm; } else { boolean isSAXSource = (null != source) ? (source instanceof SAXSource) : true; boolean isStreamSource = (null != source) ? (source instanceof StreamSource) : false; if (isSAXSource || isStreamSource) { XMLReader reader; InputSource xmlSource; if (null == source) { xmlSource = null; reader = null; hasUserReader = false; // Make sure the user didn't lie } else { reader = getXMLReader(source); xmlSource = SAXSource.sourceToInputSource(source); String urlOfSource = xmlSource.getSystemId(); if (null != urlOfSource) { try { urlOfSource = SystemIDResolver.getAbsoluteURI(urlOfSource); } catch (Exception e) { // %REVIEW% Is there a better way to send a warning? System.err.println("Can not absolutize URL: " + urlOfSource); } xmlSource.setSystemId(urlOfSource); } } // Create the basic SAX2DTM. SAXImpl dtm; if (size <= 0) { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, DTMDefaultBase.DEFAULT_BLOCKSIZE, buildIdIndex, newNameTable); } else { dtm = new SAXImpl(this, source, documentID, whiteSpaceFilter, null, doIndexing, size, buildIdIndex, newNameTable); } // Go ahead and add the DTM to the lookup table. This needs to be // done before any parsing occurs. Note offset 0, since we've just // created a new DTM. addDTM(dtm, dtmPos, 0); if (null == reader) { // Then the user will construct it themselves. return dtm; } reader.setContentHandler(dtm.getBuilder()); if (!hasUserReader || null == reader.getDTDHandler()) { reader.setDTDHandler(dtm); } if(!hasUserReader || null == reader.getErrorHandler()) { reader.setErrorHandler(dtm); } try { reader.setProperty("http://xml.org/sax/properties/lexical-handler", dtm); } catch (SAXNotRecognizedException e){} catch (SAXNotSupportedException e){} try { reader.parse(xmlSource); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } finally { if (!hasUserReader) { releaseXMLReader(reader); } } if (DUMPTREE) { System.out.println("Dumping SAX2DOM"); dtm.dumpDTM(System.err); } return dtm; } else { // It should have been handled by a derived class or the caller // made a mistake. throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NOT_SUPPORTED, new Object[]{source})); } } }
// in src/org/apache/xalan/templates/FuncDocument.java
int getDoc(XPathContext xctxt, int context, String uri, String base) throws javax.xml.transform.TransformerException { // System.out.println("base: "+base+", uri: "+uri); SourceTreeManager treeMgr = xctxt.getSourceTreeManager(); Source source; int newDoc; try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); newDoc = treeMgr.getNode(source); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } catch(TransformerException te) { throw new TransformerException(te); } if (DTM.NULL != newDoc) return newDoc; // If the uri length is zero, get the uri of the stylesheet. if (uri.length() == 0) { // Hmmm... this seems pretty bogus to me... -sb uri = xctxt.getNamespaceContext().getBaseIdentifier(); try { source = treeMgr.resolveURI(base, uri, xctxt.getSAXLocator()); } catch (IOException ioe) { throw new TransformerException(ioe.getMessage(), (SourceLocator)xctxt.getSAXLocator(), ioe); } } String diagnosticsString = null; try { if ((null != uri) && (uri.length() > 0)) { newDoc = treeMgr.getSourceTree(source, xctxt.getSAXLocator(), xctxt); // System.out.println("newDoc: "+((Document)newDoc).getDocumentElement().getNodeName()); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_MAKE_URL_FROM, new Object[]{ ((base == null) ? "" : base) + uri }); //"Can not make URL from: "+((base == null) ? "" : base )+uri); } catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); } if (DTM.NULL == newDoc) { // System.out.println("what?: "+base+", uri: "+uri); if (null != diagnosticsString) { warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ diagnosticsString }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else warn(xctxt, XSLTErrorResources.WG_CANNOT_LOAD_REQUESTED_DOC, new Object[]{ uri == null ? ((base == null) ? "" : base) + uri : uri.toString() }); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); } else { // %REVIEW% // TBD: What to do about XLocator? // xctxt.getSourceTreeManager().associateXLocatorToNode(newDoc, url, null); } return newDoc; }
// in src/org/apache/xalan/templates/Stylesheet.java
protected void callChildVisitors(XSLTVisitor visitor, boolean callAttrs) { int s = getImportCount(); for (int j = 0; j < s; j++) { getImport(j).callVisitors(visitor); } s = getIncludeCount(); for (int j = 0; j < s; j++) { getInclude(j).callVisitors(visitor); } s = getOutputCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getOutput(j)); } // Next, add in the attribute-set elements s = getAttributeSetCount(); for (int j = 0; j < s; j++) { ElemAttributeSet attrSet = getAttributeSet(j); if (visitor.visitTopLevelInstruction(attrSet)) { attrSet.callChildVisitors(visitor); } } // Now the decimal-formats s = getDecimalFormatCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getDecimalFormat(j)); } // Now the keys s = getKeyCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getKey(j)); } // And the namespace aliases s = getNamespaceAliasCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getNamespaceAlias(j)); } // Next comes the templates s = getTemplateCount(); for (int j = 0; j < s; j++) { try { ElemTemplate template = getTemplate(j); if (visitor.visitTopLevelInstruction(template)) { template.callChildVisitors(visitor); } } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } } // Then, the variables s = getVariableOrParamCount(); for (int j = 0; j < s; j++) { ElemVariable var = getVariableOrParam(j); if (visitor.visitTopLevelVariableOrParamDecl(var)) { var.callChildVisitors(visitor); } } // And lastly the whitespace preserving and stripping elements s = getStripSpaceCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getStripSpace(j)); } s = getPreserveSpaceCount(); for (int j = 0; j < s; j++) { visitor.visitTopLevelInstruction(getPreserveSpace(j)); } if(null != m_NonXslTopLevel) { java.util.Enumeration elements = m_NonXslTopLevel.elements(); while(elements.hasMoreElements()) { ElemTemplateElement elem = (ElemTemplateElement)elements.nextElement(); if (visitor.visitTopLevelInstruction(elem)) { elem.callChildVisitors(visitor); } } } }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
protected WalkingIterator createIteratorFromSteps(final WalkingIterator wi, int numSteps) { WalkingIterator newIter = new WalkingIterator(wi.getPrefixResolver()); try { AxesWalker walker = (AxesWalker)wi.getFirstWalker().clone(); newIter.setFirstWalker(walker); walker.setLocPathIterator(newIter); for(int i = 1; i < numSteps; i++) { AxesWalker next = (AxesWalker)walker.getNextWalker().clone(); walker.setNextWalker(next); next.setLocPathIterator(newIter); walker = next; } walker.setNextWalker(null); } catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); } return newIter; }
// in src/org/apache/xalan/transformer/KeyTable.java
private Hashtable getRefsTable() { if (m_refsTable == null) { // initial capacity set to a prime number to improve hash performance m_refsTable = new Hashtable(89); KeyIterator ki = (KeyIterator) (m_keyNodes).getContainedIter(); XPathContext xctxt = ki.getXPathContext(); Vector keyDecls = getKeyDeclarations(); int nKeyDecls = keyDecls.size(); int currentNode; m_keyNodes.reset(); while (DTM.NULL != (currentNode = m_keyNodes.nextNode())) { try { for (int keyDeclIdx = 0; keyDeclIdx < nKeyDecls; keyDeclIdx++) { KeyDeclaration keyDeclaration = (KeyDeclaration) keyDecls.elementAt(keyDeclIdx); XObject xuse = keyDeclaration.getUse().execute(xctxt, currentNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); addValueInRefsTable(xctxt, exprResult, currentNode); } else { DTMIterator i = ((XNodeSet)xuse).iterRaw(); int currentNodeInUseClause; while (DTM.NULL != (currentNodeInUseClause = i.nextNode())) { DTM dtm = xctxt.getDTM(currentNodeInUseClause); XMLString exprResult = dtm.getStringValue(currentNodeInUseClause); addValueInRefsTable(xctxt, exprResult, currentNode); } } } } catch (TransformerException te) { throw new WrappedRuntimeException(te); } } } return m_refsTable; }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
void apply(TransformerImpl transformer) { try { // Are all these clones deep enough? SerializationHandler rtf = transformer.getResultTreeHandler(); if (rtf != null) { // restore serializer fields rtf.setNamespaceMappings((NamespaceMappings)m_nsSupport.clone()); } XPathContext xpc = transformer.getXPathContext(); xpc.setVarStack((VariableStack) m_variableStacks.clone()); xpc.setCurrentNodeStack((IntStack) m_currentNodes.clone()); xpc.setCurrentExpressionNodeStack( (IntStack) m_currentExpressionNodes.clone()); xpc.setContextNodeListsStack((Stack) m_contextNodeLists.clone()); if (m_contextNodeList != null) xpc.pushContextNodeList((DTMIterator) m_contextNodeList.clone()); xpc.setAxesIteratorStackStacks((Stack) m_axesIteratorStack.clone()); transformer.m_currentTemplateRuleIsNull = (BoolStack) m_currentTemplateRuleIsNull.clone(); transformer.m_currentTemplateElements = (ObjectStack) m_currentTemplateElements.clone(); transformer.m_currentMatchTemplates = (Stack) m_currentMatchTemplates.clone(); transformer.m_currentMatchedNodes = (NodeVector) m_currentMatchNodes.clone(); transformer.m_countersTable = (CountersTable) m_countersTable.clone(); if (m_attrSetStack != null) transformer.m_attrSetStack = (Stack) m_attrSetStack.clone(); } catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
public short filterNode(int testNode) { boolean foundKey = false; Vector keys = m_keyDeclarations; QName name = m_name; KeyIterator ki = (KeyIterator)(((XNodeSet)m_keysNodes).getContainedIter()); org.apache.xpath.XPathContext xctxt = ki.getXPathContext(); if(null == xctxt) assertion(false, "xctxt can not be null here!"); try { XMLString lookupKey = m_ref; // System.out.println("lookupKey: "+lookupKey); int nDeclarations = keys.size(); // Walk through each of the declarations made with xsl:key for (int i = 0; i < nDeclarations; i++) { KeyDeclaration kd = (KeyDeclaration) keys.elementAt(i); // Only continue if the name on this key declaration // matches the name on the iterator for this walker. if (!kd.getName().equals(name)) continue; foundKey = true; // xctxt.setNamespaceContext(ki.getPrefixResolver()); // Query from the node, according the the select pattern in the // use attribute in xsl:key. XObject xuse = kd.getUse().execute(xctxt, testNode, ki.getPrefixResolver()); if (xuse.getType() != xuse.CLASS_NODESET) { XMLString exprResult = xuse.xstr(); if (lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } else { DTMIterator nl = ((XNodeSet)xuse).iterRaw(); int useNode; while (DTM.NULL != (useNode = nl.nextNode())) { DTM dtm = getDTM(useNode); XMLString exprResult = dtm.getStringValue(useNode); if ((null != exprResult) && lookupKey.equals(exprResult)) return DTMIterator.FILTER_ACCEPT; } } } // end for(int i = 0; i < nDeclarations; i++) } catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } if (!foundKey) throw new RuntimeException( XSLMessages.createMessage( XSLTErrorResources.ER_NO_XSLKEY_DECLARATION, new Object[] { name.getLocalName()})); return DTMIterator.FILTER_REJECT; }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
public void setDocumentLocator(Locator locator) { try { if (null == m_resultContentHandler) createResultContentHandler(m_result); } catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } m_resultContentHandler.setDocumentLocator(locator); }
// in src/org/apache/xalan/lib/Extensions.java
public static NodeSet nodeset(ExpressionContext myProcessor, Object rtf) { String textNodeValue; if (rtf instanceof NodeIterator) { return new NodeSet((NodeIterator) rtf); } else { if (rtf instanceof String) { textNodeValue = (String) rtf; } else if (rtf instanceof Boolean) { textNodeValue = new XBoolean(((Boolean) rtf).booleanValue()).str(); } else if (rtf instanceof Double) { textNodeValue = new XNumber(((Double) rtf).doubleValue()).str(); } else { textNodeValue = rtf.toString(); } // This no longer will work right since the DTM. // Document myDoc = myProcessor.getContextNode().getOwnerDocument(); try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document myDoc = db.newDocument(); Text textNode = myDoc.createTextNode(textNodeValue); DocumentFragment docFrag = myDoc.createDocumentFragment(); docFrag.appendChild(textNode); return new NodeSet(docFrag); } catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); } } }
// in src/org/apache/xalan/lib/Extensions.java
public static Node checkEnvironment(ExpressionContext myContext) { Document factoryDocument; try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); factoryDocument = db.newDocument(); } catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); } Node resultNode = null; try { // First use reflection to try to load Which, which is a // better version of EnvironmentCheck resultNode = checkEnvironmentUsingWhich(myContext, factoryDocument); if (null != resultNode) return resultNode; // If reflection failed, fallback to our internal EnvironmentCheck EnvironmentCheck envChecker = new EnvironmentCheck(); Hashtable h = envChecker.getEnvironmentHash(); resultNode = factoryDocument.createElement("checkEnvironmentExtension"); envChecker.appendEnvironmentReport(resultNode, factoryDocument, h); envChecker = null; } catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } return resultNode; }
// in src/org/apache/xpath/objects/XBooleanStatic.java
public boolean equals(XObject obj2) { try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XObjectFactory.java
static public XObject create(Object val, XPathContext xctxt) { XObject result; if (val instanceof XObject) { result = (XObject) val; } else if (val instanceof String) { result = new XString((String) val); } else if (val instanceof Boolean) { result = new XBoolean((Boolean)val); } else if (val instanceof Number) { result = new XNumber(((Number) val)); } else if (val instanceof DTM) { DTM dtm = (DTM)val; try { int dtmRoot = dtm.getDocument(); DTMAxisIterator iter = dtm.getAxisIterator(Axis.SELF); iter.setStartNode(dtmRoot); DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(dtmRoot, xctxt); result = new XNodeSet(iterator); } catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); } } else if (val instanceof DTMAxisIterator) { DTMAxisIterator iter = (DTMAxisIterator)val; try { DTMIterator iterator = new OneStepIterator(iter, Axis.SELF); iterator.setRoot(iter.getStartNode(), xctxt); result = new XNodeSet(iterator); } catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); } } else if (val instanceof DTMIterator) { result = new XNodeSet((DTMIterator) val); } // This next three instanceofs are a little worrysome, since a NodeList // might also implement a Node! else if (val instanceof org.w3c.dom.Node) { result = new XNodeSetForDOM((org.w3c.dom.Node)val, xctxt); } // This must come after org.w3c.dom.Node, since many Node implementations // also implement NodeList. else if (val instanceof org.w3c.dom.NodeList) { result = new XNodeSetForDOM((org.w3c.dom.NodeList)val, xctxt); } else if (val instanceof org.w3c.dom.traversal.NodeIterator) { result = new XNodeSetForDOM((org.w3c.dom.traversal.NodeIterator)val, xctxt); } else { result = new XObject(val); } return result; }
// in src/org/apache/xpath/objects/XNumber.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (t == XObject.CLASS_NODESET) return obj2.equals(this); else if(t == XObject.CLASS_BOOLEAN) return obj2.bool() == bool(); else return m_val == obj2.num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XString.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. int t = obj2.getType(); try { if (XObject.CLASS_NODESET == t) return obj2.equals(this); // If at least one object to be compared is a boolean, then each object // to be compared is converted to a boolean as if by applying the // boolean function. else if(XObject.CLASS_BOOLEAN == t) return obj2.bool() == bool(); // Otherwise, if at least one object to be compared is a number, then each object // to be compared is converted to a number as if by applying the number function. else if(XObject.CLASS_NUMBER == t) return obj2.num() == num(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } // Otherwise, both objects to be compared are converted to strings as // if by applying the string function. return xstr().equals(obj2.xstr()); }
// in src/org/apache/xpath/objects/XString.java
public int compareToIgnoreCase(XMLString str) { // %REVIEW% Like it says, @since 1.2. Doesn't exist in earlier // versions of Java, hence we can't yet shell out to it. We can implement // it as character-by-character compare, but doing so efficiently // is likely to be (ahem) interesting. // // However, since nobody is actually _using_ this method yet: // return str().compareToIgnoreCase(str.toString()); throw new org.apache.xml.utils.WrappedRuntimeException( new java.lang.NoSuchMethodException( "Java 1.2 method, not yet implemented")); }
// in src/org/apache/xpath/objects/XBoolean.java
public boolean equals(XObject obj2) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. if (obj2.getType() == XObject.CLASS_NODESET) return obj2.equals(this); try { return m_val == obj2.bool(); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XRTreeFrag.java
public boolean equals(XObject obj2) { try { if (XObject.CLASS_NODESET == obj2.getType()) { // In order to handle the 'all' semantics of // nodeset comparisons, we always call the // nodeset function. return obj2.equals(this); } else if (XObject.CLASS_BOOLEAN == obj2.getType()) { return bool() == obj2.bool(); } else if (XObject.CLASS_NUMBER == obj2.getType()) { return num() == obj2.num(); } else if (XObject.CLASS_NODESET == obj2.getType()) { return xstr().equals(obj2.xstr()); } else if (XObject.CLASS_STRING == obj2.getType()) { return xstr().equals(obj2.xstr()); } else if (XObject.CLASS_RTREEFRAG == obj2.getType()) { // Probably not so good. Think about this. return xstr().equals(obj2.xstr()); } else { return super.equals(obj2); } } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/objects/XNodeSet.java
public boolean equals(XObject obj2) { try { return compare(obj2, S_EQ); } catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); } }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
public void loadPropertyFile(String file, Properties target) { try { // Use SecuritySupport class to provide privileged access to property file InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(), file); // get a buffered version BufferedInputStream bis = new BufferedInputStream(is); target.load(bis); // and load up the property bag from this bis.close(); // close out after reading } catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); } }
// in src/org/apache/xpath/functions/FuncPosition.java
public int getPositionInContextNodeList(XPathContext xctxt) { // System.out.println("FuncPosition- entry"); // If we're in a predicate, then this will return non-null. SubContextList iter = m_isTopLevel ? null : xctxt.getSubContextList(); if (null != iter) { int prox = iter.getProximityPosition(xctxt); // System.out.println("FuncPosition- prox: "+prox); return prox; } DTMIterator cnl = xctxt.getContextNodeList(); if (null != cnl) { int n = cnl.getCurrentNode(); if(n == DTM.NULL) { if(cnl.getCurrentPos() == 0) return 0; // Then I think we're in a sort. See sort21.xsl. So the iterator has // already been spent, and is not on the node we're processing. // It's highly possible that this is an issue for other context-list // functions. Shouldn't be a problem for last(), and it shouldn't be // a problem for current(). try { cnl = cnl.cloneWithReset(); } catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); } int currentNode = xctxt.getContextNode(); // System.out.println("currentNode: "+currentNode); while(DTM.NULL != (n = cnl.nextNode())) { if(n == currentNode) break; } } // System.out.println("n: "+n); // System.out.println("FuncPosition- cnl.getCurrentPos(): "+cnl.getCurrentPos()); return cnl.getCurrentPos(); } // System.out.println("FuncPosition - out of guesses: -1"); return -1; }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/axes/UnionPathIterator.java
public void setRoot(int context, Object environment) { super.setRoot(context, environment); try { if (null != m_exprs) { int n = m_exprs.length; DTMIterator newIters[] = new DTMIterator[n]; for (int i = 0; i < n; i++) { DTMIterator iter = m_exprs[i].asIterator(m_execContext, context); newIters[i] = iter; iter.nextNode(); } m_iterators = newIters; } } catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); } }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr ) throws org.apache.xml.utils.WrappedRuntimeException { PrefixResolver savedResolver = xctxt.getNamespaceContext(); XNodeSet result = null; try { xctxt.pushCurrentNode(context); xctxt.setNamespaceContext(prefixResolver); // The setRoot operation can take place with a reset operation, // and so we may not be in the context of LocPathIterator#nextNode, // so we have to set up the variable context, execute the expression, // and then restore the variable context. if (isTopLevel) { // System.out.println("calling m_expr.execute(getXPathContext())"); VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int savedStart = vars.getStackFrame(); vars.setStackFrame(stackFrame); result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); result.setShouldCacheNodes(true); // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } else result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); } catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); } finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); } return result; }
// in src/org/apache/xpath/axes/IteratorPool.java
public synchronized DTMIterator getInstance() { // Check if the pool is empty. if (m_freeStack.isEmpty()) { // Create a new object if so. try { return (DTMIterator)m_orig.clone(); } catch (Exception ex) { throw new WrappedRuntimeException(ex); } } else { // Remove object from end of free pool. DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1); return result; } }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
public void resetProximityPositions() { int nPredicates = getPredicateCount(); if (nPredicates > 0) { if (null == m_proximityPositions) m_proximityPositions = new int[nPredicates]; for (int i = 0; i < nPredicates; i++) { try { initProximityPosition(i); } catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); } } } }
// in src/org/apache/xpath/operations/Variable.java
public void fixupVariables(java.util.Vector vars, int globalsSize) { m_fixUpWasCalled = true; int sz = vars.size(); for (int i = vars.size()-1; i >= 0; i--) { QName qn = (QName)vars.elementAt(i); // System.out.println("qn: "+qn); if(qn.equals(m_qname)) { if(i < globalsSize) { m_isGlobal = true; m_index = i; } else { m_index = i-globalsSize; } return; } } java.lang.String msg = XSLMessages.createXPATHMessage(XPATHErrorResources.ER_COULD_NOT_FIND_VAR, new Object[]{m_qname.toString()}); TransformerException te = new TransformerException(msg, this); throw new org.apache.xml.utils.WrappedRuntimeException(te); }
45
            
// in src/org/apache/xml/utils/ObjectPool.java
catch(ClassNotFoundException cnfe) { throw new WrappedRuntimeException(cnfe); }
// in src/org/apache/xml/dtm/ref/DTMNodeIterator.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java
catch (CloneNotSupportedException e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/dtm/ref/DTMManagerDefault.java
catch (Exception e) { dtm.clearCoRoutine(); throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY, new Object[] { fileName, method }), ioe); }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (IOException ioe) { if (defaults == null) { throw ioe; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), ioe); //"Could not load '"+resourceName+"' (check CLASSPATH), now using just the defaults ", ioe); } }
// in src/org/apache/xml/serializer/OutputPropertiesFactory.java
catch (SecurityException se) { // Repeat IOException handling for sandbox/applet case -sc if (defaults == null) { throw se; } else { throw new WrappedRuntimeException( Utils.messages.createMessage( MsgKey.ER_COULD_NOT_LOAD_RESOURCE, new Object[] { resourceName }), se); //"Could not load '"+resourceName+"' (check CLASSPATH, applet security), now using just the defaults ", se); } }
// in src/org/apache/xml/serializer/CharInfo.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xml/serializer/SerializerFactory.java
catch (Exception e) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(e); }
// in src/org/apache/xml/serializer/ToStream.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.net.MalformedURLException mue) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue); }
// in src/org/apache/xml/serializer/Encodings.java
catch (java.io.IOException ioe) { throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe); }
// in src/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java
catch (org.xml.sax.SAXException se) { throw new WrappedRuntimeException(se); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/xsltc/dom/XSLTCDTMManager.java
catch (Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/templates/FuncDocument.java
catch (Throwable throwable) { // throwable.printStackTrace(); newDoc = DTM.NULL; // path.warn(XSLTErrorResources.WG_ENCODING_NOT_SUPPORTED_USING_JAVA, new Object[]{((base == null) ? "" : base )+uri}); //"Can not load requested doc: "+((base == null) ? "" : base )+uri); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } if ((throwable instanceof NullPointerException) || (throwable instanceof ClassCastException)) { throw new org.apache.xml.utils.WrappedRuntimeException( (Exception) throwable); } StringWriter sw = new StringWriter(); PrintWriter diagnosticsWriter = new PrintWriter(sw); if (throwable instanceof TransformerException) { TransformerException spe = (TransformerException) throwable; { Throwable e = spe; while (null != e) { if (null != e.getMessage()) { diagnosticsWriter.println(" (" + e.getClass().getName() + "): " + e.getMessage()); } 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(); } else e = null; } } } else { diagnosticsWriter.println(" (" + throwable.getClass().getName() + "): " + throwable.getMessage()); } diagnosticsString = throwable.getMessage(); //sw.toString(); }
// in src/org/apache/xalan/templates/Stylesheet.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/templates/RedundentExprEliminator.java
catch(CloneNotSupportedException cnse) { throw new WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/KeyTable.java
catch (TransformerException te) { throw new WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/TransformSnapshotImpl.java
catch (CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xalan/transformer/KeyRefIterator.java
catch (javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xalan/lib/ExsltStrings.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xalan/lib/Extensions.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xalan/lib/Extensions.java
catch(ParserConfigurationException pce) { throw new org.apache.xml.utils.WrappedRuntimeException(pce); }
// in src/org/apache/xpath/objects/XBooleanStatic.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XObjectFactory.java
catch(Exception ex) { throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/objects/XNumber.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XString.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XBoolean.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XRTreeFrag.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/objects/XNodeSet.java
catch(javax.xml.transform.TransformerException te) { throw new org.apache.xml.utils.WrappedRuntimeException(te); }
// in src/org/apache/xpath/functions/FuncSystemProperty.java
catch (Exception ex) { // ex.printStackTrace(); throw new org.apache.xml.utils.WrappedRuntimeException(ex); }
// in src/org/apache/xpath/functions/FuncPosition.java
catch(CloneNotSupportedException cnse) { throw new org.apache.xml.utils.WrappedRuntimeException(cnse); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/axes/UnionPathIterator.java
catch(Exception e) { throw new org.apache.xml.utils.WrappedRuntimeException(e); }
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); }
// in src/org/apache/xpath/axes/IteratorPool.java
catch (Exception ex) { throw new WrappedRuntimeException(ex); }
// in src/org/apache/xpath/axes/PredicatedNodeTest.java
catch(Exception e) { // TODO: Fix this... throw new org.apache.xml.utils.WrappedRuntimeException(e); }
1
            
// in src/org/apache/xpath/axes/FilterExprIteratorSimple.java
public static XNodeSet executeFilterExpr(int context, XPathContext xctxt, PrefixResolver prefixResolver, boolean isTopLevel, int stackFrame, Expression expr ) throws org.apache.xml.utils.WrappedRuntimeException { PrefixResolver savedResolver = xctxt.getNamespaceContext(); XNodeSet result = null; try { xctxt.pushCurrentNode(context); xctxt.setNamespaceContext(prefixResolver); // The setRoot operation can take place with a reset operation, // and so we may not be in the context of LocPathIterator#nextNode, // so we have to set up the variable context, execute the expression, // and then restore the variable context. if (isTopLevel) { // System.out.println("calling m_expr.execute(getXPathContext())"); VariableStack vars = xctxt.getVarStack(); // These three statements need to be combined into one operation. int savedStart = vars.getStackFrame(); vars.setStackFrame(stackFrame); result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); result.setShouldCacheNodes(true); // These two statements need to be combined into one operation. vars.setStackFrame(savedStart); } else result = (org.apache.xpath.objects.XNodeSet) expr.execute(xctxt); } catch (javax.xml.transform.TransformerException se) { // TODO: Fix... throw new org.apache.xml.utils.WrappedRuntimeException(se); } finally { xctxt.popCurrentNode(); xctxt.setNamespaceContext(savedResolver); } return result; }
2
            
// in src/org/apache/xalan/transformer/TransformerImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } fatalError(throwable); }
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
1
            
// in src/org/apache/xalan/transformer/TransformerIdentityImpl.java
catch (org.apache.xml.utils.WrappedRuntimeException wre) { Throwable throwable = wre.getException(); while (throwable instanceof org.apache.xml.utils.WrappedRuntimeException) { throwable = ((org.apache.xml.utils.WrappedRuntimeException) throwable).getException(); } throw new TransformerException(wre.getException()); }
0
checked (Domain) WrongNumberArgsException
public class WrongNumberArgsException extends Exception
{
    static final long serialVersionUID = -4551577097576242432L;

  /**
   * Constructor WrongNumberArgsException
   *
   * @param argsExpected Error message that tells the number of arguments that 
   * were expected.
   */
  public WrongNumberArgsException(String argsExpected)
  {

    super(argsExpected);
  }
}
9
            
// in src/org/apache/xalan/templates/FuncDocument.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_ONE_OR_TWO, null)); //"1 or 2"); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); }
// in src/org/apache/xpath/functions/FuncSubstring.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function3Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null)); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1"); }
// in src/org/apache/xpath/functions/FuncConcat.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null)); }
// in src/org/apache/xpath/functions/Function2Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null)); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null)); }
0 28
            
// in src/org/apache/xalan/templates/FuncDocument.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if ((argNum < 1) || (argNum > 2)) reportWrongNumberArgs(); }
// in src/org/apache/xalan/templates/FuncDocument.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_ONE_OR_TWO, null)); //"1 or 2"); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if ((argNum > 3) || (argNum < 2)) reportWrongNumberArgs(); }
// in src/org/apache/xalan/templates/FuncFormatNumb.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createMessage(XSLTErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { // throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 0) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("zero", null)); }
// in src/org/apache/xpath/functions/FuncSubstring.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum < 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FuncSubstring.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_TWO_OR_THREE, null)); //"2 or 3"); }
// in src/org/apache/xpath/functions/Function3Args.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (argNum < 2) super.setArg(arg, argNum); else if (2 == argNum) { m_arg2 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function3Args.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 3) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function3Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("three", null)); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum > 1) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionDef1Arg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ZERO_OR_ONE, null)); //"0 or 1"); }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (argNum < 3) super.setArg(arg, argNum); else { if (null == m_args) { m_args = new Expression[1]; m_args[0] = arg; } else { // Slow but space conservative. Expression[] args = new Expression[m_args.length + 1]; System.arraycopy(m_args, 0, args, 0, m_args.length); args[m_args.length] = arg; m_args = args; } arg.exprSetParent(this); } }
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
// in src/org/apache/xpath/functions/FunctionMultiArgs.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { m_argVec.addElement(arg); arg.exprSetParent(this); }
// in src/org/apache/xpath/functions/FuncExtFunction.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException{}
// in src/org/apache/xpath/functions/FuncExtFunction.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { String fMsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION, new Object[]{ "Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." }); throw new RuntimeException(fMsg); }
// in src/org/apache/xpath/functions/FuncConcat.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum < 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FuncConcat.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("gtone", null)); }
// in src/org/apache/xpath/functions/Function2Args.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { // System.out.println("argNum: "+argNum); if (argNum == 0) super.setArg(arg, argNum); else if (1 == argNum) { m_arg1 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function2Args.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 2) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/Function2Args.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("two", null)); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
public void setArg(Expression arg, int argNum) throws WrongNumberArgsException { if (0 == argNum) { m_arg0 = arg; arg.exprSetParent(this); } else reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
public void checkNumberArgs(int argNum) throws WrongNumberArgsException { if (argNum != 1) reportWrongNumberArgs(); }
// in src/org/apache/xpath/functions/FunctionOneArg.java
protected void reportWrongNumberArgs() throws WrongNumberArgsException { throw new WrongNumberArgsException(XSLMessages.createXPATHMessage("one", null)); }
2
            
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { java.lang.String name = m_functionTable.getFunctionName(funcID); m_errorHandler.fatalError( new TransformerException( XSLMessages.createXPATHMessage(XPATHErrorResources.ER_ONLY_ALLOWS, new Object[]{name, wnae.getMessage()}), m_locator)); //"name + " only allows " + wnae.getMessage() + " arguments", m_locator)); }
// in src/org/apache/xpath/compiler/Compiler.java
catch (WrongNumberArgsException wnae) { ; // should never happen }
0 0
runtime (Domain) WrongParserException
public class WrongParserException extends RuntimeException
{
    static final long serialVersionUID = 6481643018533043846L;

  /**
   * Create a WrongParserException object.
   * @param message The error message that should be reported to the user.
   */
  public WrongParserException(String message)
  {
    super(message);
  }
}
0 0 0 0 0 0
unknown (Domain) XPathException
public class XPathException extends TransformerException
{
    static final long serialVersionUID = 4263549717619045963L;

  /** The home of the expression that caused the error.
   *  @serial  */
  Object m_styleNode = null;

  /**
   * Get the stylesheet node from where this error originated.
   * @return The stylesheet node from where this error originated, or null.
   */
  public Object getStylesheetNode()
  {
    return m_styleNode;
  }
  
  /**
   * Set the stylesheet node from where this error originated.
   * @param styleNode The stylesheet node from where this error originated, or null.
   */
  public void setStylesheetNode(Object styleNode)
  {
    m_styleNode = styleNode;
  }


  /** A nested exception.
   *  @serial   */
  protected Exception m_exception;

  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message, ExpressionNode ex)
  {
    super(message);
    this.setLocator(ex);
    setStylesheetNode(getStylesheetNode(ex));
  }
  
  /**
   * Create an XPathException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathException(String message)
  {
    super(message);
  }

  
  /**
   * Get the XSLT ElemVariable that this sub-expression references.  In order for 
   * this to work, the SourceLocator must be the owning ElemTemplateElement.
   * @return The dereference to the ElemVariable, or null if not found.
   */
  public org.w3c.dom.Node getStylesheetNode(ExpressionNode ex)
  {
  	
    ExpressionNode owner = getExpressionOwner(ex);

    if (null != owner && owner instanceof org.w3c.dom.Node)
    {
		return ((org.w3c.dom.Node)owner);
    }
    return null;

  }
  
  /**
   * Get the first non-Expression parent of this node.
   * @return null or first ancestor that is not an Expression.
   */
  protected ExpressionNode getExpressionOwner(ExpressionNode ex)
  {
  	ExpressionNode parent = ex.exprGetParent();
  	while((null != parent) && (parent instanceof Expression))
  		parent = parent.exprGetParent();
  	return parent;
  }



  /**
   * Create an XPathException object that holds
   * an error message and the stylesheet node that
   * the error originated from.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   */
  public XPathException(String message, Object styleNode)
  {

    super(message);

    m_styleNode = styleNode;
  }

  /**
   * Create an XPathException object that holds
   * an error message, the stylesheet node that
   * the error originated from, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param styleNode The stylesheet node that the error originated from.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Node styleNode, Exception e)
  {

    super(message);

    m_styleNode = styleNode;
    this.m_exception = e;
  }

  /**
   * Create an XPathException object that holds
   * an error message, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param e The exception that caused this exception.
   */
  public XPathException(String message, Exception e)
  {

    super(message);

    this.m_exception = e;
  }

  /**
   * Print the the trace of methods from where the error
   * originated.  This will trace all nested exception
   * objects, as well as this object.
   * @param s The stream where the dump will be sent to.
   */
  public void printStackTrace(java.io.PrintStream s)
  {

    if (s == null)
      s = System.err;

    try
    {
      super.printStackTrace(s);
    }
    catch (Exception e){}

    Throwable exception = m_exception;

    for (int i = 0; (i < 10) && (null != exception); i++)
    {
      s.println("---------");
      exception.printStackTrace(s);

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }
  }
19
            
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public double getNumberValue() throws XPathException { if (getResultType() != NUMBER_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number" } else { try { return m_resultObj.num(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public String getStringValue() throws XPathException { if (getResultType() != STRING_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string." } else { try { return m_resultObj.str(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public boolean getBooleanValue() throws XPathException { if (getResultType() != BOOLEAN_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean." } else { try { return m_resultObj.bool(); } catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node getSingleNodeValue() throws XPathException { if ((m_resultType != ANY_UNORDERED_NODE_TYPE) && (m_resultType != FIRST_ORDERED_NODE_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a single node. // This method applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE." } NodeIterator result = null; try { result = m_resultObj.nodeset(); } catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); } if (null == result) return null; Node node = result.nextNode(); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public int getSnapshotLength() throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. } return m_list.getLength(); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node snapshotItem(int index) throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, } Node node = m_list.item(index); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/objects/XObject.java
protected void error(String msg, Object[] args) throws javax.xml.transform.TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); // boolean shouldThrow = support.problem(m_support.XPATHPROCESSOR, // m_support.ERROR, // null, // null, fmsg, 0, 0); // if(shouldThrow) { throw new XPathException(fmsg, this); } }
8
            
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { // probably not a node type String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); }
10
            
// in src/org/apache/xpath/domapi/XPathExpressionImpl.java
public Object evaluate( Node contextNode, short type, Object result) throws XPathException, DOMException { // If the XPathEvaluator was determined by "casting" the document if (m_doc != null) { // Check that the context node is owned by the same document if ((contextNode != m_doc) && (!contextNode.getOwnerDocument().equals(m_doc))) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_DOCUMENT, null); throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, fmsg); } // Check that the context node is an acceptable node type short nodeType = contextNode.getNodeType(); if ((nodeType != Document.DOCUMENT_NODE) && (nodeType != Document.ELEMENT_NODE) && (nodeType != Document.ATTRIBUTE_NODE) && (nodeType != Document.TEXT_NODE) && (nodeType != Document.CDATA_SECTION_NODE) && (nodeType != Document.COMMENT_NODE) && (nodeType != Document.PROCESSING_INSTRUCTION_NODE) && (nodeType != XPathNamespace.XPATH_NAMESPACE_NODE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_WRONG_NODETYPE, null); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, fmsg); } } // // If the type is not a supported type, throw an exception and be // done with it! if (!XPathResultImpl.isValidType(type)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INVALID_XPATH_TYPE, new Object[] {new Integer(type)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // Invalid XPath type argument: {0} } // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. // Cache xpath context? XPathContext xpathSupport = new XPathContext(false); // if m_document is not null, build the DTM from the document if (null != m_doc) { xpathSupport.getDTMHandleFromNode(m_doc); } XObject xobj = null; try { xobj = m_xpath.execute(xpathSupport, contextNode, null); } catch (TransformerException te) { // What should we do here? throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,te.getMessageAndLocation()); } // Create a new XPathResult object // Reuse result object passed in? // The constructor will check the compatibility of type and xobj and // throw an exception if they are not compatible. return new XPathResultImpl(type,xobj,contextNode, m_xpath); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public double getNumberValue() throws XPathException { if (getResultType() != NUMBER_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number" } else { try { return m_resultObj.num(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public String getStringValue() throws XPathException { if (getResultType() != STRING_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string." } else { try { return m_resultObj.str(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public boolean getBooleanValue() throws XPathException { if (getResultType() != BOOLEAN_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean." } else { try { return m_resultObj.bool(); } catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node getSingleNodeValue() throws XPathException { if ((m_resultType != ANY_UNORDERED_NODE_TYPE) && (m_resultType != FIRST_ORDERED_NODE_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a single node. // This method applies only to types ANY_UNORDERED_NODE_TYPE and FIRST_ORDERED_NODE_TYPE." } NodeIterator result = null; try { result = m_resultObj.nodeset(); } catch (TransformerException te) { throw new XPathException(XPathException.TYPE_ERR,te.getMessage()); } if (null == result) return null; Node node = result.nextNode(); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public int getSnapshotLength() throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. } return m_list.getLength(); }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node iterateNext() throws XPathException, DOMException { if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method iterateNext cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_ITERATOR_TYPE and ORDERED_NODE_ITERATOR_TYPE."}, } if (getInvalidIteratorState()) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_DOC_MUTATED, null); throw new DOMException(DOMException.INVALID_STATE_ERR,fmsg); // Document mutated since result was returned. Iterator is invalid. } Node node = m_iterator.nextNode(); if(null == node) removeEventListener(); // JIRA 1673 // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathResultImpl.java
public Node snapshotItem(int index) throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The method snapshotItem cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. // This method applies only to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, } Node node = m_list.item(index); // Wrap "namespace node" in an XPathNamespace if (isNamespaceNode(node)) { return new XPathNamespaceImpl(node); } else { return node; } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public XPathExpression createExpression( String expression, XPathNSResolver resolver) throws XPathException, DOMException { try { // If the resolver is null, create a dummy prefix resolver XPath xpath = new XPath(expression,null, ((null == resolver) ? new DummyPrefixResolver() : ((PrefixResolver)resolver)), XPath.SELECT); return new XPathExpressionImpl(xpath, m_doc); } catch (TransformerException e) { // Need to pass back exception code DOMException.NAMESPACE_ERR also. // Error found in DOM Level 3 XPath Test Suite. if(e instanceof XPathStylesheetDOM3Exception) throw new DOMException(DOMException.NAMESPACE_ERR,e.getMessageAndLocation()); else throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,e.getMessageAndLocation()); } }
// in src/org/apache/xpath/domapi/XPathEvaluatorImpl.java
public Object evaluate( String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) throws XPathException, DOMException { XPathExpression xpathExpression = createExpression(expression, resolver); return xpathExpression.evaluate(contextNode, type, result); }
0 0 0
unknown (Lib) XPathExpressionException 9
            
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
9
            
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
catch ( Exception e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( SAXException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch( IOException e ) { throw new XPathExpressionException ( e ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } }
9
            
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(Object item, QName returnType) throws XPathExpressionException { //Validating parameters to enforce constraints defined by JAXP spec if ( returnType == null ) { //Throwing NullPointerException as defined in spec String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { return eval( item, returnType); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException( te); } } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public String evaluate(Object item) throws XPathExpressionException { return (String)this.evaluate( item, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public Object evaluate(InputSource source, QName returnType) throws XPathExpressionException { if ( ( source == null ) || ( returnType == null ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, null ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to be // defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { if ( dbf == null ) { dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware( true ); dbf.setValidating( false ); } db = dbf.newDocumentBuilder(); Document document = db.parse( source ); return eval( document, returnType ); } catch ( Exception e ) { throw new XPathExpressionException ( e ); } }
// in src/org/apache/xpath/jaxp/XPathExpressionImpl.java
public String evaluate(InputSource source) throws XPathExpressionException { return (String)this.evaluate( source, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, Object item, QName returnType) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } // Checking if requested returnType is supported. returnType need to // be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { XObject resultObject = eval( expression, item ); return getResultAsType( resultObject, returnType ); } catch ( java.lang.NullPointerException npe ) { // If VariableResolver returns null Or if we get // NullPointerException at this stage for some other reason // then we have to reurn XPathException throw new XPathExpressionException ( npe ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { // For any other exceptions we need to throw // XPathExpressionException ( as per spec ) throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public String evaluate(String expression, Object item) throws XPathExpressionException { return (String)this.evaluate( expression, item, XPathConstants.STRING ); }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public XPathExpression compile(String expression) throws XPathExpressionException { if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } try { org.apache.xpath.XPath xpath = new XPath (expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); // Can have errorListener XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath, prefixResolver, functionResolver, variableResolver, featureSecureProcessing ); return ximpl; } catch ( javax.xml.transform.TransformerException te ) { throw new XPathExpressionException ( te ) ; } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public Object evaluate(String expression, InputSource source, QName returnType) throws XPathExpressionException { // Checking validity of different parameters if( source== null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"source"} ); throw new NullPointerException ( fmsg ); } if ( expression == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"XPath expression"} ); throw new NullPointerException ( fmsg ); } if ( returnType == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"returnType"} ); throw new NullPointerException ( fmsg ); } //Checking if requested returnType is supported. //returnType need to be defined in XPathConstants if ( !isSupported ( returnType ) ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_UNSUPPORTED_RETURN_TYPE, new Object[] { returnType.toString() } ); throw new IllegalArgumentException ( fmsg ); } try { Document document = getParser().parse( source ); XObject resultObject = eval( expression, document ); return getResultAsType( resultObject, returnType ); } catch ( SAXException e ) { throw new XPathExpressionException ( e ); } catch( IOException e ) { throw new XPathExpressionException ( e ); } catch ( javax.xml.transform.TransformerException te ) { Throwable nestedException = te.getException(); if ( nestedException instanceof javax.xml.xpath.XPathFunctionException ) { throw (javax.xml.xpath.XPathFunctionException)nestedException; } else { throw new XPathExpressionException ( te ); } } }
// in src/org/apache/xpath/jaxp/XPathImpl.java
public String evaluate(String expression, InputSource source) throws XPathExpressionException { return (String)this.evaluate( expression, source, XPathConstants.STRING ); }
0 0 0
unknown (Lib) XPathFactoryConfigurationException 2
            
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
0 2
            
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public void setFeature(String name, boolean value) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_NAME_NULL, new Object[] { CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { featureSecureProcessing = value; // all done processing feature return; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_FEATURE_UNKNOWN, new Object[] { name, CLASS_NAME, value ? Boolean.TRUE : Boolean.FALSE } ); throw new XPathFactoryConfigurationException( fmsg ); }
// in src/org/apache/xpath/jaxp/XPathFactoryImpl.java
public boolean getFeature(String name) throws XPathFactoryConfigurationException { // feature name cannot be null if (name == null) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_NULL_FEATURE, new Object[] { CLASS_NAME } ); throw new NullPointerException( fmsg ); } // secure processing? if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { return featureSecureProcessing; } // unknown feature String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE, new Object[] { name, CLASS_NAME } ); throw new XPathFactoryConfigurationException( fmsg ); }
0 0 0
unknown (Lib) XPathFunctionException 3
            
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
public Object evaluate(List args) throws XPathFunctionException { Vector argsVec = listToVector(args); try { // The method key and ExpressionContext are set to null. return m_handler.callFunction(m_funcName, argsVec, null, null); } catch (TransformerException e) { throw new XPathFunctionException(e); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey) throws javax.xml.transform.TransformerException { try { if ( funcName == null ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_ARG_CANNOT_BE_NULL, new Object[] {"Function Name"} ); throw new NullPointerException ( fmsg ); } //Find the XPathFunction corresponding to namespace and funcName javax.xml.namespace.QName myQName = new QName( ns, funcName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } // Assuming user is passing all the needed parameters ( including // default values ) int arity = argVec.size(); javax.xml.xpath.XPathFunction xpathFunction = resolver.resolveFunction ( myQName, arity ); // not using methodKey ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec) throws javax.xml.transform.TransformerException { try { String namespace = extFunction.getNamespace(); String functionName = extFunction.getFunctionName(); int arity = extFunction.getArgCount(); javax.xml.namespace.QName myQName = new javax.xml.namespace.QName( namespace, functionName ); // JAXP 1.3 spec says When XMLConstants.FEATURE_SECURE_PROCESSING // feature is set then invocation of extension functions need to // throw XPathFunctionException if ( extensionInvocationDisabled ) { String fmsg = XSLMessages.createXPATHMessage( XPATHErrorResources.ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, new Object[] { myQName.toString() } ); throw new XPathFunctionException ( fmsg ); } XPathFunction xpathFunction = resolver.resolveFunction( myQName, arity ); ArrayList argList = new ArrayList( arity); for ( int i=0; i<arity; i++ ) { Object argument = argVec.elementAt( i ); // XNodeSet object() returns NodeVector and not NodeList // Explicitly getting NodeList by using nodelist() if ( argument instanceof XNodeSet ) { argList.add ( i, ((XNodeSet)argument).nodelist() ); } else if ( argument instanceof XObject ) { Object passedArgument = ((XObject)argument).object(); argList.add ( i, passedArgument ); } else { argList.add ( i, argument ); } } return ( xpathFunction.evaluate ( argList )); } catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); } catch ( Exception e ) { throw new javax.xml.transform.TransformerException ( e ); } }
1
            
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
catch (TransformerException e) { throw new XPathFunctionException(e); }
1
            
// in src/org/apache/xalan/extensions/XPathFunctionImpl.java
public Object evaluate(List args) throws XPathFunctionException { Vector argsVec = listToVector(args); try { // The method key and ExpressionContext are set to null. return m_handler.callFunction(m_funcName, argsVec, null, null); } catch (TransformerException e) { throw new XPathFunctionException(e); } }
2
            
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
2
            
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
// in src/org/apache/xpath/jaxp/JAXPExtensionsProvider.java
catch ( XPathFunctionException xfe ) { // If we get XPathFunctionException then we want to terminate // further execution by throwing WrappedRuntimeException throw new org.apache.xml.utils.WrappedRuntimeException ( xfe ); }
0
unknown (Domain) XPathProcessorException
public class XPathProcessorException extends XPathException
{
    static final long serialVersionUID = 1215509418326642603L;

  /**
   * Create an XPathProcessorException object that holds
   * an error message.
   * @param message The error message.
   */
  public XPathProcessorException(String message)
  {
    super(message);
  }
  

  /**
   * Create an XPathProcessorException object that holds
   * an error message, and another exception
   * that caused this exception.
   * @param message The error message.
   * @param e The exception that caused this exception.
   */
  public XPathProcessorException(String message, Exception e)
  {
    super(message, e);
  }
}
4
            
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(String ns, String funcName, Vector argVec, Object methodKey, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(funcName, argVec, methodKey, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, funcName })); //"Extension function '" + ns + ":" + funcName + "' is unknown"); } } return result; }
// in src/org/apache/xalan/extensions/ExtensionsTable.java
public Object extFunction(FuncExtFunction extFunction, Vector argVec, ExpressionContext exprContext) throws javax.xml.transform.TransformerException { Object result = null; String ns = extFunction.getNamespace(); if (null != ns) { ExtensionHandler extNS = (ExtensionHandler) m_extensionFunctionNamespaces.get(ns); if (null != extNS) { try { result = extNS.callFunction(extFunction, argVec, exprContext); } catch (javax.xml.transform.TransformerException e) { throw e; } catch (Exception e) { throw new javax.xml.transform.TransformerException(e); } } else { throw new XPathProcessorException(XSLMessages.createMessage(XSLTErrorResources.ER_EXTENSION_FUNC_UNKNOWN, new Object[]{ns, extFunction.getFunctionName()})); } } return result; }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(String expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ expected, m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
// in src/org/apache/xpath/compiler/XPathParser.java
private final void consumeExpected(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
0 0 2
            
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
2
            
// in src/org/apache/xalan/extensions/ExtensionHandlerGeneral.java
catch (XPathProcessorException e) { // e.printStackTrace (); throw new TransformerException(e.getMessage(), e); }
// in src/org/apache/xpath/compiler/XPathParser.java
catch (org.apache.xpath.XPathProcessorException e) { if(CONTINUE_AFTER_FATAL_ERROR.equals(e.getMessage())) { // What I _want_ to do is null out this XPath. // I doubt this has the desired effect, but I'm not sure what else to do. // %REVIEW%!!! initXPath(compiler, "/..", namespaceContext); } else throw e; }
0
unknown (Domain) XPathStylesheetDOM3Exception
final public class XPathStylesheetDOM3Exception extends TransformerException {
	public XPathStylesheetDOM3Exception(String msg, SourceLocator arg1)
	{
		super(msg, arg1);
	}
}
0 0 0 0 0 0

Miscellanous Metrics

nF = Number of Finally 163
nF = Number of Try-Finally (without catch) 69
Number of Methods with Finally (nMF) 120 / 9746 (1.2%)
Number of Finally with a Continue 0
Number of Finally with a Return 0
Number of Finally with a Throw 1
Number of Finally with a Break 0
Number of different exception types thrown 45
Number of Domain exception types thrown 17
Number of different exception types caught 58
Number of Domain exception types caught 12
Number of exception declarations in signatures 2279
Number of different exceptions types declared in method signatures 48
Number of library exceptions types declared in method signatures 37
Number of Domain exceptions types declared in method signatures 11
Number of Catch with a continue 2
Number of Catch with a return 186
Number of Catch with a Break 2
nbIf = Number of If 9759
nbFor = Number of For 950
Number of Method with an if 3464 / 9746
Number of Methods with a for 708 / 9746
Number of Method starting with a try 164 / 9746 (1.7%)
Number of Expressions 158161
Number of Expressions in try 14874 (9.4%)