Dude ... it's right there in the first couple of lines of XML::XPath:

my $nodeset = $row->find('AD'); foreach my $node ( $nodeset->get_nodelist ) { my $xref = $node->find( '@XREF' )->string_value; my $fname = $node->find( 'FName')->string_value; my $lname = $node->find('LName')->string_value; my $bdate = $node->find('BDate')->string_value; my $no = $node->find('No')->string_value; my $state = $node->find('State')->string_value; my $ssss = $node->find('SSSS')->string_value; my $train = $node->find('Train')->string_value; my $volume = $node->find('Volume')->string_value; my $cno = $node->find('CNo')->string_value; my $id = $node->find('ID')->string_value; print "1-$trans - 2-$cert - 3-$xref - 4-$fname - 5-$lname - 6-$b +date - 7-$no - 8-$state - 9-$ssss - 10-$train - 11-$volume - 12- +$cno - 13-$id\n"; }

but then again ... I prefer to use XSLT for stuff like this ... I love the pain

-derby

In reply to Re^3: XML Path and Perl by derby
in thread XML Path and Perl by Anonymous Monk

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.