我有一個XML文件的XDocument刪除節點
<rows>
<head>
<beforeInit>
<call command="attachHeader">
<param>#text_filter,#text_filter,#text_filter,#text_filter,#text_filter,#text_filter</param>
</call>
</beforeInit>
<afterInit>
<call command="enablePaging">
<param>recinfoArea</param>
</call>
</afterInit>
<column width="100" align="center" type="ro" sort="server" color="undefined" id="Id">Id</column>
<column width="100" align="center" type="ro" sort="server" color="undefined" id="NazovProjektu">NazovProjektu</column>
</head>
</rows>
我想刪除beforeInit和afterInit元素。
我試圖
xml.Elements().Where(e=>e.Name == "beforeInit" || e.Name == "afterInit").Remove();
,但沒有運氣。
如果我知道我不會問:-) – user137348 2010-12-21 15:02:36