BEGIN { plan
tests
=> 1 }
my
$handler
= TestH->new();
my
$parser
= XML::SAX::ExpatXS->new(
Handler
=>
$handler
);
my
$xml
=
<<_xml_;
<!DOCTYPE root [
<!NOTATION n1Name PUBLIC "nPubId1">
<!NOTATION n2Name SYSTEM "nSysId2">
<!NOTATION n3Name PUBLIC "nPubId3" "nSysId3">
]>
<root/>
_xml_
$parser
->parse_string(
$xml
);
ok(
$handler
->{data} eq
'_sd_nd|n1Name|nPubId1|_nd|n2Name||nSysId2_nd|n3Name|nPubId3|nSysId3_se_ee_ed'
);
sub
new {
bless
{
data
=>
''
},
shift
}
sub
start_document {
my
(
$self
,
$doc
) =
@_
;
$self
->{data} .=
'_sd'
;
}
sub
end_document {
my
(
$self
,
$doc
) =
@_
;
$self
->{data} .=
'_ed'
;
}
sub
start_element {
my
(
$self
,
$el
) =
@_
;
$self
->{data} .=
'_se'
;
}
sub
end_element {
my
(
$self
,
$el
) =
@_
;
$self
->{data} .=
'_ee'
;
}
sub
notation_decl {
my
(
$self
,
$not
) =
@_
;
$self
->{data} .=
'_nd|'
.
$not
->{Name};
$self
->{data} .=
'|'
.
$not
->{PublicId};
$self
->{data} .=
'|'
.
$not
->{SystemId};
}