GetXmlDocument Script

Build 1501 on 14/Nov/2017  This topic last edited on: 29/Mar/2016, at 18:08

Description

Returns, as XML document, the value of the attribute attributeName of the object obj.

Syntax

dim i = GetXMLDocument(obj, attributeName)

obj

the object, to read the attribute attributeName from

attributeName

the name of the attribute to be read from the object obj.

Code

  <Extension()> _

  Public Function GetXmlDocument(ByVal obj As IGenericAttrObj, ByVal attributeName As String) As XmlDocument

    Dim value As Object

    Dim found As Boolean

    value = GetAttributeBase(obj, attributeName, found)

    If found Then

      Return CType(value, XmlDocument)

    End If

    Return Nothing

  End Function

Examples

  Public Function TText(ByVal obj As IGenericAttrObj) As String

    Dim xmlDoc As XmlDocument

    xmlDoc = GetXmlDocument(obj, "tText")

    If Not xmlDoc Is Nothing Then

      Return xmlDoc.InnerText

    End If

    Return Nothing

  End Function

See also

GetString, GetBoolean, GetDecimal, GetDate, GetXmlDocument, GetDataContent

GetAttributeBase Function