How can I take items from this xml
inside <elem></elem>
and use it in RecyclerView
? How can I modify my parse to take all things inside this one and what should I do with them? Add it to the ArrayList
and then use it in RecyclerView
? What is your idea?
<xl>
<elem>
<data>2019-03-05 10:20:23</data>
<id>1</id>
<points>5</points>
<cost>54.00</cost>
</elem>
<elem>
<data>2019-03-05 10:50:52</data>
<id>2</id>
<points>5</points>
<cost>50.00</cost>
</elem>
<elem>
<data>2019-03-05 14:58:47</data>
<id>3</id>
<points>5</points>
<cost>50.00</cost>
</elem>
</xl>
From code like this I can take "Someone to parse" by parser below:
<xl>
<elem>
Someone to parse
</elem>
public String[][] parserXMLArrayTest(Document doc, String name) {
NodeList dane = doc.getElementsByTagName(name);
String[][] ret = null;
for (int i = 0; i < dane.getLength(); i++) {
Element e = (Element) dane.item(i);
NodeList node = e.getElementsByTagName("elem");
ret = new String[node.getLength()][4];
for (int j = 0; j < node.getLength(); j++) {
}
}
return ret;
}