public void addLibrary(String libraryURI) { needsCheck = true; libraries.add(new Input(libraryURI)); }
private XLibrary _loadLibrary(Input library) throws SaxonApiException, IOException { PipelineLibrary plibrary; switch (library.getKind()) { case URI: plibrary = parser.loadLibrary(library.getUri()); break; case INPUT_STREAM: plibrary = parser.loadLibrary(library.getInputStream(), library.getInputStreamUri()); break; default: throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind())); } if (errorCode != null) { throw new XProcException(errorCode, errorMessage); } XLibrary xlibrary = new XLibrary(this, plibrary); if (errorCode != null) { throw new XProcException(errorCode, errorMessage); } return xlibrary; }
try { Input library = libraries.get(0); if (library.getKind() == INPUT_STREAM) { InputStream libraryInputStream = library.getInputStream(); FileOutputStream fileOutputStream = null; try { fileOutputStream = new FileOutputStream(tempLibrary); fileOutputStream.getChannel().transferFrom(newChannel(libraryInputStream), 0, MAX_VALUE); libraries.set(0, new Input(tempLibrary.toURI().toASCIIString())); } finally { Closer.close(fileOutputStream); switch (library.getKind()) { case URI: tree.addStartElement(p_import); tree.addAttribute(new QName("href"), library.getUri()); tree.startContent(); tree.addEndElement(); InputStream libraryInputStream = library.getInputStream(); FileOutputStream fileOutputStream = null; try { throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind())); QName qname = (input.getType() == DATA) ? p_data : p_document; switch (input.getKind()) { case URI:
loader = _load(new Input(loaderURI)); } catch (SaxonApiException sae) { error(sae); switch (pipeline.getKind()) { case URI: if (data) { ReadableData rdata = new ReadableData(this, XProcConstants.c_result, getStaticBaseURI().resolve(pipeline.getUri()).toASCIIString(), "text/plain"); pipeDoc = rdata.read(); } else { pipeDoc = parse(pipeline.getUri(), getStaticBaseURI().toASCIIString()); ReadableData rdata = new ReadableData(this, XProcConstants.c_result, pipeline.getInputStream(), "text/plain"); pipeDoc = rdata.read(); } else { pipeDoc = parse(new InputSource(pipeline.getInputStream())); throw new UnsupportedOperationException(format("Unsupported pipeline kind '%s'", pipeline.getKind()));
try { InputStream instream = null; switch (saxoncfg.getKind()) { case URI: URI furi = URI.create(saxoncfg.getUri()); instream = new FileInputStream(new File(furi)); break; instream = saxoncfg.getInputStream(); break; throw new UnsupportedOperationException(format("Unsupported saxonConfig kind '%s'", saxoncfg.getKind()));
public XLibrary loadLibrary(Input library) throws SaxonApiException { String libraryURI; switch (library.getKind()) { case URI: libraryURI = library.getUri(); break; libraryURI = library.getInputStreamUri(); break; throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind()));
try { Input library = libraries.get(0); if (library.getKind() == INPUT_STREAM) { InputStream libraryInputStream = library.getInputStream(); FileOutputStream fileOutputStream = null; try { fileOutputStream = new FileOutputStream(tempLibrary); fileOutputStream.getChannel().transferFrom(newChannel(libraryInputStream), 0, MAX_VALUE); libraries.set(0, new Input(tempLibrary.toURI().toASCIIString())); } finally { Closer.close(fileOutputStream); switch (library.getKind()) { case URI: tree.addStartElement(p_import); tree.addAttribute(new QName("href"), library.getUri()); tree.startContent(); tree.addEndElement(); InputStream libraryInputStream = library.getInputStream(); FileOutputStream fileOutputStream = null; try { throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind())); QName qname = (input.getType() == DATA) ? p_data : p_document; switch (input.getKind()) { case URI:
loader = _load(new Input(loaderURI)); } catch (SaxonApiException sae) { error(sae); switch (pipeline.getKind()) { case URI: if (data) { ReadableData rdata = new ReadableData(this, XProcConstants.c_result, getStaticBaseURI().resolve(pipeline.getUri()).toASCIIString(), "text/plain"); pipeDoc = rdata.read(); } else { pipeDoc = parse(pipeline.getUri(), getStaticBaseURI().toASCIIString()); ReadableData rdata = new ReadableData(this, XProcConstants.c_result, pipeline.getInputStream(), "text/plain"); pipeDoc = rdata.read(); } else { pipeDoc = parse(new InputSource(pipeline.getInputStream())); throw new UnsupportedOperationException(format("Unsupported pipeline kind '%s'", pipeline.getKind()));
try { InputStream instream = null; switch (saxoncfg.getKind()) { case URI: URI furi = URI.create(saxoncfg.getUri()); instream = new FileInputStream(new File(furi)); break; instream = saxoncfg.getInputStream(); break; throw new UnsupportedOperationException(format("Unsupported saxonConfig kind '%s'", saxoncfg.getKind()));
public XLibrary loadLibrary(Input library) throws SaxonApiException { String libraryURI; switch (library.getKind()) { case URI: libraryURI = library.getUri(); break; libraryURI = library.getInputStreamUri(); break; throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind()));
XdmNode doc = null; for (Input input : userArgs.getInputs(port)) { switch (input.getType()) { case XML: switch (input.getKind()) { case URI: String uri = input.getUri(); if ("-".equals(uri)) { doc = runtime.parse(new InputSource(System.in)); InputStream inputStream = input.getInputStream(); try { doc = runtime.parse(new InputSource(inputStream)); throw new UnsupportedOperationException(format("Unsupported input kind '%s'", input.getKind())); switch (input.getKind()) { case URI: rd = new ReadableData(runtime, c_data, input.getUri(), input.getContentType()); doc = rd.read(); break; InputStream inputStream = input.getInputStream(); try { rd = new ReadableData(runtime, c_data, inputStream, input.getContentType()); doc = rd.read(); } finally { throw new UnsupportedOperationException(format("Unsupported input kind '%s'", input.getKind()));
private XLibrary _loadLibrary(Input library) throws SaxonApiException, IOException { PipelineLibrary plibrary; switch (library.getKind()) { case URI: plibrary = parser.loadLibrary(library.getUri()); break; case INPUT_STREAM: plibrary = parser.loadLibrary(library.getInputStream(), library.getInputStreamUri()); break; default: throw new UnsupportedOperationException(format("Unsupported library kind '%s'", library.getKind())); } if (errorCode != null) { throw new XProcException(errorCode, errorMessage); } XLibrary xlibrary = new XLibrary(this, plibrary); if (errorCode != null) { throw new XProcException(errorCode, errorMessage); } return xlibrary; }
public void addLibrary(String libraryURI) { needsCheck = true; libraries.add(new Input(libraryURI)); }
try { InputStream instream; switch (this.config.getKind()) { case URI: URI furi = URI.create(this.config.getUri()); instream = new FileInputStream(new File(furi)); break; instream = this.config.getInputStream(); break; throw new UnsupportedOperationException(format("Unsupported config kind '%s'", this.config.getKind()));
public XPipeline load(Input pipeline) throws SaxonApiException { String uri; switch (pipeline.getKind()) { case URI: uri = pipeline.getUri(); break; uri = pipeline.getInputStreamUri(); break; throw new UnsupportedOperationException(format("Unsupported pipeline kind '%s'", pipeline.getKind()));
XdmNode doc = null; for (Input input : userArgs.getInputs(port)) { switch (input.getType()) { case XML: switch (input.getKind()) { case URI: String uri = input.getUri(); if ("-".equals(uri)) { doc = runtime.parse(new InputSource(System.in)); InputStream inputStream = input.getInputStream(); try { doc = runtime.parse(new InputSource(inputStream)); throw new UnsupportedOperationException(format("Unsupported input kind '%s'", input.getKind())); switch (input.getKind()) { case URI: rd = new ReadableData(runtime, c_data, input.getUri(), input.getContentType()); doc = rd.read(); break; InputStream inputStream = input.getInputStream(); try { rd = new ReadableData(runtime, c_data, inputStream, input.getContentType()); doc = rd.read(); } finally { throw new UnsupportedOperationException(format("Unsupported input kind '%s'", input.getKind()));
private XPipeline _load(Input pipelineInput) throws SaxonApiException, IOException { reset(); configurer.getXMLCalabashConfigurer().configRuntime(this); switch (pipelineInput.getKind()) { case URI: if (baseURI == null) { pipeline = parser.loadPipeline(pipelineInput.getUri()); } else { pipeline = parser.loadPipeline(pipelineInput.getUri(), baseURI.toASCIIString()); pipeline = parser.loadPipeline(pipelineInput.getInputStream(), pipelineInput.getInputStreamUri()); break; throw new UnsupportedOperationException(format("Unsupported pipeline kind '%s'", pipelineInput.getKind()));
public void addLibrary(InputStream libraryInputStream, String libraryURI) { needsCheck = true; libraries.add(new Input(libraryInputStream, libraryURI)); }
try { InputStream instream; switch (this.config.getKind()) { case URI: URI furi = URI.create(this.config.getUri()); instream = new FileInputStream(new File(furi)); break; instream = this.config.getInputStream(); break; throw new UnsupportedOperationException(format("Unsupported config kind '%s'", this.config.getKind()));
public XPipeline load(Input pipeline) throws SaxonApiException { String uri; switch (pipeline.getKind()) { case URI: uri = pipeline.getUri(); break; uri = pipeline.getInputStreamUri(); break; throw new UnsupportedOperationException(format("Unsupported pipeline kind '%s'", pipeline.getKind()));