Suppose I have the following XML code:
I want to get the Assembly subnode by specifying the Name value. So for example, I want to specify "TS_Upper_1D" and get this subnode:Code:Dim assembliesElement As XElement = <Job> <Assemblies> <Assembly> <Properties> <General> <Name>TS_Upper_1S</Name> <Type>Standard</Type> </General> </Properties> </Assembly> <Assembly> <Properties> <General> <Name>TS_Lower_2S</Name> <Type>Standard</Type> </General> </Properties> </Assembly> <Assembly> <Properties> <General> <Name>TS_Upper_1D</Name> <Type>Standard</Type> </General> </Properties> </Assembly> <Assembly> <Properties> <General> <Name>TS_Upper_3F</Name> <Type>Standard</Type> </General> </Properties> </Assembly> </Assemblies> </Job>
There could be several dozen <Assembly> nodes under the <Assemblies> node. How would I do this? Thanks...Code:<Assembly> <Properties> <General> <Name>TS_Upper_1D</Name> <-- retrieve by this value <Type>Standard</Type> </General> </Properties> </Assembly>




Reply With Quote