Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.save()


     * @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
     */
    public void write( Object obj, OutputStream out ) throws Exception
    {
        XmlObject xmlObj = (XmlObject) obj;
        xmlObj.save( out );
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here


            // before saving, make sure the directory is present
            ensureMonitorDir();

            //TODO GERONIMO-3719.  Hack to use xmlbeans to write out xml instead of sun specific classes.
            XmlObject xmlObject = XmlObject.Factory.parse(document.getDocumentElement());
            xmlObject.save(new File(path));

            // formatting the doc
//            OutputFormat format = new OutputFormat(document);
//            format.setIndenting(true);
            // generate a file output
View Full Code Here

                    targetDir.mkdirs();
                }

                XmlOptions xmlOptions = new XmlOptions();
                xmlOptions.setSavePrettyPrint();
                doc.save(targetFile, xmlOptions);

                if (getLog() != null) {
                    getLog().info("Generated: " + targetFile);
                }
            }
View Full Code Here

            if(entry.getName().endsWith(".xml") || entry.getName().endsWith(".vml") || entry.getName().endsWith(".rels")){
                try {
                    XmlObject xml = XmlObject.Factory.parse(zip.getInputStream(entry));
                    XmlOptions options = new XmlOptions();
                    options.setSavePrettyPrint();
                    xml.save(out, options);
                } catch (Exception e){
                    System.err.println("Failed to parse " + entry.getName() + ", dumping raw content");
                    dump(zip.getInputStream(entry), out);
                }
            } else {
View Full Code Here

        XmlObject xmlObject = parse(source);
        xmlObject = upgrade(xmlObject);

        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSavePrettyPrint();
        xmlObject.save(target, xmlOptions);

    }

    public XmlObject upgrade(XmlObject xmlObject) throws XmlException {
        XmlCursor cursor = xmlObject.newCursor();
View Full Code Here

                    targetDir.mkdirs();
                }
                File output = new File(targetFile);
                XmlOptions xmlOptions = new XmlOptions();
                xmlOptions.setSavePrettyPrint();
                doc.save(output, xmlOptions);
            } finally {
                xmlCursor.dispose();
            }
        } catch (Exception e) {
            log.error(e.getClass().getName() + ": " + e.getMessage(), e);
View Full Code Here

                targetDir.mkdirs();
            }

            XmlOptions xmlOptions = new XmlOptions();
            xmlOptions.setSavePrettyPrint();
            doc.save(targetFile, xmlOptions);

            log.info("Generated: " + targetFile);
        }
        finally {
            xmlCursor.dispose();
View Full Code Here

*/
public class XmlBeansDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        XmlObject object = ExchangeHelper.convertToMandatoryType(exchange, XmlObject.class, body);
        object.save(stream);
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return XmlObject.Factory.parse(stream);
    }
View Full Code Here

                    targetDir.mkdirs();
                }

                XmlOptions xmlOptions = new XmlOptions();
                xmlOptions.setSavePrettyPrint();
                doc.save(targetFile, xmlOptions);

                if (getLog() != null) {
                    getLog().info("Generated: " + targetFile);
                }
            }
View Full Code Here

        map.put("urn:schemas-microsoft-com:vml", "v");
        map.put("urn:schemas-microsoft-com:office:office", "o");
        map.put("urn:schemas-microsoft-com:office:excel", "x");
        xmlOptions.setSaveSuggestedPrefixes(map);

        rootObject.save(out, xmlOptions);
    }

    @Override
    protected void commit() throws IOException {
        PackagePart part = getPackagePart();
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.