Package net.sf.saxon.event

Examples of net.sf.saxon.event.SequenceReceiver


     * @param state   a stack on which the instruction can save state information during the call on processLeft()
     */

    public void processLeft(Stack<XPathContext> contextStack, Stack state) throws XPathException {
        XPathContext context = contextStack.peek();
        SequenceReceiver out = context.getReceiver();
        state.push(out);
        SequenceOutputter out2 = new SequenceOutputter();
        out2.setPipelineConfiguration(out.getPipelineConfiguration());
        context.setReceiver(out2);
    }
View Full Code Here


     */

    public void processRight(Stack<XPathContext> contextStack, Stack state) throws XPathException {
        XPathContext context = contextStack.peek();
        CharSequence value = ((SequenceOutputter)context.getReceiver()).getFirstItem().getStringValueCS();
        SequenceReceiver out = (SequenceReceiver)state.pop();
        context.setReceiver(out);
        out.append(new StringValue(value), 0, 0);
    }
View Full Code Here

    public void process(XPathContext context) throws XPathException {
        ValueRepresentation[] actualArgs = evaluateArguments(context);
        if (tailCall) {
            ((XPathContextMajor)context).requestTailCall(function, actualArgs);
        } else {
            SequenceReceiver out = context.getReceiver();
            XPathContextMajor c2 = context.newCleanContext();
            c2.setReceiver(out);
            c2.setOrigin(this);
            function.process(actualArgs, c2);
        }
View Full Code Here

        ValueRepresentation[] actualArgs = evaluateArguments(context);
        if (tailCall) {
            ((XPathContextMajor)context).requestTailCall(function, actualArgs);
            return EmptyEventIterator.getInstance();
        } else {
            SequenceReceiver out = context.getReceiver();
            XPathContextMajor c2 = context.newCleanContext();
            c2.setReceiver(out);
            c2.setOrigin(this);
            return function.iterateEvents(actualArgs, c2);
        }
View Full Code Here

     * @param state   a stack on which the instruction can save state information during the call on processLeft()
     */

    public void processLeft(Stack<XPathContext> contextStack, Stack state) throws XPathException {
        XPathContext context = contextStack.peek();
        SequenceReceiver out = context.getReceiver();
        state.push(out);
        SequenceOutputter out2 = new SequenceOutputter();
        out2.setPipelineConfiguration(out.getPipelineConfiguration());
        context.setReceiver(out2);
        int annotation = ((NodeInfo)context.getContextItem()).getTypeAnnotation();
        state.push(annotation);
    }
View Full Code Here

        XPathContext context = contextStack.peek();
        int annotation = (Integer)state.pop();
        CharSequence value = ((SequenceOutputter)context.getReceiver()).getFirstItem().getStringValueCS();
        SchemaType type = context.getConfiguration().getSchemaType(annotation);

        SequenceReceiver out = (SequenceReceiver)state.pop();
        context.setReceiver(out);
       
        if (type.isComplexType()) {
            if (((ComplexType)type).isMixedContent()) {
                SequenceIterator iter = SingletonIterator.makeIterator(new UntypedAtomicValue(value));
View Full Code Here

      * the current variables, etc.
      */

    public void process(XPathContext context) throws XPathException {
        SequenceIterator iter = iterate();
        SequenceReceiver out = context.getReceiver();
        while (true) {
            Item it = iter.next();
            if (it==null) break;
            out.append(it, 0, NodeInfo.ALL_NAMESPACES);
        }
    }
View Full Code Here

        XPathContext context = contextStack.peek();
        if (evalBeforeChildren) {
            ValueRepresentation val = eval(context);
            context.setLocalVariable(getLocalSlotNumber(), val);
        } else {
            SequenceReceiver out = context.getReceiver();
            state.push(out);
            SequenceOutputter out2 = new SequenceOutputter();
            out2.setPipelineConfiguration(out.getPipelineConfiguration());
            context.setReceiver(out2);
        }
    }
View Full Code Here

    public void processRight(Stack<XPathContext> contextStack, Stack state) throws XPathException {
        XPathContext context = contextStack.peek();
        if (!evalBeforeChildren) {
            SequenceOutputter out2 = (SequenceOutputter)context.getReceiver();
            SequenceReceiver out = (SequenceReceiver)state.pop();
            context.setReceiver(out);
            ValueRepresentation val = out2.getSequence();
            context.setLocalVariable(getLocalSlotNumber(), val);
            action.process(context);
        }
View Full Code Here

     */

    public void process(XPathContext context) throws XPathException {
        if (expression == null) {
            // This is a Closure that simply wraps a SequenceIterator supplied from the Java level
            SequenceReceiver out = context.getReceiver();
            while (true) {
                Item item = inputIterator.next();
                if (item == null) {
                    break;
                }
                out.append(item, 0, NodeInfo.ALL_NAMESPACES);
            }
            inputIterator = inputIterator.getAnother();
        } else {
            // To evaluate the closure in push mode, we need to use the original context of the
            // expression for everything except the current output destination, which is newly created
            XPathContext c2 = savedXPathContext.newContext();
            SequenceReceiver out = context.getReceiver();
            c2.setTemporaryReceiver(out);
            expression.process(c2);
        }
    }
View Full Code Here

TOP

Related Classes of net.sf.saxon.event.SequenceReceiver

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.