/[suikacvs]/messaging/manakai/lib/Message/DOM/Element.pm
Suika

Diff of /messaging/manakai/lib/Message/DOM/Element.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by wakaba, Thu Jan 24 11:25:19 2008 UTC revision 1.30 by wakaba, Sat Apr 12 15:58:41 2008 UTC
# Line 863  package Message::DOM::Document; Line 863  package Message::DOM::Document;
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
# Line 883  sub create_element ($$) { Line 884  sub create_element ($$) {
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    {    {
# Line 896  sub create_element ($$) { Line 897  sub create_element ($$) {
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;
# Line 996  sub create_element_ns ($$$) { Line 997  sub create_element_ns ($$$) {
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;
# Line 1285  sub create_element_ns ($$$) { Line 1287  sub create_element_ns ($$$) {
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.

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24