Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package org.holoeverywhere.builder;
 
 
public class Processer {
    public static void process(Document document) {
        process(document.);
    }
    public static void process(Document documentOutputStream os) {
        if (document == null || os == null) {
            return;
        }
        try {
            StringWriter writer = new StringWriter();
            process(document, XMLOutputFactory.newFactory().createXMLStreamWriter(writer));
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount""4");
            transformer.setOutputProperty(."yes");
            transformer.setOutputProperty(."utf-8");
            transformer.transform(new StreamSource(new StringReader(writer.toString())),
                    new StreamResult(os));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static void process(Document documentXMLStreamWriter writerthrows XMLStreamException {
        writer.writeStartDocument("utf-8""1.0");
        writer.writeStartElement("resources");
        document.process(writer);
        writer.writeEndElement();
        writer.writeEndDocument();
        writer.flush();
        writer.close();
    }
New to GrepCode? Check out our FAQ X