http://d.puremagic.com/issues/show_bug.cgi?id=3201

           Summary: std.xml incorrectly converts symbols in attributes,
                    & -> &amp
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jesse.k.phillip...@gmail.com
                CC: jesse.k.phillip...@gmail.com


The example code below will output:

Attr: What & Up
Elem: What & Up

Expected:

Attr: What & Up
Elem: What & Up

*testfile.xml:*

<?xml version="1.0" encoding="utf-8"?> <Tests>
    <Test thing="What &amp; Up">What &amp; Up</Test>
</Tests>


*test.d:*

import std.stdio;
import std.xml;

void main() {
    auto file = "testfile.xml";

    auto s = cast(string)std.file.read(file);

    auto xml = new DocumentParser(s);

    xml.onStartTag["Test"] = (ElementParser xml) {
        writeln("Attr: ", xml.tag.attr["thing"]);
    };

    xml.onEndTag["Test"] = (in Element e) {
        writeln("Elem: ", e.text);
    };
    xml.parse();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to