Skip Menu |

This queue is for tickets about the SVG CPAN distribution.

Report information
The Basics
Id: 57000
Status: resolved
Priority: 0/
Queue: SVG

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

Bug Information
Severity: Normal
Broken in: 2.70
Fixed in: 2.72



Subject: SVG instance does not represent svg root element
I think it should be mentioned in the docu that an SVG instance represents the document and not the <svg> root element. For example if you create an object $svg = SVG->new(width => 100); then $svg->getAttribute('width') will not give you your 100, but undef. Instead, you will get the 100 for example with $svg->firstChild->getAttribute('width'); It would be nice to have an explicit method that returns the root element, e.g. $svg->root. However, if the behaviour described above will not change in the future then the firstChild approach is fine. Additionally, it would be good to have a documented way to tell if an element - for example given to a subroutine - is a document or an SVG element, for example representing a subtree. Right now, this could be tested by $node->isa('SVG') or by $node->getNodeName eq 'document' However, as I said, it would be nice to have a documented way to do this which will be stable across future versions. Thanks for your great work on SVG, Lutz
Hi, Thanks for report the issue. I will get it fixed in the next 24 hours. Best Regards, Mohammad S Anwar
Resolved.