i am new to work on xml.i have used an xml file as follows:
-
-
You are not checking if the value of the node is "wallstreet?" - so it simply changes every first child node.
String str = child.getFirstChild( ).getNodeValue( );
if ( "wallstreet?".compareTo( str ) == 0 )
{
child.getFirstChild( ).setNodeValue( "WonderWorld" );
System.out.println( "tag val modified success fuly" );
}