/[suikacvs]/markup/html/whatpm/Whatpm/HTML/Dumper.pm
Suika

Diff of /markup/html/whatpm/Whatpm/HTML/Dumper.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by wakaba, Tue Oct 14 10:36:33 2008 UTC revision 1.5 by wakaba, Sun Oct 19 06:14:57 2008 UTC
# Line 69  sub dumptree ($) { Line 69  sub dumptree ($) {
69        }        }
70        $r .= ">\x0A";        $r .= ">\x0A";
71        unshift @node,        unshift @node,
72          map { [$_, $child->[1] . '  '] } @{$child->[0]->child_nodes};            map { [$_, $child->[1] . '  '] }
73              sort { $a->node_name cmp $b->node_name }
74              values %{$child->[0]->element_types};
75          unshift @node,
76              map { [$_, $child->[1] . '  '] }
77              sort { $a->node_name cmp $b->node_name }
78              values %{$child->[0]->entities};
79          unshift @node,
80              map { [$_, $child->[1] . '  '] }
81              sort { $a->node_name cmp $b->node_name }
82              values %{$child->[0]->notations};
83          unshift @node,
84              map { [$_, $child->[1] . '  '] } @{$child->[0]->child_nodes};
85      } elsif ($nt == $child->[0]->PROCESSING_INSTRUCTION_NODE) {      } elsif ($nt == $child->[0]->PROCESSING_INSTRUCTION_NODE) {
86        $r .= $child->[1] . '<?' . $child->[0]->target . ' ';        $r .= $child->[1] . '<?' . $child->[0]->target . ' ';
87        $r .= $child->[0]->data . "?>\x0A";        $r .= $child->[0]->data . "?>\x0A";
88        } elsif ($nt == $child->[0]->ENTITY_NODE) {
89          $r .= $child->[1] . '<!ENTITY ' . $child->[0]->node_name . ' "';
90          $r .= $child->[0]->text_content;
91          $r .= '" "';
92          $r .= $child->[0]->public_id if defined $child->[0]->public_id;
93          $r .= '" "';
94          $r .= $child->[0]->system_id if defined $child->[0]->system_id;
95          $r .= '" ';
96          $r .= $child->[0]->notation_name if defined $child->[0]->notation_name;
97          $r .= ">\x0A";
98          unshift @node,
99              map { [$_, $child->[1] . '  '] } @{$child->[0]->child_nodes};
100        } elsif ($nt == $child->[0]->NOTATION_NODE) {
101          $r .= $child->[1] . '<!NOTATION ' . $child->[0]->node_name . ' "';
102          $r .= $child->[0]->public_id if defined $child->[0]->public_id;
103          $r .= '" "';
104          $r .= $child->[0]->system_id if defined $child->[0]->system_id;
105          $r .= qq[">\x0A];
106        } elsif ($nt == $child->[0]->ELEMENT_TYPE_DEFINITION_NODE) {
107          $r .= $child->[1] . '<!ELEMENT ' . $child->[0]->node_name . ' ';
108          $r .= $child->[0]->content_model_text;
109          $r .= ">\x0A";
110          unshift @node,
111              map { [$_, $child->[1] . '  '] }
112              sort { $a->node_name cmp $b->node_name }
113              values %{$child->[0]->attribute_definitions};
114        } elsif ($nt == $child->[0]->ATTRIBUTE_DEFINITION_NODE) {
115          $r .= $child->[1] . $child->[0]->node_name . ' ';
116          $r .= [
117            0, 'CDATA', 'ID', 'IDREF', 'IDREFS', 'ENTITY', 'ENTITIES',
118            'NMTOKEN', 'NMTOKENS', 'NOTATION', 'ENUMERATION', 11,
119          ]->[$child->[0]->declared_type] || $child->[0]->declared_type;
120          $r .= ' (' . join ('|', @{$child->[0]->allowed_tokens}) . ') ';
121          $r .= [
122            0, 'FIXED', 'REQUIRED', 'IMPLIED', 'EXPLICIT',
123          ]->[$child->[0]->default_type] || $child->[0]->default_type;
124          $r .= ' "' . $child->[0]->text_content . '"';
125          $r .= "\x0A";
126      } else {      } else {
127        $r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error        $r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error
128      }      }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24