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

Examples of com.sun.org.apache.xml.internal.serialize.XMLSerializer.serialize()


                    w3cDoc.appendChild(dup);
                    // print document
                    OutputFormat xmlFormat = new OutputFormat("xml","ISO-8859-1", true);
                    xmlFormat.setOmitXMLDeclaration(true);
                    XMLSerializer serializer = new XMLSerializer(stringWriter, xmlFormat);
                    serializer.serialize(w3cDoc);
                   
                    value = stringWriter.toString();
                } catch (ParserConfigurationException e) {
                    e.printStackTrace();
                }   catch (IOException e) {
View Full Code Here


                    w3cDoc.appendChild(dup);
                    // print document
                    OutputFormat xmlFormat = new OutputFormat("xml","ISO-8859-1", true);
                    xmlFormat.setOmitXMLDeclaration(true);
                    XMLSerializer serializer = new XMLSerializer(stringWriter, xmlFormat);
                    serializer.serialize(w3cDoc);
                   
                    value = stringWriter.toString();
                } catch (ParserConfigurationException e) {
                    e.printStackTrace();
                }   catch (IOException e) {
View Full Code Here

  public void saveXMLDocument() {
      try {
        log.info("saving classpath file...");
      XMLSerializer serializer = new XMLSerializer();
        serializer.setOutputCharStream(new FileWriter(file));
      serializer.serialize(doc);
    } catch (IOException e) {
      log.error("unable to save resulting classpath file!");
      throw new RuntimeException("unable to save resulting classpath file", e);
    }
  }
View Full Code Here

            OutputFormat format = new OutputFormat(createDocument());
            format.setLineWidth(65);
            format.setIndenting(true);
            format.setIndent(2);
            XMLSerializer serializer = new XMLSerializer(writer, format);
            serializer.serialize(getDocument());
            writer.close();
        }
        catch (ConfigurationException ce) {
            logger.severe("Failed to save configuration: " + ce.getMessage());
        }
View Full Code Here

        format.setIndent(2);

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        XMLSerializer serializer = new XMLSerializer(outputStream, format);
        serializer.serialize(doc);

        return new String(outputStream.toByteArray(), "UTF-8");
    }

    public static Document createXMLDocument() throws Exception {
View Full Code Here

        format.setIndent(2);

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        XMLSerializer serializer = new XMLSerializer(outputStream, format);
        serializer.serialize(doc);

        return new String(outputStream.toByteArray(), "UTF-8");
    }

    public static Document createXMLDocument() throws Exception {
View Full Code Here

        format.setIndent(2);
       
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
       
        XMLSerializer serializer = new XMLSerializer(outputStream, format);
        serializer.serialize(doc);
       
        return new String(outputStream.toByteArray(), "UTF-8");
    }

}
View Full Code Here

        format.setIndent(2);

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        XMLSerializer serializer = new XMLSerializer(outputStream, format);
        serializer.serialize(doc);

        return new String(outputStream.toByteArray(), "UTF-8");
    }

    public static String toPrettyXML(XmlObject element) throws Exception {
View Full Code Here

    Document document = (Document) result.getNode();

    OutputFormat format = new OutputFormat(document);
    format.setIndenting(true);
    XMLSerializer serializer = new XMLSerializer(System.out, format);
    serializer.serialize(document);
  }

  private static DOMResult extractSchemaResult(JAXBContext ctx) throws IOException {

    final Set<DOMResult> resultWrapper = new HashSet<>();
View Full Code Here

                    w3cDoc.appendChild(dup);
                    // print document
                    OutputFormat xmlFormat = new OutputFormat("xml","ISO-8859-1", true);
                    xmlFormat.setOmitXMLDeclaration(true);
                    XMLSerializer serializer = new XMLSerializer(stringWriter, xmlFormat);
                    serializer.serialize(w3cDoc);
                   
                    value = stringWriter.toString();
                } catch (ParserConfigurationException e) {
                    e.printStackTrace();
                }   catch (IOException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.