I'm trying to make use of the library on Kotlin, but I cannot call asCharacters() on the events it returns. A tutorial I've followed suggests doing this to get the contents of a tag. My full code is here, the call ot asCharacters on line 36 is the first part where this fails.
The problematic part is:
var someString = nextEvent.asCharacters().data
which throws
Exception in thread "main" java.lang.ClassCastException: com.ctc.wstx.evt.CompactStartElement cannot be cast to javax.xml.stream.events.Characters
at org.codehaus.stax2.ri.evt.BaseEventImpl.asCharacters(BaseEventImpl.java:47)
Calling isCharacters on the event returns false, but I'm 100% certain all elements this gets called on do contain a value within them. How do I access this value?
I'm trying to make use of the library on Kotlin, but I cannot call asCharacters() on the events it returns. A tutorial I've followed suggests doing this to get the contents of a tag. My full code is here, the call ot
asCharacters
on line 36 is the first part where this fails.The problematic part is:
var someString = nextEvent.asCharacters().data
which throws
Calling
isCharacters
on the event returns false, but I'm 100% certain all elements this gets called on do contain a value within them. How do I access this value?