You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2002/11/13 07:38:29 UTC

cvs commit: xml-xerces/perl/t DOMTreeWalker.t

jasons      2002/11/12 22:38:29

  Modified:    perl/t   DOMTreeWalker.t
  Log:
  added error checking to createTreeWalker() call
  
  Revision  Changes    Path
  1.2       +5 -2      xml-xerces/perl/t/DOMTreeWalker.t
  
  Index: DOMTreeWalker.t
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/t/DOMTreeWalker.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DOMTreeWalker.t	27 Aug 2002 19:20:00 -0000	1.1
  +++ DOMTreeWalker.t	13 Nov 2002 06:38:29 -0000	1.2
  @@ -61,13 +61,16 @@
   my $DOM = new XML::Xerces::XercesDOMParser;
   my $ERROR_HANDLER = XML::Xerces::PerlErrorHandler->new();
   $DOM->setErrorHandler($ERROR_HANDLER);
  -$DOM->parse(XML::Xerces::MemBufInputSource->new($document));
  +eval{$DOM->parse(XML::Xerces::MemBufInputSource->new($document))};
  +XML::Xerces::error($@) if $@;
   
   my $doc = $DOM->getDocument();
   my $root = $doc->getDocumentElement();
   my $filter = MyNodeFilter->new();
   my $what = $XML::Xerces::DOMNodeFilter::SHOW_ELEMENT;
  -my $walker = $doc->createTreeWalker($root,$what,$filter,1);
  +my $walker = eval{$doc->createTreeWalker($root,$what,$filter,1)};
  +XML::Xerces::error($@) if $@;
  +
   result(defined $walker
         and is_object($walker)
         and $walker->isa('XML::Xerces::DOMTreeWalker'));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org