overwriting in xml file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scn87
    New Member
    • Oct 2008
    • 7

    overwriting in xml file

    I am doing a PHP DOM application.On basis of query some huge datas are selected and they are stored in an xml file.After doing certain calculations on this data i need to remove the existing data and replaced it with new one or is it possible to write the calculated data to another xml file.If so how can i do that.I tried many methods.But not getting worked.And this process of calculations and xml updations occur freqeuntly until some conditions in database are met.

    What should i do to import calculated data to new xml file or replace it in same file.

    Thanks for any help in advance.

    Regards
    scn87
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if you have an xml file imported in DOMDocument you can save it to file by the save() method.

    importing data to xml is similar to extracting data from xml, but without any information about that I can tell nothing.

    regards

    Comment

    • scn87
      New Member
      • Oct 2008
      • 7

      #3
      I have saved it using save() method for first xml file(test.xml).

      The first set of data are stored in test.xml file ,i need to do some calculations upon data of test.xml using php . Now the calculated result must be stored either in same xml file(by overwriting existing data) or save to a new xml file.

      How to get data from the test.xml file to store to test1.xml .

      Thanks
      Regards

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        without any information this is hard to tell, my usual guess would be, use DOM methods to find the according node and replace the value. basicly, do the extraction steps backwards (more or less).

        whether or not you overwrite or save anew your updated xml is up to you.

        regards

        Comment

        Working...