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

XML ConstructingParser too aggressive trimming whitespace around character references #3527

Closed
scabug opened this issue Jun 3, 2010 · 4 comments

Comments

@scabug
Copy link

scabug commented Jun 3, 2010

when preserveWS = false. example:

Welcome to Scala version 2.8.0.RC3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).

scala> xml.parsing.ConstructingParser.fromSource(io.Source.fromString("<x>a &amp; b</x>"), preserveWS = false).document.text
res0: String = a&b

note that spaces on either side of the escaped ampersand have been lost.

I can't see why you would ever want this behavior. and I'm not an XML laywer, but section 4.4 of the XML 1.0 spec suggests that the character encoded by a character reference should be "retrieved and processed, in place of the reference itself, as though it were part of the document at the location the reference was recognized"

perhaps vaguely related: #3062

@scabug
Copy link
Author

scabug commented Jun 3, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3527?orig=1
Reporter: @SethTisue
See #3062

@scabug
Copy link
Author

scabug commented Oct 4, 2011

@SethTisue said:
the "&SI-38;" in the description seems to be an artifact of the Trac-to-JIRA transition. It should read:

scala> xml.parsing.ConstructingParser.fromSource(io.Source.fromString("<x>a &amp; b</x>"), preserveWS = false).document.text
res1: String = a&b

@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:
Migrated to scala/scala-xml#77

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