Closed as not planned
Description
This used to work a while ago
@UnitTest
def contentHandler(): Unit = {
val p = defaultParserFactory.newSAXParser()
val handler = new parsing.NoBindingFactoryAdapter
val input = new ByteArrayInputStream("<hello>world</hello>".getBytes("UTF-8"))
p.parse(input, handler)
val n: Node = handler.rootElem
}
This bypasses FactoryAdapter.loadDocument
, which is used internally within scala.xml.
Currently:
- After XMLLoader returns Document #663,
rootElem
is set tonull
- After Capture more of the Document #668,
endDocument
crashes withNone.get
inxmlReader.get.getProperty(...)
I came across some code at a customer that uses NoBindingFactoryAdapter
as a ContentHandler
in their internal XML library to convert to scala.xml.
I can work around it by overriding def endDocument()
, getting out the rootElem
and avoid calling super.endDocument()
.
I don't know if the use case should be supported?
Metadata
Metadata
Assignees
Labels
No labels