Skip to main content

Create Section With Complex Linq query



I'm trying to create a section with linq from xml file. my xml file build like this:







<root>

<Item>

<name>a</name>

<status>new</status>

</Item>

<Item>

<name>b</name>

<status>old</status>

</Item>



</root>







I want to create the section by the following way if the status tag = "new it will create an entry element and if its old it will create a stringelement





i thought of something like this







new section()

{

from x in myXdoc.Descendants("Item")

where x.element("Status").value == "new" || x.element("Status").value == "old"



??????



}




Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?