public StepErrorListener(XProcRuntime runtime) { super(); this.runtime = runtime; baseURI = runtime.getStaticBaseURI(); }
public StepErrorListener(XProcRuntime runtime) { super(); this.runtime = runtime; this.msgListener = runtime.getMessageListener(); baseURI = runtime.getStaticBaseURI(); }
private void loadPipeline(String uri, String id, int seconds) { Calendar expires = GregorianCalendar.getInstance(); if (seconds >= 0) { long millis = seconds; long extime = expires.getTimeInMillis() + (millis*1000); expires.setTimeInMillis(extime); } else { expires.setTimeInMillis(Long.MAX_VALUE); } XProcRuntime runtime = new XProcRuntime(getConfiguration()); try { XdmNode doc = runtime.parse(uri, runtime.getStaticBaseURI().toASCIIString()); XPipeline pipeline = runtime.use(doc); getPipelines().put(id, new PipelineConfiguration(runtime, pipeline, expires)); } catch (Exception e) { throw new XProcException(e); } } }
private void loadPipeline(String uri, String id, int seconds) { Calendar expires = GregorianCalendar.getInstance(); if (seconds >= 0) { long millis = seconds; long extime = expires.getTimeInMillis() + (millis*1000); expires.setTimeInMillis(extime); } else { expires.setTimeInMillis(Long.MAX_VALUE); } XProcRuntime runtime = new XProcRuntime(getConfiguration()); try { XdmNode doc = runtime.parse(uri, runtime.getStaticBaseURI().toASCIIString()); XPipeline pipeline = runtime.use(doc); getPipelines().put(id, new PipelineConfiguration(runtime, pipeline, expires)); } catch (Exception e) { throw new XProcException(e); } } }
public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException { XProcRuntime runtime = registry.getRuntime(xdef); XStep step = runtime.getXProcData().getStep(); // FIXME: this can't be the best way to do this... // step == null in use-when if (step != null && !(step instanceof XCompoundStep)) { throw XProcException.dynamicError(23); } // In 0.9.20, I removed the trailing slash from cwd(). // The community didn't like that, so I put it back. String cwd = runtime.getStaticBaseURI().toASCIIString(); return new AnyURIValue(cwd); } }
public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException { XProcRuntime runtime = registry.getRuntime(xdef); XStep step = runtime.getXProcData().getStep(); // FIXME: this can't be the best way to do this... // step == null in use-when if (step != null && !(step instanceof XCompoundStep)) { throw XProcException.dynamicError(23); } // In 0.9.20, I removed the trailing slash from cwd(). // The community didn't like that, so I put it back. String cwd = runtime.getStaticBaseURI().toASCIIString(); return new AnyURIValue(cwd); } }
URL url = runtime.getStaticBaseURI().resolve(href).toURL(); URLConnection connection = url.openConnection(); FunctionLibrary fl = null;
URL url = runtime.getStaticBaseURI().resolve(href).toURL(); URLConnection connection = url.openConnection(); FunctionLibrary fl = null;
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());
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());
baseURI = sequences[1].head().getStringValue(); } else { baseURI = runtime.getStaticBaseURI().toASCIIString(); try {
baseURI = sequences[1].head().getStringValue(); } else { baseURI = runtime.getStaticBaseURI().toASCIIString(); try {
tree.startDocument(runtime.getStaticBaseURI()); tree.addStartElement(p_declare_step); tree.addAttribute(new QName("version"), "1.0");
tree.startDocument(runtime.getStaticBaseURI()); tree.addStartElement(p_declare_step); tree.addAttribute(new QName("version"), "1.0");
tw.startDocument(runtime.getStaticBaseURI()); tw.addStartElement(OutputRootTag); tw.startDocument(runtime.getStaticBaseURI()); tw.addStartElement(StatusRootTag); if (mErrorCounter == 0) printInfo("writing TTS logs..."); TreeWriter xmlLog = new TreeWriter(runtime); xmlLog.startDocument(runtime.getStaticBaseURI()); xmlLog.addStartElement(LogRootTag); xmlLog.startContent();