Я новичок в Kotlin, пытаюсь создать свое первое приложение для Android.
У меня есть строка XML, которую я хотел бы проанализировать в классе. Xml поступает из мыльного вызова веб-службы, а результат находится в строке с именем xmlOut.pcReturnData, которая выглядит следующим образом:
<?xml version="1.0" ?><ShipmentDetail><Waybill><WaybillNumber>0087073606</WaybillNumber><ServiceType>ECONOMY ROAD</ServiceType><CurrentStatus>Proof of delivery</CurrentStatus><CurrentStatusCode>POD</CurrentStatusCode><DeliveredDate>18052017</DeliveredDate><DeliveredTime>1200</DeliveredTime><ReceiverName>PIET</ReceiverName><NumberOfPieces>3</NumberOfPieces><TotalWeight> 330.00</TotalWeight><Contents/><ManifestReference/><OriginSuburb>MILNERTON</OriginSuburb><OriginHub>ATL</OriginHub><DestinationSuburb>BLOEMFONTEIN</DestinationSuburb><DestinationHub>BFN</DestinationHub><ShipperReference>0087073606</ShipperReference><TrackingEvents><BranchCode>ATL</BranchCode><EventDate>15052017</EventDate><EventTime>1158</EventTime><EventDescription>Waybill Created</EventDescription><EventCode>WBLCRE</EventCode></TrackingEvents><TrackingEvents><BranchCode>ATL</BranchCode><EventDate>15052017</EventDate><EventTime>1224</EventTime><EventDescription>In Trip</EventDescription><EventCode>WBLALL</EventCode></TrackingEvents><TrackingEvents><BranchCode>CPT</BranchCode><EventDate>15052017</EventDate><EventTime>1530</EventTime><EventDescription>On Floor</EventDescription><EventCode>WBLDAL</EventCode></TrackingEvents><TrackingEvents><BranchCode>CPT</BranchCode><EventDate>15052017</EventDate><EventTime>2238</EventTime><EventDescription>In Trip</EventDescription><EventCode>WBLALL</EventCode></TrackingEvents><TrackingEvents><BranchCode>BFN</BranchCode><EventDate>16052017</EventDate><EventTime>1534</EventTime><EventDescription>On Floor</EventDescription><EventCode>WBLDAL</EventCode></TrackingEvents><TrackingEvents><BranchCode>BFN</BranchCode><EventDate>16052017</EventDate><EventTime>1858</EventTime><EventDescription>In Trip</EventDescription><EventCode>WBLALD</EventCode></TrackingEvents><TrackingEvents><BranchCode>BFN</BranchCode><EventDate>17052017</EventDate><EventTime>1722</EventTime><EventDescription>Comments captured</EventDescription><EventCode>WBLCOM</EventCode></TrackingEvents><TrackingEvents><BranchCode>BFN</BranchCode><EventDate>17052017</EventDate><EventTime>1726</EventTime><EventDescription>In Trip</EventDescription><EventCode>WBLALD</EventCode></TrackingEvents><TrackingEvents><BranchCode>BFN</BranchCode><EventDate>18052017</EventDate><EventTime>1835</EventTime><EventDescription>Waybill Delivered</EventDescription><EventCode>WBLDLV</EventCode></TrackingEvents><TrackingEvents><BranchCode>CHLR</BranchCode><EventDate>19052017</EventDate><EventTime>1047</EventTime><EventDescription>POD</EventDescription><EventCode>PODCRE</EventCode></TrackingEvents></Waybill></ShipmentDetail>
Класс, который я создал:
data class ShipmentDetail(val Waybill: Waybill?)
data class TrackingEventsList(val EventDate: Number?, val EventTime: Number?, val EventDescription: String?, val BranchCode: String?, val EventCode: String?)
data class Waybill(val TrackingEvents: List<TrackingEventsList>?, val WaybillNumber: String?, val CurrentStatus: String?, val ShipperReference: String?, val CurrentStatusCode: String?, val ManifestReference: String?, val NumberOfPieces: Number?, val DeliveredDate: Number?, val OriginSuburb: String?, val TotalWeight: Number?, val Contents: String?, val DestinationSuburb: String?, val ServiceType: String?, val DestinationHub: String?, val DeliveredTime: Number?, val ReceiverName: String?, val OriginHub: String?)
Я хотел бы разобрать xml в классе ShipmentDetail, есть ли сборка XMLParser в Kotlin или мне нужно использовать какой-нибудь плагин или расширение?