62 |
sub DOCUMENT_POSITION_CONTAINED_BY () { 0x10 } |
sub DOCUMENT_POSITION_CONTAINED_BY () { 0x10 } |
63 |
sub DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC () { 0x20 } |
sub DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC () { 0x20 } |
64 |
|
|
65 |
## TODO: Define |UserDataHandler| Perl bindig |
## |OperationType| from the |UserDataHandler| interface. |
|
## OperationType |
|
66 |
sub NODE_CLONED () { 1 } |
sub NODE_CLONED () { 1 } |
67 |
sub NODE_IMPORTED () { 2 } |
sub NODE_IMPORTED () { 2 } |
68 |
sub NODE_DELETED () { 3 } |
sub NODE_DELETED () { 3 } |
147 |
|
|
148 |
sub manakai_language ($;$) { |
sub manakai_language ($;$) { |
149 |
my $self = $_[0]; |
my $self = $_[0]; |
150 |
|
local $Error::Depth = $Error::Depth + 1; |
151 |
|
|
152 |
if (@_ > 1) { |
if (@_ > 1) { |
|
local $Error::Depth = $Error::Depth + 1; |
|
153 |
if ($self->node_type == 1) { # ELEMENT_NODE |
if ($self->node_type == 1) { # ELEMENT_NODE |
154 |
if (defined $_[1]) { |
if (defined $_[1]) { |
155 |
if ($self->has_attribute_ns (undef, 'xml:lang')) { |
if ($self->has_attribute_ns (undef, 'xml:lang')) { |
171 |
|
|
172 |
my $target = $self; |
my $target = $self; |
173 |
while (defined $target) { |
while (defined $target) { |
174 |
if ($target->node_Type == 1) { # ELEMENT_NODE |
if ($target->node_type == 1) { # ELEMENT_NODE |
175 |
|
## Step 1 |
176 |
|
|
177 |
|
## Step 1.1 |
178 |
my $r = $target->get_attribute_ns |
my $r = $target->get_attribute_ns |
179 |
(q<http://www.w3.org/XML/1998/namespace>, 'lang'); |
(q<http://www.w3.org/XML/1998/namespace>, 'lang'); |
180 |
return $r if defined $r; |
return $r if defined $r; |
181 |
|
|
182 |
|
## Step 1.2 |
183 |
$r = $target->get_attribute_ns (undef, 'xml:lang'); |
$r = $target->get_attribute_ns (undef, 'xml:lang'); |
184 |
return $r if defined $r; |
return $r if defined $r; |
185 |
} |
} |
186 |
|
|
187 |
|
## Step 2 |
188 |
$target = $target->parent_node; |
$target = $target->parent_node; |
189 |
} |
} |
190 |
|
|
191 |
## TODO: from ownerDocument |
## Step 3 |
192 |
## TODO: from upper-level protocol |
my $od = $self->owner_document; |
193 |
|
if (defined $od) { |
194 |
|
return $od->manakai_language; |
195 |
|
} |
196 |
|
|
197 |
|
## Step 4 |
198 |
|
## TODO: from upper-level protocol, if $self isa Document |
199 |
|
|
200 |
## TODO: Documentation |
## Step 5 |
|
|
|
201 |
return ''; |
return ''; |
202 |
} # manakai_language |
} # manakai_language |
203 |
|
|