⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ppd.pm

📁 ARM上的如果你对底层感兴趣
💻 PM
📖 第 1 页 / 共 2 页
字号:
#
# XML::PPD
#
# Definition of the PPD file format.
#
###############################################################################

use XML::ValidatingElement;
use Exporter;

$XML::PPD::revision = '$Id: PPD.pm,v 1.5 1998/09/24 22:04:30 graham Exp $';
$XML::PPD::VERSION  = '0.01';

###############################################################################
# Set up XML::PPD to export it's sub-packages so that we can use them in other
# XML documents without too much effort.
###############################################################################
package XML::PPD;
@ISA = qw( Exporter );
%EXPORT_TAGS = ( 'elements' =>
                 [ '%SOFTPKG::', '%IMPLEMENTATION::', '%DEPENDENCY::',
                   '%TITLE::', '%ABSTRACT::', '%AUTHOR::',
                   '%LANGUAGE::', '%LICENSE::', '%OS::',
                   '%OSVERSION::', '%PERLCORE::', '%PROCESSOR::',
                   '%CODEBASE::', '%INSTALL::', '%UNINSTALL::',
                 ] );
Exporter::export_ok_tags( 'elements' );

###############################################################################
# PPD Element: SOFTPKG
###############################################################################
package XML::PPD::SOFTPKG;
@ISA = qw( XML::ValidatingElement );
@oattrs = qw( VERSION );
@rattrs = qw( NAME );
@okids  = qw( ABSTRACT AUTHOR IMPLEMENTATION LICENSE TITLE INSTALL UNINSTALL );

###############################################################################
# PPD Element: TITLE
###############################################################################
package XML::PPD::TITLE;
@ISA = qw( XML::ValidatingElement );

###############################################################################
# PPD Element: ABSTRACT
###############################################################################
package XML::PPD::ABSTRACT;
@ISA = qw( XML::ValidatingElement );

###############################################################################
# PPD Element: AUTHOR
###############################################################################
package XML::PPD::AUTHOR;
@ISA = qw( XML::ValidatingElement );

###############################################################################
# PPD Element: LICENSE
###############################################################################
package XML::PPD::LICENSE;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( HREF );

###############################################################################
# PPD Element: IMPLEMENTATION
###############################################################################
package XML::PPD::IMPLEMENTATION;
@ISA = qw( XML::ValidatingElement );
@okids = qw( DEPENDENCY INSTALL LANGUAGE OS OSVERSION PERLCORE PROCESSOR
             UNINSTALL ARCHITECTURE );
@rkids = qw( CODEBASE );

###############################################################################
# PPD Element: OS
###############################################################################
package XML::PPD::OS;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VALUE );
sub validate_possible_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_possible_attrs( @_ );
}

sub validate_required_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_required_attrs( @_ );
}

sub compatibility_check
{
    my $self = shift;
    if (exists $self->{NAME})
    {
        $self->{VALUE} = $self->{NAME};
        delete $self->{NAME};
    }
}

###############################################################################
# PPD Element: OSVERSION
###############################################################################
package XML::PPD::OSVERSION;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VALUE );
sub validate_possible_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_possible_attrs( @_ );
}

sub validate_required_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_required_attrs( @_ );
}

sub compatibility_check
{
    my $self = shift;
    if (exists $self->{NAME})
    {
        $self->{VALUE} = $self->{NAME};
        delete $self->{NAME};
    }
}

###############################################################################
# PPD Element: PROCESSOR
###############################################################################
package XML::PPD::PROCESSOR;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VALUE );
sub validate_possible_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_possible_attrs( @_ );
}

sub validate_required_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_required_attrs( @_ );
}

sub compatibility_check
{
    my $self = shift;
    if (exists $self->{NAME})
    {
        $self->{VALUE} = $self->{NAME};
        delete $self->{NAME};
    }
}

###############################################################################
# PPD Element: ARCHITECTURE
###############################################################################
package XML::PPD::ARCHITECTURE;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VALUE );
sub validate_possible_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_possible_attrs( @_ );
}

sub validate_required_attrs
{
    my $self = shift;
    $self->compatibility_check();
    $self->SUPER::validate_required_attrs( @_ );
}

sub compatibility_check
{
    my $self = shift;
    if (exists $self->{NAME})
    {
        $self->{VALUE} = $self->{NAME};
        delete $self->{NAME};
    }
}

###############################################################################
# PPD Element: CODEBASE
###############################################################################
package XML::PPD::CODEBASE;
@ISA = qw( XML::ValidatingElement );
@oattrs = qw( FILENAME );
@rattrs = qw( HREF );

###############################################################################
# PPD Element: DEPENDENCY
###############################################################################
package XML::PPD::DEPENDENCY;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( NAME );
@oattrs = qw( VERSION );

###############################################################################
# PPD Element: LANGUAGE
###############################################################################
package XML::PPD::LANGUAGE;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VALUE );

###############################################################################
# PPD Element: PERLCORE
###############################################################################
package XML::PPD::PERLCORE;
@ISA = qw( XML::ValidatingElement );
@rattrs = qw( VERSION );

###############################################################################
# PPD Element: INSTALL
###############################################################################
package XML::PPD::INSTALL;
@ISA = qw( XML::ValidatingElement );
@oattrs = qw( HREF EXEC );

###############################################################################
# PPD Element: UNINSTALL
###############################################################################
package XML::PPD::UNINSTALL;
@ISA = qw( XML::ValidatingElement );
@oattrs = qw( HREF EXEC );

__END__

###############################################################################
# POD
###############################################################################

=head1 NAME

XML::PPD - PPD file format and XML parsing elements

=head1 SYNOPSIS

 use XML::Parser;
 use XML::PPD;

 $p = new XML::Parser( Style => 'Objects', Pkg => 'XML::PPD' );
 ...

=head1 DESCRIPTION

This module provides a set of classes for parsing PPD files using the
C<XML::Parser> module.  Each of the classes is derived from
C<XML::ValidatingElement>, with optional/required attributes/children
enforced.

=head1 MAJOR ELEMENTS

=head2 SOFTPKG

Defines a Perl Package.  The root of a PPD document is B<always> a SOFTPKG
element.  The SOFTPKG element allows for the following attributes:

=over 4

=item NAME

Required attribute.  Name of the package (e.g. "Foobar").

=item VERSION

Version number of the package, in comma-delimited format (e.g. "1,0,0,0").

=back

=head2 IMPLEMENTATION

Child of SOFTPKG, used to describe a particular implementation of the Perl
Package.  Multiple instances are valid, and should be used to describe
different implementations/ports for different operating systems or
architectures.

=head2 DEPENDENCY

Child of SOFTPKG or IMPLEMENTATION, used to indicate a dependency this Perl
Package has on another Perl Package.  Multiple instances are valid.  The
DEPENDENCY element allows for the following attributes:

=over 4

=item NAME

Name of the package that this implementation is dependant upon.

=item VERSION

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -