private void writeXml(Node n, PrintWriter pw) throws XMLStreamException { XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(pw); writer = new PrettyPrintXMLStreamWriter(writer, 2); StaxUtils.copy(new DOMSource(n), writer); writer.close(); } }
public static void writeTo(Node node, Writer os, int indent) throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(os); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } try { copy(new DOMSource(node), writer); } finally { writer.close(); } }
public static void writeTo(Node node, Writer os, int indent) throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(os); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } try { copy(new DOMSource(node), writer); } finally { writer.close(); } }
protected void writePrettyPayload(StringBuilder builder, StringWriter stringWriter, String contentType) throws Exception { // Just transform the XML message when the cos has content StringWriter swriter = new StringWriter(); XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(swriter); xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2); StaxUtils.copy(new StreamSource(new StringReader(stringWriter.getBuffer().toString())), xwriter); xwriter.close(); String result = swriter.toString(); if (result.length() < limit || limit == -1) { builder.append(swriter.toString()); } else { builder.append(swriter.toString().substring(0, limit)); } }
public static void writeTo(Node node, Writer os, int indent) throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(os); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } try { copy(new DOMSource(node), writer); } finally { writer.close(); } }
protected void writePrettyPayload(StringBuilder builder, StringWriter stringWriter, String contentType) throws Exception { // Just transform the XML message when the cos has content StringWriter swriter = new StringWriter(); XMLStreamWriter xwriter = StaxUtils.createXMLStreamWriter(swriter); xwriter = new PrettyPrintXMLStreamWriter(xwriter, 2); StaxUtils.copy(new StreamSource(new StringReader(stringWriter.getBuffer().toString())), xwriter); xwriter.close(); String result = swriter.toString(); if (result.length() < limit || limit == -1) { builder.append(swriter.toString()); } else { builder.append(swriter.toString().substring(0, limit)); } }
public static void writeTo(Node node, Writer os, int indent) throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(os); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } try { copy(new DOMSource(node), writer); } finally { writer.close(); } }
private void writeXml(Node n, PrintWriter pw) throws XMLStreamException { XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(pw); writer = new PrettyPrintXMLStreamWriter(writer, 2); StaxUtils.copy(new DOMSource(n), writer); writer.close(); } }
private void writeXml(Node n, PrintWriter pw) throws XMLStreamException { XMLStreamWriter writer = StaxUtils.createXMLStreamWriter(pw); writer = new PrettyPrintXMLStreamWriter(writer, 2); StaxUtils.copy(new DOMSource(n), writer); writer.close(); } }
public static void writeTo(Node node, Writer os, int indent) throws XMLStreamException { XMLStreamWriter writer = createXMLStreamWriter(os); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } try { copy(new DOMSource(node), writer); } finally { writer.close(); } }
public static void writeTo(Node node, OutputStream os, int indent) throws XMLStreamException { if (indent > 0) { XMLStreamWriter writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(os), indent); try { copy(new DOMSource(node), writer); } finally { writer.close(); } } else { copy(new DOMSource(node), os); } } public static void writeTo(Node node, Writer os) throws XMLStreamException {
public static void printXmlFragment(XMLStreamReader reader) { try { StringWriter sw = new StringWriter(1024); XMLStreamWriter writer = null; try { writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(sw), 4); copy(reader, writer); writer.flush(); } finally { StaxUtils.close(writer); } LOG.info(sw.toString()); } catch (XMLStreamException e) { LOG.severe(e.getMessage()); } }
public static void writeTo(Node node, OutputStream os, int indent) throws XMLStreamException { if (indent > 0) { XMLStreamWriter writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(os), indent); try { copy(new DOMSource(node), writer); } finally { writer.close(); } } else { copy(new DOMSource(node), os); } } public static void writeTo(Node node, Writer os) throws XMLStreamException {
public static void printXmlFragment(XMLStreamReader reader) { try { StringWriter sw = new StringWriter(1024); XMLStreamWriter writer = null; try { writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(sw), 4); copy(reader, writer); writer.flush(); } finally { StaxUtils.close(writer); } LOG.info(sw.toString()); } catch (XMLStreamException e) { LOG.severe(e.getMessage()); } }
public static void printXmlFragment(XMLStreamReader reader) { try { StringWriter sw = new StringWriter(1024); XMLStreamWriter writer = null; try { writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(sw), 4); copy(reader, writer); writer.flush(); } finally { StaxUtils.close(writer); } LOG.info(sw.toString()); } catch (XMLStreamException e) { LOG.severe(e.getMessage()); } }
public static void printXmlFragment(XMLStreamReader reader) { try { StringWriter sw = new StringWriter(1024); XMLStreamWriter writer = null; try { writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(sw), 4); copy(reader, writer); writer.flush(); } finally { StaxUtils.close(writer); } LOG.info(sw.toString()); } catch (XMLStreamException e) { LOG.severe(e.getMessage()); } }
public static void writeTo(Node node, OutputStream os, int indent) throws XMLStreamException { if (indent > 0) { XMLStreamWriter writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(os), indent); try { copy(new DOMSource(node), writer); } finally { writer.close(); } } else { copy(new DOMSource(node), os); } } public static void writeTo(Node node, Writer os) throws XMLStreamException {
public static void writeTo(Node node, OutputStream os, int indent) throws XMLStreamException { if (indent > 0) { XMLStreamWriter writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(os), indent); try { copy(new DOMSource(node), writer); } finally { writer.close(); } } else { copy(new DOMSource(node), os); } } public static void writeTo(Node node, Writer os) throws XMLStreamException {
public static void writeTo(Node node, OutputStream os, int indent) throws XMLStreamException { if (indent > 0) { XMLStreamWriter writer = new PrettyPrintXMLStreamWriter(createXMLStreamWriter(os), indent); try { copy(new DOMSource(node), writer); } finally { writer.close(); } } else { copy(new DOMSource(node), os); } } public static void writeTo(Node node, Writer os) throws XMLStreamException {
public static String toString(Element el, int indent) { StringWriter sw = new StringWriter(1024); XMLStreamWriter writer = null; try { writer = createXMLStreamWriter(sw); if (indent > 0) { writer = new PrettyPrintXMLStreamWriter(writer, indent); } copy(el, writer); writer.flush(); } catch (XMLStreamException e) { throw new RuntimeException(e); } finally { StaxUtils.close(writer); } return sw.toString(); } public static void close(XMLStreamReader reader) throws XMLStreamException {