public XProcError getCause() { Throwable cause = e.getCause(); if (cause != null && cause instanceof XProcException) return new CalabashXProcError((XProcException)cause); else return null; }
private String checkNCName(String name) { if (name != null) { try { TypeUtils.checkType(runtime, name, XProcConstants.xs_NCName,null); } catch (XProcException xe) { throw new XProcException("Invalid name: \"" + name + "\". Step and port names must be NCNames.", xe.getCause()); } } return name; }
private String checkNCName(String name) { if (name != null) { try { TypeUtils.checkType(runtime, name, XProcConstants.xs_NCName,null); } catch (XProcException xe) { throw new XProcException("Invalid name: \"" + name + "\". Step and port names must be NCNames.", xe.getCause()); } } return name; }
Throwable cause = err.getCause(); while (cause != null && cause instanceof XProcException) { cause = cause.getCause();
throw XProcException.staticError(52, node, xe.getCause(), "Cannot import: " + importURI.toASCIIString()); } else { throw xe;
Throwable cause = err.getCause(); while (cause != null && cause instanceof XProcException) { cause = cause.getCause();
throw XProcException.staticError(52, node, xe.getCause(), "Cannot import: " + importURI.toASCIIString()); } else { throw xe;
Throwable c = this.getCause(); if (c != null && c instanceof XProcException) cause = ((XProcException)c).rebaseOnto(base);
public void close(Result result) throws TransformerException { String href = result.getSystemId(); XdmDestination xdmResult = secondaryResults.get(href); XdmNode doc = xdmResult.getXdmNode(); try { S9apiUtils.assertDocument(doc); secondaryPipe.write(doc); } catch (XProcException e) { // If the document isn't well-formed XML, encode it as text if (runtime.getAllowTextResults()) { // Document is apparently not well-formed XML. TreeWriter tree = new TreeWriter(runtime); tree.startDocument(doc.getBaseURI()); tree.addStartElement(XProcConstants.c_result); tree.addAttribute(_content_type, "text/plain"); tree.addAttribute(cx_decode, "true"); tree.startContent(); tree.addText(doc.toString()); tree.addEndElement(); tree.endDocument(); secondaryPipe.write(tree.getResult()); } else { throw new XProcException(step.getStep(), "p:xslt returned non-XML secondary result", e.getCause()); } } } }
public void close(Result result) throws TransformerException { String href = result.getSystemId(); XdmDestination xdmResult = secondaryResults.get(href); XdmNode doc = xdmResult.getXdmNode(); try { S9apiUtils.assertDocument(doc); secondaryPipe.write(doc); } catch (XProcException e) { // If the document isn't well-formed XML, encode it as text if (runtime.getAllowTextResults()) { // Document is apparently not well-formed XML. TreeWriter tree = new TreeWriter(runtime); tree.startDocument(doc.getBaseURI()); tree.addStartElement(XProcConstants.c_result); tree.addAttribute(_content_type, "text/plain"); tree.addAttribute(cx_decode, "true"); tree.startContent(); tree.addText(doc.toString()); tree.addEndElement(); tree.endDocument(); secondaryPipe.write(tree.getResult()); } else { throw new XProcException(step.getStep(), "p:xslt returned non-XML secondary result", e.getCause()); } } } }
node = tree.getResult(); } else { throw new XProcException(step.getStep(), "p:xquery returned non-XML result", e.getCause());
node = tree.getResult(); } else { throw new XProcException(step.getStep(), "p:xquery returned non-XML result", e.getCause());
resultPipe.write(tree.getResult()); } else { throw new XProcException(step.getStep(), "p:xslt returned non-XML result", e.getCause());
resultPipe.write(tree.getResult()); } else { throw new XProcException(step.getStep(), "p:xslt returned non-XML result", e.getCause());