The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

URL::Transform::using::XML::SAX - XML::SAX parsing of the html/xml for url transformation

SYNOPSIS

my $urlt = URL::Transform::using::XML::SAX->new(
    'output_function'    => sub { $output .= "@_" },
    'transform_function' => sub { return (join '|', @_) },
);
$urlt->parse_file($Bin.'/data/URL-Transform-01.html');

DESCRIPTION

This is a helper module to set-up URL::Transform::SAX::Filter for a URL::Transform.

You can set which SAX driver will be used by:

$XML::SAX::ParserPackage = "XML::LibXML::SAX";

See: XML::SAX::ParserFactory.

This module lacks the advanced features of URL::Transform::using::HTML::Parser like transforming the urls in the inside document elements types (CSS/JavaScript/Meta) because it was used mosty to benchmark the performance of the HTML::Parser vs XML::SAX. The HTML::Parser turned out to be much more performant.

PROPERTIES

output_function
transform_function

_libxml_parser

METHODS

new

Object constructor.

Requires:

output_function
transform_function 

Which are the code refs. See URL::Transform for more details/example.

parse_string($string)

Submit document as a string for parsing.

parse_file($file_name)

Submit file for parsing.

SEE ALSO

URL::Transform, URL::Transform::SAX::Filter

AUTHOR

Jozef Kutej