Package client.net.sf.saxon.ce.trans

Examples of client.net.sf.saxon.ce.trans.XPathException


            String cName = (pool == null) ? toString() : toString(pool);
            boolean isCCE = (exe instanceof ClassCastException);
           if (exe instanceof NullPointerException || item == null || isCCE) {
                String appendText = " is " + ((isCCE)? "not a node" : "undefined");
                String code = (isCCE)? "XPTY0020" : "XPDY0002";
              XPathException err = new XPathException("The context item for axis step " +
                  cName + appendText);
              err.setErrorCode(code);
              err.setXPathContext(context);
              err.setLocator(getSourceLocator());
              err.setIsTypeError(true);
              throw err;
            } else { // if (exe instanceof UnsupportedOperationException) {
              if (exe.getCause() instanceof XPathException) {
                  XPathException ec = (XPathException)exe.getCause();
                  ec.maybeSetLocation(getSourceLocator());
                  ec.maybeSetContext(context);
                  throw ec;
              } else {
                  // the namespace axis is not supported for all tree implementations
                  dynamicError("Axis Expression Error on: " + cName + " " + exe.getMessage(), "XPST0010", context);
                  return null;
View Full Code Here


    */

    protected int checkArgumentCount(int min, int max, ExpressionVisitor visitor) throws XPathException {
        int numArgs = argument.length;
        if (min==max && numArgs != min) {
            throw new XPathException("Function " + getDisplayName() + " must have "
                    + min + pluralArguments(min),
                    getSourceLocator());
        }
        if (numArgs < min) {
            throw new XPathException("Function " + getDisplayName() + " must have at least "
                    + min + pluralArguments(min),
                    getSourceLocator());
        }
        if (numArgs > max) {
            throw new XPathException("Function " + getDisplayName() + " must have no more than "
                    + max + pluralArguments(max),
                    getSourceLocator());
        }
        return numArgs;
    }
View Full Code Here

     * @throws XPathException if the context position is undefined
    */

    public final int getContextPosition() throws XPathException {
        if (currentIterator==null) {
            XPathException e = new XPathException("The context position is currently undefined");
            e.setXPathContext(this);
            e.setErrorCode("FONC0001");
            throw e;
        }
        return currentIterator.position();
    }
View Full Code Here

     * @throws XPathException if the context position is undefined
     */

    public final int getLast() throws XPathException {
        if (currentIterator == null) {
            XPathException e = new XPathException("The context size is currently undefined");
            e.setXPathContext(this);
            e.setErrorCode("FONC0001");
            throw e;
        }
        if (last.value >= 0) {
            return last.value;
        }
View Full Code Here

    public void changeOutputDestination(Receiver receiver,
                                        boolean isFinal
    )
    throws XPathException {
        if (isFinal && isTemporaryDestination) {
            XPathException err = new XPathException("Cannot switch to a final result destination while writing a temporary tree");
            err.setErrorCode("XTDE1480");
            throw err;
        }
        if (!isFinal) {
            isTemporaryDestination = true;
        }
View Full Code Here

    }

    public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException {
        Expression e = super.typeCheck(visitor, contextItemType);
        if (e == this) {
            XPathException err0 = TypeChecker.ebvError(operand0, visitor.getConfiguration().getTypeHierarchy());
            if (err0 != null) {
                err0.setLocator(getSourceLocator());
                throw err0;
            }
            XPathException err1 = TypeChecker.ebvError(operand1, visitor.getConfiguration().getTypeHierarchy());
            if (err1 != null) {
                err1.setLocator(getSourceLocator());
                throw err1;
            }
            // Precompute the EBV of any constant operand
            if (operand0 instanceof Literal && !(((Literal)operand0).getValue() instanceof BooleanValue)) {
                operand0 = Literal.makeLiteral(BooleanValue.get(operand0.effectiveBooleanValue(null)));
View Full Code Here

   
    public static String makeHTTPRequest(String url) throws XPathException {
      try {
        return makeNativeHTTPRequest(url);
      } catch(Exception e) {
        throw new XPathException("error in Saxon.makeHTTPRequest: " + e.getMessage());
      }
    }
View Full Code Here

   
    public static JavaScriptObject parseXML(String text) throws XPathException {
      try {
        return parseNativeXML(text);
      } catch (JavaScriptException je){
        throw new XPathException("JS error in Saxon.parseXML: " + je.getMessage());       
      } catch(Exception e) {
        throw new XPathException("error in Saxon.parseXML: " + e.getMessage());
      }
    }
View Full Code Here

   
    public static String serializeXML(Node node) throws XPathException {
      try {
        return serializeNativeXML(node);
      } catch(Exception e) {
        throw new XPathException("error in Saxon.serializeXML: " + e.getMessage());
      }
    }
View Full Code Here

     * @throws client.net.sf.saxon.ce.trans.XPathException
     *
     */

    public CalendarValue add(DurationValue duration) throws XPathException {
        XPathException err = new XPathException("Cannot add a duration to an xs:gDay");
        err.setErrorCode("XPTY0004");
        throw err;
    }
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.trans.XPathException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.