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

Replacing Values in an XML

$
0
0

Hi,

I have an Xml file that has some values (InnerText) that has been encrypted. I have the decript tool which accepts the InnerText of the element (not an attribute) and a password.

Here is the approximate xml structure:

<?xml version="1.0" encoding="UTF-8"?><Configuration Version="2.2"><Globals xmlns="http://www.site.com"><DataFrameResizable Value="True"/><DataFrameMinWidth Value="360"/><HomePanelContent><![CDATA[ <p style="text-align: center">Text...</p> ]]></HomePanelContent></Globals><Modules><AdvancedSearch LibraryId="LibraryId"><Views><View Visible="false" Id="AdvancedSearchView" Type="AdvancedSearchView" Region="DataRegion"/></Views><Configuration><searches><search><ID>0</ID><name>Equipment</name><description/><searchfields><field><ID>0</ID><name>88CntWQzzOp72jT3r8hpHw==</name>  <--- THIS LINE<mandatory>True</mandatory><fieldtype>TextBox</fieldtype><parametersComboBox><parameters><selecttable>MMtAGQM3bk3KyfcZa6MoXA==</selecttable><valuecolumn>MMtAGQM3bk3KyfcZa6MoXA==</valuecolumn></parameters></parametersComboBox></field><field>
							SOME MORE ELEMENTS HERE</field></searchfields></search></searches></Configuration></AdvancedSearch></Modules></Configuration>

I have indicated on the xml one of the lines that has to have its value decrypted (<-- THIS LINE) but there are a couple more on the file.

Also the xml is dynamic, meaning it can have more elements that are not present at this time.

Now what I need is to create a dynamic method in C# preferably that iterates through everything and replaces only the encrypted text.

I know I can do that by referencing the tags and using xelement or xpath but the issue is I need to make it dynamic.

Can anyone help me please?

If needed I will provide further info.

Thanks in advance


Viewing all articles
Browse latest Browse all 935

Trending Articles



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