Package org.apache.xml.serialize

Examples of org.apache.xml.serialize.Serializer


    org.w3c.dom.Document dom,
    SecurityOptions options) {
      Document doc = null;
      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


    org.w3c.dom.Element element,
    SecurityOptions options) {
    Element el = null;
    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

    protected Document domToFom(org.w3c.dom.Document dom, SecurityOptions options) {
        Document doc = null;
        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) {
            }
        }
View Full Code Here

    protected Element domToFom(org.w3c.dom.Element element, SecurityOptions options) {
        Element el = null;
        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) {
            }
        }
View Full Code Here

                FileWriter writer = null;

                writer = new FileWriter(f);

                System.out.println("-----------------------------------------------------------------");
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(mapping);
                marshaller.marshal(rootset);
                System.out.println("-----------------------------------------------------------------");
                System.out.println("done");
View Full Code Here

            try
            {
              fos = new FileOutputStream(file);
                writer = new OutputStreamWriter(fos, encoding);
                format.setEncoding(encoding);
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(this.mapping);
                marshaller.marshal(fragment);
            }
            catch (Throwable t)
            {
View Full Code Here

            try
            {
              fos = new FileOutputStream(file);
                writer = new OutputStreamWriter(fos, encoding);
                format.setEncoding(encoding);
                Serializer serializer = new XMLSerializer(writer, format);
                Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
                marshaller.setMapping(this.mapping);
                marshaller.marshal(fragment);
            }
            catch (Throwable t)
            {
View Full Code Here

        String encoding = this.defaultEncoding;

        if (portlets != null)
        {
            format.setEncoding(encoding);
            Serializer serializer = new XMLSerializer(writer, format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.mapping);
            marshaller.marshal(portlets);
        }
    }
View Full Code Here

            writer = new FileWriter(f);
            // create the serializer output format
            OutputFormat format = new OutputFormat();
            format.setIndenting(true);
            format.setIndent(4);
            Serializer serializer = new XMLSerializer(writer,format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.loadMapping());
            marshaller.marshal(doc.getPortlets());

            success = true;
        }
View Full Code Here

            writer = new FileWriter(f);
            // create the serializer output format
            OutputFormat format = new OutputFormat();
            format.setIndenting(true);
            format.setIndent(4);
            Serializer serializer = new XMLSerializer(writer,format);
            Marshaller marshaller = new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(this.loadMapping());
            marshaller.marshal(doc.getPortlets());

            success = true;
        }
View Full Code Here

TOP

Related Classes of org.apache.xml.serialize.Serializer

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.