Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

xml Reading issue

$
0
0

Hi,

Below is the xml,

<?xml version="1.0" encoding="utf-8"?><UsersList><User><Name>sam&Tim</Name><Address>21, bills street, CA</Address><Issues>"Issues1", "Issues2"</Issues></User></UsersList>

C#:


                string xml = System.IO.File.ReadAllText(@"E:\Sample.xml");
                xml = System.Text.RegularExpressions.Regex.Replace(xml, "<(?![_:a-z][-._:a-z0-9]*\b[^<>]*>)", "&lt;");

                XDocument doc = XDocument.Parse(xml);
i need to convert the special charecters (<,>,",',&) and i am using the above regex. but parse method throws an error. any help please how to resolve the issue


loving dotnet


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>