SVG::DOM2::Element::Document - svg document functions


SVG-DOM2 documentation Contained in the SVG-DOM2 distribution.

Index


Code Index:

NAME

Top

SVG::DOM2::Element::Document - svg document functions

SUMMARY

Top

Provides the svg document object with the required DOM interface for document wide element requests.

METHODS

Top

AUTHOR

Top

Martin Owens, doctormo@postmaster.co.uk

SEE ALSO

Top

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;