Permalink
Browse files

Also fix issue #173 with respect to loading pipeline libraries

  • Loading branch information...
ndw committed Aug 27, 2014
1 parent 23e0845 commit 761317abb37ea2468cd6b12a93bbffa652dbacd1
Showing with 12 additions and 2 deletions.
  1. +1 −1 src/com/xmlcalabash/core/XProcRuntime.java
  2. +11 −1 src/com/xmlcalabash/model/Parser.java
@@ -718,7 +718,7 @@ private XLibrary _loadLibrary(Input library) throws SaxonApiException, IOExcepti
break;
case INPUT_STREAM:
- plibrary = parser.loadLibrary(library.getInputStream());
+ plibrary = parser.loadLibrary(library.getInputStream(), library.getInputStreamUri());
break;
default:
@@ -167,9 +167,19 @@ private XdmNode loadExtensionLibrary() throws FileNotFoundException, URISyntaxEx
return doc;
}
+ @Deprecated
public PipelineLibrary loadLibrary(InputStream libraryInputStream) throws SaxonApiException, IOException {
+ return loadLibrary(libraryInputStream, null);
+ }
+
+ public PipelineLibrary loadLibrary(InputStream libraryInputStream, String base) throws SaxonApiException, IOException {
+ InputSource is = new InputSource(libraryInputStream);
+ if (base != null) {
+ is.setSystemId(base);
+ }
+
try {
- XdmNode doc = runtime.parse(new InputSource(libraryInputStream));
+ XdmNode doc = runtime.parse(is);
XdmNode root = S9apiUtils.getDocumentElement(doc);
return useLibrary(root);
} finally {

0 comments on commit 761317a

Please sign in to comment.