GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SVG::Parser::Expat(3) User Contributed Perl Documentation SVG::Parser::Expat(3)

SVG::Parser::Expat - XML Expat Parser for SVG documents

  #!/usr/bin/perl -w
  use strict;
  use SVG::Parser::Expat;

  die "Usage: $0 <file>\n" unless @ARGV;

  my $xml;
  {
      local $/=undef;
      $xml=<>;
  }

  my $parser=new SVG::Parser::Expat;

  my $svg=$parser->parse($xml);

  print $svg->xmlify;

SVG::Parser::Expat is the Expat-specific parser module used by SVG::Parser when an underlying XML::Parser-based parser is selected. It may also be used directly, as shown in the synopsis above.

Use SVG::Parser to retain maximum flexibility as to which underlying parser is chosen. Use SVG::Parser::Expat to supply Expat-specific parser options or where the presence of XML::Parser is known and/or preferred.

None. However, an alternative parent class (other than XML::Parser) can be specified by passing the package name to SVG::Parser::Expat in the import list. For example:

    use SVG::Parser::Expat qw(My::XML::Parser::Subclass);

Where My::XML::Parser::Subclass is a subclass like:

    package My::XML::Parser::Subclass;
    use strict;
    use vars qw(@ISA);
    use XML::Parser;
    @ISA=qw(XML::Parser);

    ...custom methods...

    1;

When loaded via SVG::Parser, this parent class may be specified by placing it after the '=' in a parser specification:

    use SVG::Parser qw(Expat=My::XML::Parser::Subclass);

See SVG::Parser for more details.

See "svgexpatparse" in the examples directory of the distribution.

Peter Wainwright, peter.wainwright@cybrid.net

SVG, SVG::Parser, SVG::Parser::SAX, XML::Parser
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.