1 package OpenILS::Application::Cat::Utils;
2 use strict; use warnings;
4 use constant INTRA_DOC => 2;
5 use constant PARENT => 3;
6 use constant TYPE => 4;
7 use constant NAME => 5;
8 use constant VALUE => 6;
9 use constant CHILDREN => 7;
12 # Converts an XML nodeset into a tree
14 my($class, $nodeset) = @_;
17 for my $index (0..$size) {
19 my $child = $nodeset->[$index];
21 if( $child and defined($child->[PARENT]) ) {
22 my $parent = $nodeset->[$child->[PARENT]];
23 push( @{$parent->[CHILDREN]}, $child );