Bug 11005 – std.xml does not encode attributes

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-10T00:09:00Z
Last change time
2013-11-12T22:24:46Z
Keywords
pull
Assigned to
nobody
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2013-09-10T00:09:37Z
This program: import std.xml; import std.stdio; void main() { string s = `<tag attr="&quot;value&gt;"></tag>`; auto doc = new Document(s); writeln("attr = ", doc.tag.attr["attr"]); writeln(doc); } compiles and runs with output attr = "value> <tag attr=""value>" /> The expected output is attr = "value> <tag attr="&quot;value&gt;" /> The xml writer does not encode " and < of the stribute string (actually, it decaodes them again).
Comment #1 by r.sagitario — 2013-09-10T00:29:01Z
Comment #2 by github-bugzilla — 2013-09-10T00:33:13Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e1ed1ae8a888af2622aa31aa8963b95af895f950 Merge pull request #1558 from rainers/std_xml_attr_encode Issue 11005 - std.xml does not encode attributes