Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
xml
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
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() ); } } } } } }
Show compiler warnings
[
+
]
Show input
Compilation time: 0,19 sec, absolute running time: 0,8 sec, cpu time: 0,69 sec, average memory usage: 25 Mb, average nr of threads: 8
edit mode
|
history
|
discussion
Hello, world!