By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 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


Frinavale
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.

-Frinny
Oct 25 '12 #2

Post your reply

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