Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to get paired values from the nested XML structure?

by vagabonding electron (Curate)
on Nov 01, 2011 at 19:43 UTC ( [id://935195]=note: print w/replies, xml ) Need Help??


in reply to Re: How to get paired values from the nested XML structure?
in thread How to get paired values from the nested XML structure?

Thank you Jenda,
I must read this carefully und try it. I did not know XML::Rules bevor. The good news - this module exists for ActivePerl.
The "real" huge xml file consists of many nested structures like in the example. They "dive" from the surface of simple data such as the "address" or the "boss name" (and the "unit_id").
I had hence an idea to make several csv files with id of the unit (here in example shown as unit name) and connect them in the database later. This eclectic (promiscuous? :-)) idea comes since my knowledge of perl is limited and I have to get the things run at the same time.

Replies are listed 'Best First'.
Re^3: How to get paired values from the nested XML structure?
by Jenda (Abbot) on Nov 02, 2011 at 09:42 UTC

    If the file is huge you can process it in parts. In this case and with XML::Rules it would mean that the rule for <unit> would be a subroutine that inserts the data of the unit to database and then returns nothing. That way you do not keep the already processed data in memory.

    Another good module for processing huge XML files is XML::Twig.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      Thank you Jenda, I will certainly try it too.
      The Module XML::Twig is also available for ActivePerl - great!(and btw. it is the real blessing to be able to install ppm modules manually, without administrator privileges and without proxy issue).
      Many thanks!
      VE

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://935195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-29 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found