You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Jaideep Padhye <jd...@yahoo.com> on 2006/08/31 19:40:28 UTC

Error in Xerces libraries in perl

Hi all,
   
  I am trying to use the parse XML documents. I am trying to write a perl program which has the following structure. I am giving just the outline of code.
   
  parse.pl
  ############
  sub parseXml {
   
  XML::Xerces::XMLPlatformUtils::Initialize();
   
  ## this contains all the other code for doig various things like coutning nodes
   
  my $parser = XML::Xerces::XercesDOMParser->new();
my $doc = $parser->getDocument();
 XML::Xerces::XMLPlatformUtils::Terminate();
 return $doc;
  }
   
  init();
  my $doc = parseXml("1..xml");
print Data::Dumper->Dump([$doc]);

  ## Some code
   
  my $doc1 = parseXml("2.xml");
print Data::Dumper->Dump([$doc1]);
   
  ##########
  End of parse.pl 
  
Problems:
   
  1] When I run the above program the first call to the parseXml function provides correct output.For ex: 
   
  $VAR1 = {
          'job_id' => '41',
          'status' => '0',
          'status_tag' => 'COMMAND COMPLETED'
        };
   
  but after the second call to the parseXml function the parsed document format returned is not proper. When I try to print the varible the second time I get the following output:
   
  $VAR1 = bless( {}, 'XML::Xerces::DOMDocument' );

  2] I assumed from the above output the Xerces library is having some errors. Hence I checked the logs and I found the follwoing errors:
   
  Validating test output :
  Can't locate auto/XML/Xerces/DOMDocument/swig_switch.al in @INC (@INC contains: /root/jdpadhye/autotest/clplib /root/jdpadhye/autotest/profilelib /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
 /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/XML/Xerces.pm line 998

  Can anyone help me with this problem? Any kind of help is appreciated. Thanks a lot.
   
   
  JD


\\\\////  
            /        \
           | \\   // |
         ( | (.) (.) |)
---------o00o--(_)--o00o-----------------------
"A billion flies can be wrong !!
 I would rather eat lamb chops than shit "
 - Linus Torwalds
---------ooo0-------------------------------
        (   )     0ooo
         \ (      (   )
          \_)      ) /
                  (_/
 		
---------------------------------
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.