Bug 4598 – std.xml check is too restrictive

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-08-08T07:28:00Z
Last change time
2011-02-07T00:50:52Z
Assigned to
nobody
Creator
kroeplin.d

Comments

Comment #0 by kroeplin.d — 2010-08-08T07:28:17Z
The check function of std.xml requires each XML document to begin with an XML declaration <?xml ... According to the specification http://www.w3.org/TR/2008/REC-xml-20081126/#NT-prolog, however, the XML declaration is optional! The check function should not throw for well-formed XML documents like <Root/> The following trivial change fixes the issue: in function checkProlog replace checkXMLDecl(s); with opt!(checkXMLDecl)(s); (at line 2249 inD 2.047) Then, the by-the-book implementation conforms to the XML specification.
Comment #1 by bugzilla — 2011-02-07T00:50:52Z