/[suikacvs]/test/html-whatpm/parser-manakai.cgi
Suika

Diff of /test/html-whatpm/parser-manakai.cgi

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

revision 1.2 by wakaba, Mon Jun 25 00:15:12 2007 UTC revision 1.4 by wakaba, Sun Jul 15 06:14:30 2007 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -d:DProf  #!/usr/bin/perl
2  use strict;  use strict;
3    
4  use lib qw[/home/httpd/html/www/markup/html/whatpm  use lib qw[/home/httpd/html/www/markup/html/whatpm
# Line 28  shift @mode if @mode and $mode[0] == ''; Line 28  shift @mode if @mode and $mode[0] == '';
28    my $time2;    my $time2;
29    
30    require Message::DOM::DOMImplementation;    require Message::DOM::DOMImplementation;
31    my $dom = Message::DOM::DOMImplementation->____new;    my $dom = Message::DOM::DOMImplementation->new;
32  #  $| = 1;  #  $| = 1;
33    my $doc;    my $doc;
34    my $el;    my $el;
# Line 54  if (@mode == 3 and $mode[0] eq 'html' an Line 54  if (@mode == 3 and $mode[0] eq 'html' an
54    };    };
55    
56    $doc = $dom->create_document;    $doc = $dom->create_document;
57      $doc->manakai_is_html (1);
58    $time1 = time;    $time1 = time;
59    if (length $mode[1]) {    if (length $mode[1]) {
60      $el = $doc->create_element_ns      $el = $doc->create_element_ns
# Line 70  if (@mode == 3 and $mode[0] eq 'html' an Line 71  if (@mode == 3 and $mode[0] eq 'html' an
71    my $out;    my $out;
72    if ($mode[2] eq 'html') {    if ($mode[2] eq 'html') {
73      $time1 = time;      $time1 = time;
74      $out = Whatpm::HTML->get_inner_html ($el || $doc);      $out = \( ($el or $doc)->inner_html );
75      $time2 = time;      $time2 = time;
76      $time{serialize_html} = $time2 - $time1;      $time{serialize_html} = $time2 - $time1;
77    } else { # test    } else { # test
# Line 107  if (@mode == 3 and $mode[0] eq 'html' an Line 108  if (@mode == 3 and $mode[0] eq 'html' an
108    
109    my $out;    my $out;
110    if ($mode[2] eq 'html') {    if ($mode[2] eq 'html') {
111      ## TODO: Use XHTML serializer      $time1 = time;
112      #$out = Whatpm::HTML->get_inner_html ($doc);      $out = \( $doc->inner_html ); ## TODO: $el case
113        $time2 = time;
114        $time{serialize_xml} = $time2 - $time1;
115    } else { # test    } else { # test
116      $time1 = time;      $time1 = time;
117      $out = test_serialize ($doc);      $out = test_serialize ($doc);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24