/[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.72 by wakaba, Thu Mar 20 10:30:20 2008 UTC revision 1.73 by wakaba, Fri Mar 21 08:58:35 2008 UTC
# Line 35  my $Namespace = { Line 35  my $Namespace = {
35    $HTML_NS => {module => 'Whatpm::ContentChecker::HTML'},    $HTML_NS => {module => 'Whatpm::ContentChecker::HTML'},
36    $XML_NS => {loaded => 1},    $XML_NS => {loaded => 1},
37    $XMLNS_NS => {loaded => 1},    $XMLNS_NS => {loaded => 1},
38      q<http://www.w3.org/1999/02/22-rdf-syntax-ns#> => {loaded => 1},
39  };  };
40    
41  our $AttrChecker = {  our $AttrChecker = {
# Line 234  my $HTMLSemiTransparentElements = { Line 235  my $HTMLSemiTransparentElements = {
235    
236  our $Element = {};  our $Element = {};
237    
238    $Element->{q<http://www.w3.org/1999/02/22-rdf-syntax-ns#>}->{RDF} = {
239      %AnyChecker,
240      status => FEATURE_STATUS_REC | FEATURE_ALLOWED,
241      is_root => 1, ## ISSUE: Not explicitly allowed for non application/rdf+xml
242      check_start => sub {
243        my ($self, $item, $element_state) = @_;
244        my $triple = [];
245        push @{$self->{return}->{rdf}}, [$item->{node}, $triple];
246        require Whatpm::RDFXML;
247        my $rdf = Whatpm::RDFXML->new;
248        $rdf->{onerror} = $self->{onerror};
249        $rdf->{ontriple} = sub {
250          my %opt = @_;
251          push @$triple,
252              [$opt{node}, $opt{subject}, $opt{predicate}, $opt{object}];
253        };
254        $rdf->convert_rdf_element ($item->{node});
255      },
256    };
257    
258  sub check_document ($$$;$) {  sub check_document ($$$;$) {
259    my ($self, $doc, $onerror, $onsubdoc) = @_;    my ($self, $doc, $onerror, $onsubdoc) = @_;
260    $self = bless {}, $self unless ref $self;    $self = bless {}, $self unless ref $self;
# Line 249  sub check_document ($$$;$) { Line 270  sub check_document ($$$;$) {
270    $self->{info_level} = 'i';    $self->{info_level} = 'i';
271    $self->{unsupported_level} = 'u';    $self->{unsupported_level} = 'u';
272    
273      ## TODO: If application/rdf+xml, RDF/XML mode should be invoked.
274    
275    my $docel = $doc->document_element;    my $docel = $doc->document_element;
276    unless (defined $docel) {    unless (defined $docel) {
277      ## ISSUE: Should we check content of Document node?      ## ISSUE: Should we check content of Document node?
# Line 377  sub check_element ($$$;$) { Line 400  sub check_element ($$$;$) {
400    $self->{return} = {    $self->{return} = {
401      class => {},      class => {},
402      id => $self->{id}, table => [], term => $self->{term},      id => $self->{id}, table => [], term => $self->{term},
403        rdf => [],
404    };    };
405    
406    my @item = ({type => 'element', node => $el, parent_state => {}});    my @item = ({type => 'element', node => $el, parent_state => {}});

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24