fork(4) download
  1. using System;
  2. using System.Xml;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var d = new XmlDocument();
  9. d.LoadXml(@"<data>
  10. <string id='test-text'>Some sample text from XML</string>
  11. <string id='test-text2'>Some more sample text</string>
  12. </data>");
  13. var elem = d.SelectSingleNode("//*[@id='test-text']");
  14. Console.WriteLine(elem.InnerText);
  15. }
  16. }
Success #stdin #stdout 0.09s 34384KB
stdin
Standard input is empty
stdout
Some sample text from XML