Summary: std.xml.Document.pretty saves empty elements with
                    spaces and line breaks
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Rainer Schuetze <> 2010-04-05 10:11:32 
PDT ---
Test case:

import std.stdio;
import std.xml;
import std.string;

void main() {

    auto doc = new Document(new Tag("root"));
    doc ~= new Element("elem", "");
    string s = join(doc.pretty(1),"");
    writefln("doc: '%s'", s);

    auto xml = new Document(s);

    string t = xml.elements[0].text();

    writefln("elem: '%s'", t);
    assert(t == "");


doc: '<root> <elem> </elem></root>'
elem: ' '
core.exception.asserter...@test(17): Assertion failure

This does not happen with non-empty elements or with Document.toString

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to