Package com.sun.org.apache.xml.internal.serialize

Examples of com.sun.org.apache.xml.internal.serialize.OutputFormat


     * the DIG XML used to communicate with the reasoner.
     */
    protected void log(Document doc) {

        StringWriter writer = new StringWriter();
        OutputFormat format = new OutputFormat();
        format.setIndent(4);
        format.setIndenting(true);
        XMLSerializer serializer = new XMLSerializer(writer,
                                                     format);
        try {
            serializer.serialize(doc);
            System.out.println(writer.getBuffer().toString());
View Full Code Here


    }


    public static void serializeXML(Document dom, String pathDest)
    {
    OutputFormat format = new OutputFormat(dom);
    format.setIndenting(true);
   
    XMLSerializer serializer;
    try {
      File fileDest = new File(pathDest);
      serializer = new XMLSerializer(
View Full Code Here

        return document;
    }

    public static void writeXml(Document document, OutputStream os) throws TransformerException {
        try {
            OutputFormat format = new OutputFormat(document, PluginConstants.UTF_ENCODING, true);
            format.setIndent(2);
            Writer output = new BufferedWriter(new OutputStreamWriter(os, PluginConstants.UTF_ENCODING));
            XMLSerializer serializer = new XMLSerializer(output, format);
            serializer.serialize(document);
        } catch (IOException e) {
            throw new TransformerException(e);
View Full Code Here

                Element itemElem = createFilterElement(dom, flitem);
                filterElem.appendChild(itemElem);
            }
        }
        // print to file
        OutputFormat format = new OutputFormat(dom);
        format.setIndenting(true);

        // to generate a file output use fileoutputstream instead of system.out
        FileOutputStream out = new FileOutputStream(new File(file));
        XMLSerializer serializer = new XMLSerializer(out, format);
        serializer.serialize(dom);
View Full Code Here

            if(entry.getName().endsWith(".xml") || entry.getName().endsWith(".vml") || entry.getName().endsWith(".rels")){
                try {
                    //pass the xml through the Xerces serializer to produce nicely formatted output
                    Document doc = builder.parse(zip.getInputStream(entry));

                    OutputFormat  format  = new OutputFormat( doc );
                    format.setIndenting(true);

                    XMLSerializer serial = new  XMLSerializer( out, format );
                    serial.asDOMSerializer();
                    serial.serialize( doc.getDocumentElement() );
                } catch (Exception e){
View Full Code Here

    protected void setUp() throws Exception {
        frameHolder = new FrameHolder();
        out = new StringWriter();
        ve = new VariableExpander(new Framer(frameHolder));
        ve.setParent(getXMLReader());
        OutputFormat of = new OutputFormat();
        of.setOmitXMLDeclaration(true);       
        Serializer ts = new XMLSerializer(of);
        ts.setOutputCharStream(out);
        ve.setContentHandler(ts.asContentHandler());
    }
View Full Code Here

                java.io.StringWriter outString = new java.io.StringWriter ();
                /* This should be reviewed at some point to see if we can use the
                 * DOM3 LS capability and hence a standard way of doing this rather
                 * than using an internal implementation class.
                 */
                OutputFormat format = new OutputFormat();
                format.setOmitXMLDeclaration(true);
                format.setIndenting(true);
                XMLSerializer xsl = new XMLSerializer(outString, format);               
                xsl.serialize (doc);
                log.debug(outString.toString());
            } catch (Exception e) {
                log.debug(e, e);
View Full Code Here

          StringWriter outString = new StringWriter();
        /* TODO: This should be reviewed at some point to see if we can use the
           * DOM3 LS capability and hence a standard way of doing this rather
         * than using an internal implementation class.
           */
          OutputFormat format = new OutputFormat();
          format.setOmitXMLDeclaration(true);
          format.setIndenting(true);
          XMLSerializer xsl = new XMLSerializer(outString, format);
          xsl.serialize(doc);
        log.debug(outString.toString());
      } catch (Exception e) {
        log.debug(e, e);
View Full Code Here

          StringWriter outString = new StringWriter();
        /* TODO: This should be reviewed at some point to see if we can use the
           * DOM3 LS capability and hence a standard way of doing this rather
         * than using an internal implementation class.
           */
          OutputFormat format = new OutputFormat();
          format.setOmitXMLDeclaration(true);
          format.setIndenting(true);
        XMLSerializer serializer = new XMLSerializer(outString, format);       
        serializer.serialize(doc);
        if (log.isDebugEnabled())
          log.debug(outString.toString());
      } catch (Exception e) {
View Full Code Here

        StringWriter outString = new StringWriter();
        /* TODO: This should be reviewed at some point to see if we can use the
         * DOM3 LS capability and hence a standard way of doing this rather
         * than using an internal implementation class.
         */
        OutputFormat format = new OutputFormat();
        format.setOmitXMLDeclaration(true);
        format.setIndenting(true);
        XMLSerializer xsl = new XMLSerializer(outString, format);       
        xsl.serialize(doc);
        log.debug(outString.toString());
      } catch (Exception e) {
        log.debug(e, e);
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xml.internal.serialize.OutputFormat

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.