Package org.pdf4j.saxon.om

Examples of org.pdf4j.saxon.om.ValueRepresentation


     * @throws XPathException if the variable is undefined
     */

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        try {
            ValueRepresentation actual = evaluateVariable(c);
            return Value.getIterator(actual);
        } catch (XPathException err) {
            err.maybeSetLocation(this);
            throw err;
        } catch (AssertionError err) {
View Full Code Here


        }
    }

    public Item evaluateItem(XPathContext c) throws XPathException {
        try {
            ValueRepresentation actual = evaluateVariable(c);
            if (actual instanceof Item) {
                return (Item) actual;
            }
            return Value.asItem(actual);
        } catch (XPathException err) {
View Full Code Here

        }
    }

    public void process(XPathContext c) throws XPathException {
        try {
            ValueRepresentation actual = evaluateVariable(c);
            if (actual instanceof NodeInfo) {
                actual = new SingletonNode((NodeInfo) actual);
            }
            ((Value) actual).process(c);
        } catch (XPathException err) {
View Full Code Here

    * only when the cardinality is zero or one. If the function is tail recursive,
    * it returns an Object representing the arguments to the next (recursive) call
    */

    public Item evaluateItem(XPathContext c) throws XPathException {
        ValueRepresentation val = callFunction(c);
        return Value.asItem(val);
    }
View Full Code Here

    * Call the function, returning an iterator over the results. (But if the function is
    * tail recursive, it returns an iterator over the arguments of the recursive call)
    */

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        ValueRepresentation result = callFunction(c);
        return Value.getIterator(result);
    }
View Full Code Here

    public SequenceIterator iterate(XPathContext c) throws XPathException {
        return Value.getIterator(c.evaluateLocalVariable(slotNumber));
    }

    public Item evaluateItem(XPathContext c) throws XPathException {
        ValueRepresentation actual = c.evaluateLocalVariable(slotNumber);
        return Value.asItem(actual);
    }
View Full Code Here

    public SequenceIterator iterate(XPathContext context) throws XPathException {
        final XPathContextMajor cm = (XPathContextMajor)context;
        while (true) {
            SequenceIterator iter = operand.iterate(cm);
            ValueRepresentation extent = SequenceExtent.makeSequenceExtent(iter);
            UserFunction fn = cm.getTailCallFunction();
            if (fn == null) {
                return Value.asIterator(extent);
            }
            if (fn != containingFunction) {
View Full Code Here

    public TailCall processLeavingTail(XPathContext context) throws XPathException {
        if (binding==null) {
            throw new IllegalStateException("saxon:assign binding has not been fixed up");
        }
        ValueRepresentation value = getSelectValue(context);
        if (value instanceof Closure) {
            value = SequenceExtent.makeSequenceExtent(((Closure)value).iterate());
        }
        if (binding instanceof GeneralVariable) {
            if (binding.isGlobal()) {
View Full Code Here

        } catch (XPathException e) {
            e.setLocator(this);
            throw e;
        }

        ValueRepresentation val = b.getGlobalVariableValue(this);
        if (wasSupplied || val!=null) {
            return val;
        } else {
            if (isRequiredParam()) {
                XPathException e = new XPathException("No value supplied for required parameter $" +
                        getVariableQName().getDisplayName());
                e.setXPathContext(context);
                e.setLocator(getSourceLocator());
                e.setErrorCode(isXSLT() ? "XTDE0050" : "XPDY0002");
                throw e;
            } else if (isImplicitlyRequiredParam()) {
                XPathException e = new XPathException("A value must be supplied for parameter $" +
                        getVariableQName().getDisplayName() +
                        " because there is no default value for the required type");
                e.setXPathContext(context);
                e.setLocator(getSourceLocator());
                e.setErrorCode("XTDE0610");
                throw e;
            }

            // This is the first reference to a global variable; try to evaluate it now.
            // But first set a flag to stop looping. This flag is set in the Bindery because
            // the VariableReference itself can be used by multiple threads simultaneously

            try {
                b.setExecuting(this, true);
                ValueRepresentation value = getSelectValue(context);
                b.defineGlobalVariable(this, value);
                b.setExecuting(this, false);
                return value;

            } catch (XPathException err) {
View Full Code Here

     * @return An <code>XdmValue</code> representing the results of the expression.
     * @throws SaxonApiException if a dynamic error occurs during the expression evaluation.
     */

    public XdmValue evaluate() throws SaxonApiException {
        ValueRepresentation value;
        try {
            value = SequenceExtent.makeSequenceExtent(exp.iterate(dynamicContext));
        } catch (XPathException e) {
            throw new SaxonApiException(e);
        }
View Full Code Here

TOP

Related Classes of org.pdf4j.saxon.om.ValueRepresentation

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.