By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,949 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,949 IT Pros & Developers. It's quick & easy.

How to move around a XML node using C# or Linq

P: 1
I want to move a node around in XML

for e.g. if the string is

<strong><u><?custom_mark_start ForFormatCount='BU' Forunformatchar='i' data='evolved'?>evolved<?custom_format_mark_end ?></u></strong>

then the custom PI should be moved before the formatting tags

The Result should be

<?custom_mark_start ForFormatCount='BU' Forunformatchar='i' data='evolved'?><strong><u>evolved</u></strong><?custom_format_mark_end ?>

I need to do this for the Entire XML file.

Can we do it with Regex or Linq?
Sep 12 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
Not sure if this is useful for a string, but I would look into using the XmlDocument class to help me manage XML nodes.

Oct 25 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.