Lines Matching refs:node
63 local ($node, $attrvalue);
66 foreach $node (@{$nodelist}) {
67 $attrvalue = node_attribute($node, $attr);
69 return $node;
73 foreach $node (@{$nodelist}) {
74 if (! defined node_attribute($node, $attr)) {
75 return $node;
110 if (defined ($node = open_tag($parent, $tag))) {
112 $parent = $node;
144 my %node;
145 $node{PARENT} = $parent_node;
146 $node{TYPE} = $type;
149 $node{TEXT} = $tag;
150 $node{NAME} = $type;
151 return \%node;
155 $node{NAME} = $tname;
168 $node{ATTRIBUTES} = \%attr_table;
170 return \%node;
174 local ($parent_node, $node) = @_;
175 push @{$parent_node->{CHILDREN}}, $node;
177 local $tname = $node->{NAME};
179 push @{$parent_node->{$tname}}, $node
181 $parent_node->{$tname} = [ $node ];
187 local $node = new_node($parent_node, $tag, 'EMPTY');
188 add_node($parent_node, $node);
193 local $node;
196 $node = new_node($parent_node, $tag, 'COMMENT');
197 add_node($parent_node, $node);
200 $node = new_node($parent_node, $tag, 'NODE');
201 $node->{CHILDREN} = [];
202 add_node($parent_node, $node);
203 return $node;
209 local $node = new_node($parent_node, $text, 'TEXT');
210 add_node($parent_node, $node);
214 local ($node, $name) = @_;
220 while ($node->{PARENT} != 0) {
221 $node = $node->{PARENT};
223 sublist_by_name($node, $path, \@nodelist);
225 sublist_by_name($node, $name, \@nodelist);
231 local ($node, $name, $res) = @_;
235 push @{$res}, (@{$node->{$tagname}});
239 if ($tagname eq '..' && $node->{PARENT} != 0) {
240 $node = $node->{PARENT};
241 sublist_by_name($node, $path, $res);
244 for $n (@{$node->{$tagname}}) {
251 local $node = @_[0];
252 if (defined $node->{ATTRIBUTES}) {
253 return $node->{ATTRIBUTES}{@_[1]};
259 local ($node) = @_;
260 local ($child) = node_by_name($node, 'TEXT');