Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / SVG::DOM.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "SVG::DOM 3"
132.TH SVG::DOM 3 "2003-11-02" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134SVG::DOM \- A library of DOM (Document Object Model) methods for SVG objects.
135.SH "SUMMARY"
136.IX Header "SUMMARY"
137\&\s-1SVG::DOM\s0 provides a selection of methods for accessing and manipulating \s-1SVG\s0
138elements through DOM-like methods such as getElements, getChildren, getNextSibling
139and so on.
140.PP
141Currently only methods that provide read operations are supported. Methods to
142manipulate \s-1SVG\s0 elements will be added in a future release.
143.SH "SYNOPSIS"
144.IX Header "SYNOPSIS"
145.Vb 2
146\& my $svg=new SVG(id=>"svg_dom_synopsis", width=>"100", height=>"100");
147\& my %attributes=$svg->getAttributes;
148.Ve
149.PP
150.Vb 3
151\& my $group=$svg->group(id=>"group_1");
152\& my $name=$group->getElementName;
153\& my $id=$group->getElementID;
154.Ve
155.PP
156.Vb 3
157\& $group->circle(id=>"circle_1", cx=>20, cy=>20, r=>5, fill=>"red");
158\& my $rect=$group->rect(id=>"rect_1", x=>10, y=>10, width=>20, height=>30);
159\& my $width=$rect->getAttribute("width");
160.Ve
161.PP
162.Vb 2
163\& my $has_children=$group->hasChildren();
164\& my @children=$group->getChildren();
165.Ve
166.PP
167.Vb 4
168\& my $kid=$group->getFirstChild();
169\& do {
170\& print $kid->xmlify();
171\& } while ($kid=$kid->getNextSibling);
172.Ve
173.PP
174.Vb 3
175\& my @ancestors=$rect->getParents();
176\& my $is_ancestor=$group->isAncestor($rect);
177\& my $is_descendant=$rect->isDescendant($svg);
178.Ve
179.PP
180.Vb 2
181\& my @rectangles=$svg->getElements("rect");
182\& my $allelements_arrayref=$svg->getElements();
183.Ve
184.PP
185.Vb 1
186\& ...and so on...
187.Ve
188.SH "METHODS"
189.IX Header "METHODS"
190.ie n .Sh "@elements = $obj\->getElements($element_name)"
191.el .Sh "@elements = \f(CW$obj\fP\->getElements($element_name)"
192.IX Subsection "@elements = $obj->getElements($element_name)"
193Return a list of all elements with the specified name (i.e. type) in the document. If
194no element name is provided, returns a list of all elements in the document.
195In scalar context returns an array reference.
196.ie n .Sh "@children = $obj\fP\->\fIgetChildren()"
197.el .Sh "@children = \f(CW$obj\fP\->\fIgetChildren()\fP"
198.IX Subsection "@children = $obj->getChildren()"
199Return a list of all children defined on the current node, or undef if there are no children.
200In scalar context returns an array reference.
201.PP
202Alias: \fIgetChildElements()\fR, \fIgetChildNodes()\fR
203.ie n .Sh "@children = $obj\fP\->\fIhasChildren()"
204.el .Sh "@children = \f(CW$obj\fP\->\fIhasChildren()\fP"
205.IX Subsection "@children = $obj->hasChildren()"
206Return 1 if the current node has children, or 0 if there are no children.
207.PP
208Alias: hasChildElements, \fIhasChildNodes()\fR
209.ie n .Sh "$ref = $obj\fP\->\fIgetFirstChild()"
210.el .Sh "$ref = \f(CW$obj\fP\->\fIgetFirstChild()\fP"
211.IX Subsection "$ref = $obj->getFirstChild()"
212Return the first child element of the current node, or undef if there are no children.
213.ie n .Sh "$ref = $obj\fP\->\fIgetLastChild()"
214.el .Sh "$ref = \f(CW$obj\fP\->\fIgetLastChild()\fP"
215.IX Subsection "$ref = $obj->getLastChild()"
216Return the last child element of the current node, or undef if there are no children.
217.ie n .Sh "$ref = $obj\fP\->\fIgetSiblings()"
218.el .Sh "$ref = \f(CW$obj\fP\->\fIgetSiblings()\fP"
219.IX Subsection "$ref = $obj->getSiblings()"
220Return a list of all children defined on the parent node, containing the current node.
221.ie n .Sh "$ref = $obj\fP\->\fIgetNextSibling()"
222.el .Sh "$ref = \f(CW$obj\fP\->\fIgetNextSibling()\fP"
223.IX Subsection "$ref = $obj->getNextSibling()"
224Return the next child element of the parent node, or undef if this is the last child.
225.ie n .Sh "$ref = $obj\fP\->\fIgetPreviousSibling()"
226.el .Sh "$ref = \f(CW$obj\fP\->\fIgetPreviousSibling()\fP"
227.IX Subsection "$ref = $obj->getPreviousSibling()"
228Return the previous child element of the parent node, or undef if this is the first child.
229.ie n .Sh "$index = $obj\fP\->\fIgetChildIndex()"
230.el .Sh "$index = \f(CW$obj\fP\->\fIgetChildIndex()\fP"
231.IX Subsection "$index = $obj->getChildIndex()"
232Return the place of this element in the parent node's list of children, starting from 0.
233.ie n .Sh "$element = $obj\->getChildAtIndex($index)"
234.el .Sh "$element = \f(CW$obj\fP\->getChildAtIndex($index)"
235.IX Subsection "$element = $obj->getChildAtIndex($index)"
236Returns the child element at the specified index in the parent node's list of children.
237.ie n .Sh "$ref = $obj\fP\->\fIgetParentElement()"
238.el .Sh "$ref = \f(CW$obj\fP\->\fIgetParentElement()\fP"
239.IX Subsection "$ref = $obj->getParentElement()"
240Return the parent of the current node.
241.PP
242Alias: \fIgetParent()\fR
243.ie n .Sh "@refs = $obj\fP\->\fIgetParentElements()"
244.el .Sh "@refs = \f(CW$obj\fP\->\fIgetParentElements()\fP"
245.IX Subsection "@refs = $obj->getParentElements()"
246Return a list of the parents of the current node, starting from the immediate parent. The
247last member of the list should be the document element.
248.PP
249Alias: \fIgetParents()\fR
250.ie n .Sh "$name = $obj\fP\->\fIgetElementName()"
251.el .Sh "$name = \f(CW$obj\fP\->\fIgetElementName()\fP"
252.IX Subsection "$name = $obj->getElementName()"
253Return a string containing the name (i.e. the type, not the \s-1ID\s0) of an element.
254.PP
255Alias: \fIgetType()\fR, \fIgetTagName()\fR, \fIgetNodeName()\fR
256.ie n .Sh "$ref = $svg\->getElementByID($id)"
257.el .Sh "$ref = \f(CW$svg\fP\->getElementByID($id)"
258.IX Subsection "$ref = $svg->getElementByID($id)"
259Alias: \fIgetElementbyID()\fR
260.PP
261Return 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.
262.ie n .Sh "$id = $obj\fP\->\fIgetElementID()"
263.el .Sh "$id = \f(CW$obj\fP\->\fIgetElementID()\fP"
264.IX Subsection "$id = $obj->getElementID()"
265Return a string containing the \s-1ID\s0 of the current node, or undef if it has no \s-1ID\s0.
266.ie n .Sh "$ref = $obj\fP\->\fIgetAttributes()"
267.el .Sh "$ref = \f(CW$obj\fP\->\fIgetAttributes()\fP"
268.IX Subsection "$ref = $obj->getAttributes()"
269Return a hash reference of attribute names and values for the current node.
270.ie n .Sh "$value = $obj\->getAttribute($name);"
271.el .Sh "$value = \f(CW$obj\fP\->getAttribute($name);"
272.IX Subsection "$value = $obj->getAttribute($name);"
273Return the string value attribute value for an attribute of name \f(CW$name\fR.
274.ie n .Sh "$ref = $obj\->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
275.el .Sh "$ref = \f(CW$obj\fP\->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
276.IX Subsection "$ref = $obj->setAttributes({name1=>$value1,name2=>undef,name3=>$value3})"
277Set a set of attributes. If \f(CW$value\fR is undef, deletes the attribute.
278.ie n .Sh "$value = $obj\->setAttribute($name,$value);"
279.el .Sh "$value = \f(CW$obj\fP\->setAttribute($name,$value);"
280.IX Subsection "$value = $obj->setAttribute($name,$value);"
281Set attribute \f(CW$name\fR to \f(CW$value\fR. If \f(CW$value\fR is undef, deletes the attribute.
282.ie n .Sh "$cdata = $obj\fP\->\fIgetCDATA()"
283.el .Sh "$cdata = \f(CW$obj\fP\->\fIgetCDATA()\fP"
284.IX Subsection "$cdata = $obj->getCDATA()"
285Return the cannonical data (i.e. textual content) of the current node.
286.PP
287Alias: \fIgetCdata()\fR, \fIgetData()\fR
288.ie n .Sh "$boolean = $obj\->isAncestor($element)"
289.el .Sh "$boolean = \f(CW$obj\fP\->isAncestor($element)"
290.IX Subsection "$boolean = $obj->isAncestor($element)"
291Returns 1 if the current node is an ancestor of the specified element, otherwise 0.
292.ie n .Sh "$boolean = $obj\->isDescendant($element)"
293.el .Sh "$boolean = \f(CW$obj\fP\->isDescendant($element)"
294.IX Subsection "$boolean = $obj->isDescendant($element)"
295Returns 1 if the current node is a descendant of the specified element, otherwise 0.
296.SH "AUTHOR"
297.IX Header "AUTHOR"
298Ronan Oger, ronan@roasp.com
299.SH "SEE ALSO"
300.IX Header "SEE ALSO"
301\&\fIperl\fR\|(1), \s-1SVG\s0, \s-1SVG::XML\s0, SVG::Element, SVG::Parser, SVG::Manual
302.PP
303<http://www.roasp.com/>
304.PP
305<http://www.perlsvg.com/>
306.PP
307<http://www.roitsystems.com/>
308.PP
309<http://www.w3c.org/Graphics/SVG/>