/[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.1 by wakaba, Tue Oct 14 07:49:55 2008 UTC revision 1.4 by wakaba, Sat Oct 18 08:05:29 2008 UTC
# Line 17  sub dumptree ($) { Line 17  sub dumptree ($) {
17      q<http://www.w3.org/1998/Math/MathML> => 'math',      q<http://www.w3.org/1998/Math/MathML> => 'math',
18      q<http://www.w3.org/1999/xlink> => 'xlink',      q<http://www.w3.org/1999/xlink> => 'xlink',
19      q<http://www.w3.org/XML/1998/namespace> => 'xml',      q<http://www.w3.org/XML/1998/namespace> => 'xml',
20      q<http://www.w3.org/2002/xmlns/> => 'xmlns',      q<http://www.w3.org/2000/xmlns/> => 'xmlns',
21    };    };
22    
23    my @node = map { [$_, ''] } @{$node->child_nodes};    my @node = map { [$_, ''] } @{$node->child_nodes};
# 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]->public_id if defined $child->[0]->public_id;
91          $r .= '" "';
92          $r .= $child->[0]->system_id if defined $child->[0]->system_id;
93          $r .= '" ';
94          $r .= $child->[0]->notation_name if defined $child->[0]->notation_name;
95          $r .= ">\x0A";
96          unshift @node,
97              map { [$_, $child->[1] . '  '] } @{$child->[0]->child_nodes};
98        } elsif ($nt == $child->[0]->NOTATION_NODE) {
99          $r .= $child->[1] . '<!NOTATION ' . $child->[0]->node_name . ' "';
100          $r .= $child->[0]->public_id if defined $child->[0]->public_id;
101          $r .= '" "';
102          $r .= $child->[0]->system_id if defined $child->[0]->system_id;
103          $r .= qq[">\x0A];
104        } elsif ($nt == $child->[0]->ELEMENT_TYPE_DEFINITION_NODE) {
105          $r .= $child->[1] . '<!ELEMENT ' . $child->[0]->node_name . ' ';
106          $r .= $child->[0]->content_model_text;
107          $r .= ">\x0A";
108          unshift @node,
109              map { [$_, $child->[1] . '  '] }
110              sort { $a->node_name cmp $b->node_name }
111              values %{$child->[0]->attribute_definitions};
112        } elsif ($nt == $child->[0]->ATTRIBUTE_DEFINITION_NODE) {
113          $r .= $child->[1] . $child->[0]->node_name . ' ';
114          $r .= [
115            0, 'CDATA', 'ID', 'IDREF', 'IDREFS', 'ENTITY', 'ENTITIES',
116            'NMTOKEN', 'NMTOKENS', 'NOTATION', 'ENUMERATION', 11,
117          ]->[$child->[0]->declared_type] || $child->[0]->declared_type;
118          $r .= ' (' . join ('|', @{$child->[0]->allowed_tokens}) . ') ';
119          $r .= [
120            0, 'FIXED', 'REQUIRED', 'IMPLIED', 'EXPLICIT',
121          ]->[$child->[0]->default_type] || $child->[0]->default_type;
122          $r .= ' "' . $child->[0]->text_content . '"';
123          $r .= "\x0A";
124      } else {      } else {
125        $r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error        $r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error
126      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24