Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix issue #175 by making sure that the base URI of a pipeline that co…
…mes from an input stream Input is specified (if the URI is known).
  • Loading branch information
ndw committed Aug 25, 2014
1 parent a9439c1 commit 3fb5315
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/com/xmlcalabash/core/XProcRuntime.java
Expand Up @@ -606,7 +606,7 @@ private XPipeline _load(Input pipelineInput) throws SaxonApiException, IOExcepti
break;

case INPUT_STREAM:
pipeline = parser.loadPipeline(pipelineInput.getInputStream());
pipeline = parser.loadPipeline(pipelineInput.getInputStream(), pipelineInput.getInputStreamUri());
break;

default:
Expand Down
11 changes: 10 additions & 1 deletion src/com/xmlcalabash/model/Parser.java
Expand Up @@ -76,8 +76,17 @@ public Parser(XProcRuntime runtime) {
declStack = new Stack<DeclareStep> ();
}

@Deprecated
public DeclareStep loadPipeline(InputStream inputStream) throws SaxonApiException, IOException {
XdmNode doc = runtime.parse(new InputSource(inputStream));
return loadPipeline(inputStream, null);
}

public DeclareStep loadPipeline(InputStream inputStream, String base) throws SaxonApiException, IOException {
InputSource is = new InputSource(inputStream);
if (base != null) {
is.setSystemId(base);
}
XdmNode doc = runtime.parse(is);
inputStream.close();
return loadPipeline(doc);
}
Expand Down

0 comments on commit 3fb5315

Please sign in to comment.