Closed GoogleCodeExporter closed 8 years ago
Reusing the "resultNodes" NSArray where I define the textNodes NSArray does
work.
What am I missing?
Original comment by wh.haanstra
on 14 Feb 2009 at 10:18
No idea. It works just fine for me:
NSString *xmlData = @"<Root><Item><Text>Small
Text</Text></Item><Item><Text>Small Text
2</Text></Item></Root>";
CXMLDocument* xmlDocument = [[CXMLDocument alloc] initWithXMLString:xmlData
options:0 error:nil];
NSError *theError;
NSArray *theNodes = [xmlDocument nodesForXPath:@"//Item" error:&theError];
NSLog(@"Nodes: %@", theNodes);
NSLog(@"Error: %@", theError);
Prints out:
2009-02-28 13:52:07.061 TouchXML_Demo[31596:10b] Nodes: (
<CXMLElement 0x1005f80 [0x1006570] Item <Item><Text>Small Text</Text></Item>>,
<CXMLElement 0x1007d60 [0x1006660] Item <Item><Text>Small Text 2</Text></Item>>
)
2009-02-28 13:52:07.063 TouchXML_Demo[31596:10b] Error: (null)
2009-02-28 13:52:07.063 TouchXML_Demo[31596:10b]
################################################################################
#####
#############
Original comment by jwight
on 28 Feb 2009 at 6:52
Original issue reported on code.google.com by
wh.haanstra
on 14 Feb 2009 at 10:07