Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/XML-Output/Fantom/xml-output.fantom
Normal file
26
Task/XML-Output/Fantom/xml-output.fantom
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using xml
|
||||
|
||||
class XmlOutput
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
Str[] names := ["April", "Tam O'Shanter", "Emily"]
|
||||
Str[] remarks := ["Bubbly: I'm > Tam and <= Emily",
|
||||
"Burns: \"When chapman billies leave the street ...\"",
|
||||
"Short & shrift"]
|
||||
|
||||
doc := XDoc()
|
||||
root := XElem("CharacterRemarks")
|
||||
doc.add (root)
|
||||
|
||||
names.each |Str name, Int i|
|
||||
{
|
||||
child := XElem("Character")
|
||||
child.addAttr("Name", name)
|
||||
child.add(XText(remarks[i]))
|
||||
root.add (child)
|
||||
}
|
||||
|
||||
doc.write(Env.cur.out)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue