Skip Menu |

This queue is for tickets about the XML-DTD CPAN distribution.

Report information
The Basics
Id: 57072
Status: resolved
Priority: 0/
Queue: XML-DTD

People
Owner: wohl [...] cpan.org
Requestors: bitcard [...] lutzgehlen.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.08
Fixed in: 0.09



Subject: XML::DTD fails to parse the official SVG DTD correctly
I tried to parse the attached official W3C SVG DTD with XML::DTD. If I run perl -MXML::DTD -e '$dtd=new XML::DTD; open(DTD, "<", "svg11-flat-20030114.dtd"); $dtd->fread(*DTD); close(DTD); $dtd->fwrite(*STDOUT);' > foo.dtd then svg11-flat-20030114.dtd and foo.dtd are binary equal. However, if I run perl -MXML::DTD -e '$dtd=new XML::DTD; open(DTD, "<", "svg11-flat-20030114.dtd"); $dtd->fread(*DTD); close(DTD); print "@{$dtd->elementlist}\n";' then I get nothing. Anyway, thanks for developing XML::DTD. Hope, you can fix this. Lutz
Subject: svg11-flat-20030114.dtd
Download svg11-flat-20030114.dtd
application/xml-dtd 183.1k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #57072] XML::DTD fails to parse the official SVG DTD correctly
Date: Fri, 30 Apr 2010 21:58:43 -0600
To: bug-XML-DTD [...] rt.cpan.org
From: Brendt Wohlberg <osspkg [...] gmail.com>
Dear Lutz, Show quoted text
> [...] > I tried to parse the attached official W3C SVG DTD with XML::DTD. If I run > [...] > then svg11-flat-20030114.dtd and foo.dtd are binary equal. However, if I run > > perl -MXML::DTD -e '$dtd=new XML::DTD; open(DTD, "<", > "svg11-flat-20030114.dtd"); $dtd->fread(*DTD); close(DTD); print > "@{$dtd->elementlist}\n";' > [...]
Thanks for the bug report. The SVG DTD is rather complex, and makes heavy use of entities in element content models, and include sections, both of which were not being handled properly by XML::DTD. I am attaching version 0.09b1 which fixes the main problem you reported (empty elementlist), and some others I discovered. Could you please check whether you can find any other problems in handling of the SVG DTD by 0.09b1? If it seems fine, I will release 0.09 on CPAN. One request: if you do find any more problems, please try to send a simple test DTD which illustrates the bug, as this will enable me to fix it significantly faster. Sincerely, Brendt
Download XML-DTD-0.09b1.tar.gz
application/x-gzip 40.2k

Message body not shown because it is not plain text.

Hello Brendt, thanks a lot for the quick response! On Fri Apr 30 23:59:18 2010, Brendt Wohlberg wrote: Show quoted text
> Could you please check whether you can find any other problems in > handling of the SVG DTD by 0.09b1? If it seems fine, I will release > 0.09 on CPAN. One request: if you do find any more problems, please > try to send a simple test DTD which illustrates the bug, as this will > enable me to fix it significantly faster.
I have tried (rather superficially) a few things that I am likely to use in the future like elementlist, attlist, contentmodel and so on, and it seems to work fine except one thing. The contentspec method of XML::DTD::Element does not expand entities. The script at the end of this messages prints out "%SVG.svg.content;". I don't think this is intended. I have tried to distill an example DTD (attached) from the SVG DTD and hope I did not mess it up. As you said, the SVG DTD is rather complex. However, the script on the whole DTD shows the same behaviour. Aside from this, I haven't found any issues. I just have a few questions/feature requests which I will send separately by email. Thanks for your work on XML::DTD. Best wishes Lutz perl script: use strict; use warnings; use XML::DTD; my $dtd=new XML::DTD; #open(DTD, "<", "svg11-flat-20030114.dtd"); open(DTD, "<", "example.dtd"); $dtd->fread(*DTD); close(DTD); print $dtd->element('svg')->contentspec, "\n";
Subject: example.dtd
Download example.dtd
application/xml-dtd 1k

Message body not shown because it is not plain text.