- Home /
Question by
Wolf_dead_inside · Jul 29, 2021 at 02:14 AM ·
listxmlparse
How can I store data from an XML in lists
I want to store one list for IDs of items and then for each ID have another list of the attributes of the item that the ID belongs to. How can I parse the XML in a way that creates these 2 lists that can be easily accessed?
this is my XML layout if it makes it any easier
<?xml version="1.0" encoding="utf-8"?>
<items>
<item id = "1">
<name>"Item 1"</name>
<sprite>"item.png"</sprite>
</item>
<item id = "2">
<name>"Item 2"</name>
<sprite>"item2.png"</sprite>
</item>
</items>
if i could pass the lists to an item manager script which would do the rest of the work that would be great. thanks!
Comment
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Runtime instantiation based on XML 1 Answer
An element with the same key already exists in the dictionary 0 Answers
IDictionary 1 Answer
Parsing and displaying KML 0 Answers