And one more since I've become the chapter secretary for the XML::LibXML fan club (I like Twig too).

use strict; use warnings; use XML::LibXML; my $doc = XML::LibXML->new->parse_fh(\*DATA); for my $node ( $doc->findnodes('//experiment[@accnum]') ){ print $node->getAttribute("accnum"), "\n"; } __DATA__ <?xml version="1.0" encoding="UTF-8"?> <experiments total-hybs="629" total-samples="733" total="21" to="21" f +rom="1"> <experiment accnum="E-GEOD-8918" array="Agilent Human Genome CGH Mic +roarray 44B [G4410B]" biosamples-png="download/mageml/E-GEOD-8918.bio +samples.png" biosamples-svg="download/mageml/E-GEOD-8918.biosamples.s +vg" fgem="download/mageml/E-GEOD-8918.processed.zip" fgem-count="87" +hybs="87" id="1636341195" name="CGH profiling of 87 indolent non-hodg +kin s lymphoma (NHL)" releasedate="2008-06-19" samples="174" sdrf="do +wnload/mageml/E-GEOD-8918.sdrf.txt" species="Homo sapiens" two-column +s="download/mageml/E-GEOD-8918.2columns.txt"> <users> <user id="1"/> </users> <secondaryaccessions> <secondaryaccession>GSE8918</secondaryaccession> </secondaryaccessions> </experiment> </experiments>

In reply to Re: XML parsing by Your Mother
in thread XML parsing by advait

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.