-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 );
        }
    }
2
  • u can search it, stackoverflow.com/questions/475293/… just try to be resourceful and try to learn from your own first, its fulfilling! Commented Aug 12, 2015 at 10:10
  • UP ! UP! UP ! @Euphoria Commented Aug 17, 2015 at 8:14

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

5 Comments

i say if you change A --> < A > you can replace it with < HTML >
A have to take properties of <HTML>
try get all code as string then replace < HTML > with A string.Replace
And the attributes of A will be the attributes of <HTML>?
did you what ti change function what html to make your A do it , or only change in display
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.