By programming :)
#!/usr/bin/perl -- use strict; use warnings; use XML::Simple; my $xml =<<'__XML__'; <?xml version='1.0'?> <table_data> <row> <field name="column1">Homer</field> <field name="column2">Homer Simpson</field> <field name="column3">Nuclear Systems Operation</field> </row> <row> <field name="column1">Marge</field> <field name="column2">Marge Simpson</field> <field name="column3">Homers caretaker</field> </row> </table_data> __XML__ $xml =~ s/^\s+//s; $xml =~ s/\s+\z//s; my $rows = XMLin($xml,ForceContent=>1, ForceArray=>1); print Data::Dumper->new([$rows])->Indent(1)->Dump;use Data::Dumper; for my $row( @{ $rows->{row} }){ for my $key( keys %{$row->{field}} ){ print "$key => ", $row->{field}{$key}{content},"\n"; } } __END__ $VAR1 = { 'row' => [ { 'field' => { 'column3' => { 'content' => 'Nuclear Systems Operation' }, 'column2' => { 'content' => 'Homer Simpson' }, 'column1' => { 'content' => 'Homer' } } }, { 'field' => { 'column3' => { 'content' => 'Homers caretaker' }, 'column2' => { 'content' => 'Marge Simpson' }, 'column1' => { 'content' => 'Marge' } } } ] }; column3 => Nuclear Systems Operation column2 => Homer Simpson column1 => Homer column3 => Homers caretaker column2 => Marge Simpson column1 => Marge
references quick reference

In reply to Re^3: Change MySQL 5.0 XML output to 4.0 output by Anonymous Monk
in thread Change MySQL 5.0 XML output to 4.0 output by rycher

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.