Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<logs>
<actions name="a1">
<action id="SignIn">1
<action id="SignOut">2
<action id="Open">3

<actions name="a2">
<action id="SignIn">5
<action id="SignOut">6
<action id="Open">7

<actions name="a3">
<action id="SignIn">8
<action id="SignOut">9
<action id="Open">10




Here i have one List of Id

XElement xx=XElement.Load("abc.xml");

string id="5";

var vAct=from p in abc.Element(Logs).Elements(Actions)
where p.Attribute("id").Value=="SignIn" &&
(p.Attribute("id").Value).Value=id
select p;


I want the output like :

<actions name="a2">
<action id="SignIn">5
<action id="SignOut">6
<action id="Open">7


Thanks in advance,Please help how to get the Collections
based on where condition matching id=5;
Posted
Comments
Akbar Ali Hussain 30-Nov-12 19:59pm    
Please include the xml file content also

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900