Extensions.DescendantsAndSelf Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a collection of every element in the source collection, and all descendant elements for every element in the source collection.
Overloads
DescendantsAndSelf(IEnumerable<XElement>) |
Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection. |
DescendantsAndSelf(IEnumerable<XElement>, XName) |
Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching XName are included in the collection. |
Remarks
Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method.
This method uses deferred execution.
DescendantsAndSelf(IEnumerable<XElement>)
- Source:
- Extensions.cs
- Source:
- Extensions.cs
- Source:
- Extensions.cs
Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection.
public:
[System::Runtime::CompilerServices::Extension]
static System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ DescendantsAndSelf(System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ source);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> source);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement?> source);
static member DescendantsAndSelf : seq<System.Xml.Linq.XElement> -> seq<System.Xml.Linq.XElement>
<Extension()>
Public Function DescendantsAndSelf (source As IEnumerable(Of XElement)) As IEnumerable(Of XElement)
Parameters
- source
- IEnumerable<XElement>
An IEnumerable<T> of XElement that contains the source collection.
Returns
An IEnumerable<T> of XElement that contains every element in the source collection, and the descendent elements of every element in the source collection.
Remarks
Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method, so Visual Basic users must use this axis method explicitly.
This method uses deferred execution.
See also
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- Descendants()
- DescendantNodes<T>(IEnumerable<T>)
- Descendants
- Nodes<T>(IEnumerable<T>)
- LINQ to XML overview
Applies to
DescendantsAndSelf(IEnumerable<XElement>, XName)
- Source:
- Extensions.cs
- Source:
- Extensions.cs
- Source:
- Extensions.cs
Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching XName are included in the collection.
public:
[System::Runtime::CompilerServices::Extension]
static System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ DescendantsAndSelf(System::Collections::Generic::IEnumerable<System::Xml::Linq::XElement ^> ^ source, System::Xml::Linq::XName ^ name);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> source, System.Xml.Linq.XName name);
public static System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement> DescendantsAndSelf (this System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement?> source, System.Xml.Linq.XName? name);
static member DescendantsAndSelf : seq<System.Xml.Linq.XElement> * System.Xml.Linq.XName -> seq<System.Xml.Linq.XElement>
<Extension()>
Public Function DescendantsAndSelf (source As IEnumerable(Of XElement), name As XName) As IEnumerable(Of XElement)
Parameters
- source
- IEnumerable<XElement>
An IEnumerable<T> of XElement that contains the source collection.
Returns
An IEnumerable<T> of XElement that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching XName are included in the collection.
Remarks
Although Visual Basic has an integrated XML axis for descendant elements, there is no integrated axis that has the semantics of this method, so Visual Basic users must use this axis method explicitly.
This method uses deferred execution.
See also
- DescendantNodesAndSelf()
- DescendantsAndSelf()
- DescendantNodes()
- Descendants()
- DescendantNodes<T>(IEnumerable<T>)
- Descendants
- Nodes<T>(IEnumerable<T>)
- LINQ to XML overview