0

Midified the xml file using DomDocument object?

Have a file.xml

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <Document xmlns="urn:iso:std">
 <content>
 <GrpHdr>
   <MsgId>xxxxxx </MsgId>
   <CreDtTm>2010-07-05T16:48:00</CreDtTm>
   <BtchBookg>false</BtchBookg>
   <NbOfTxs>2</NbOfTxs>
   <CtrlSum>56653</CtrlSum>
   <Grpg>Old</Grpg>
   <InitgPty>
   <Nm> Name </Nm>
   </InitgPty>
 </GrpHdr>
 </content>
 <Document>

How can modified the xml data and save back to file.xml (for example )

 <NbOfTxs>1</NbOfTxs>
 <CtrlSum>1223</CtrlSum>
 <Grpg>NEW</Grpg>
hakre
  • 193,403
  • 52
  • 435
  • 836
tree em
  • 20,379
  • 30
  • 92
  • 130
  • 2
    possible duplicate of [How to modify xml file using PHP](http://stackoverflow.com/questions/1193528/how-to-modify-xml-file-using-php) – Pekka Dec 28 '10 at 11:03

1 Answers1

1

Use save() function of the DomDocument Object, for example:

$dom->save("newfile.xml")

Look here for further details

Shamim Hafiz - MSFT
  • 21,454
  • 43
  • 116
  • 176