863 |
|
|
864 |
sub create_element ($$) { |
sub create_element ($$) { |
865 |
my $self = $_[0]; |
my $self = $_[0]; |
866 |
|
my $eln = ''.$_[1]; ## TODO: Need testing against DOM Perl binding. |
867 |
if ($$self->{strict_error_checking}) { |
if ($$self->{strict_error_checking}) { |
868 |
my $xv = $self->xml_version; |
my $xv = $self->xml_version; |
869 |
## TODO: HTML Document ?? |
## TODO: HTML Document ?? |
870 |
if (defined $xv) { |
if (defined $xv) { |
871 |
if ($xv eq '1.0' and |
if ($xv eq '1.0' and |
872 |
$_[1] =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) { |
$eln =~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) { |
873 |
# |
# |
874 |
} elsif ($xv eq '1.1' and |
} elsif ($xv eq '1.1' and |
875 |
$_[1] =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) { |
$eln =~ /\A\p{InXMLNameStartChar11}\p{InXMLNameChar11}*\z/) { |
876 |
# |
# |
877 |
} else { |
} else { |
878 |
report Message::DOM::DOMException |
report Message::DOM::DOMException |
884 |
} |
} |
885 |
## TODO: HTML5 |
## TODO: HTML5 |
886 |
|
|
887 |
my $r = Message::DOM::Element->____new ($self, undef, undef, $_[1]); |
my $r = Message::DOM::Element->____new ($self, undef, undef, $eln); |
888 |
|
|
889 |
## -- Default attributes |
## -- Default attributes |
890 |
{ |
{ |
897 |
my $doctype = $self->doctype; |
my $doctype = $self->doctype; |
898 |
return $r unless defined $doctype; |
return $r unless defined $doctype; |
899 |
|
|
900 |
my $et = $doctype->get_element_type_definition_node ($_[1]); |
my $et = $doctype->get_element_type_definition_node ($eln); |
901 |
return $r unless defined $et; |
return $r unless defined $et; |
902 |
|
|
903 |
my $orig_strict = $self->strict_error_checking; |
my $orig_strict = $self->strict_error_checking; |
997 |
($prefix, $lname) = split /:/, $_[2], 2; |
($prefix, $lname) = split /:/, $_[2], 2; |
998 |
($prefix, $lname) = (undef, $prefix) unless defined $lname; |
($prefix, $lname) = (undef, $prefix) unless defined $lname; |
999 |
} |
} |
1000 |
my $nsuri = defined $_[1] ? $_[1] eq '' ? undef : $_[1] : undef; |
my $nsuri = defined $_[1] ? $_[1] eq '' ? undef : ''.$_[1] : undef; |
1001 |
|
## TODO: Need tests against DOM Perl binding. |
1002 |
|
|
1003 |
if ($$self->{strict_error_checking}) { |
if ($$self->{strict_error_checking}) { |
1004 |
my $xv = $self->xml_version; |
my $xv = $self->xml_version; |
1287 |
|
|
1288 |
=head1 LICENSE |
=head1 LICENSE |
1289 |
|
|
1290 |
Copyright 2007 Wakaba <w@suika.fam.cx> |
Copyright 2007-2008 Wakaba <w@suika.fam.cx> |
1291 |
|
|
1292 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
1293 |
modify it under the same terms as Perl itself. |
modify it under the same terms as Perl itself. |