Skip to content

FindXElement Method ​

Definition ​

  • Namespace: JASE.Serializers
  • Assembly: JASE.Serializers.dll

Overloads ​

NameDescription
XElement FindXElement(string xml, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XML string or XElement object.
XElement FindXElement(XDocument document, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XDocument object.
XElement FindXElement(XElement start, string elementName, bool caseSensitive = null)Finds the first XElement that matches the specified element name within the given XElement object.

XElement FindXElement(string xml, string elementName, bool caseSensitive = null) ​

csharp
XElement FindXElement(string xml, string elementName, bool caseSensitive = null)

Finds the first XElement that matches the specified element name within the given XML string or XElement object.

Parameters ​

NameDescription
caseSensitiveIndicates whether the search should be case-sensitive.
elementNameThe name of the element to search for.
xmlThe XML string to search within.

Returns ​

The first XElement that matches the specified element name, or null if no match is found.

XElement FindXElement(XDocument document, string elementName, bool caseSensitive = null) ​

csharp
XElement FindXElement(XDocument document, string elementName, bool caseSensitive = null)

Finds the first XElement that matches the specified element name within the given XDocument object.

Parameters ​

NameDescription
caseSensitiveIndicates whether the search should be case-sensitive.
documentThe XDocument object to search within.
elementNameThe name of the element to search for.

Returns ​

The first XElement that matches the specified element name, or null if no match is found.

XElement FindXElement(XElement start, string elementName, bool caseSensitive = null) ​

csharp
XElement FindXElement(XElement start, string elementName, bool caseSensitive = null)

Finds the first XElement that matches the specified element name within the given XElement object.

Parameters ​

NameDescription
caseSensitiveIndicates whether the search should be case-sensitive.
elementNameThe name of the element to search for.
startThe starting XElement object to search within.

Returns ​

The first XElement that matches the specified element name, or null if no match is found.