Hi Have you tried using xpath for splitting?
<camel:split> <camel:xpath>/city</camel:xpth> ... </camel:split> There is some examples here http://camel.apache.org/splitter http://camel.apache.org/xpath On Tue, Nov 22, 2011 at 11:13 PM, santoshjoshi <santoshjoshi2...@gmail.com> wrote: > Environment > Camel:2.8.1 > java 6 > > i have a pojo like > > @XmlRootElement(name = "city") > public class City{ > > @XmlElement(name = "citycode", required = true) > protected String citycode; > > @XmlElement(name = "countrycode", required = true) > protected String countrycode; > > } > > > i am getting a list of the above cities from a web service Calls Like > *List<City> cities * > > I want to split the above list and group the country related cities into a > single file > and for which i am using the below code > > <camel:split streaming="true"> > <camel:simple>body</camel:simple> > <camel:to > uri="file:/home/country-{body.countrycode}/?fileName=city.xml&fileExist=Append" > /> > </camel:split> > > the code works fine but it gives me the out like > > *<?xml version="1.0" encoding="UTF-8" standalone="yes"?>* > <city> > <citycode>XYZ</citycode> > <countrycode>au</countrycode> > </city> > *<?xml version="1.0" encoding="UTF-8" standalone="yes"?>* > <city> > <citycode>ABC</citycode> > <countrycode>ad</countrycode> > </city> > > > I just want to ignore all <?xml version="1.0" encoding="UTF-8" > standalone="yes"?> while writing and appending to xml files. > > > Thanks > Santosh > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-write-or-append-content-to-XML-file-without-XML-declaration-tp5014969p5014969.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/