2 use Test::More tests => 8;
5 my $p = HTML::Parser->new(xml_mode => 1,
13 for my $k (sort keys %$attr) {
21 $text .= "E[" . shift() . "]";
23 $p->handler(process =>
25 $text .= "PI[" . shift() . "]";
34 <?IS10744:arch name="html"?><!-- comment -->
36 <title html="h1">My first architectual document</title>
37 <author html="address">Geir Ove Gronmo, grove@infotek.no</author>
38 <para>This is the first paragraph in this document</para>
39 <para html="p">This is the second paragraph</para>
41 <xmp><foo></foo></xmp>
49 PI[IS10744:arch name="html"]
51 S[title html=h1]My first architectual documentE[title]
52 S[author html=address]Geir Ove Gronmo, grove@infotek.noE[author]
53 S[para]This is the first paragraph in this documentE[para]
54 S[para html=p]This is the second paragraphE[para]
56 S[xmp]S[foo]E[foo]E[xmp]
65 PI[xml version="1.0"?]
66 PI[IS10744:arch name="html"?]
68 S[title html=h1]My first architectual documentE[title]
69 S[author html=address]Geir Ove Gronmo, grove@infotek.noE[author]
70 S[para]This is the first paragraph in this documentE[para]
71 S[para html=p]This is the second paragraphE[para]
73 S[xmp]<foo></foo>E[xmp]
77 # Test that we get an empty tag back
78 $p = HTML::Parser->new(api_version => 3,
83 my($tagname, $text) = @_;
84 is($tagname, "Xyzzy");
87 $p->parse("<Xyzzy foo=bar/>and some more")->eof;
89 # Test that we get an empty tag back
90 $p = HTML::Parser->new(api_version => 3,
91 empty_element_tags => 1);
95 my($tagname, $text) = @_;
96 is($tagname, "xyzzy");
99 $p->parse("<Xyzzy foo=bar/>and some more")->eof;
101 $p = HTML::Parser->new(
109 is($text, "<?foo > bar?>");
110 is($t0, "foo > bar");
112 $p->parse("<?foo > bar?> and then")->eof;