# getting-started

Kaj Koivunen

02/28/2023, 11:20 AM
I'm having trouble parsing XML using Woodstox on kotlin, I'm following a java tutorial ( ) that otherwise seems to work but trying to read the actual values inside XML tags like:
Copy code
val something = nextEvent.asCharacters().data
fails with an exception:
Exception in thread "main" java.lang.ClassCastException: com.ctc.wstx.evt.CompactStartElement cannot be cast to
If I check the even with isCharacters it returns false even though it most definitely contains a value. How do I get that value?


02/28/2023, 1:17 PM
not sure how is this kotlin related. but I assume you are still in startElement and not in "body" element

Kaj Koivunen

02/28/2023, 1:33 PM
thanks, that works, I didn't expect the tutorial to be wrong