Code Comments
Programming Forum and web based access to our favorite programming groups.this gives me a DTD as output.
My problem is I want to parse this output!
But how can ich give it to the second code that this parses the result
of (sub_daten_einlesen)
I hope someone understands my question ;-)
#!/usr/bin/perl -w
use LWP::Simple;
sub daten_einlesen
{
print "geben Sie ein gtpprotein ein\n";
my $eingabe =<STDIN>;
my
$url='http://eutils.ncbi.nlm.nih.gov/entrez/eutils/egquery.fcgi?term=';
# print $url;
# print"\n";
$newurl= $url.$eingabe;
# print $newurl;
return $newurl;
}
$url1 =daten_einlesen();
$doc = get $url1;
print $doc;
#!/xprog/bin/perl
# use module
use XML::Simple;
use Data::Dumper;
# create object
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("which path???");
# print output
print Dumper($data);
Post Follow-up to this messageOn Thursday 28 October 2004 10:56, E.Horn wrote:
Good morning,
> this gives me a DTD as output.
DTD?
As in the kind of document that describes XML files?
If yes, an XML Parser might be the wrong tool for parsing this kind of file.
Could you give us an example?
> My problem is I want to parse this output!
> But how can ich give it to the second code that this parses the result
> of (sub_daten_einlesen)
> I hope someone understands my question ;-)
[..snipped some code...]
>
>
> $url1 =daten_einlesen();
> $doc = get $url1;
> print $doc;
>
> #!/xprog/bin/perl
>
> # use module
> use XML::Simple;
> use Data::Dumper;
>
> # create object
> $xml = new XML::Simple;
>
> # read XML file
> $data = $xml->XMLin("which path???");
If the output you want to parse is stored in $doc, you should be able to pas
s
it directly to XML::Simple:
my $data = $xml->XMLin($doc);
HTH,
Philipp
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.