root/main/trunk/release-kits/shared/linux/XML-Parser/64-bit/perl-5.22/XML/Parser/Style/Debug.pm @ 31809

Revision 31809, 1.0 KB (checked in by ak19, 3 years ago)

Added the XML-Parser for perl 5.22 as well for the release-kit to include in binaries. Note that, just as for the perl-5.24 version committed before, the auto/XML/Parser/Expat.bs (bootstrap file?) is copied from the perl 5.18 that was committed much longer ago, since the .bs file didn't differ between 5.10 and 5.18.

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 browser.