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.
Still exists in 2.068. Backtrace (lacking line numbers, sadly): std.xml.TagException@std/xml.d(2743): <stream:stream xmlns:stream= ---------------- ./test(void std.xml.ElementParser.parse()+0x2ba) [0x809910a] ./test(std.xml.DocumentParser std.xml.DocumentParser.__ctor(immutable(char)[])+0x33) [0x8098d33] ./test(_Dmain+0x38) [0x80935b8] ./test(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x12) [0x8094d82] ./test(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x18) [0x8094cf0] ./test(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x27) [0x8094d47] ./test(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x18) [0x8094cf0] ./test(_d_run_main+0x166) [0x8094c86] ./test(main+0x14) [0x8093634] /lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf3) [0xb75b4a63]
I have sent a PR to fix this bug https://github.com/D-Programming-Language/phobos/pull/4064 .
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/1533801fc890ee70178f04059422e9ce0e41d239 std.xml: accept single quotes for attributes Fixes issue 4509 - XML parser in std.xml throws TagException if the attr value is put in apostrophes. https://github.com/dlang/phobos/commit/d231d783e68ed8b3c3950158a6ccc696b9be33b8 Merge pull request #4567 from aG0aep6G/4509 Fix issue 4509 - XML parser in std.xml throws TagException if the attr value is put in apostrophes.
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/1533801fc890ee70178f04059422e9ce0e41d239 std.xml: accept single quotes for attributes https://github.com/dlang/phobos/commit/d231d783e68ed8b3c3950158a6ccc696b9be33b8 Merge pull request #4567 from aG0aep6G/4509