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

file.readalltext() method truncating file data in c#

$
0
0

my xml file is

<?xml version="1.0" encoding="UTF-8"?>
<journal-meta>
<issn>Modern data &#x00027; is needed with dummy content. we are good to go.</issn>
<issn1><![CDATA[ &#x000E9; ]]>Modern data is needed with dummy content. we are good to go.</issn1>
 ]]>Modern data is needed with dummy content. we are good to go.</issn1>
<issn2>&#x000E9;Modern data is needed with dummy content. we are good to go.</issn2>
<issn3>&#x00027;Modern data is needed with dummy content. we are good to go.</issn3>

<issn4>&#x00026;Modern data is needed with dummy content. we are good to go.</issn4>
<issn5>&#x02013;Modern data is needed with dummy content. we are good to go.</issn5>
</journal-meta>

using this code truncating file data

string inputString = File.ReadAllText(OFile);

  File.WriteAllText(
             "output.xml",
             CdataText
       );

<?xml version="1.0" encoding="UTF-8"?>
<journal-meta>
<issn>Modern data &#x00027; is needed with dummy content. we are good to go.</issn>
<issn1><![CDATA[ &#x000E9; ]]>Modern data is needed with dummy content. we are good to go.</issn1>
 ]]>Modern data is needed with dummy content. we are good to go.</issn1>
<issn2>&#x000E9;Modern data is needed with dummy content. we are good to go.</issn2>

<issn5>&#x02013;Modern data is needed with dummy content. we are good to go.</issn5>
</journal-meta>






Viewing all articles
Browse latest Browse all 935

Trending Articles



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