Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / SVG::DOM.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" 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<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. 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
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" 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.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" 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
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. 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 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SVG::DOM 3"
.TH SVG::DOM 3 "2003-11-02" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
SVG::DOM \- A library of DOM (Document Object Model) methods for SVG objects.
.SH "SUMMARY"
.IX Header "SUMMARY"
\&\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
and so on.
.PP
Currently only methods that provide read operations are supported. Methods to
manipulate \s-1SVG\s0 elements will be added in a future release.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& my $svg=new SVG(id=>"svg_dom_synopsis", width=>"100", height=>"100");
\& my %attributes=$svg->getAttributes;
.Ve
.PP
.Vb 3
\& my $group=$svg->group(id=>"group_1");
\& my $name=$group->getElementName;
\& my $id=$group->getElementID;
.Ve
.PP
.Vb 3
\& $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");
.Ve
.PP
.Vb 2
\& my $has_children=$group->hasChildren();
\& my @children=$group->getChildren();
.Ve
.PP
.Vb 4
\& my $kid=$group->getFirstChild();
\& do {
\& print $kid->xmlify();
\& } while ($kid=$kid->getNextSibling);
.Ve
.PP
.Vb 3
\& my @ancestors=$rect->getParents();
\& my $is_ancestor=$group->isAncestor($rect);
\& my $is_descendant=$rect->isDescendant($svg);
.Ve
.PP
.Vb 2
\& my @rectangles=$svg->getElements("rect");
\& my $allelements_arrayref=$svg->getElements();
.Ve
.PP
.Vb 1
\& ...and so on...
.Ve
.SH "METHODS"
.IX Header "METHODS"
.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.
.PP
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.
.PP
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.
.PP
Alias: \fIgetParent()\fR
.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.
.PP
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.
.PP
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
.PP
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.
.PP
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.
.SH "AUTHOR"
.IX Header "AUTHOR"
Ronan Oger, ronan@roasp.com
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIperl\fR\|(1), \s-1SVG\s0, \s-1SVG::XML\s0, SVG::Element, SVG::Parser, SVG::Manual
.PP
<http://www.roasp.com/>
.PP
<http://www.perlsvg.com/>
.PP
<http://www.roitsystems.com/>
.PP
<http://www.w3c.org/Graphics/SVG/>