public static void serialize(XProcRuntime xproc, XdmNode node, Serializer serializer) throws SaxonApiException { Vector<XdmNode> nodes = new Vector<XdmNode> (); nodes.add(node); serialize(xproc, nodes, serializer); }
public static void serialize(XProcRuntime xproc, XdmNode node, Serializer serializer) throws SaxonApiException { Vector<XdmNode> nodes = new Vector<XdmNode> (); nodes.add(node); serialize(xproc, nodes, serializer); }
public void store(OutputStream ostream) throws IOException { logger.trace("Attempt to write file: " + uri); serializer.setOutputStream(ostream); try { S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new IOException(e); } } });
public void store(OutputStream ostream) throws IOException { logger.trace("Attempt to write file: " + uri); serializer.setOutputStream(ostream); try { S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new IOException(e); } } });
public void store(OutputStream outstr) throws IOException { if (method == CompressionMethod.GZIP) { GZIPOutputStream gzout = new GZIPOutputStream(outstr); outstr = gzout; } serializer.setOutputStream(outstr); try { S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new IOException(e); } } });
public void store(OutputStream outstr) throws IOException { if (method == CompressionMethod.GZIP) { GZIPOutputStream gzout = new GZIPOutputStream(outstr); outstr = gzout; } serializer.setOutputStream(outstr); try { S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new IOException(e); } } });
public static InputSource xdmToInputSource(XProcRuntime runtime, XdmNode node) throws SaxonApiException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputStream(out); serialize(runtime, node, serializer); InputSource isource = new InputSource(new ByteArrayInputStream(out.toByteArray())); if (node.getBaseURI() != null) { isource.setSystemId(node.getBaseURI().toASCIIString()); } return isource; }
public static InputSource xdmToInputSource(XProcRuntime runtime, XdmNode node) throws SaxonApiException { ByteArrayOutputStream out = new ByteArrayOutputStream(); Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputStream(out); serialize(runtime, node, serializer); InputSource isource = new InputSource(new ByteArrayInputStream(out.toByteArray())); if (node.getBaseURI() != null) { isource.setSystemId(node.getBaseURI().toASCIIString()); } return isource; }
private byte[] textContent(final XdmNode doc) { Serializer serializer = makeSerializer(); serializer.setOutputProperty(Serializer.Property.METHOD, "text"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); serializer.setOutputStream(baos); try { S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new XProcException(e); } return baos.toByteArray(); }
private byte[] XmlContent(final XdmNode doc) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { try { Serializer serializer = makeSerializer(); serializer.setOutputStream(baos); S9apiUtils.serialize(runtime, doc, serializer); } catch (SaxonApiException e) { throw new XProcException(e); } finally { baos.close(); } } catch (IOException e) { throw new XProcException(e); } return baos.toByteArray(); }
public void storeXML(FileToZip file, XdmNode doc, OutputStream out) throws SaxonApiException { Serializer serializer = makeSerializer(file.getOptions()); serializer.setOutputStream(out); S9apiUtils.serialize(runtime, doc, serializer); }
public void storeXML(FileToZip file, XdmNode doc, OutputStream out) throws SaxonApiException { Serializer serializer = makeSerializer(file.getOptions()); serializer.setOutputStream(out); S9apiUtils.serialize(runtime, doc, serializer); }
public String serializeAsXML(XdmNode node) { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.BYTE_ORDER_MARK, "no"); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); ByteArrayOutputStream os = new ByteArrayOutputStream(); serializer.setOutputStream(os); S9apiUtils.serialize(runtime, node, serializer); String result = os.toString(); return result; } catch (SaxonApiException sae) { logger.warn("Failed to serialize node: " + node); logger.debug(sae.getMessage(), sae); return ""; } }
public String serializeAsXML(XdmNode node) { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.BYTE_ORDER_MARK, "no"); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); ByteArrayOutputStream os = new ByteArrayOutputStream(); serializer.setOutputStream(os); S9apiUtils.serialize(runtime, node, serializer); String result = os.toString(); return result; } catch (SaxonApiException sae) { logger.warn("Failed to serialize node: " + node); logger.debug(sae.getMessage(), sae); return ""; } } }
public String serializeAsXML(XdmNode node) { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.BYTE_ORDER_MARK, "no"); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); ByteArrayOutputStream os = new ByteArrayOutputStream(); serializer.setOutputStream(os); S9apiUtils.serialize(runtime, node, serializer); String result = os.toString(); return result; } catch (SaxonApiException sae) { logger.warn("Failed to serialize node: " + node); logger.debug(sae.getMessage(), sae); return ""; } } }
public String serializeAsXML(XdmNode node) { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.BYTE_ORDER_MARK, "no"); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); ByteArrayOutputStream os = new ByteArrayOutputStream(); serializer.setOutputStream(os); S9apiUtils.serialize(runtime, node, serializer); String result = os.toString(); return result; } catch (SaxonApiException sae) { logger.warn("Failed to serialize node: " + node); logger.debug(sae.getMessage(), sae); return ""; } }
private static void storeXML(XProcRuntime runtime, XdmNode doc, OutputStream stream) { try { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "no"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputStream(stream); S9apiUtils.serialize(runtime, doc, serializer); } finally { stream.close(); } } catch (IOException ioe) { throw new XProcException("Failed to serialize as XML: " + doc, ioe); } catch (SaxonApiException sae) { throw new XProcException("Failed to serialize as XML: " + doc, sae); } }
private static void storeXML(XProcRuntime runtime, XdmNode doc, OutputStream stream) { try { try { Serializer serializer = runtime.getProcessor().newSerializer(); serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8"); serializer.setOutputProperty(Serializer.Property.INDENT, "no"); serializer.setOutputProperty(Serializer.Property.OMIT_XML_DECLARATION, "yes"); serializer.setOutputProperty(Serializer.Property.METHOD, "xml"); serializer.setOutputStream(stream); S9apiUtils.serialize(runtime, doc, serializer); } finally { stream.close(); } } catch (IOException ioe) { throw new XProcException("Failed to serialize as XML: " + doc, ioe); } catch (SaxonApiException sae) { throw new XProcException("Failed to serialize as XML: " + doc, sae); } }
S9apiUtils.serialize(runtime, child, serializer); String data = sw.toString();
S9apiUtils.serialize(runtime, child, serializer); String data = sw.toString();