kiranreddys.com
Kiran's personal website
Blog    Forums   Sitemap   Social    Phone
 
     

 
Knowledgebase
 
Home
Knowledge base home, and site home.
Categories
List of all Knowledge base categories.
Glossary
An alphabetical list of technical terms.
Contact Me
Contact me for knowledge base questions
My Blog
My articles, white papers, ideas and thoughts.
 

 
 


Replacing or removing characters in XmlDocument

Date Added July 23, 2010 | Print | Bookmark


//Replace or remove characters from the XmlDocument
private void ReplaceCharsInXml(XmlDocument xmlDoc, string toReplace, string replaceWith){
    String xmlString = GetXmlString(xmlDoc);
    xmlString = xmlString.Replace(toReplace, replaceWith);
    xmlDoc.LoadXml(xmlString);
}

private string GetXmlString(XmlDocument xmlDoc){
    StringWriter sw = new StringWriter();
    XmlTextWriter xw = new XmlTextWriter(sw);
    xmlDoc.WriteTo(xw);
    return sw.ToString();
}

Was this article helpful?

Yes No

Category: C#.NET - XML

Last updated on July 23, 2010 with 1941 views

0 User Comments

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

CAPTCHA Image
Security code

 



Home | About Me | Products | Support | Contact | Knowledgebase | Forums | Blog | Site map | Site Search | Subscribe | Links | Social | News

Travel | Guest Book | All Pages | History | Site Calendar | Recipes | Ex-Rates | UK Stuff | Downloads | Telugu Stuff | Tell a Friend | Feedback

Bookmark and Share
www.kiranreddys.com
Terms of Use
Site contents Copyright © 2008-2009 Kiran Reddy. All rights reserved.