www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4509] New: XML parser in std.xml throws TagException if the attr value is put in apostrophes.

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

           Summary: XML parser in std.xml throws TagException if the attr
                    value is put in apostrophes.
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: the.mail.of.mi2 gmail.com



The best way to illustrate this error is this code:

[code]
import std.xml;

void main()
{
    string goesRight = `<?xml version='1.0' encoding='UTF-8'?><stream:stream
xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"
from="jid.pl" id="587a5767" xml:lang="en" version="1.0"></stream:stream>`;
    string goesWrong = `<?xml version='1.0' encoding='UTF-8'?><stream:stream
xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'
from='jid.pl' id='587a5767' xml:lang='en' version='1.0'></stream:stream>`;

    DocumentParser parser = new DocumentParser(goesRight);
}
[/code]

It creates a DocumentParser object and shuts down. But when change the
constructor argument to goesWrong (the only difference between the two strings
are " changed to '. Please note that in the prologue it doesn't matter), it
results in TagError.

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