Last change
on this file since 13983 was 13983, checked in by lh92, 17 years ago |
Added for Realistic Book Project
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.3 KB
|
Line | |
---|
1 | package HTML::TokeParser::Simple::Token::ProcessInstruction;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 |
|
---|
5 | use vars qw/ $VERSION $REVISION /;
|
---|
6 | $REVISION = '$Id: ProcessInstruction.pm 13983 2007-03-15 01:32:44Z lh92 $';
|
---|
7 | $VERSION = '2.0';
|
---|
8 | use base 'HTML::TokeParser::Simple::Token';
|
---|
9 |
|
---|
10 | sub return_token0 { goto &get_token0 } # deprecated
|
---|
11 |
|
---|
12 | sub get_token0 {
|
---|
13 | return shift->[1];
|
---|
14 | }
|
---|
15 |
|
---|
16 | sub is_pi { 1 }
|
---|
17 |
|
---|
18 | sub is_process_instruction { 1 }
|
---|
19 |
|
---|
20 | 1;
|
---|
21 |
|
---|
22 | __END__
|
---|
23 |
|
---|
24 | =head1 NAME
|
---|
25 |
|
---|
26 | HTML::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 |
|
---|
41 | Process Instructions are from XML. This is very handy if you need to parse out
|
---|
42 | PHP and similar things with a parser.
|
---|
43 |
|
---|
44 | Currently, there appear to be some problems with process instructions. You can
|
---|
45 | override this class if you need finer grained handling of process instructions.
|
---|
46 |
|
---|
47 | C<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.