source: gs2-extensions/parallel-building/trunk/src/perllib/cpan/HTML/TokeParser/Simple/Token/ProcessInstruction.pm@ 24626

Last change on this file since 24626 was 24626, checked in by jmt12, 13 years ago

An (almost) complete copy of the perllib directory from a (circa SEP2011) head checkout from Greenstone 2 trunk - in order to try and make merging in this extension a little easier later on (as there have been some major changes to buildcol.pl commited in the main trunk but not in the x64 branch)

File size: 1.3 KB
Line 
1package HTML::TokeParser::Simple::Token::ProcessInstruction;
2
3use strict;
4
5use vars qw/ $VERSION $REVISION /;
6$REVISION = '$Id: ProcessInstruction.pm 13983 2007-03-15 01:32:44Z lh92 $';
7$VERSION = '2.0';
8use base 'HTML::TokeParser::Simple::Token';
9
10sub return_token0 { goto &get_token0 } # deprecated
11
12sub get_token0 {
13 return shift->[1];
14}
15
16sub is_pi { 1 }
17
18sub is_process_instruction { 1 }
19
201;
21
22__END__
23
24=head1 NAME
25
26HTML::TokeParser::Simple::Token::ProcessInstruction - Token.pm process instruction class.
27
28=head1 SYNOPSIS
29
30 use HTML::TokeParser::Simple;
31 my $p = HTML::TokeParser::Simple->new( $somefile );
32
33 while ( my $token = $p->get_token ) {
34 # This prints all text in an HTML doc (i.e., it strips the HTML)
35 next unless $token->is_text;
36 print $token->as_is;
37 }
38
39=head1 DESCRIPTION
40
41Process Instructions are from XML. This is very handy if you need to parse out
42PHP and similar things with a parser.
43
44Currently, there appear to be some problems with process instructions. You can
45override this class if you need finer grained handling of process instructions.
46
47C<is_pi()> and C<is_process_instruction()> both return true.
48
49=head1 OVERRIDDEN METHODS
50
51=over 4
52
53=item * get_token0
54
55=item * is_pi
56
57=item * is_process_instruction
58
59=item * return_token0
60
61=back
62
63=cut
Note: See TracBrowser for help on using the repository browser.