XML::XPath::PerlSAX - A PerlSAX event generator for my wierd node structure
use XML::XPath; use XML::XPath::PerlSAX; use XML::DOM::PerlSAX;
my $xp = XML::XPath->new(filename => 'test.xhtml'); my $paras = $xp->find('/html/body/p');
my $handler = XML::DOM::PerlSAX->new(); my $generator = XML::XPath::PerlSAX->new( Handler => $handler );
foreach my $node ($paras->get_nodelist) { my $domtree = $generator->parse($node); # do something with $domtree }
Unfortunately SAX doesn't seem to cope with namespaces, so these are lost completely. I believe SAX2 is doing namespaces.
This software may only be distributed as part of the XML::XPath package.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |