/[suikacvs]/markup/html/whatpm/Whatpm/ContentChecker.pm
Suika

Diff of /markup/html/whatpm/Whatpm/ContentChecker.pm

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

revision 1.17 by wakaba, Sun May 20 11:12:25 2007 UTC revision 1.18 by wakaba, Fri May 25 14:46:54 2007 UTC
# Line 1  Line 1 
1  package Whatpm::ContentChecker;  package Whatpm::ContentChecker;
2  use strict;  use strict;
3    
4    require Whatpm::URIChecker;
5    
6  ## ISSUE: How XML and XML Namespaces conformance can (or cannot)  ## ISSUE: How XML and XML Namespaces conformance can (or cannot)
7  ## be applied to an in-memory representation (i.e. DOM)?  ## be applied to an in-memory representation (i.e. DOM)?
8    
# Line 34  my $AttrChecker = { Line 36  my $AttrChecker = {
36          $self->{onerror}->(node => $attr,          $self->{onerror}->(node => $attr,
37                             type => 'syntax error');                             type => 'syntax error');
38        }        }
39        ## NOTE: Conformance to URI standard is not checked.        ## NOTE: Conformance to URI standard is not checked since there is
40          ## no author requirement on conformance in the XML Base specification.
41      },      },
42      id => sub {      id => sub {
43        my ($self, $attr) = @_;        my ($self, $attr) = @_;
# Line 80  my $AttrChecker = { Line 83  my $AttrChecker = {
83        my ($self, $attr) = @_;        my ($self, $attr) = @_;
84        ## TODO: In XML 1.0, URI reference [RFC 3986] or an empty string        ## TODO: In XML 1.0, URI reference [RFC 3986] or an empty string
85        ## TODO: In XML 1.1, IRI reference [RFC 3987] or an empty string        ## TODO: In XML 1.1, IRI reference [RFC 3987] or an empty string
86          ## TODO: relative references are deprecated
87        my $value = $attr->value;        my $value = $attr->value;
88        if ($value eq $XML_NS) {        if ($value eq $XML_NS) {
89          $self->{onerror}          $self->{onerror}
# Line 660  my $HTMLUnorderedSetOfSpaceSeparatedToke Line 664  my $HTMLUnorderedSetOfSpaceSeparatedToke
664    }    }
665  }; # $HTMLUnorderedSetOfSpaceSeparatedTokensAttrChecker  }; # $HTMLUnorderedSetOfSpaceSeparatedTokensAttrChecker
666    
667    ## URI (or IRI)
668  my $HTMLURIAttrChecker = sub {  my $HTMLURIAttrChecker = sub {
669    my ($self, $attr) = @_;    my ($self, $attr) = @_;
   ## TODO: URI or IRI check  
670    ## ISSUE: Relative references are allowed? (RFC 3987 "IRI" is an absolute reference with optional fragment identifier.)    ## ISSUE: Relative references are allowed? (RFC 3987 "IRI" is an absolute reference with optional fragment identifier.)
671      my $value = $attr->value;
672      Whatpm::URIChecker->check_iri_reference ($value, sub {
673        my %opt = @_;
674        $self->{onerror}->(node => $attr, type => 'URI:'.$opt{level}.':'.$opt{type});
675      });
676  }; # $HTMLURIAttrChecker  }; # $HTMLURIAttrChecker
677    
678  ## A space separated list of one or more URIs (or IRIs)  ## A space separated list of one or more URIs (or IRIs)

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24