public void run() throws SaxonApiException { super.run(); while (source.moreDocuments()) { XdmNode node = source.read(); } } }
private void doReplace() throws SaxonApiException { while (replacement.moreDocuments()) { matcher.addSubtree(replacement.read()); } replacement.resetReader(); } }
public ReadablePipe getReader() { if (documents == null) { documents = new DocumentSequence(runtime); } ReadablePipe pipe = new Pipe(runtime, documents); pipe.canReadSequence(sequenceOk); readers.add(pipe); return pipe; }
public void reset() { for (ReadablePipe pipe : sources) { pipe.resetReader(); } for (ReadablePipe pipe : options) { pipe.resetReader(); } pipeline.resetReader(); // What about parameters? result.resetWriter(); }
while (is_reader.moreDocuments()) { XdmNode is_doc = is_reader.read(); logger.trace(MessageFormatter.nodeMessage(step.getNode(), "Input copy from " + is_reader)); logger.trace(MessageFormatter.nodeMessage(step.getNode(), is_doc.toString())); reader.canReadSequence(true); // Hack again! while (reader.moreDocuments()) { XdmNode doc = reader.read(); pipe.write(doc); docsCopied++; logger.trace(MessageFormatter.nodeMessage(step.getNode(), "Output copy from " + reader + " to " + pipe)); reader.resetReader();
public void store(OutputStream out) throws IOException { try { provider.format(source.read(),out,contentType); } catch(SaxonApiException e) { throw new IOException(e); } } });
pipe.canReadSequence(input.getSequence()); for (ReadablePipe reader : inputs.get(port)) { if (reader.moreDocuments()) { while (reader.moreDocuments()) { XdmNode doc = reader.read(); pipe.write(doc); totalDocs++; } else if (readerCount == 1) { ReadablePipe pipe = inputs.get(port).firstElement(); pipe.setReader(step); if (pipe.moreDocuments()) { totalDocs += pipe.documentCount(); } else if (pipe instanceof ReadableDocument) { totalDocs++; rpipe.canReadSequence(true); rpipe.setReader(step); while (rpipe.moreDocuments()) { XdmNode doc = rpipe.read(); runtime.cache(doc, step.getNode().getBaseURI());
public void run() throws SaxonApiException { if (step.getNode().getNodeName().equals(XProcConstants.p_document_template)) { logger.trace(MessageFormatter.nodeMessage(step.getNode(), "The template step should be named p:template, the name p:document-template is deprecated.")); } super.run(); if (source.documentCount() > 1) { throw XProcException.stepError(68); } context = source.read(); matcher = new ProcessMatch(runtime, this); matcher.match(template.read(), new RuntimeValue("node()", step.getNode())); result.write(matcher.getResult()); }
public boolean hasNext() { return pipe.moreDocuments(); } public XdmNode next() throws TransformerException {
pipe.canReadSequence(input.getSequence()); pipe.setReader(step); readers.add(pipe); logger.trace(MessageFormatter.nodeMessage(step.getNode(),
public ReadablePipe getBinding(String stepName, String portName) { if (name.equals(stepName) && "#xpath-context".equals(portName)) { // FIXME: Check that .get(0) works, and that there's no sequence Vector<ReadablePipe> xpc = inputs.get("#xpath-context"); if (xpc.size() == 0) { // If there's no binding for a p:choose, the default is an empty binding... return new ReadableEmpty(); } ReadablePipe pipe = xpc.get(0); return new Pipe(runtime, pipe.documents()); } else { return super.getBinding(stepName, portName); } }
public void reset() { source.resetReader(); manifest.resetReader(); result.resetWriter(); }
while (is_reader.moreDocuments()) { XdmNode is_doc = is_reader.read(); logger.trace(MessageFormatter.nodeMessage(step.getNode(), "Input copy from " + is_reader)); logger.trace(MessageFormatter.nodeMessage(step.getNode(), is_doc.toString())); reader.canReadSequence(true); // Hack again! while (reader.moreDocuments()) { XdmNode doc = reader.read(); pipe.write(doc); docsCopied++; logger.trace(MessageFormatter.nodeMessage(step.getNode(), "Output copy from " + reader + " to " + pipe)); reader.resetReader();
public XdmNode next() throws TransformerException { try { return pipe.read(); } catch (SaxonApiException e) { throw new TransformerException(e); } } public void remove() {
pipe.canReadSequence(input.getSequence()); for (ReadablePipe reader : inputs.get(port)) { if (reader.moreDocuments()) { while (reader.moreDocuments()) { XdmNode doc = reader.read(); pipe.write(doc); totalDocs++; } else if (readerCount == 1) { ReadablePipe pipe = inputs.get(port).firstElement(); pipe.setReader(step); if (pipe.moreDocuments()) { totalDocs += pipe.documentCount(); } else if (pipe instanceof ReadableDocument) { totalDocs++; rpipe.canReadSequence(true); rpipe.setReader(step); while (rpipe.moreDocuments()) { XdmNode doc = rpipe.read(); runtime.cache(doc, step.getNode().getBaseURI());
public void run() throws SaxonApiException { if (step.getNode().getNodeName().equals(XProcConstants.p_document_template)) { logger.trace(MessageFormatter.nodeMessage(step.getNode(), "The template step should be named p:template, the name p:document-template is deprecated.")); } super.run(); if (source.documentCount() > 1) { throw XProcException.stepError(68); } context = source.read(); matcher = new ProcessMatch(runtime, this); matcher.match(template.read(), new RuntimeValue("node()", step.getNode())); result.write(matcher.getResult()); }
pipe.canReadSequence(input.getSequence()); pipe.setReader(step); readers.add(pipe); logger.trace(MessageFormatter.nodeMessage(step.getNode(),
public ReadablePipe getBinding(String stepName, String portName) { if (name.equals(stepName) && "#xpath-context".equals(portName)) { // FIXME: Check that .get(0) works, and that there's no sequence Vector<ReadablePipe> xpc = inputs.get("#xpath-context"); if (xpc.size() == 0) { // If there's no binding for a p:choose, the default is an empty binding... return new ReadableEmpty(); } ReadablePipe pipe = xpc.get(0); return new Pipe(runtime, pipe.documents()); } else { return super.getBinding(stepName, portName); } }