SetAttribute()

Top  Previous  Next

Object: EHL7.QSXML

FileName: EHL7.dll

 

METHOD

 

Name: SetAttribute()

Parameters:

1.objNode (XML Node Object)
2.strAttribute (String) the name of the attribute (case sensitive)
3.strValue (String) the value to set.

Returns: String

Description: This method sets the value of a named attribute on an xml node object.

 

See Also: VendorsXML(), GetAttributeValue()

 

Example Code:

Private Sub VendorTest()

Dim myVendorObj As New EHL7.HL7Vendors

Dim strVendorID As String

Dim strXML As String

Dim domNode As Object

Dim myXMLObj As New EHL7.qsXML

myVendorObj.VendorPath = "C:\EasyHL7"

'Process the XML        

strVendorID = myVendorObj.GetVendorID("Default","2.3")

If strVendorID = "" Then

    MsgBox myVendorObj.LastError

    Set myVendorObj = Nothing

    Exit Sub

End If

strXML = myVendorObj.GetVendorXML(strVendorID)

If strXML = "" Then

    MsgBox myVendorObj.LastError

    Set myVendorObj = Nothing

    Exit Sub

End If

With myXMLObj

    .OpenFromString strXML

    Set domNode = .GetRootElement()

    'Change the description

    .SetAttribute domNode,"DESCRIPTION", "New description for default 2.3 vendor"

    'The XML is formed

    strXML = .XML 

End With

With myVendorObj

   If Not .UpdateVendor(strXML) Then

     MsgBox .LastError

     Exit Sub

   End If

   .ClearErrors

   Call .OpenVendor(strVendorID)

End With

End Sub