Permalink
Browse files

Attempt to resolve issue #39, use STDIN by default if there's no bind…

…ing for the primary input port
  • Loading branch information...
ndw committed Jan 29, 2013
1 parent cdeeb66 commit 66c1224db95a82a38299ec39457c5e2734277aff
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/com/xmlcalabash/drivers/Main.java
@@ -274,6 +274,22 @@ public void run(String[] args) throws SaxonApiException, IOException, URISyntaxE
String stdio = null;
// Implicit binding for stdin?
String implicitPort = null;
for (String port : pipeline.getInputs()) {
if (!allPorts.contains(port)) {
if (pipeline.getDeclareStep().getInput(port).getPrimary()
&& !pipeline.getDeclareStep().getInput(port).getParameterInput()) {
implicitPort = port;
}
}
}
if (implicitPort != null) {
XdmNode doc = runtime.parse(new InputSource(System.in));
pipeline.writeTo(implicitPort, doc);
}
// Look for explicit binding to "-"
for (String port : pipeline.getOutputs()) {
String uri = null;

0 comments on commit 66c1224

Please sign in to comment.