Package net.sf.saxon.event

Examples of net.sf.saxon.event.SequenceOutputter


            return iterate(context).next();
        } else {
            Controller controller = context.getController();
            XPathContext c2 = context.newMinorContext();
            c2.setOrigin(this);
            SequenceOutputter seq = controller.allocateSequenceOutputter(1);
            PipelineConfiguration pipe = controller.makePipelineConfiguration();
            pipe.setHostLanguage(getHostLanguage());
            seq.setPipelineConfiguration(pipe);
            c2.setTemporaryReceiver(seq);
            process(c2);
            seq.close();
            Item result = seq.getFirstItem();
            seq.reset();
            return result;
        }
    }
View Full Code Here


            throw new AssertionError("iterate() is not implemented in the subclass " + getClass());
        } else {
            Controller controller = context.getController();
            XPathContext c2 = context.newMinorContext();
            c2.setOrigin(this);
            SequenceOutputter seq = controller.allocateSequenceOutputter(20);
            PipelineConfiguration pipe = controller.makePipelineConfiguration();
            pipe.setHostLanguage(getHostLanguage());
            seq.setPipelineConfiguration(pipe);
            c2.setTemporaryReceiver(seq);
            process(c2);
            seq.close();
            return seq.iterate();
        }
    }
View Full Code Here

            Controller controller = context.getController();
            XPathContext c2 = savedXPathContext.newMinorContext();
            //c2.setOrigin(this);
            // Fork the output: one copy goes to a SequenceOutputter which remembers the contents for
            // use next time the variable is referenced; another copy goes to the current output destination.
            SequenceOutputter seq = controller.allocateSequenceOutputter(20);
            seq.setPipelineConfiguration(controller.makePipelineConfiguration());
            seq.open();
            TeeOutputter tee = new TeeOutputter(context.getReceiver(), seq);
            tee.setPipelineConfiguration(controller.makePipelineConfiguration());
            c2.setTemporaryReceiver(tee);

            expression.process(c2);

            seq.close();
            List list = seq.getList();
            if (list.isEmpty()) {
                state = EMPTY;
            } else {
                reservoir = new Item[list.size()];
                reservoir = (Item[])list.toArray(reservoir);
                used = list.size();
                state = ALL_READ;
            }
            // give unwanted stuff to the garbage collector
            savedXPathContext = null;
            seq.reset();
        }

    }
View Full Code Here

    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 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

            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

            case PROCESS:
                Controller controller = context.getController();
                XPathContext c2 = context.newMinorContext();
                c2.setOrigin(exp);
                SequenceOutputter seq = controller.allocateSequenceOutputter(20);
                PipelineConfiguration pipe = controller.makePipelineConfiguration();
                pipe.setHostLanguage(exp.getHostLanguage());
                seq.setPipelineConfiguration(pipe);
                c2.setTemporaryReceiver(seq);
                seq.open();
                exp.process(c2);
                seq.close();
                ValueRepresentation val = seq.getSequence();
                seq.reset();
                return val;

            case LAZY_TAIL_EXPRESSION: {
                TailExpression tail = (TailExpression)exp;
                VariableReference vr = (VariableReference)tail.getBaseExpression();
View Full Code Here

            return iterate(context).next();
        } else {
            Controller controller = context.getController();
            XPathContext c2 = context.newMinorContext();
            c2.setOrigin(this);
            SequenceOutputter seq = controller.allocateSequenceOutputter(1);
            PipelineConfiguration pipe = controller.makePipelineConfiguration();
            pipe.setHostLanguage(getContainer().getHostLanguage());
            seq.setPipelineConfiguration(pipe);
            c2.setTemporaryReceiver(seq);
            process(c2);
            Item item = seq.getFirstItem();
            seq.reset();
            return item;
        }
    }
View Full Code Here

        } else {
            Controller controller = context.getController();
            XPathContext c2 = context.newMinorContext();
            c2.setOrigin(this);
            SequenceOutputter seq = controller.allocateSequenceOutputter(10);
            PipelineConfiguration pipe = controller.makePipelineConfiguration();
            pipe.setHostLanguage(getContainer().getHostLanguage());
            seq.setPipelineConfiguration(pipe);
            c2.setTemporaryReceiver(seq);

            process(c2);

            SequenceIterator result = Value.getIterator(seq.getSequence());
            seq.reset();
            return result;
        }
    }
View Full Code Here

TOP

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

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.