alexsc01 has asked for the wisdom of the Perl Monks concerning the following question:
I need to get the username from each element. How can I loop thru all the elements? id_ can be what ever and is in no order.<blocks_conduit_model_service_course generator="zend" version="1.0"> <get_course_grades> <users> <id_8004><user><id>8004</id><fullname>Päivi Timonen</fullname><usernam +e>timopa01</username><idnumber/></user></id_8004> <id_601><user><id>601</id><fullname>Pekka Harjula</fullname><username> +harjpe01</username><idnumber/></user></id_601> <id_5><user><id>5</id><fullname>Hanna Laitinen</fullname><username>lai +tha02</username><idnumber/></user></id_5> </users> </blocks_conduit_model_service_course> I'm using XML::Simple print "$response_xml->{get_course_grades}->{users}->{id_8004}->{user}- +>{username}" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing xml
by choroba (Cardinal) on Feb 19, 2016 at 11:43 UTC | |
by alexsc01 (Novice) on Feb 19, 2016 at 11:55 UTC | |
|
Re: Parsing xml
by Discipulus (Canon) on Feb 19, 2016 at 11:49 UTC | |
|
Re: Parsing xml
by kcott (Archbishop) on Feb 19, 2016 at 12:12 UTC |