Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/XML-Input/Fantom/xml-input.fantom
Normal file
18
Task/XML-Input/Fantom/xml-input.fantom
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using xml
|
||||
|
||||
class XmlInput
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
// create the XML parser
|
||||
parser := XParser(File("sample-xml.xml".toUri).in)
|
||||
// parse the document, creating an XML document
|
||||
XDoc doc := parser.parseDoc
|
||||
// walk through each child element from the root of the document
|
||||
doc.root.elems.each |elem|
|
||||
{
|
||||
// printing the Name attribute of all Students
|
||||
if (elem.name == "Student") { echo (elem.get("Name")) }
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue