Package org.exist.util.serializer

Examples of org.exist.util.serializer.IndentingXMLWriter


          //serialize the node to SAX
          ByteArrayOutputStream baos = new ByteArrayOutputStream();

            OutputStreamWriter osw = new OutputStreamWriter( baos, UTF_8 );

          IndentingXMLWriter     xmlWriter = new IndentingXMLWriter( osw );
          Properties outputProperties = new Properties();
          outputProperties.setProperty(OutputKeys.ENCODING, "UTF-8");
          if (indentLevel != null) {
              outputProperties.setProperty(OutputKeys.INDENT, "yes");
              outputProperties.setProperty(EXistOutputKeys.INDENT_SPACES, indentLevel);
          } else {
              outputProperties.setProperty(OutputKeys.INDENT, "no");
          }
          xmlWriter.setOutputProperties(outputProperties);
 
          SAXSerializer sax       = new SAXSerializer();
 
          sax.setReceiver( xmlWriter );
 
View Full Code Here

TOP

Related Classes of org.exist.util.serializer.IndentingXMLWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.