source: main/trunk/release-kits/shared/linux/XML-Parser/64-bit/perl-5.24/XML/Parser/Style/Debug.pm@ 31805

Last change on this file since 31805 was 31805, checked in by ak19, 7 years ago

Committing the perl 5.24 that Dr Bainbridge successfully built on Ubuntu 16.06 against (a locally compiled, non-system) perl 5.24 perl. It is a byproduct of compiling up a gs3-svn on the Ubuntu 16.04 with the perl 5.24 in the PATH. This perl-5.24 folder was copied from the gs3-svn's gs2build/perllib/cpan folder. It's being committed into the release-kits area as other versions before have been, as it's needed for release-kits, to generate binaries that will work with perl 5.24. However, the version we generated only has Expat.so, not le Expat.bs. Not sure if that's still necessary, and if so, how it should be generated. See http://www.cryst.bbk.ac.uk/CCSG/programming/perl/PerlDoc/lib/ExtUtils/Mkbootstrap.html for ideas, if the bs extension stands for bootstrap as it seems to.

File size: 982 bytes
Line 
1# $Id: Debug.pm,v 1.1 2003-07-27 16:07:49 matt Exp $
2
3package XML::Parser::Style::Debug;
4use strict;
5
6sub Start {
7 my $expat = shift;
8 my $tag = shift;
9 print STDERR "@{$expat->{Context}} \\\\ (@_)\n";
10}
11
12sub End {
13 my $expat = shift;
14 my $tag = shift;
15 print STDERR "@{$expat->{Context}} //\n";
16}
17
18sub Char {
19 my $expat = shift;
20 my $text = shift;
21 $text =~ s/([\x80-\xff])/sprintf "#x%X;", ord $1/eg;
22 $text =~ s/([\t\n])/sprintf "#%d;", ord $1/eg;
23 print STDERR "@{$expat->{Context}} || $text\n";
24}
25
26sub Proc {
27 my $expat = shift;
28 my $target = shift;
29 my $text = shift;
30 my @foo = @{$expat->{Context}};
31 print STDERR "@foo $target($text)\n";
32}
33
341;
35__END__
36
37=head1 NAME
38
39XML::Parser::Style::Debug - Debug style for XML::Parser
40
41=head1 SYNOPSIS
42
43 use XML::Parser;
44 my $p = XML::Parser->new(Style => 'Debug');
45 $p->parsefile('foo.xml');
46
47=head1 DESCRIPTION
48
49This just prints out the document in outline form to STDERR. Nothing special is
50returned by parse.
51
52=cut
Note: See TracBrowser for help on using the repository browser.