c# - Preserve XML entity references while getting InnerText or InnerXml with XmlDocument -


i trying innertext or innerxml of xml node using xmldocument, @ same time want preserve & ' ".

however, if try innerxml, preserves & not ' , "

i know exact reason why happening , solution problem.

e.g. suppose have xml node text inside "'cancel' & 'abort'" , in retrun when read node innerxml (or innertext), must give me exact same string output.

but when try this, returns, "'cancel' & 'abort'" means preserves &

note:

<source>&quot;&amp;cancel&apos;&quot;</source> <target>&quot;&amp;cancel&apos;&quot;</target> 

this have in xliff(xml) file, while reading xliff(xml) file, want retrieve text inside both nodes visible now, without exclusive conversion or processing.

the problem xliff(xml) data have, contains both ' or " &apos; , &quot; , goal detect these entity references error because not supposed have in our data. in other words, ' or " shall permitted in our data.

try using webutility.htmlencode() method on innerxml or innertext


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -