Hi,
[quoted text, click to view] >How can I delete the stock nodelist where LocID is 01
Inaddition to Martin's reply , you can use 'an xpath query to get to the
node or nodelists with LocID=01 or whatever id you want and then delete them
as follows
//for node list//
System.Xml.XmlNodeList nodeList =
doc.SelectNodes("/Respo1/Articles/A/Stock[LocID=01]");
//for single node//
System.Xml.XmlNode node =
doc.SelectSingleNode("/Respo1/Articles/A/Stock[LocID=01]");
node.ParentNode.RemoveChild(node);
Regards,
Rami Farhat
[quoted text, click to view] "William" wrote:
> Have somebody a brilliant idea how to remove a nodelist in a XML
> document? (With C#)
>
> I have this xml file,I want delete the stock nodelist when an user
> don't have permissions to see stocklist of that location.
>
> <Respo1>
> <From>Test</From>
> <To>Test</To>
> <MsgType>RESPO1</MsgType>
> <MsgVer>001</MsgVer>
> <MsgID>1712435695</MsgID>
> <MsgDtTm>2005-08-18-17.01.47.634000</MsgDtTm>
> <CustID>132300</CustID>
> <QueryID>I1023932000030</QueryID>
> <Cux>EUR</Cux>
> <Articles>
> <A>
> <Lin>
> </Lin>
> <S>FVR1039</S>
> <Stock>
> <LocID>01</LocID>
> <Qty>135,00</Qty>
> <NetPr>50,00</NetPr>
> </Stock>
> <Stock>
> <LocID>05</LocID>
> <Qty>1,00</Qty>
> <NetPr>50,00</NetPr>
> </Stock>
> </A>
> </Articles>
> </Respo1>
>
> example: The user is not authorize to see the information where LocID
> is 01. How can I delete the stock nodelist where LocID is 01.
>
> Thanks for your advice
> Regards,
>
> William Mayvis
>