Package org.apache.xmlbeans

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


                    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


*/
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

        for (InterfaceDefinitionPart part : partList) {
            // XmlObject obj = XmlObject.Factory.parse( part.getContent() );
            XmlObject obj = XmlUtils.createXmlObject(part.getContent());
            replaceImportsAndIncludes(obj, urlToFileMap, part.getUrl());
            postProcessing(obj, part);
            obj.save(new File(outFolder, urlToFileMap.get(part.getUrl())));
        }

        return folderName + File.separatorChar
                + urlToFileMap.get(definition.getDefinitionCache().getRootPart().getUrl());
    }
View Full Code Here

                // obj = XmlObject.Factory.parse( part.getContent().toString() );
                obj = XmlUtils.createXmlObject(part.getContent().toString());
            }

            replaceImportsAndIncludes(obj, urlToFileMap, part.getUrl());
            obj.save(new File(outFolder, urlToFileMap.get(part.getUrl())));
        }

        return folderName + File.separatorChar + urlToFileMap.get(config.getRootPart());
    }
View Full Code Here

    }

    public static void serialize(Element elm, Writer writer) throws IOException {
        try {
            XmlObject xmlObject = XmlObject.Factory.parse(elm);
            xmlObject.save(writer);
        } catch (XmlException e) {
            throw new IOException(e.toString());
        }
    }
View Full Code Here

        try {
            try {
                // XmlObject xml = XmlObject.Factory.parse( textArea.getText() );
                XmlObject xml = XmlUtils.createXmlObject(textArea.getText());
                xml.save(file);
            } catch (XmlException e1) {
                writer = new FileWriter(file);
                writer.write(textArea.getText());
                writer.close();
            }
View Full Code Here

                continue;
            }
           
            try
            {
                doc.save(System.out, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(indent));
            }
            catch (IOException e)
            {
                System.err.println("Unable to pretty print " + files[i] + ": " + e.getMessage());
            }
View Full Code Here

            OVALDirectives directives = (OVALDirectives)config.getDirective(getCheckSystem().getSystem());
            if (directives != null) {
              File directivesFile = resultContext.getAuxiliaryFile("oval-directives_", ".xml");
              XmlObject content = directives.getContent(config);
              content.save(directivesFile, new XmlOptions().setSavePrettyPrint());
                exec.setDirectivesFile(directivesFile);
                directivesContent = new FileResultContent(directivesFile);

                // Handle suppression of systems characteristics
                if (directives.isSuppressSystemsCharacteristics()) {
View Full Code Here

       
        Content content2 = new Content();

        XmlObject x = XmlObject.Factory.parse( xml );

        x.save( content2, content2 );

        // THEM

        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
View Full Code Here

        nses.put( "y", "y.com" );
        XmlOptions options = new XmlOptions();
        options.setLoadAdditionalNamespaces( nses );
       
        XmlObject x = XmlObject.Factory.parse( "<a></a>", options );
        x.save( System.out );
    }
}
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.