Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.xmlcalabash.runtime;
 
Created by IntelliJ IDEA. User: ndw Date: Oct 13, 2008 Time: 7:44:46 PM To change this template use File | Settings | File Templates.
public class XCatch extends XCompoundStep {
    Pipe errorPipe = null;
    public XCatch(XProcRuntime runtimeStep stepXCompoundStep parent) {
          super(runtimestepparent);
    }
    public void writeError(XdmNode doc) {
        .write(doc);
    }
    protected ReadablePipe getPipeFromBinding(Binding binding) {
        if (binding.getBindingType() == .) {
             = new Pipe();
            return ;
        } else {
            return super.getPipeFromBinding(binding);
        }
    }
    public ReadablePipe getBinding(String stepNameString portName) {
        if (.equals(stepName) && "error".equals(portName)) {
            return new Pipe(,.documents());
        } else {
            return super.getBinding(stepNameportName);
        }
    }
    protected void copyInputs() throws SaxonApiException {
        for (String port : .keySet()) {
            if (!port.startsWith("|") && !"error".equals(port)) {
            String wport = port + "|";
                WritablePipe pipe = .get(wport);
                for (ReadablePipe reader : .get(port)) {
                    while (reader.moreDocuments()) {
                        XdmNode doc = reader.read();
                        pipe.write(doc);
                        finest(.getNode(), "Compound input copy from " + reader + " to " + pipe);
                    }
                }
            }
        }
    }
    public void reset() {
        super.reset();
        .resetReader();
        .resetWriter();
    }
New to GrepCode? Check out our FAQ X