Package org.apache.xml.serialize

Examples of org.apache.xml.serialize.XMLSerializer.asDOMSerializer()


        try {

            FileWriter writer = new FileWriter(name);
            BufferedWriter buf = new BufferedWriter(writer);
            XMLSerializer FileSerial = new XMLSerializer(writer, format);
            FileSerial.asDOMSerializer(); // As a DOM Serializer
            FileSerial.serialize(document);

        } catch (IOException ioe) {
            ioe.printStackTrace();
View Full Code Here


            } else {
                format.setLineSeparator("");
            }
            StringWriter writer = new StringWriter(1000);
            XMLSerializer serial = new XMLSerializer(writer, format);
            serial.asDOMSerializer();
            if (node instanceof Document) {
                serial.serialize((Document) node);
            } else if (node instanceof Element) {
                format.setOmitXMLDeclaration(true);
                serial.serialize((Element) node);
View Full Code Here

        SAXException
    {
        OutputFormat format  = new OutputFormat(doc, null, true);
        StringWriter writer = new StringWriter(1000);
        XMLSerializer serial = new XMLSerializer(writer, format);
        serial.asDOMSerializer();
        serial.serialize(doc);
        String docString = writer.toString();

        validate(docString, schemaLocationPropertyValue, resolver);
    }
View Full Code Here

      if (dom != null) {
        try {
          Serializer ser = new XMLSerializer();
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          ser.setOutputByteStream(out);
          ser.asDOMSerializer().serialize(dom);
          ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
          doc = options.getParser().parse(in);
        } catch (Exception e) {}
      }
      return doc;
View Full Code Here

    if (element != null) {
      try {
        Serializer ser = new XMLSerializer();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ser.setOutputByteStream(out);
        ser.asDOMSerializer().serialize(element);
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        el = options.getParser().parse(in).getRoot();
      } catch (Exception e) {}
    }
    return el;
View Full Code Here

            Debug.logWarning("[UtilXml.writeXmlDocument] OutputStream was null, doing nothing", module);
            return;
        }

        XMLSerializer serializer = new XMLSerializer(os, format);
        serializer.asDOMSerializer();
        serializer.serialize(element);       
    }
       
    public static Document readXmlDocument(String content)
            throws SAXException, ParserConfigurationException, java.io.IOException {
View Full Code Here

                    try {
                        OutputFormat format = new OutputFormat(raw_records[i]
                                .getDocument());
                        XMLSerializer serial = new XMLSerializer(sw, format);
                        serial.asDOMSerializer();
                        serial.serialize(raw_records[i].getDocument()
                                                       .getDocumentElement());
                    } catch (Exception e) {
                        LOGGER.severe("Problem serializing dom tree to"
                            + " result record" + e.getMessage());
View Full Code Here

                    StringWriter sw = new StringWriter();
                    XMLSerializer serializer = new XMLSerializer(sw, format);

                    try {
                        serializer.asDOMSerializer();
                        serializer.serialize(tmp);
                    } catch (IOException e) {
                        throw new ConfigurationException(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.