XML Feed - Beating the impossible

Discussion in 'PHP' started by abuzant, Sep 13, 2006.

  1. #1
    Hello,

    I have an XML file of about 200K lines (Thats total of about 70K childs in 500 containers) as shown in the following format

    
    <container1>
       <property1>
       <property2>
       <child1>
            <property1>
             <property2>
        </child1>
       <child2>
            <property1>
             <property2>
        </child2>
       ....
    </container1>
    <container2>
       <property1>
       <property2>
       <child1>
            <property1>
             <property2>
        </child1>
       <child2>
            <property1>
             <property2>
        </child2>
       ....
    </container2>
    
    Code (markup):
    I need to make some sort of script that will 'quickly' get me any value from that file. My question is..

    Shall i do some super-puper PHP class that will smartly get what i want.. OR .. Shall i do a script to dump that into a database which will be easier to search.. OR.. suiggest me something please. I am lost as the ampount of data there shall kill almost any server.

    Good luck and TIA, Ruslan
     
    abuzant, Sep 13, 2006 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    I'd probably write a script to put it in a database. Even mysql could handle the size. From there you can deal with it in pieces or anything else you want.

    Do you know what the file size is if it were a flat text file?
     
    jestep, Sep 13, 2006 IP
  3. abuzant

    abuzant Well-Known Member

    Messages:
    956
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Hello..

    Yeah thats 6.19 MB (6,492,160 bytes) exactly, no tabs or etc..
    I am already on writing the parser script. It is working ok but i have doubtsa that it will timeout on most shared hosting servers because of safemode and/or memory limitations.. don't you think so?

    Thanks again, Ruslan
     
    abuzant, Sep 13, 2006 IP
  4. sketch

    sketch Well-Known Member

    Messages:
    898
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    148
    #4
    Do you have a web server running in your home/office? If so you can parse the XML there, do a SQL dump then import THAT into your shared hosting DB without worrying about time/memory limitations.
     
    sketch, Sep 13, 2006 IP