NAME

SGML::PYX - Convertor between SGML and PYX.

SYNOPSIS

use SGML::PYX;
my $obj = SGML::PYX->new(%params);
$obj->parsefile($sgml_file);

METHODS

new(%params)
Constructor.
  • output

    Output callback, which prints output PYX code.
    Default value is subroutine:
      my (@data) = @_;
      print join "\n", map { encode_utf8($_) } @data;
      print "\n";
      return;
parsefile($sgml_file)
Parse input SGML file and convert to PYX output.
Returns undef.

ERRORS

new():
        From Class::Utils::set_params():
                Unknown parameter '%s'.

parsefile():
        Unsupported tag type '%s'.
        Problem with attribute parsing.
                data: %s

EXAMPLE

# Pragmas.
use strict;
use warnings;

# Modules.
use File::Temp qw(tempfile);
use IO::Barf qw(barf);
use SGML::PYX;

# Input file.
my (undef, $input_file) = tempfile();
my $input = <<'END';
<html><head><title>Foo</title></head><body><div /></body></html>
END
barf($input_file, $input);

# Object.
my $obj = SGML::PYX->new;

# Parse file.
$obj->parsefile($input_file);

# Output:
# (html
# (head
# (title
# -Foo
# )title
# )head
# (body
# (div
# )div
# )body
# )html
# -\n

DEPENDENCIES

Class::Utils, Encode, Error::Pure, Tag::Reader::Perl, PYX, PYX::Utils.

SEE ALSO

Task::PYX

Install the PYX modules.

REPOSITORY

https://github.com/tupinek/SGML-PYX

AUTHOR

Michal Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© Michal Špaček 2015-2016
BSD 2-Clause License

VERSION

0.01