FindElement Method (XContainer, XNamespace, String, Boolean)

Finds a specific element in the container by using the XML container, the XML container namespace, the XML element name, and a value that specifies whether the descendant elements should be searched.

Namespace:  Microsoft.Web.Media.TransformManager
Assembly:  Microsoft.Web.Media.TransformManager.Common (in Microsoft.Web.Media.TransformManager.Common.dll)

Syntax

'Declaration

  Public Shared Function FindElement ( _
    container As XContainer, _
    containerNamespace As XNamespace, _
    elementName As String, _
    searchChildren As Boolean _
) As XElement
'Usage

  Dim container As XContainer
Dim containerNamespace As XNamespace
Dim elementName As String
Dim searchChildren As Boolean
Dim returnValue As XElement

returnValue = Utilities.FindElement(container, _
    containerNamespace, elementName, _
    searchChildren)
  public static XElement FindElement(
    XContainer container,
    XNamespace containerNamespace,
    string elementName,
    bool searchChildren
)
  public:
static XElement^ FindElement(
    XContainer^ container, 
    XNamespace^ containerNamespace, 
    String^ elementName, 
    bool searchChildren
)
  static member FindElement : 
        container:XContainer * 
        containerNamespace:XNamespace * 
        elementName:string * 
        searchChildren:bool -> XElement 
  public static function FindElement(
    container : XContainer, 
    containerNamespace : XNamespace, 
    elementName : String, 
    searchChildren : boolean
) : XElement

Parameters

  • searchChildren
    Type: System. . :: . .Boolean
    true if the descendant elements should be searched; otherwise, false.

Return Value

Type: System.Xml.Linq. . :: . .XElement

Exceptions

Exception Condition
ArgumentNullException

container, containerNamespace, or elementName is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

See Also

Reference

Utilities Class

FindElement Overload

Microsoft.Web.Media.TransformManager Namespace