XMLStreaming doesn't convert XML character references. Only tested for attributes, don't know about other places in the XML where XML character references could occur.
This unit test would currently fail:
@Test fun `writer converts character references in attributes`() {
val buffer = StringBuilder()
val writer = xmlStreaming.newWriter(buffer)
writer.startTag("", "test", null)
writer.attribute(null, "attr", null, "With\nlinefeed")
writer.endTag("", "test", null)
assertEquals(
"<test attr=\"With linefeed\"></test>", // or hexadecimal: 

buffer.toString()
)
}
instead, the result looks like this:
<test attr="With
linefeed"></test>
Additional information
This unit test does not fail
@Test fun `reader converts character references in attributes`() {
val source = "<test attr=\"With linefeed\"></test>" // or hexadecimal: 

val reader = xmlStreaming.newReader(source)
forEach {
if (it == START_ELEMENT && localName == "test") {
assertEquals(
"With\nlinefeed",
getAttributeValue(null, "attr")!!
)
}
}
}
XMLStreaming doesn't convert XML character references. Only tested for attributes, don't know about other places in the XML where XML character references could occur.
This unit test would currently fail:
instead, the result looks like this:
Additional information
This unit test does not fail