Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sspbond007

macrumors member
Original poster
Aug 19, 2008
46
0
Hi there!

I am parsing a XML file . I am stuck at a specific problem, I can't figure out how to get the whole inner XML of a node.

The node looks like that:

<td><b>this</b> is a <b>test</b></td>

What function do I have to use to get the content of <td> node:

"<b>this</b> is a <b>test</b>"

Thanks....
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Yes, I'm Using the NSXMLParser.
Then you'll want to set up parser:didStartElement:namespaceURI:qualifiedName:attributes: and parser:didEndElement:namespaceURI:qualifiedName: in your delegate to handle the <td> element. Check out the SeismicXML sample app to learn more about how this technique works.
 

sspbond007

macrumors member
Original poster
Aug 19, 2008
46
0
Then you'll want to set up parser:didStartElement:namespaceURI:qualifiedName:attributes: and parser:didEndElement:namespaceURI:qualifiedName: in your delegate to handle the <td> element. Check out the SeismicXML sample app to learn more about how this technique works.

Yes, I'm doing the same.But

parser:didStartElement:namespaceURI:qualifiedName:attributes: gives the ideaa of current Element and its attribute,

parser:didEndElement:namespaceURI:qualifiedName: tell that the current Elemnt is closed now.

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string : gives the simple text content enclosed by the current Element,

But I actually want the XML content of a Element.

Thanks for reply.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.