# man > XML::XPath::PerlSAX(3pm)

## NAME
    [XML::XPath::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3APerlSAX/markdown) - A PerlSAX event generator for my weird node structure

## SYNOPSIS
            use [XML::XPath](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath/markdown);
            use [XML::XPath::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3APerlSAX/markdown);
            use [XML::DOM::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM%3A%3APerlSAX/markdown);

            my $xp = [XML::XPath](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath/markdown)->new(filename => 'test.xhtml');
            my $paras = $xp->find('/html/body/p');

            my $handler = [XML::DOM::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM%3A%3APerlSAX/markdown)->new();
            my $generator = [XML::XPath::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3APerlSAX/markdown)->new( Handler => $handler );

            foreach my $node ($paras->get_nodelist) {
                    my $domtree = $generator->parse($node);
                    # do something with $domtree
            }

## DESCRIPTION
    This module generates PerlSAX events to pass to a PerlSAX handler such as [XML::DOM::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM%3A%3APerlSAX/markdown). It
    operates specifically on my weird tree format.

    Unfortunately SAX doesn't seem to cope with namespaces, so these are lost completely. I believe
    SAX2 is doing namespaces.

## Other
    The [XML::DOM::PerlSAX](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM%3A%3APerlSAX/markdown) handler I tried was completely broken (didn't even compile before I
    patched it a bit), so I don't know how correct this is or how far it will work.

## LICENSE AND COPYRIGHT
    This module is copyright 2000 AxKit.com Ltd. This is free software, and as such comes with NO
    WARRANTY. No dates are used in this module. You may distribute this module under the terms of
    either the Gnu GPL, or the Artistic License (the same terms as Perl itself).

