Skip to content

Instantly share code, notes, and snippets.

@Audhil
Last active January 24, 2018 06:19
Show Gist options
  • Save Audhil/921d00eb1657c93ccd93ffe8a401627a to your computer and use it in GitHub Desktop.
Save Audhil/921d00eb1657c93ccd93ffe8a401627a to your computer and use it in GitHub Desktop.
XML - Generation Blog_3
val xmlSerializer = Xml.newSerializer()
val xmlString = xmlSerializer.document {
element("Movies") {
element("row") {
attribute("no", "1")
element("FL", "6000000066015") {
attribute("val", "TicketId")
}
element("FL", "Dunkirk") {
attribute("val", "MovieName")
}
element("FL") {
attribute("val", "TimeLog")
element("row") {
attribute("no", "1")
element("FL", "23/01/2018") {
attribute("val", "date")
}
element("FL", "08:00") {
attribute("val", "startTime")
}
}
}
}
}
}
println(xmlString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment