How to read a DOM Document from XML? #165
-
I'm trying to replace the usage of org.xml.sax API. The original code looks like this:
How do I need to use xmlutil to get that DOM Document? |
Beta Was this translation helpful? Give feedback.
Answered by
pdvrieze
Jun 29, 2023
Replies: 1 comment
-
To do this you can use something like: val writer = DomWriter()
val reader = XmlStreaming.newReader(inputStream) // or KtXmlReader(InputStreamReader(inputStream))
do {
val event = reader.next()
reader.writeCurrent(writer) // from nl.adaptivity.xmlutil.writeCurrent
} while (event != EventType.END_DOCUMENT) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
StefanOltmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To do this you can use something like: