| SVG-DOM2 documentation | Contained in the SVG-DOM2 distribution. |
SVG::DOM2::Element::Document - svg document functions
Provides the svg document object with the required DOM interface for document wide element requests.
Martin Owens, doctormo@postmaster.co.uk
perl(1), XML::DOM2, XML::DOM2::Element, XML::DOM2::DOM
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html DOM at the W3C
| SVG-DOM2 documentation | Contained in the SVG-DOM2 distribution. |
package SVG::DOM2::Element::Document;
use base "XML::DOM2::Element::Document"; use Carp; sub new { my ($proto, %args) = @_; return $proto->SUPER::new(%args); } sub _attribute_handle { my ($self, $name, %opts) = @_; my $ns = $opts{'namespace'}; return SVG::DOM2::Attribute::Metric->new(%opts) if $name eq 'width' or $name eq 'height'; return $self->SUPER::_attribute_handle($name, %opts); } sub attr { my ($self, $name, $set) = @_; $self->setAttribute($name, $set) if defined($set); return $self->getAttribute($name); } sub width { shift->attr('width', @_); } sub height { shift->attr('height', @_); }
return 1;