OutputFormat format = new OutputFormat(document); format.setIndenting(true); format.setOmitXMLDeclaration(true);
serial.serialize((Document) node); } else if (node instanceof Element) { format.setOmitXMLDeclaration(true); serial.serialize((Element) node); } else if (node instanceof DocumentFragment) { format.setOmitXMLDeclaration(true); serial.serialize((DocumentFragment) node); } else if (node instanceof Text) {
/** * Sets XML declaration omitting on and off. * * @param ommitXmlDeclaration * <code>true</code> if XML declaration should be omitted */ public void setOmitXMLDeclaration(final boolean ommitXmlDeclaration) { outputFormat.setOmitXMLDeclaration(ommitXmlDeclaration); }
/** * Sets XML declaration omitting on and off. * * @param ommitXmlDeclaration * <code>true</code> if XML declaration should be omitted */ public void setOmitXMLDeclaration(final boolean ommitXmlDeclaration) { outputFormat.setOmitXMLDeclaration(ommitXmlDeclaration); }
@XContent("description") public void setDescription(DocumentFragment descriptionDOM) { try { OutputFormat of = new OutputFormat(); of.setOmitXMLDeclaration(true); this.description = DOMSerializer.toString(descriptionDOM, of).trim(); } catch (IOException e) { log.error(e, e); } }
public static String toStringOmitXml(Element element) throws IOException { OutputFormat of = new OutputFormat(); of.setOmitXMLDeclaration(true); return toString(element, of); }
@XContent("description") public void setDescription(DocumentFragment descriptionDOM) { try { OutputFormat of = new OutputFormat(); of.setOmitXMLDeclaration(true); this.description = DOMSerializer.toString(descriptionDOM, of).trim(); } catch (IOException e) { log.error(e, e); } }
private XMLSerializer createXMLSerializer(Node node, Format fmt) { if(fmt==null) { fmt = Format.defaultFormat; } OutputFormat format = new OutputFormat(); //node.getOwnerDocument()); format.setIndent(fmt.indent); format.setOmitXMLDeclaration(!fmt.xmlDecl); format.setEncoding(fmt.encoding); return new XMLSerializer(format); }
private static OutputFormat getPrettyPrint() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setEncoding("UTF-8"); fmt.setIndenting(true); fmt.setIndent(2); fmt.setOmitXMLDeclaration(true); return fmt; }
private static OutputFormat getPrettyPrint() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setEncoding("UTF-8"); fmt.setIndenting(true); fmt.setIndent(2); fmt.setOmitXMLDeclaration(true); return fmt; }
private static OutputFormat getPrettyPrintWithDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setEncoding("UTF-8"); fmt.setIndenting(true); fmt.setIndent(2); fmt.setOmitXMLDeclaration(false); return fmt; } }
private static OutputFormat getPrettyPrintWithDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setEncoding("UTF-8"); fmt.setIndenting(true); fmt.setIndent(2); fmt.setOmitXMLDeclaration(false); return fmt; } }
private static OutputFormat getConsoleWithDocType() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(80); fmt.setPreserveSpace(false); // default is false fmt.setOmitXMLDeclaration(false); // default is false fmt.setOmitDocumentType(false); return fmt; }
private static OutputFormat getMgmtWithDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(120); fmt.setPreserveSpace(false); fmt.setOmitXMLDeclaration(false); fmt.setOmitDocumentType(true); return fmt; }
private static OutputFormat getConsoleWithDocType() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(80); fmt.setPreserveSpace(false); // default is false fmt.setOmitXMLDeclaration(false); // default is false fmt.setOmitDocumentType(false); return fmt; }
private static OutputFormat getConsoleNoDocType() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(80); fmt.setPreserveSpace(false); // default is false fmt.setOmitXMLDeclaration(false); fmt.setOmitDocumentType(true); return fmt; }
private static OutputFormat getMgmtNoDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(120); fmt.setPreserveSpace(false); fmt.setOmitXMLDeclaration(true); fmt.setOmitDocumentType(true); return fmt; }
private static OutputFormat getMgmtNoDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(120); fmt.setPreserveSpace(false); fmt.setOmitXMLDeclaration(true); fmt.setOmitDocumentType(true); return fmt; }
private static OutputFormat getMgmtWithDecl() { OutputFormat fmt = new OutputFormat("XML", "UTF-8", true); fmt.setIndent(2); fmt.setLineWidth(120); fmt.setPreserveSpace(false); fmt.setOmitXMLDeclaration(false); fmt.setOmitDocumentType(true); return fmt; }
public SerializingUserLayoutDao() { layoutOutputFormat=new OutputFormat(); layoutOutputFormat.setIndenting(true); layoutOutputFormat.setLineWidth(0); layoutOutputFormat.setOmitDocumentType(false); layoutOutputFormat.setPreserveSpace(true); layoutOutputFormat.setEncoding("UTF-8"); layoutOutputFormat.setOmitComments(false); layoutOutputFormat.setOmitXMLDeclaration(false); layoutOutputFormat.setDoctype(publicDoctype, systemDoctype); }