Hi,
I am trying to parse String to XML using FileWriter ,so I am able to parse the data.
Next thing is to fetch the data from xml in xhtml page to display the graph.
But the problem is that I have to initially once refresh the XML file.
I want to know how to fetch the data from XML without refreshing?
For reference will share my code:
public static void main(String[] args) throws IOException{
String strXML = ” <graph caption="Annual Sales Summary" subcaption="For the period of 2004 to 2007"xAxisName="Year" yAxisName="Sales" numberPrefix="$"><set name="2004" value="37800" color='F6BD0F' /><set name="2005" value="21900" color='8BBA00' /></graph> ”
BufferedWriter out = new BufferedWriter(new FileWriter("WebContent/Data/outfilename.xml"));
try {
out.write(strXML);
}
catch (IOException e) {
e.printStackTrace();
}
finally{
out.close();
}
}
Regards,
Shweta K