Created
November 27, 2021 12:23
-
-
Save sheerazam/27f68b8f60f838fc70c2035b914247cb to your computer and use it in GitHub Desktop.
How to Parse Xml using Kotlin in 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Root(strict = false, name = "COL") | |
class Col { | |
@field:Attribute(name = "NAME", required = false) | |
var name: String? = null | |
@field:Attribute(name = "VALUE", required = false) | |
var value: String? = null | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Root(name = "DATA_FETCH", strict = false) | |
class DataFetch { | |
@field:ElementList(name = "REC", required = false) | |
lateinit var REC: List<Rec> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Root(strict = false, name = "REC") | |
class Rec { | |
@field:Element(name = "COL", required = false) | |
lateinit var listCol: List<Col> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment