开发者

How to add a node to an existing xml file using iphone?

开发者 https://www.devze.com 2023-03-13 01:24 出处:网络
In my application I need to add new element to parent node.开发者_运维百科 for Example My Xmlfile:

In my application I need to add new element to parent node.

开发者_运维百科

for Example My Xmlfile:

 <person>  
    <Name>Thrinath</Name> 
    <Add>Hyd</Add>   
 </person>

Now I need to add new element named sal to person parent node

 <person>   
      <Name>Thrinath</Name>  
      <Sal>50000</Sal>  
      <Add>Hyd</Add> 
 </person>  

I know that to read XML file we have XML parser,but I dont know how to write into the XML file like my requirement.


Use some kind of DOM model to modify the XML, see for example this link.

0

精彩评论

暂无评论...
验证码 换一张
取 消