Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLEventReader does not handle ' properly #7796

Closed
scabug opened this issue Aug 29, 2013 · 3 comments
Closed

XMLEventReader does not handle ' properly #7796

scabug opened this issue Aug 29, 2013 · 3 comments

Comments

@scabug
Copy link

scabug commented Aug 29, 2013

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>&amp;&lt;&gt;&apos;&quot;</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.

@scabug
Copy link
Author

scabug commented Aug 29, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7796?orig=1
Reporter: Jin Choi (jinschoi)
Affected Versions: 2.10.2

@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

@scabug scabug closed this as completed Jul 17, 2015
@scabug
Copy link
Author

scabug commented Jul 29, 2015

Michael Beckerle (mbeckerle.dfdl) said:
This issue now at GitHub: scala/scala-xml#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant