Using Xstream i need to create the following xml file but i created with toXML method which is availble in the Xstream and my problem is i need to pass this
string object to one javascript function to load the chart
<Chart caption="Model Comparison" shownames="1" showvalues="0" decimals="0" numberPrefix="$">
<categories>
<category label="Lot Quantity"/>
<category label="Total Cost"/>
</categories>
<dataset seriesName="Lot Quantity" color="8BBA00" showValues="0">
<set>
<set value="100"/>
<set value="101"/>
<set value="102"/>
</set>
</dataset>
<dataset seriesName="Total Cost" color="8BBA00" showValues="0">
<set>
<set value="1000"/>
<set value="1001"/>
<set value="1002"/>
</set>
</dataset>
so when i am passing am getting the error and the view source is
<script type='text/javascript'>
var chart_Compare Model = new FusionCharts('../content/charts/MSColumn3D.swf', 'Compare Model', '650', '300', '0', '0');
//Provide entire XML data using dataXML method
chart_Compare Model.setDataXML("<Chart caption=\"Total Cost\"><categories>
<category label="Lot Quantity"/>
<category/>
</categories>
<dataset seriesName="Lot Quantity">
<set>
<set value="100"/>
<set value="101"/>
<set value="102"/>
</set>
</dataset>
<dataset seriesName="Total Cost">
<set>
<set value="100"/>
<set value="101"/>
<set value="102"/>
</set></dataset><set/></Chart>");
//Finally, render the chart.
chart_Compare Model.render("Compare ModelDiv");
</script>
</Chart>
the problem is toXml from xstream returned xml as string but the string contains the xml nodes line by line so when i pass it to javascript the line is brokened could any one please give the help?