develooper Front page | perl.beginners | Postings from February 2002

PERL and XML Parser

Thread Next
From:
P0R0NG
Date:
February 1, 2002 04:52
Subject:
PERL and XML Parser
Message ID:
20020201210454.3e0922c1.p0r0ng@yahoo.com
Hi list.

I'm currently doing a perl project involving XML parser.

given this xml snippet:

<albums>
  <owner>Percy</owner>
  <categories="rock">
    <artist>Alice in Chains</rock>
    <artist>The Pixies</artist>
  </categories>  
  <categories = "reggae">
    <artist>Bob Marley</artist>
    <artist>Peter Tosh</artist>
  </categories>  
</albums>

how can i get the PCDATA for the element "owner"? i want to get just 
the "owner" elements and the content of the "owner."

i've created a code that will trap for the start and end tags of 
the element "owner" as well as the handlers for the characters 
that were part of the markup but no particular handlers.

please help.

thanks.

percy

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About