You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by Anshuman Singh Rawat <as...@nyu.edu> on 2004/06/15 07:08:36 UTC

help with XML::Xerces::LocalInputSource()

Hi,
I am trying to use LocalInputSource() to parse an xml document contained in a variable 'body' ($parser->parse (XML::Xerces::LocalInputSource($body));) .

I am not sure if I am calling it correctly (I couldn;t find any example on how to use it).

I get the following errom messages - 

Use of inherited AUTOLOAD for non-method XML::Xerces::LocalInputSource() is deprecated at ./parse.pl line 349.
Error in eval: Can't locate auto/XML/Xerces/LocalInputS.al in @INC (@INC contains: /n/lion/u/lion2/rawat/XML-Xerces-2.3.0-4/samples/../blib/arch /n/lion/u/lion2/rawat/XML-Xerces-2.3.0-4/samples/../blib/lib ./lib /home/rawat/XML-Xerces-2.3.0-4/perl5/site_perl/5.8.0/i386-linux-thread-multi /home/rawat/MIME-tools-5.411/perl5/site_perl/5.8.0/i386-linux-thread-multi /home/rawat/MIME-tools-5.411/perl5/site_perl/5.8.0 /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at ./parse.pl line 349
 at ./parse.pl line 352

Any help in this regard will be appreciated.
Thanks,
Anshuman



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


Re: help with XML::Xerces::LocalInputSource()

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
Anshuman Singh Rawat <as...@nyu.edu> writes:

> I am trying to use LocalInputSource() to parse an xml document
> contained in a variable 'body' ($parser->parse
> (XML::Xerces::LocalInputSource($body));) .
>
> I am not sure if I am calling it correctly (I couldn;t find any
> example on how to use it).

That is because there is no such method ;-)

> I get the following errom messages - 
>
> Use of inherited AUTOLOAD for non-method XML::Xerces::LocalInputSource() is deprecated at ./parse.pl line 349.
> Error in eval: Can't locate auto/XML/Xerces/LocalInputS.al

That message means that Perl's object oriented method lookup mechanism
exhausted all of it's possible means of locating a method by that name
and failed (with the painfully useless message of the last method it
attempted to find and couldn't).

There are two types of input sources you are likely to use:
1) LocalFileInputSource - from a disk file
2) MemBufInputSource - from a variable

Given what you are trying to do, I would use a MemBufInputSource:

  my $text = 'some piece of xml here';
  my $parser = XML::Xerces::XercesDOMParser->new();
  eval {$parser->parse(XML::Xerces::MemBufInputSource->new($test))};
  XML::Xerces::error($@) if $@;

You can always look in the samples/ and t/ directories for more examples.

Cheers,
jas.

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