XML::DTD::PI - Perl module representing a processing instruction in a DTD


XML-DTD documentation Contained in the XML-DTD distribution.

Index


Code Index:

NAME

Top

XML::DTD::PI - Perl module representing a processing instruction in a DTD

SYNOPSIS

Top

  use XML::DTD::PI;

  my $pi = XML::DTD::PI->new('example pi');

DESCRIPTION

Top

  XML::DTD::PI is a Perl module representing a processing instruction
  in a DTD. The following methods are provided.

new
 my $pi = XML::DTD::PI->new('<?example pi?>');

Construct a new XML::DTD::PI object.

SEE ALSO

Top

XML::DTD, XML::DTD::Component

AUTHOR

Top

Brendt Wohlberg <wohl@cpan.org>

COPYRIGHT AND LICENSE

Top


XML-DTD documentation Contained in the XML-DTD distribution.

package XML::DTD::PI;

use XML::DTD::Component;

use 5.008;
use strict;
use warnings;

our @ISA = qw(XML::DTD::Component);

our $VERSION = '0.09';


# Constructor
sub new {
  my $arg = shift;
  my $pi = shift;

  my $cls = ref($arg) || $arg;
  my $obj = ref($arg) && $arg;

  my $self;
  if ($obj) {
    # Called as a copy constructor
    $self = { %$obj };
    bless $self, $cls;
  } else {
    # Called as the main constructor
    $self = { };
    bless $self, $cls;
    $self->define('pi', $pi, '<\?', '\?>');
  }
  return $self;
}


1;
__END__