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/2000/xmlns/> => 'xmlns', |
q<http://www.w3.org/2000/xmlns/> => 'xmlns', |
21 |
|
|
22 |
|
q<urn:x-suika-fam-cx:markup:suikawiki:0:9:> => 'sw', |
23 |
|
q<urn:x-suika-fam-cx:markup:suikawiki:0:10:> => 'sw10', |
24 |
}; |
}; |
25 |
|
|
26 |
my @node = map { [$_, ''] } @{$node->child_nodes}; |
my @node = map { [$_, ''] } @{$node->child_nodes}; |
72 |
} |
} |
73 |
$r .= ">\x0A"; |
$r .= ">\x0A"; |
74 |
unshift @node, |
unshift @node, |
75 |
map { [$_, $child->[1] . ' '] } @{$child->[0]->child_nodes}; |
map { [$_, $child->[1] . ' '] } |
76 |
|
sort { $a->node_name cmp $b->node_name } |
77 |
|
values %{$child->[0]->element_types}; |
78 |
|
unshift @node, |
79 |
|
map { [$_, $child->[1] . ' '] } |
80 |
|
sort { $a->node_name cmp $b->node_name } |
81 |
|
values %{$child->[0]->entities}; |
82 |
|
unshift @node, |
83 |
|
map { [$_, $child->[1] . ' '] } |
84 |
|
sort { $a->node_name cmp $b->node_name } |
85 |
|
values %{$child->[0]->notations}; |
86 |
|
unshift @node, |
87 |
|
map { [$_, $child->[1] . ' '] } @{$child->[0]->child_nodes}; |
88 |
} elsif ($nt == $child->[0]->PROCESSING_INSTRUCTION_NODE) { |
} elsif ($nt == $child->[0]->PROCESSING_INSTRUCTION_NODE) { |
89 |
$r .= $child->[1] . '<?' . $child->[0]->target . ' '; |
$r .= $child->[1] . '<?' . $child->[0]->target . ' '; |
90 |
$r .= $child->[0]->data . "?>\x0A"; |
$r .= $child->[0]->data . "?>\x0A"; |
91 |
|
} elsif ($nt == $child->[0]->ENTITY_NODE) { |
92 |
|
$r .= $child->[1] . '<!ENTITY ' . $child->[0]->node_name . ' "'; |
93 |
|
$r .= $child->[0]->text_content; |
94 |
|
$r .= '" "'; |
95 |
|
$r .= $child->[0]->public_id if defined $child->[0]->public_id; |
96 |
|
$r .= '" "'; |
97 |
|
$r .= $child->[0]->system_id if defined $child->[0]->system_id; |
98 |
|
$r .= '" '; |
99 |
|
$r .= $child->[0]->notation_name if defined $child->[0]->notation_name; |
100 |
|
$r .= ">\x0A"; |
101 |
|
unshift @node, |
102 |
|
map { [$_, $child->[1] . ' '] } @{$child->[0]->child_nodes}; |
103 |
|
} elsif ($nt == $child->[0]->NOTATION_NODE) { |
104 |
|
$r .= $child->[1] . '<!NOTATION ' . $child->[0]->node_name . ' "'; |
105 |
|
$r .= $child->[0]->public_id if defined $child->[0]->public_id; |
106 |
|
$r .= '" "'; |
107 |
|
$r .= $child->[0]->system_id if defined $child->[0]->system_id; |
108 |
|
$r .= qq[">\x0A]; |
109 |
|
} elsif ($nt == $child->[0]->ELEMENT_TYPE_DEFINITION_NODE) { |
110 |
|
$r .= $child->[1] . '<!ELEMENT ' . $child->[0]->node_name . ' '; |
111 |
|
$r .= $child->[0]->content_model_text; |
112 |
|
$r .= ">\x0A"; |
113 |
|
unshift @node, |
114 |
|
map { [$_, $child->[1] . ' '] } |
115 |
|
sort { $a->node_name cmp $b->node_name } |
116 |
|
values %{$child->[0]->attribute_definitions}; |
117 |
|
} elsif ($nt == $child->[0]->ATTRIBUTE_DEFINITION_NODE) { |
118 |
|
$r .= $child->[1] . $child->[0]->node_name . ' '; |
119 |
|
$r .= [ |
120 |
|
0, 'CDATA', 'ID', 'IDREF', 'IDREFS', 'ENTITY', 'ENTITIES', |
121 |
|
'NMTOKEN', 'NMTOKENS', 'NOTATION', 'ENUMERATION', 11, |
122 |
|
]->[$child->[0]->declared_type] || $child->[0]->declared_type; |
123 |
|
$r .= ' (' . join ('|', @{$child->[0]->allowed_tokens}) . ') '; |
124 |
|
$r .= [ |
125 |
|
0, 'FIXED', 'REQUIRED', 'IMPLIED', 'EXPLICIT', |
126 |
|
]->[$child->[0]->default_type] || $child->[0]->default_type; |
127 |
|
$r .= ' "' . $child->[0]->text_content . '"'; |
128 |
|
$r .= "\x0A"; |
129 |
} else { |
} else { |
130 |
$r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error |
$r .= $child->[1] . $child->[0]->node_type . "\x0A"; # error |
131 |
} |
} |