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 <vijit...@wso2.com>
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
> Dev@wso2.org
> 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: mo...@wso2.com
phone:(+94) 771117673
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to