Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
xml
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Xml; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"); foreach(XmlNode xmlNode in xmlDoc.DocumentElement.ChildNodes[1].ChildNodes) { // Console.WriteLine(xmlNode.Attributes["currency"].Value + ": " + xmlNode.Attributes["rate"].Value); //Console.WriteLine("inside for loop"); //Console.WriteLine(xmlNode.InnerText); } int count = 0; XmlReader xmlReader = XmlReader.Create("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"); while(xmlReader.Read()) { if((xmlReader.NodeType == XmlNodeType.Element) && (xmlReader.Name == "gesmes:name")) { if(xmlReader.HasAttributes) { //Console.WriteLine(xmlReader.GetAttribute("currency") + ": " + xmlReader.GetAttribute("rate")); } } if(1>0) { count++; // Console.WriteLine( "Count is {0} , \n Node-Name : {1} ,\n Value : {2} " , count , xmlReader.Name , xmlReader.Value); if(xmlReader.HasAttributes) { int y = xmlReader.AttributeCount; // Console.WriteLine( "attribute count : {0} , attribute valuue {1}" , y ,reader.MoveToNextAttribute() ); } } } } } }
run
|
edit
|
history
|
help
0
merge 2 arrays
codejam1a1
ttttt
pointer
Interface fully qualified names
dlritytio
Lazy exception caching
Create HardwareConfigs
EnumToList
Readonly