Delete List XElement

  • Thread starter Thread starter CY_Chen
  • Start date Start date
C

CY_Chen

Guest
I try to delete XElement from structure

Here is my structure look like

<Frames>
<FRAME FrameName="Frame0">
<Frame_Elements>
<Frame_Element>
<Basic>
<Id>0</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>f.png</BaseFileName>
<BaseBX>0</BaseBX>
<BaseBY>0</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>1</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>5.png</BaseFileName>
<BaseBX>154</BaseBX>
<BaseBY>25</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>2</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>4.png</BaseFileName>
<BaseBX>96</BaseBX>
<BaseBY>17</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>3</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>cc.png</BaseFileName>
<BaseBX>61</BaseBX>
<BaseBY>11</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>4</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>bb.png</BaseFileName>
<BaseBX>60</BaseBX>
<BaseBY>8</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>5</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>a.png</BaseFileName>
<BaseBX>0</BaseBX>
<BaseBY>0</BaseBY>
</Base>
</Frame_Element>
</Frame_Elements>
</FRAME>
<FRAME FrameName="Frame1">
<Frame_Elements>
<Frame_Element>
<Basic>
<Id>6</Id>
<Index>0</Index>
<Type>0</Type>
<Mode>0</Mode>
<Frame>0</Frame>
<Angle>0</Angle>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>M.png</BaseFileName>
<BaseBX>0</BaseBX>
<BaseBY>0</BaseBY>
</Base>
</Frame_Element>
<Frame_Element>
<Basic>
<Id>7</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>mn.png</BaseFileName>
<BaseBX>0</BaseBX>
<BaseBY>0</BaseBY>
</Base>
</Frame_Element>
</Frame_Elements>
</FRAME>
</Frames>

It was add like

FRAMEXElement.Add(new XElement("FRAME"));
FRAMEXElement[PageCounts].SetAttributeValue("FrameName", "Frame" + 0);
Frame_ElementsXElement.Add(new XElement("Frame_Elements"));
FRAMEXElement[1].Add(Frame_ElementsXElement[1]);
framesXElement.Add(FRAMEXElement[1]);

FRAMEXElement.Add(new XElement("FRAME"));
FRAMEXElement[PageCounts].SetAttributeValue("FrameName", "Frame" + 1);
Frame_ElementsXElement.Add(new XElement("Frame_Elements"));
FRAMEXElement[1].Add(Frame_ElementsXElement[1]);
framesXElement.Add(FRAMEXElement[1]);


////////////////////////////Add Frame_ElementXElement for example

Frame_ElementXElement.Add(new XElement("Frame_Element"));
Frame_ElementsXElement[0].Add(Frame_ElementXElement[0]);
BasicXElement.Add(new XElement("Basic"));
Frame_ElementXElement[0].Add(BasicXElement[0]);
IdXElement.Add(new XElement("Id", 0));

BasicXElement[0].Add(AngleXElement[0]);
BaseXElement.Add(new XElement("Base"));
Frame_ElementXElement[0].Add(BaseXElement[0]);
BaseFilePathXElement.Add(new XElement("BaseFilePath", /*path*/));
BaseXElement[0].Add(BaseFilePathXElement[0]);
BaseFileNameXElement.Add(new XElement("BaseFileName", /*file*/));
BaseXElement[ICounts].Add(BaseFileNameXElement[0]);
BaseXElement[0].Add(new XElement("BaseBX", 0), new XElement("BaseBY", 0));



My problem is How to delete

1.<FRAME FrameName="Frame0"> and it contains all <Frame_Elements>

2.each Frame_Element for example

<Frame_Element>
<Basic>
<Id>0</Id>
</Basic>
<Base>
<BaseFilePath>C:\Default\Image</BaseFilePath>
<BaseFileName>f.png</BaseFileName>
<BaseBX>0</BaseBX>
<BaseBY>0</BaseBY>
</Base>
</Frame_Element>

How to those things ?

Thanks

Continue reading...
 
Back
Top