I am trying to open and read a xml file as a local resource with jdom. I can open the file but then I got an error saying that the xml file is not well-formed. Here is the code :
Uri path = Uri.parse("android:resource://package_name"+R.xml.data);
InputSource source = new InputSource(new StringReader(path.toString()));
document = builder.build(source);
I got the following error :
org.jdom.input.JDOMParseException:Error on line 1:At line 1, column 17:not well-formed (invalid token)
Here is the xml file with my data:
<?xml version="1.0" encoding="utf-8"?>
<data>
<person>
<name>Name1</name>
<firstname>Firstname1</firstname>
</person>
<person>
<name>Name2</name>
<firstname>Firstname2</firstname>
</person>
</data>
Would you have an idea ? Thanks in advance.