-4

How do i rename specific nodes? I tried a lot of things but it doesn't work for me. I need a method : replace (oldnode,newnode).
Here is my code for parsing xml file

public Recursion ( XmlNode node )
{
if ( node.NodeType != XmlNodeType.Text )
{ Console.WriteLine( "Tag Name = " + node.Name ); }

        XmlNodeList children = node.ChildNodes;
        foreach ( XmlNode child in children )
        {
            Recursion( child );
        }
    }
John
  • 19
  • 3
  • u can search it, http://stackoverflow.com/questions/475293/change-the-node-names-in-an-xml-file-using-c-sharp just try to be resourceful and try to learn from your own first, its fulfilling! – Anonymous Duck Aug 12 '15 at 10:10
  • UP ! UP! UP ! @Euphoria – John Aug 17 '15 at 08:14

2 Answers2

0

you need to make A with tag just like < A > To can Catch it by if you try to catch A You Will Get A
John KAMAL
/A
but if A With Tag < A >< br >

John< br >

< /A > < br >

it easy to replace

0

Why not use Regex.Replace()?

string str = "<html>abc</html>";
str = Regex.Replace(str, "(?:<html>)", "A");

The code above will replace all occurrences of <html> to A.

Mic
  • 1