c# - Reading XML template, make a change and display on page -


Hello, I have a preformatted XML template that lists all country codes.

I have to load it in C # SipText and Loop and the MCNN attribute should match the country code and add value attribute to the node.

Then I need to render the editable XML on the page so that it can be used as a data source for the flash chart.

Example is xml:

  & lt; Areas & gt; & Lt; Area title = "AFGHANISTAN" mc_name = "AF" & gt; & Lt; / Area & gt; & Lt; Field title = "old islands" mc_name = "AX" & gt; & Lt; / Area & gt; & Lt; Regional Title = "Albania" mc_name = "AL" & gt; & Lt; / Region & gt; & Lt; Field title = "algeria" mc_name = "dz" & gt; & Lt; / Region & gt; & Lt; Regional Title = "ANDORRA" mc_name = "AD" & gt; & Lt; / Region & gt; & Lt; Field title = "angol" mc_name = "Ao" & gt; & Lt; / Region & gt; & Lt; Field title = "anguilla" mc_name = "A" & gt; & Lt; / Area & gt; & Lt; Regional title = "Antigua and Barbuda" mc_name = "AG" & gt; & Lt; / Region & gt;  

Here's an example of how you can process XML:

  xml = @" lieutenant " Area title = "" AFGHANISTAN "" mc_name = "" AF "" & gt; & Lt; / Region & gt; Area title = "alland island" "mc_name =" ax "" "gt; & Lt; / Area & gt; Field title = "" ALBANIA "" mc_name = "" AL "" & gt; & Lt; / Region & gt; Field title = "" algeria "" mc_name = "" regional title = "ANDORRA" "mc_name =" "AD" "& gt; & Lt; / Area & gt; Field title = "" angola "" mc_name = "" Ao "" & gt; Field title = "Anguilla" "mc_name =" "A" & gt; & Lt; / Area & gt; Field title = "" Antigua and Barbuda "" MC_name = "" AG "" & gt; & Lt; / Region & gt; & Lt; / Regions> "Var doc = New XmlDocument (); doc.LoadXml (xml); Var Nodes = Doctor. Select (" Area / Area "); Foreach (XmlNode node in nodes) {// AttributeVerue = "something"; node.Attributes.Append (att);} Console WrightLine (doc.OuterXml); < / Code> 

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -