Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
libxml-perl /
[ HOME SHELL ]
Name
Size
Permission
Action
examples
[ DIR ]
drwxr-xr-x
CreatingPatActModules.pod
3.09
KB
-rw-r--r--
PerlSAX.pod.gz
6.76
KB
-rw-r--r--
UsingPatActModules.pod
3.2
KB
-rw-r--r--
UsingPerlSAX.pod
2.46
KB
-rw-r--r--
changelog.Debian.gz
1.83
KB
-rw-r--r--
copyright
1.12
KB
-rw-r--r--
index.html
14.13
KB
-rw-r--r--
interface-style.pod
2.62
KB
-rw-r--r--
sax-2.0-adv.html
35.45
KB
-rw-r--r--
sax-2.0.html
11.73
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : UsingPerlSAX.pod
=head1 Using PerlSAX Working with PerlSAX involves using two classes (packages), a PerlSAX parser that generates parsing events and a class that you write that will receive those parsing events, the ``handler''. This guide will use the XML::Parser::PerlSAX parser that uses Clark Cooper's XML::Parser module. The handler class implements the PerlSAX handler methods that you are interested in. The following example, MyHandler.pm, prints a message every time an element starts or ends: package MyHandler; sub new { my ($type) = @_; return bless {}, $type; } sub start_element { my ($self, $element) = @_; print "Start element: $element->{Name}\n"; } sub end_element { my ($self, $element) = @_; print "End element: $element->{Name}\n"; } 1; To use your handler you will need to have a script, myhandler.pl, that loads and creates your handler and the parser, and then calls the parser to parse the XML instance and send events to your handler: use XML::Parser::PerlSAX; use MyHandler; my $my_handler = MyHandler->new; my $parser = XML::Parser::PerlSAX->new( Handler => $my_handler ); foreach my $instance (@ARGV) { $parser->parse(Source => { SystemId => $instance }); } Given this XML instance, myhandler.xml: <?xml version="1.0"?> <article> <title>Using PerlSAX</title> <paragraph>Working with PerlSAX ...</paragraph> </article> Running myhandler.pl like this: perl myhandler.pl myhandler.xml will produce this output: Start element: article Start element: title End element: title Start element: paragraph End element: paragraph End element: article =head2 For More Information PerlSAX.pod describes the PerlSAX interface. Each parser module describes it's individual capabilities. XML::Parser::PerlSAX is the most commonly used PerlSAX implementation. The files described in this doc are in the `examples' directory. A more complete implementation of the very simple handler above is in the module XML::Handler::Sample. Other, more complex handlers are in the XML::Handler directory as well. Another hands-on doc for PerlSAX is the XML-Parser-and-PerlSAX.pod. This doc describes the difference between and the purpose of PerlSAX with respect to XML::Parser. This document was inspired by and uses the code examples from David Megginson's ``Quick Start for SAX Application Writers.'' <http://www.megginson.com/SAX/quickstart.html>
Close