IEnumerable multiple selections

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,
I need help in finding all the row elements with a "TBody" element as shown in the example below:
<div style="background-color:white; color:black
<pre><span style="color:blue <<span style="color:#a31515 TBody<span style="color:blue >
<span style="color:blue <<span style="color:#a31515 THRow<span style="color:blue ><span style="color:blue <<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 THRow<span style="color:blue >
<span style="color:blue <<span style="color:#a31515 TRow<span style="color:blue ><span style="color:blue <<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TRow<span style="color:blue >
<span style="color:blue </<span style="color:#a31515 THRow<span style="color:blue ><span style="color:blue <<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TRow<span style="color:blue >
<span style="color:blue <<span style="color:#a31515 TRow<span style="color:blue ><span style="color:blue <<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TCell<span style="color:blue ><span style="color:blue </<span style="color:#a31515 TRow<span style="color:blue >
<span style="color:blue </<span style="color:#a31515 TBody<span style="color:blue >
[/code]

I try to select all THRow and TRow elements using the statement below,
<div style="background-color:white; color:black
<pre>IEnumerable<XElement> TBodyHeaderRows = tBodyElement.Descendants().Where(el => el.Name.LocalName == <span style="color:#a31515 "THRow").ToList(); [/code]
<pre>IEnumerable<XElement> TBodyRows = tBodyElement.Descendants().Where(el => el.Name.LocalName == <span style="color:#a31515 "TRow").ToList();[/code]

But I would like both the results in a single collection. Is there a way to get both query results Ãn one collection like in one IEnumerable<XElement>?
I also do the following, but get no result:
<span style="font-family:Consolas; color:#2b91af; font-size:small <span style="font-family:Consolas; color:#2b91af; font-size:small
<span style="font-family:Consolas; color:#2b91af; font-size:small <span style="font-family:Verdana; color:#000000
<pre lang="x-c# IEnumerable<XElement> tableBodyRows = tBodyElement.Descendants("TBody");

[/code]

<br/>
Greets

View the full article
 
Back
Top