in reply to Re: XML::Parser Style=>Subs and undefined subroutines
in thread XML::Parser Style=>Subs and undefined subroutines
You have to activate a flipflop variable when you open the desired tag. And deactivate it when this tag closes.$xs = new XML::Parser; die ("Can't find file: $completePathFile $!") unless -f($completePat +hFile); $xs->setHandlers( Start => \&openElem, End => \&closElem, Char => \&heresTheData, Default => \&forgetit ); $xs->parsefile($completePathFile); ##now, parses and logic sub openElem{ } sub closElem{ } sub heresTheData{ } sub forgetit{ }
In between, you are able to process the data that is received. Or waiting for other(s) flipflop(s) before processing the incoming data. You could leave it like this, and the file is going to parse perfectly ('though without any profit :).
For me, this module is a great masterpiece. But I only know this one, because it is the one more easyly found at any WWW site.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: XML::Parser Style=>Subs and undefined subroutines
by mirod (Canon) on Oct 02, 2003 at 11:47 UTC |