How to get inner xml content of a node?

Discussion in 'iPhone/iPad Programming' started by sspbond007, Apr 20, 2009.

  1. macrumors member

    Joined:
    Aug 19, 2008
    #1
    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....
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Are you using NSXMLParser?
     
  3. thread starter macrumors member

    Joined:
    Aug 19, 2008
    #3
    Yes, I'm Using the NSXMLParser.
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    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.
     
  5. thread starter macrumors member

    Joined:
    Aug 19, 2008
    #5
    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.
     
  6. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    What do you mean by "XML content"? Like in a DOM or something?
     

Share This Page