problem using std.xml

boyd gaboonviper at gmx.net
Fri May 2 07:03:56 PDT 2008


Except that the check(s) function that is supposed to check this, didn't  
give any errors.

I found the bug though. Apparently if a closed <node/> is written inside  
another node, an access violation occurs.

works:
	<?xml version="1.0"?><tag/>

doesn't work:
	<?xml version="1.0"?><something><tag/></something>

I'll post this on bugzilla. Thanks for trying to help though.

Cheers,
Boyd

-------
On Fri, 02 May 2008 14:38:36 +0200, Gide Nwawudu <gide at btinternet.com>  
wrote:

> On Fri, 02 May 2008 09:34:00 +0200, boyd <gaboonviper at gmx.net> wrote:
>
>> I've been trying to work with the D2 xml module. It compiles fine, but
>> when I run it I get an access violation. Am I doing something wrong?
>>
>> module main;
>>
>> import std.stdio;
>> import std.file;
>> import std.xml;
>>
>> int main(){
>>     string s = cast(string)std.file.read("widget.xml");
>>
>>     check(s);
>>     auto doc = new Document(s);
>>     writefln(doc);
>>
>>     return 0;
>> }
>>
>> Cheers,
>> Boyd
>
> If widget.xml is malformed, it crashes. Probably a bug.
>
> Tested with the following; the first errors, the second version  is
> ok.
>
> [widget.xml]
> <?xml version="1.0"?><widget>
> [/widget.xml]
>
> [widget.xml]
> <?xml version="1.0"?><widget></widget>
> [/widget.xml]
>
> Gide


More information about the Digitalmars-d-learn mailing list