Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Parse XML into CSV Files

by alexm (Chaplain)
on Jul 21, 2009 at 12:01 UTC ( #781932=note: print w/replies, xml ) Need Help??


in reply to Parse XML into CSV Files

Could you please show us the code that gives you trouble with the foreach?

Replies are listed 'Best First'.
Re^2: Parse XML into CSV Files
by dmsparts (Sexton) on Jul 21, 2009 at 14:46 UTC
    I was not sure where or how to declare the "foreach" statement for the contents of the XML, Hence my queery. Regards

      Once you remove the last <Vehicle> tag from the XML, the XMLin parser should read the file and then you can iterate over the vehicle array like this:

      my @vehicle_list = @{ $config->{Vehicle} }; foreach my $vehicle ( @vehicle_list ) { print $vehicle->{AuctionID} . "\n"; }
        Thanks for the reply,

        This is what i have found in another post on here,

        It seems to work fine until i get a XML TAG with no data in it. ie,
        <Mileage> </Mileage>


        When i print this variable to either the screen or an output file i get a value such as,

        HASH(0x17ce550)

        Any ideas how to stop this??

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://781932]
help
Chatterbox?
[choroba]: Also, I'd try starting the App with the US layout and switch to the dead keys layout later
[Tux]: no, it was not .xinput related, but that did ring a bell. digging in my $ENV I found the cause: XMODIFIERS=@im=xim
[Tux]: Héŀłő çřűèļ ŵøŗľđ, ıŧ'š ºvəř
[choroba]: ÿǎÿ!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-09-25 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (290 votes). Check out past polls.

    Notices?