/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XMLSerializer() { super( new OutputFormat( Method.XML, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public HTMLSerializer( OutputFormat format ) { this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public HTMLSerializer( OutputFormat format ) { this( false, format != null ? format : new OutputFormat( Method.HTML, "ISO-8859-1", false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public TextSerializer() { super( new OutputFormat( Method.TEXT, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XHTMLSerializer( OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public HTMLSerializer() { this( false, new OutputFormat( Method.HTML, "ISO-8859-1", false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XHTMLSerializer( OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XHTMLSerializer( OutputFormat format ) { super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public HTMLSerializer() { this( false, new OutputFormat( Method.HTML, "ISO-8859-1", false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public TextSerializer() { super( new OutputFormat( Method.TEXT, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XMLSerializer() { super( new OutputFormat( Method.XML, null, false ) ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XMLSerializer( OutputFormat format ) { super( format != null ? format : new OutputFormat( Method.XML, null, false ) ); _format.setMethod( Method.XML ); }
/** * Constructs a new serializer. The serializer cannot be used without * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} * first. */ public XMLSerializer( OutputFormat format ) { super( format != null ? format : new OutputFormat( Method.XML, null, false ) ); _format.setMethod( Method.XML ); }
private static OutputFormat getXmlNoSpace(String encoding) { OutputFormat fmt = new OutputFormat("XML", encoding, false); // indent == 0 means add no indenting fmt.setIndent(0); // default line width is 72, but only applies when indenting fmt.setLineWidth(0); fmt.setPreserveSpace(false); return fmt; }
private static OutputFormat getXmlNoSpace(String encoding) { OutputFormat fmt = new OutputFormat("XML", encoding, false); // indent == 0 means add no indenting fmt.setIndent(0); // default line width is 72, but only applies when indenting fmt.setLineWidth(0); fmt.setPreserveSpace(false); return fmt; }
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 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; }