I am new to Java and I have a question:
Is there any possibility to store/set integer values in XML? I would like to set
- X0 = 123
- Y0 = 123
- X1 = 123
- Y1 = 130
from xml file below
<line>
<point>
<X>123</X>
<Y>123</Y>
</point>
<point>
<X>123</X>
<Y>130</Y>
</point>
</line>
I would suggest create a
Pointclass with attributesX/Yand getter/setters for X/Y.Use SAX parser to parse the XML (There are other techniques also like DOM/ Pull parser etc.,) and populate Point object and add it to List.
See this example for more info