public void add(XdmNode document) { if (closed) { throw new XProcException("You can't add a document to a closed DocumentSequence."); } else { S9apiUtils.assertDocument(document); //runtime.finest(logger, null, "Wrote " + (document == null ? "null" : document.getBaseURI()) + " to " + toString()); documents.add(document); if (outputlog != null) { outputlog.log(document); } } }
public void add(XdmNode document) { if (closed) { throw new XProcException("You can't add a document to a closed DocumentSequence."); } else { S9apiUtils.assertDocument(document); //runtime.finest(logger, null, "Wrote " + (document == null ? "null" : document.getBaseURI()) + " to " + toString()); documents.add(document); if (outputlog != null) { outputlog.log(document); } } }
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()); } } } }
S9apiUtils.assertDocument(node); } catch (XProcException e) {
S9apiUtils.assertDocument(node); } catch (XProcException e) {
S9apiUtils.assertDocument(xformed); resultPipe.write(xformed); } catch (XProcException e) {
S9apiUtils.assertDocument(xformed); resultPipe.write(xformed); } catch (XProcException e) {