Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

xml parsing
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);






Report this thread to moderator Post Follow-up to this message
Old Post
E.Horn
10-28-04 01:56 PM


Re: xml parsing
On 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

Report this thread to moderator Post Follow-up to this message
Old Post
Philipp Traeder
10-29-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:19 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.