0

I wanted to insert new record for employee on in employee.xml as I am taking XML file as my database.

manager.xml:

<?xml version="1.0"?>
<Employees>
    <Employee>
        <Id>1</Id>
        <EmployeeId>EMP001</EmployeeId>
        <Name>Thirumalai</Name>
        <Role>Architect</Role>
    </Employee>
</Employees>

I wanted to add new employee with an id of EMP002, name of John and Role of manager in mamaanger.xml file.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • sample employee.xml file 1 EMP001 Thirumalai Architect – Khusboo Soni Jun 29 '15 at 10:29
  • (similar questions) – jezrael Jun 29 '15 at 11:03
  • [similar questions](http://stackoverflow.com/questions/3191179/generate-xml-document-in-memory-with-javascript) – jezrael Jun 29 '15 at 11:05
  • XML is not suited as a "database". It is a useful transport format, and for config files, but you should consider using an actual database. – iCollect.it Ltd Jun 29 '15 at 11:12
  • @TrueBlueAussie : yes. you are right. needed one more suggestion from you, i am making online food order when any customer order the food the order details first will save (create new node unders ORDERS in order.xml) on xml file. and once order is processed these data will save on sql db. because people can also use 2g network from mobile to order food. if i will go to save these new orders on sql db directly customer will close the mobile browser in case late. please suggest if i am wrong. – Khusboo Soni Jun 29 '15 at 11:20
  • I am not 100% clear what you mean, but all orders & order items should go straight into a database. Incomplete orders can be identified and removed based on date & status information that you store in the order. This means a customer can complete their order from another login session (if they have logins). – iCollect.it Ltd Jun 29 '15 at 11:24

0 Answers0