我试图从一个名为“名单”的XmlNodeList中删除一个具体节点。 这一具体清单在我使用“消除儿童”之前有5个项目。 但是,在“消除儿童”发言之后,名单仅剩下1个项目。
XmlNodeList listaWidths = xmlDoc.SelectNodes("/MsBuild:Report/MsBuild:Body/MsBuild:ReportItems/MsBuild:Tablix/MsBuild:TablixBody/MsBuild:TablixColumns/*", nsmgr);
int indexEpoca = 0;
XmlNode node = listaWidths[indexEpoca];
XmlNode parent = listaWidths[indexEpoca].ParentNode;
parent.RemoveChild(node);
This is a RDL Reporting Services XML. The specific XML code is here:
<Tablix Name="Tablix3">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1.602in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.61in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.6323in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.6023in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.6033in</Width>
</TablixColumn>
</TablixColumns>
(...)
I ve tried every combination possible, with no luck whatsoever. What am I doing wrong? Thank you.