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: encoder.EncodeToken fails when given a xml.ProcInst with target "xml" #7380
Labels
Milestone
Comments
Posted a CR for this https://golang.org/cl/68280044/ |
The CR I posted solves the problem incorrectly. ProcInst encoding correctly should still not allow xml targets, but the xml.Decoder should not parse the XML declaration header as a ProcInst. Maybe a new XML declaration header token type is needed? I think all that is needs to change is if the first token looks like a ProcInst with a target of xml return the new XML declaration type instead. I don't think the xml.Encoder should process the xml declaration at all though, because encoding/xml doesn't support non utf-8 encodings. But it may be useful to accept the new xml declaration token so that a user could set the standalone property. But i'm not familiar enough with the standalone property to have a good opinion on it. Thoughts? |
I realized an additional declaration type wasn't strictly needed, and EncodeToken just needed to be updated to allow the xml declaration to be the first token written. This change maintains the existing restriction of ProcInst with a Target of xml not being allowed to be encoded after the first token. CL: https://golang.org/cl/72410043/ |
CL https://golang.org/cl/68280044 references this issue. |
CL https://golang.org/cl/72410043 references this issue. |
CL https://golang.org/cl/68280044 references this issue. |
This issue was closed by revision 92440fb. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by martin.n.angers:
The text was updated successfully, but these errors were encountered: