File: 19pi.t

package info (click to toggle)
libxml-sax-perl 1.02%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 608 kB
  • sloc: perl: 2,374; xml: 121; sh: 79; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use Test;
BEGIN { plan tests => 2 }
use XML::SAX::PurePerl;
use XML::SAX::PurePerl::DebugHandler;

my $value = do { local $/ = undef; my $data = <DATA>; };

my $parser = XML::SAX::PurePerl->new(Handler =>  My::SAXFilter->new());
$parser->parse_string($value);

package My::SAXFilter;

use base qw(XML::SAX::Base);

sub processing_instruction {
    my $this = shift;
    my $data = shift;

    main::ok($data->{Target},"xml-stylesheet");
    main::ok($data->{Data},"type=\"text/xsl\" href=\"processorinxml/base.xsl\"");
}

__END__
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="processorinxml/base.xsl"?>
<body/>