my attempted goal is to parse this xml doc https://api.eveonline.com/eve/SkillTree.xml.aspx and eventually get it into core data.
but the snippet i'm having trouble with is
<rowset name="requiredSkills" key="typeID" columns="typeID,skillLevel">
<row typeID="13279" skillLevel="3" />
<row typeID="3402" skillLevel="4" />
</rowset>
the problem i'm having is trying to figure out how to keep the typeID and skillLevel together to save in an nsdictionary.
So the goal is to put each <row typeID="13279" skillLevel="3" />
into its own object.
the main code i'm using is
-(void)parseXMLFromBundle
{
NSError *error;
NSString *path = [[NSBundle mainBundle] pathForResource:@"SkillTree" ofType:@"xml"];
DDXMLDocument *xmlDoc = [[DDXMLDocument alloc] initWithData:[NSData dataWithContentsOfFile:path] options:0 error:&error];
//main array with everything
NSArray *xmlItems = [xmlDoc nodesForXPath:@"//result" error:&error];
//go through it to extract each thing
for (DDXMLElement *itemElement in xmlItems)
{
self.typeArray = [itemElement nodesForXPath:@"//@typeName" error:&error];
self.requiredIDArray = [itemElement nodesForXPath:@"//row[@typeID]/@typeID" error:&error];
DLog(@"required SkillID: %@",self.requiredIDArray);
}
The typeName works fine, each object I want only has 1 name, but it can have multiple typeIDs so I am trying to group these values into 1 object so i can import it all into core data eventually. I know with the typeIDs are also just being all dumped into an array. I am just lost as to how to get stuff better separated by elemental row.
Thanks.