.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\" ========================================================================
.de Sh \" Subsection heading
.de Sp \" Vertical space (when we can't use .PP)
.de Vb \" Begin verbatim text
.de Ve \" End verbatim text
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
. tm Index:\\$1\t\\n%\t"\\$2"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. \" simple accents for nroff and troff
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
.\" ========================================================================
.TH SVG::DOM 3 "2003-11-02" "perl v5.8.0" "User Contributed Perl Documentation"
SVG::DOM \- A library of DOM (Document Object Model) methods for SVG objects.
\&\s-1SVG::DOM\s0 provides a selection of methods for accessing and manipulating \s-1SVG\s0
elements through DOM-like methods such as getElements, getChildren, getNextSibling
Currently only methods that provide read operations are supported. Methods to
manipulate \s-1SVG\s0 elements will be added in a future release.
\& my $svg=new SVG(id=>"svg_dom_synopsis", width=>"100", height=>"100");
\& my %attributes=$svg->getAttributes;
\& my $group=$svg->group(id=>"group_1");
\& my $name=$group->getElementName;
\& my $id=$group->getElementID;
\& $group->circle(id=>"circle_1", cx=>20, cy=>20, r=>5, fill=>"red");
\& my $rect=$group->rect(id=>"rect_1", x=>10, y=>10, width=>20, height=>30);
\& my $width=$rect->getAttribute("width");
\& my $has_children=$group->hasChildren();
\& my @children=$group->getChildren();
\& my $kid=$group->getFirstChild();
\& } while ($kid=$kid->getNextSibling);
\& my @ancestors=$rect->getParents();
\& my $is_ancestor=$group->isAncestor($rect);
\& my $is_descendant=$rect->isDescendant($svg);
\& my @rectangles=$svg->getElements("rect");
\& my $allelements_arrayref=$svg->getElements();
.ie n .Sh "@elements = $obj\->getElements($element_name)"
.el .Sh "@elements = \f(CW$obj\fP\->getElements($element_name)"
.IX Subsection "@elements = $obj->getElements($element_name)"
Return a list of all elements with the specified name (i.e. type) in the document. If
no element name is provided, returns a list of all elements in the document.
In scalar context returns an array reference.
.ie n .Sh "@children = $obj\fP\->\fIgetChildren()"
.el .Sh "@children = \f(CW$obj\fP\->\fIgetChildren()\fP"
.IX Subsection "@children = $obj->getChildren()"
Return a list of all children defined on the current node, or undef if there are no children.
In scalar context returns an array reference.
Alias: \fIgetChildElements()\fR, \fIgetChildNodes()\fR
.ie n .Sh "@children = $obj\fP\->\fIhasChildren()"
.el .Sh "@children = \f(CW$obj\fP\->\fIhasChildren()\fP"
.IX Subsection "@children = $obj->hasChildren()"
Return 1 if the current node has children, or 0 if there are no children.
Alias: hasChildElements, \fIhasChildNodes()\fR
.ie n .Sh "$ref = $obj\fP\->\fIgetFirstChild()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetFirstChild()\fP"
.IX Subsection "$ref = $obj->getFirstChild()"
Return the first child element of the current node, or undef if there are no children.
.ie n .Sh "$ref = $obj\fP\->\fIgetLastChild()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetLastChild()\fP"
.IX Subsection "$ref = $obj->getLastChild()"
Return the last child element of the current node, or undef if there are no children.
.ie n .Sh "$ref = $obj\fP\->\fIgetSiblings()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetSiblings()\fP"
.IX Subsection "$ref = $obj->getSiblings()"
Return a list of all children defined on the parent node, containing the current node.
.ie n .Sh "$ref = $obj\fP\->\fIgetNextSibling()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetNextSibling()\fP"
.IX Subsection "$ref = $obj->getNextSibling()"
Return the next child element of the parent node, or undef if this is the last child.
.ie n .Sh "$ref = $obj\fP\->\fIgetPreviousSibling()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetPreviousSibling()\fP"
.IX Subsection "$ref = $obj->getPreviousSibling()"
Return the previous child element of the parent node, or undef if this is the first child.
.ie n .Sh "$index = $obj\fP\->\fIgetChildIndex()"
.el .Sh "$index = \f(CW$obj\fP\->\fIgetChildIndex()\fP"
.IX Subsection "$index = $obj->getChildIndex()"
Return the place of this element in the parent node's list of children, starting from 0.
.ie n .Sh "$element = $obj\->getChildAtIndex($index)"
.el .Sh "$element = \f(CW$obj\fP\->getChildAtIndex($index)"
.IX Subsection "$element = $obj->getChildAtIndex($index)"
Returns the child element at the specified index in the parent node's list of children.
.ie n .Sh "$ref = $obj\fP\->\fIgetParentElement()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetParentElement()\fP"
.IX Subsection "$ref = $obj->getParentElement()"
Return the parent of the current node.
.ie n .Sh "@refs = $obj\fP\->\fIgetParentElements()"
.el .Sh "@refs = \f(CW$obj\fP\->\fIgetParentElements()\fP"
.IX Subsection "@refs = $obj->getParentElements()"
Return a list of the parents of the current node, starting from the immediate parent. The
last member of the list should be the document element.
Alias: \fIgetParents()\fR
.ie n .Sh "$name = $obj\fP\->\fIgetElementName()"
.el .Sh "$name = \f(CW$obj\fP\->\fIgetElementName()\fP"
.IX Subsection "$name = $obj->getElementName()"
Return a string containing the name (i.e. the type, not the \s-1ID\s0) of an element.
Alias: \fIgetType()\fR, \fIgetTagName()\fR, \fIgetNodeName()\fR
.ie n .Sh "$ref = $svg\->getElementByID($id)"
.el .Sh "$ref = \f(CW$svg\fP\->getElementByID($id)"
.IX Subsection "$ref = $svg->getElementByID($id)"
Alias: \fIgetElementbyID()\fR
Return a reference to the element which has \s-1ID\s0 \f(CW$id\fR, or undef if no element with this \s-1ID\s0 exists.
.ie n .Sh "$id = $obj\fP\->\fIgetElementID()"
.el .Sh "$id = \f(CW$obj\fP\->\fIgetElementID()\fP"
.IX Subsection "$id = $obj->getElementID()"
Return a string containing the \s-1ID\s0 of the current node, or undef if it has no \s-1ID\s0.
.ie n .Sh "$ref = $obj\fP\->\fIgetAttributes()"
.el .Sh "$ref = \f(CW$obj\fP\->\fIgetAttributes()\fP"
.IX Subsection "$ref = $obj->getAttributes()"
Return a hash reference of attribute names and values for the current node.
.ie n .Sh "$value = $obj\->getAttribute($name);"
.el .Sh "$value = \f(CW$obj\fP\->getAttribute($name);"
.IX Subsection "$value = $obj->getAttribute($name);"
Return the string value attribute value for an attribute of name \f(CW$name\fR.
.ie n .Sh "$ref = $obj\->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
.el .Sh "$ref = \f(CW$obj\fP\->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
.IX Subsection "$ref = $obj->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
Set a set of attributes. If \f(CW$value\fR is undef, deletes the attribute.
.ie n .Sh "$value = $obj\->setAttribute($name,$value);"
.el .Sh "$value = \f(CW$obj\fP\->setAttribute($name,$value);"
.IX Subsection "$value = $obj->setAttribute($name,$value);"
Set attribute \f(CW$name\fR to \f(CW$value\fR. If \f(CW$value\fR is undef, deletes the attribute.
.ie n .Sh "$cdata = $obj\fP\->\fIgetCDATA()"
.el .Sh "$cdata = \f(CW$obj\fP\->\fIgetCDATA()\fP"
.IX Subsection "$cdata = $obj->getCDATA()"
Return the cannonical data (i.e. textual content) of the current node.
Alias: \fIgetCdata()\fR, \fIgetData()\fR
.ie n .Sh "$boolean = $obj\->isAncestor($element)"
.el .Sh "$boolean = \f(CW$obj\fP\->isAncestor($element)"
.IX Subsection "$boolean = $obj->isAncestor($element)"
Returns 1 if the current node is an ancestor of the specified element, otherwise 0.
.ie n .Sh "$boolean = $obj\->isDescendant($element)"
.el .Sh "$boolean = \f(CW$obj\fP\->isDescendant($element)"
.IX Subsection "$boolean = $obj->isDescendant($element)"
Returns 1 if the current node is a descendant of the specified element, otherwise 0.
Ronan Oger, ronan@roasp.com
\&\fIperl\fR\|(1), \s-1SVG\s0, \s-1SVG::XML\s0, SVG::Element, SVG::Parser, SVG::Manual
<http://www.perlsvg.com/>
<http://www.roitsystems.com/>
<http://www.w3c.org/Graphics/SVG/>