How to add new element in xml file

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
i have so many elements like below one xml. in my xml files there are so many tables called

TickerBrokerDateFormatMaps, TickerBrokerDateFormatMap

I need to add one more element called TickerBrokerDateFormatMap at the end of last element of TickerBrokerDateFormatMap

so how could i do it ?

<TickerBrokerDateFormatMap BrokerTab_Id="0" Broker_Id="0" Ticker_Id="AMZN">
<StandardDate>1Q 2010A</StandardDate>
<ColumnCoordinate>X</ColumnCoordinate>
<TickerBrokerDateFormatMaps_Id>0</TickerBrokerDateFormatMaps_Id>
<BrokerDate StandardDate="1Q 2010A" Broker_Id="0" BrokerTab_Id="0">
<year>1Q10</year>
<Quater>1Q10</Quater>
</BrokerDate>
</TickerBrokerDateFormatMap>


Now i want to add one more element like <TickerBrokerDateFormatMap> </TickerBrokerDateFormatMap> in xml file.

how could i do it when loading file by XDocument like XDocument xmlDoc = XDocument.Load(path);

please share some example code. thanks

Continue reading...
 
Back
Top