--- test/html-webhacc/cc.cgi 2008/03/17 13:52:48 1.44 +++ test/html-webhacc/cc.cgi 2008/03/21 09:17:45 1.46 @@ -173,9 +173,13 @@ 'text/xml' => 1, 'application/atom+xml' => 1, 'application/rss+xml' => 1, - 'application/svg+xml' => 1, + 'image/svg+xml' => 1, 'application/xhtml+xml' => 1, 'application/xml' => 1, + ## TODO: Should we make all XML MIME Types fall + ## into this category? + + 'application/rdf+xml' => 1, ## NOTE: This type has different model. }->{$input->{media_type}}) { ($doc, $el) = print_syntax_error_xml_section ($input, $result); print_source_string_section ($input, @@ -214,6 +218,7 @@ print_listing_section ({ id => 'classes', label => 'Classes', heading => 'Classes', }, $input, $elements->{class}) if keys %{$elements->{class}}; + print_rdf_section ($input, $elements->{rdf}) if @{$elements->{rdf}}; } elsif (defined $cssom) { print_structure_dump_cssom_section ($input, $cssom); ## TODO: CSSOM validation @@ -997,6 +1002,61 @@ print STDOUT qq[]; } # print_listing_section +sub print_rdf_section ($$$) { + my ($input, $rdfs) = @_; + + push @nav, ['#' . $input->{id_prefix} . 'rdf' => 'RDF'] + unless $input->{nested}; + print STDOUT qq[ +
<' . $euri .
+ '>
';
+ } elsif (defined $resource->{bnodeid}) {
+ return htescape ('_:' . $resource->{bnodeid});
+ } elsif ($resource->{nodes}) {
+ return '(rdf:XMLLiteral)';
+ } elsif (defined $resource->{value}) {
+ my $elang = htescape (defined $resource->{language}
+ ? $resource->{language} : '');
+ my $r = qq[] . htescape ($resource->{value}) . '
';
+ if (defined $resource->{datatype}) {
+ my $euri = htescape ($resource->{datatype});
+ $r .= '^^<' . $euri .
+ '>
';
+ } elsif (length $resource->{language}) {
+ $r .= '@' . htescape ($resource->{language});
+ }
+ return $r;
+ } else {
+ return '??';
+ }
+} # get_rdf_resource_html
+
sub print_result_section ($) {
my $result = shift;
@@ -1492,4 +1552,4 @@
=cut
-## $Date: 2008/03/17 13:52:48 $
+## $Date: 2008/03/21 09:17:45 $