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

encoding/xml: does not append ; to unrecognised entities #3447

Closed
denisdefreyne opened this issue Mar 31, 2012 · 5 comments
Closed

encoding/xml: does not append ; to unrecognised entities #3447

denisdefreyne opened this issue Mar 31, 2012 · 5 comments

Comments

@denisdefreyne
Copy link

What steps will reproduce the problem?
1. Create a decoder with Strict=false
2. Let it parse a (raw) token with an unrecognised entity, e.g.
"Hello&nbps;Bye"
3. Print the contents of the parsed token (which will be a CharData)
http://play.golang.org/p/sqWtt6BgWp

What is the expected output?
Hello Bye

What do you see instead?
Hello&nbspBye

Which compiler are you using (5g, 6g, 8g, gccgo)?
-

Which operating system are you using?
not relevant (Mac OS X 10.7.3)

Which version are you using?  (run 'go version')
go1

Please provide any additional information below.
I believe that in http://golang.org/src/pkg/encoding/xml/xml.go lines 880 and 912 should
be followed by a d.buf.WriteByte(';').
@dsymonds
Copy link
Contributor

dsymonds commented Apr 2, 2012

Comment 1:

Labels changed: added priority-asap, packagebug, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Apr 2, 2012

Comment 2:

Gustavo, do you agree?

Labels changed: added priority-soon, removed priority-asap.

Status changed to Accepted.

@niemeyer
Copy link
Contributor

niemeyer commented Apr 2, 2012

Comment 3:

It sounds sensible from the bug report, but I'll have a more careful look at the logic.
It might be a copy & paste bug, but the same mistake done twice in a raw makes me wonder
if there's something else to be aware of.

Owner changed to @niemeyer.

@niemeyer
Copy link
Contributor

Comment 4:

There's indeed a detail to be aware of:
    <tag>foo&bar</tag>
That's not supposed to come out as "foo&bar;".
CL 6039045 should fix the issue reported here without introducing this problem.

@niemeyer
Copy link
Contributor

Comment 5:

This issue was closed by revision fdc4536.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants