domdump (314B)
1 #!/bin/rc 2 3 fn getparent{ 4 node=$1 5 parent=`{awk '/parent.*/ {print $2}' $node/ctl} 6 echo $parent 7 } 8 9 for (node in `{walk -d}){ 10 type = `{cat $node/type} 11 parent = `{getparent $node} 12 echo -n $node $parent $type' ' 13 switch ($type) { 14 case 'element' 'doctype' 15 name = `{cat $node/name} 16 echo -n $name 17 } 18 echo 19 }