Discussions

XML & Web services: Need help

  1. Need help (2 messages)

    Hi
     I have this xml string and I cant get the valu of icon tag.
    I try the following code it gives me all the text data but I get null when I try to get the :) .



    <message>
      Hi How are you doing <icon> :) </icon> today
    </message>

    String value = "";
            NodeList children = root.getChildNodes();
            for(int i = 0; i < children.getLength(); i++ )
            {
              Node ci = children.item(i);
               if( ci.getNodeType() == Node.TEXT_NODE)
                {
                  value = value + ci.getNodeValue();
                  
                }
             }

    I keep getting null

    Thankyou
    Asad

    Threaded Messages (2)

  2. Need help[ Go to top ]

    Sorry a correction

    this is the what I am doing in the if statement
    if( ci.getNodeType() == Node.ELEMENT_NODE)

    Asad
  3. Need help[ Go to top ]

    I have the solution
    Thanks anyway