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 #77

Open
mbeckerle opened this issue Jul 29, 2015 · 0 comments

Comments

@mbeckerle
Copy link

This issue migrated from https://issues.scala-lang.org/browse/SI-3527.

Original description of the issue:

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: #73

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

No branches or pull requests

1 participant