I read numerous tutorials and I managed to print all other tags apart from the details for the authors, that is <LastName>, <ForeName>, <Initials>. I used the following code:<?xml version='1.0'?> <PubmedArticle> <PMID>1766380</PMID> <Article PubModel="Print"> <Journal> <JournalIssue CitedMedium="Print"> <Volume>5</Volume> <Issue>9</Issue> <PubDate> <Year>1991</Year> <Month>Sep</Month> </PubDate> </JournalIssue> <ISOAbbreviation>Mol. Microbiol.</ISOAbbreviation> </Journal> <ArticleTitle>PhoP/PhoQ: macrophage-specific modulator +s of Salmonella virulence?</ArticleTitle> <Pagination> <MedlinePgn>2073-8</MedlinePgn> </Pagination> <AuthorList CompleteYN="Y"> <Author ValidYN="Y"> <LastName>Miller</LastName> <ForeName>S I</ForeName> <Initials>SI</Initials> </Author> <Author ValidYN="Y"> <LastName>Tsirigos</LastName> <ForeName>K T</ForeName> <Initials>KT</Initials> </Author> <Author ValidYN="Y"> <LastName>Dinous</LastName> <ForeName>A E</ForeName> <Initials>AE</Initials> </Author> </AuthorList> </Article> </PubmedArticle>
I only have problem with the authors, because there can be more than one, contrary to all the other info contained in my xml... Can you help me please?#!/usr/bin/perl use XML::Simple; use Data::Dumper; $simple = XML::Simple->new; $data = $simple->XMLin('data.xml'); print $data->{PMID}; print $data->{Article}->{...}->{...};
In reply to Perl & Simple::XML by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |