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

Entities ignored in XML.loadString #1654

Closed
scabug opened this issue Jan 20, 2009 · 3 comments
Closed

Entities ignored in XML.loadString #1654

scabug opened this issue Jan 20, 2009 · 3 comments

Comments

@scabug
Copy link

scabug commented Jan 20, 2009

val xmlLs = scala.xml.XML.loadString( "<a>ceci &amp; un msg</a>" )

Gives me an element with only one child of type scala.xml.Text.

Where as

val xmlCode = <a>ceci &amp; un msg</a>

Gives me an element with 3 children. The second is an scala.xml.EntityRef :

xmlCode.child(1).getClass

Then of course i have

xmlLs != xmlCode
@scabug
Copy link
Author

scabug commented Jan 20, 2009

Imported From: https://issues.scala-lang.org/browse/SI-1654?orig=1
Reporter: Bruno Bieth (mustaghattack)

@scabug
Copy link
Author

scabug commented Feb 16, 2010

@acruise said:
The SAX parser is handing us the "&" in a separate characters call, but it doesn't give any hint that it was previously an entity. Of course, in the case of amp,lt,gt (and quot in attributes) they couldn't have been literals, but there are plenty of situations in which a stream contains characters encoded as entities that could just as well have been literals, and the only way we'd be able to tell is that we'd receive them in a separate characters call. My inclination is to leave this one alone (or even change the XML literal parser to act like SAX!) unless someone can advance a compelling argument for change.

@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.

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