Re: Replace main node name
I'm not familiar with C#, but what is the output you're getting from this code? What XML tool are you using to parse and update the XML or does C# come with one as default?
Re: Replace main node name
Quote:
Originally Posted by GuOddian
I'm not familiar with C#, but what is the output you're getting from this code? What XML tool are you using to parse and update the XML or does C# come with one as default?
The XML namespace from the .NET Framework.
This can't work
Code:
firstNode.LocalName.Replace("Content","Page");
because firstNode.LocalName is only a get property, so it won't affect the local name of the node.
I think you have to create a new mode and then replace the old one with the new one (ReplaceChild).