C#: How to iterate and encrypt / decrypt data in xml

  • Thread starter Thread starter Mou_inn
  • Start date Start date
M

Mou_inn

Guest
i want to iterate in my all xml nodes by XmlDocument class and want to encrypt data in nodes programmatically. so here is my sample xml.

<?xml version="1.0" encoding="utf-8" ?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Red</TITLE>
<ARTIST>The Communards</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>London</COMPANY>
<PRICE>7.80</PRICE>
<YEAR>1987</YEAR>
</CD>
<CD>
<TITLE>Unchain my heart</TITLE>
<ARTIST>Joe ****er</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>EMI</COMPANY>
<PRICE>8.20</PRICE>
<YEAR>1987</YEAR>
</CD>
</CATALOG>

i do not want to iterate where i have to mention tag name rather i iterate programmatically in such a way as a result i can encrypt data or value only.

say for example i want to encrypt and decrypt data in these tags only TITLE,ARTIST,COUNTRY,COMPANY,PRICE,YEAR

i consult these links Iterating through all nodes in XML file

but not getting idea how to write code which encrypt data only inside these tags TITLE,ARTIST,COUNTRY,COMPANY,PRICE,YEAR

looking for some guide line. thanks

Continue reading...
 
Back
Top