in reply to Newbie XML Simple reference

Let see, you adapt the code from Re^2: XML to Excel : not Unique ??, then you change the xml and you don't update the code? Yeah, that'll work.

Replies are listed 'Best First'.
Re^2: Newbie XML Simple reference
by Sporti69 (Acolyte) on Nov 05, 2008 at 09:56 UTC
    Maybe that is because I am struggling with the referencing !
    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:

    This is the output i am looking for,
    "You have 2 tags: node and node
    In node you have attribute type and name with values k and n"
    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} } ){ } }