How to get the next text of an XML node, with C#?
c#, xml
Solution
Load your xml into an XmlDocument and then do:
document.SelectSingleNode("/skin/color[classname='.depth1']/colorcode").InnerText
Problem
I have the following XML. Given the classname, I need to get its corresponding colorcode. How can I accomplish this in C# ? Otherwise said, I have to get to a specific node, given its previous node's text. Thank you very much ``` <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> <?xml-stylesheet type='text/xsl' href='template.xslt'?> <skin name="GHV--bordeaux"> <color> <classname>.depth1</classname> <colorcode>#413686</colorcode> </color> <color> <classname>.depth2</classname> <colorcode>#8176c6</colorcode> </color>... ```