HTML-HTML5-Parser
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/HTML/HTML5/Parser/TagSoupParser.pm view on Meta::CPAN
## F4.6.
my $anode = $node;
AN: while (defined $anode) {
if ($anode->node_type == 1) {
my $nsuri = $anode->namespaceURI;
if (defined $nsuri and $nsuri eq 'http://www.w3.org/1999/xhtml') {
if ($anode->tagName eq 'form') {
$p->{form_element} = $anode;
last AN;
}
}
}
$anode = $anode->parentNode;
} # AN
## F.5. Set the input stream.
$p->{confident} = 1; ## Confident: irrelevant.
## F.6. Start the parser.
{
my $self = $p;
$token = $self->_get_next_token;
}
$p->_tree_construction_main;
## F.7.
my @cn = $node->childNodes;
for (@cn) {
$node->removeChild ($_);
}
## ISSUE: mutation events? read-only?
## Step 11 # MUST
@cn = $root->childNodes;
for (@cn) {
$this_doc->adoptNode ($_);
$node->appendChild ($_);
}
## ISSUE: mutation events?
$p->_terminate_tree_constructor;
## Remove self references.
delete $p->{set_nc};
delete $p->{read_until};
delete $p->{parse_error};
} else {
die "$0: |set_inner_html| is not defined for node of type $nt";
}
} # set_inner_html
} # tree construction stage
package HTML::HTML5::Parser::TagSoupParser::RestartParser;
sub new
{
my ($class, %opts) = @_;
bless \%opts => $class;
}
sub throw
{
my ($class, %opts) = @_;
die $class->new(%opts);
}
1;
# $Date: 2009/09/06 23:32:06 $
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.511 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )