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
- container
Type: System.Xml.Linq. . :: . .XContainer
An XML node to search.
- containerNamespace
Type: System.Xml.Linq. . :: . .XNamespace
The XML namespace of the XML container node.
- elementName
Type: System. . :: . .String
The name of the XML element to find.
- 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) . |