..oops i missed this..
You can also use XML::Twig to do what you want..

PS i get garbage printing 'CRXW616 AIR/OIL' but ..
use warnings; use strict; use XML::Twig; my $xml=<<'XML'; <Root> <gfx> <group name="Group1" visible="true" wallpaper="false" isReferenceOb +ject="false"> <gotoButton name="GotoDisplayButton3" display="19 UNIT STATUS"> <caption fontFamily="Arial" fontSize="9" caption="MAIN MEN +U" /> <imageSettings imageName="" alignment="middleCenter"/> </gotoButton> </group> <gotoButton name="GotoDisplayButton12" display="36 AIR_OIL SYSTEM SE +TUP_2"> <caption fontFamily="Arial" fontSize="9" caption="TO CRXW616&# +xA;AIR/OIL" /> <imageSettings imageName="" alignment="middleCenter"/> </gotoButton> </gfx> </Root> XML my $twig= new XML::Twig( pretty_print => 'indented', twig_handlers => { 'gotoButton' => sub {prin +t $_->att('name')," ",$_->att('display')," ", $_->first_child('captio +n')->att('caption'),"\n" } }, ); $twig->parse( $xml);

hth
L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: Perl LibXML Help. by Discipulus
in thread Perl LibXML Help. by DunLidjun

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.