Closed
Description
(This issue migrated from https://issues.scala-lang.org/browse/SI-7796)
Of the five required predefined entities in XML, XMLEventReader does not handle ', returning an EvComment of " unknown entity apos; " instead of an EvEntityRef.
This test program:
import scala.xml.pull._
import scala.io.Source
object reader {
val src = Source.fromString("<test>&<>'"</test>")
val er = new XMLEventReader(src)
def main(args: Array[String]) {
while (er.hasNext)
Console.println(er.next)
}
}
outputs:
EvElemStart(null,test,,)
EvEntityRef(amp)
EvEntityRef(lt)
EvEntityRef(gt)
EvComment( unknown entity apos; )
EvEntityRef(quot)
EvElemEnd(null,test)
Also, apos does not appear in XhtmlEntities.scala (may be unrelated).
Since these five entities are predefined, I would argue that the parser should auto-replace them with their equivalents so the user doesn't have to.
Metadata
Metadata
Assignees
Labels
No labels