in reply to Re^2: Newbie XML Simple reference
in thread Newbie XML Simple reference

Do your part, set it up.

Replies are listed 'Best First'.
Re^4: Newbie XML Simple reference
by Sporti69 (Acolyte) on Nov 05, 2008 at 13:10 UTC
    Sorry Guys, I am a Perl noob. My problem is that I cannot spend time studying this language. My boss wont let me
    I need an output like this:

    You have 2 tags: node and node
    In node you have attribute type and name with values k and n
    This is the output i am looking for, for this xml
    XML
    ----
    <XML> <element> <node type="k" name="n"/> <node type="i" name="q"/> </element> </XML>
    Dummy Code
    #!/usr/bin/perl -- use strict; use warnings; use XML::Simple; my $xs1 = XML::Simple->new(); my $doc = $xs1->XMLin($file, keyattr=>['????'], ForceContent=>1, Force +Array=>1); use Data::Dumper; local $Data::Dumper::Indent=1; print Dumper($doc); for my $sub ( sort keys %{ $doc->{????} } ){ for my $elem ( sort keys %{ $doc->{????}->{$sub} } ){ } }