Hi Mohan,waruna, Thank a lot for the information.
@mohan, I was able implement xml writer by going through XmlFormatter <https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/event-stream/event-formatter/org.wso2.carbon.event.formatter.core/1.0.1/src/main/java/org/wso2/carbon/event/formatter/core/internal/util/helper/XmlFormatter.java> code. On Tue, Nov 18, 2014 at 10:06 AM, Waruna Perera <[email protected]> wrote: > Hi Vijitha, > > Pls see [1] if it helps. > > [1] > http://stackoverflow.com/questions/2949203/formatting-xml-file-using-stax > > On Tue, Nov 18, 2014 at 10:04 AM, Mohanadarshan Vivekanandalingam < > [email protected]> wrote: > >> Can you check the code in [1].. It will help you.. >> >> [1] >> https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/event-stream/event-formatter/org.wso2.carbon.event.formatter.core/1.0.1/src/main/java/org/wso2/carbon/event/formatter/core/internal/util/helper/XmlFormatter.java >> >> Thanks, >> Mohan >> >> >> On Tue, Nov 18, 2014 at 9:59 AM, Vijitha Ekanayake <[email protected]> >> wrote: >> >>> Hi, >>> >>> I was trying to write OMElement to xml file. what I did is call >>> OMElements' toString method to write it into a xml, which eventually ended >>> up creating xml file content with single line. >>> following is my code. >>> >>> BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(new >>> File(filePath,eventSink.getName()+".xml"))); >>> bufferedWriter.write((OMElement).toString()); >>> >>> Is there anyway to write xml with correct indentations and formatting? >>> >>> >>> >>> >>> -- >>> Vijitha Ekanayake >>> Software Engineer*, *WSO2, Inc.; http://wso2.com/ >>> Mobile : +94 777 24 73 39 | +94 718 74 44 08 >>> lean.enterprise.middleware >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> *V. Mohanadarshan* >> *Software Engineer,* >> *Data Technologies Team,* >> *WSO2, Inc. http://wso2.com <http://wso2.com> * >> *lean.enterprise.middleware.* >> >> email: [email protected] >> phone:(+94) 771117673 >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Waruna Perera > Senior Software Engineer - Test Automation > Mobile: +94 77 3867037 > WSO2, Inc.; http://wso2.com/ > lean . enterprise . middlewear. > -- Vijitha Ekanayake Software Engineer*, *WSO2, Inc.; http://wso2.com/ Mobile : +94 777 24 73 39 | +94 718 74 44 08 lean.enterprise.middleware
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
