1SVG::Parser::SAX(3) User Contributed Perl Documentation SVG::Parser::SAX(3)
2
3
4
6 SVG::Parser::SAX - XML SAX Parser for SVG documents
7
9 #!/usr/bin/perl -w
10 use strict;
11 use SVG::Parser::SAX;
12
13 die "Usage: $0 <file>\n" unless @ARGV;
14
15 my $xml;
16 {
17 local $/=undef;
18 $xml=<>;
19 }
20
21 my $parser=new SVG::Parser::SAX(-debug => 1);
22
23 my $svg=$parser->parse($xml);
24
25 print $svg->xmlify;
26
28 SVG::Parser::SAX is the SAX-based parser module used by SVG::Parser
29 when an underlying XML::SAX-based parser is selected. It may also be
30 used directly, as shown in the synopsis above.
31
32 Use SVG::Parser to retain maximum flexibility as to which underlying
33 parser is chosen. Use SVG::Parser::SAX to supply SAX-specific parser
34 options or where the presence of a functional XML::SAX parser is known
35 and/or preferred.
36
37 EXPORTS
38 None. However, a preferred SAX parser implementations can be specified
39 by passing the package name to SVG::Parser::SAX in the import list. For
40 example:
41
42 use SVG::Parser::SAX qw(XML::LibXML::SAX::Parser);
43
44 A minimum version number may be additionally suppied as a second import
45 item:
46
47 use SVG::Parser::SAX (XML::LibXML::SAX::Parser => 1.40);
48
49 This overrides the automatic selection of a suitable SAX parser. To try
50 several different parsers in turn, use the SVG::Parser module instead
51 and restrict it to only try SAX-based parsers. To make use of the
52 automatic selection mechanism, omit the import list.
53
54 When loaded via SVG::Parser, this parent class may be specified by
55 placing it after the '=' in a parser specification:
56
57 See SVG::Parser for more details.
58
59 EXAMPLES
60 See "svgsaxparse" in the examples directory of the distribution.
61
63 Peter Wainwright, peter.wainwright@cybrid.net
64
66 SVG, SVG::Parser, SVG::Parser::Expat, XML::SAX
67
68
69
70perl v5.34.0 2021-07-22 SVG::Parser::SAX(3)