285 |
|
|
286 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
287 |
if ($nt == 1) { |
if ($nt == 1) { |
288 |
## NOTE: Not explicitly disallowed. |
my $node_ns = $node->namespace_uri; |
289 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
290 |
|
my $node_ln = $node->manakai_local_name; |
291 |
|
unless ($self->{pluses}->{$node_ns}->{$node_ln}) { |
292 |
|
## NOTE: Not explicitly disallowed. |
293 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
294 |
|
} |
295 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
296 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
297 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
331 |
|
|
332 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
333 |
if ($nt == 1) { |
if ($nt == 1) { |
334 |
## NOTE: Not explicitly disallowed. |
my $node_ns = $node->namespace_uri; |
335 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
336 |
|
my $node_ln = $node->manakai_local_name; |
337 |
|
unless ($self->{pluses}->{$node_ns}->{$node_ln}) { |
338 |
|
## NOTE: Not explicitly disallowed. |
339 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
340 |
|
} |
341 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
342 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
343 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
372 |
|
|
373 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
374 |
if ($nt == 1) { |
if ($nt == 1) { |
375 |
## NOTE: It does not explicitly say that there MUST NOT be any element. |
my $node_ns = $node->namespace_uri; |
376 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
377 |
|
my $node_ln = $node->manakai_local_name; |
378 |
|
unless ($self->{pluses}->{$node_ns}->{$node_ln}) { |
379 |
|
## NOTE: It does not explicitly say that there MUST NOT be any element. |
380 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
381 |
|
} |
382 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
383 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
384 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
455 |
# MUST |
# MUST |
456 |
my $nsuri = $node->namespace_uri; |
my $nsuri = $node->namespace_uri; |
457 |
$nsuri = '' unless defined $nsuri; |
$nsuri = '' unless defined $nsuri; |
458 |
|
my $ln = $node->manakai_local_name; |
459 |
my $not_allowed; |
my $not_allowed; |
460 |
if ($nsuri eq $ATOM_NS) { |
if ($self->{pluses}->{$nsuri}->{$ln}) { |
461 |
my $ln = $node->manakai_local_name; |
# |
462 |
|
} elsif ($nsuri eq $ATOM_NS) { |
463 |
if ({ # MUST (0, 1) |
if ({ # MUST (0, 1) |
464 |
content => 1, |
content => 1, |
465 |
id => 1, |
id => 1, |
567 |
if ($nt == 1) { |
if ($nt == 1) { |
568 |
my $nsuri = $node->namespace_uri; |
my $nsuri = $node->namespace_uri; |
569 |
$nsuri = '' unless defined $nsuri; |
$nsuri = '' unless defined $nsuri; |
570 |
|
my $ln = $node->manakai_local_name; |
571 |
my $not_allowed; |
my $not_allowed; |
572 |
if ($nsuri eq $ATOM_NS) { |
if ($self->{pluses}->{$nsuri}->{$ln}) { |
573 |
my $ln = $node->manakai_local_name; |
# |
574 |
|
} elsif ($nsuri eq $ATOM_NS) { |
575 |
if ($ln eq 'entry') { |
if ($ln eq 'entry') { |
576 |
$has_element->{entry} = 1; |
$has_element->{entry} = 1; |
577 |
} elsif ({ # MUST (0, 1) |
} elsif ({ # MUST (0, 1) |
743 |
|
|
744 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
745 |
if ($nt == 1) { |
if ($nt == 1) { |
746 |
# MUST NOT |
my $node_ns = $node->namespace_uri; |
747 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
748 |
|
my $node_ln = $node->manakai_local_name; |
749 |
|
if ($self->{pluses}->{$node_ns}->{$node_ln}) { |
750 |
|
# |
751 |
|
} else { |
752 |
|
# MUST NOT |
753 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
754 |
|
} |
755 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
756 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
757 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
776 |
|
|
777 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
778 |
if ($nt == 1) { |
if ($nt == 1) { |
779 |
# MUST NOT |
my $node_ns = $node->namespace_uri; |
780 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
781 |
|
my $node_ln = $node->manakai_local_name; |
782 |
|
if ($self->{pluses}->{$node_ns}->{$node_ln}) { |
783 |
|
# |
784 |
|
} else { |
785 |
|
# MUST NOT |
786 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
787 |
|
} |
788 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
789 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
790 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
816 |
if ($nt == 1) { |
if ($nt == 1) { |
817 |
# MUST |
# MUST |
818 |
my $nsuri = $node->namespace_uri; |
my $nsuri = $node->namespace_uri; |
819 |
if (defined $nsuri and |
$nsuri = '' unless defined $nsuri; |
820 |
$nsuri eq q<http://www.w3.org/1999/xhtml> and |
my $node_ln = $node->manakai_local_name; |
821 |
$node->manakai_local_name eq 'div' and |
if ($self->{pluses}->{$nsuri}->{$node_ln}) { |
822 |
not $has_div) { |
# |
823 |
|
} elsif ($nsuri eq q<http://www.w3.org/1999/xhtml> and |
824 |
|
$node_ln eq 'div' and not $has_div) { |
825 |
## TODO: SHOULD be suitable for handling as HTML [XHTML10] |
## TODO: SHOULD be suitable for handling as HTML [XHTML10] |
826 |
$has_div = 1; |
$has_div = 1; |
827 |
$self->{onerror}->(node => $node, type => 'element not allowed') |
$self->{onerror}->(node => $node, type => 'element not allowed') |
860 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
861 |
if ($nt == 1) { |
if ($nt == 1) { |
862 |
## MAY contain elements |
## MAY contain elements |
863 |
$self->{onerror}->(node => $node, type => 'element not allowed') |
if ($src_attr) { |
864 |
if $src_attr; |
my $node_ns = $node->namespace_uri; |
865 |
|
$node_ns = '' unless defined $node_ns; |
866 |
|
my $node_ln = $node->manakai_local_name; |
867 |
|
if ($self->{pluses}->{$node_ns}->{$node_ln}) { |
868 |
|
# |
869 |
|
} else { |
870 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
871 |
|
} |
872 |
|
} |
873 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
874 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
875 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
898 |
|
|
899 |
my $nt = $node->node_type; |
my $nt = $node->node_type; |
900 |
if ($nt == 1) { |
if ($nt == 1) { |
901 |
# MUST NOT |
my $node_ns = $node->namespace_uri; |
902 |
$self->{onerror}->(node => $node, type => 'element not allowed'); |
$node_ns = '' unless defined $node_ns; |
903 |
|
my $node_ln = $node->manakai_local_name; |
904 |
|
if ($self->{pluses}->{$node_ns}->{$node_ln}) { |
905 |
|
# |
906 |
|
} else { |
907 |
|
# MUST NOT |
908 |
|
$self->{onerror}->(node => $node, type => 'element not allowed'); |
909 |
|
} |
910 |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
my ($sib, $ch) = $self->_check_get_children ($node, $todo); |
911 |
unshift @nodes, @$sib; |
unshift @nodes, @$sib; |
912 |
push @$new_todos, @$ch; |
push @$new_todos, @$ch; |
962 |
} |
} |
963 |
}, |
}, |
964 |
}; |
}; |
965 |
|
## TODO: Tests for <html:nest/> in <atom:content/> |
966 |
|
|
967 |
$Element->{$ATOM_NS}->{author} = $AtomPersonConstruct; |
$Element->{$ATOM_NS}->{author} = $AtomPersonConstruct; |
968 |
|
|
1014 |
|
|
1015 |
$Element->{$ATOM_NS}->{contributor} = $AtomPersonConstruct; |
$Element->{$ATOM_NS}->{contributor} = $AtomPersonConstruct; |
1016 |
|
|
1017 |
|
## TODO: Anything below does not support <html:nest/> yet. |
1018 |
|
|
1019 |
$Element->{$ATOM_NS}->{generator} = { |
$Element->{$ATOM_NS}->{generator} = { |
1020 |
attrs_checker => $GetAtomAttrsChecker->({ |
attrs_checker => $GetAtomAttrsChecker->({ |
1021 |
uri => sub { # MUST |
uri => sub { # MUST |