- 12/30/04 0 1 - 1.00 01/06/05 01/06/05 NEVER SC 4 DOC AND IMAGE /DDL/servlets/dv.search?docID=100386419&searchType=INTRANET doc #### sub ParseCSrsp { my ($CSrspXMLMsg,$StatusRef) = @_; my $CSxmlParser; $CSxmlParser = new XML::Parser(ErrorContext => 2); $CSxmlParser->setHandlers(Init => \&InitHandler, Final => \&FinalHandler, Start => \&StartHandler, End => \&EndHandler, Char => \&CharHandler); $CSxmlParser->parse($CSrspXMLMsg); return 1; } # XML parser handler functions sub InitHandler { $CSElement = {}; undef $XMLTagContent; } sub FinalHandler { } sub StartHandler { my $Element = $_[1]; undef $XMLTagContent; &{$LBSubIndex{$Element}} if $LBSubIndex{$Element}; if ($Element =~ /URI/i) { $TagElement = 'E'; } } sub EndHandler { my $Element = $_[1]; # &{$LBSubIndex{$Element . '_'}} if $LBSubIndex{$Element . '_'}; &{$LBSubIndex{$Element}} if $LBSubIndex{$Element}; } sub CharHandler { $XMLTagContent .= $_[1]; } # Custom handlers sub ParseELEMENT_ { $CSElement = {}; } sub LBGeneric { my $Element = $_[1]; print "$Element is generic element and $XMLTagContent is tagcontent\n"; if ($TagElement eq 'E') { if ($XMLTagContent eq '') { $PrevContact = ' '; } else { $PrevContact = $XMLTagContent ; } print "GOT IT NOW $PrevContact\n"; $TagElement = ''; $URL = $PrevContact; } elsif ($XMLTagContent =~ /search/i) { print "GOT IT NOW $PrevContact\n"; } # $CSrsp->{$Element} = $XMLTagContent if $XMLTagContent; } # Custom handlers sub ParseELEMENT_ { $CSElement = {}; print $CSElement; }