GetElemText(String,Object) Method
- Last UpdatedNov 06, 2025
- 1 minute read
To extract the text for a given element in the loaded XML document. The text may be a single text value or an XML substring if the element has child nodes NB: XML doc object must have been created and loaded with the XML string. ElemName may include XPath syntax eg: "//object" or "//request/object" Throws an exception containing the error details if specified element is NOT found
'Declaration
Public Overloads Function GetElemText( _
ByVal ElemName As String, _
ByVal DefaultValue As Object _
) As String
public string GetElemText(
string ElemName,
object DefaultValue
)
Parameters
- ElemName
- The name of the element whose text is required as a string
- DefaultValue
- The supplied default value is returned if the node exist and does not have a value
Return Value
Returns the string if the specified element is found