This Function allows an XML File to contain parameters that can be accessed from within the ARS Scripting environment.
Define the XML required and call the function as
For text value of a node
Value=ReadXMLNode(<Full XML Path to Node>,"")
For named attribute of a node eg. Name
Value=ReadXMLNode(<Full XML Path to Node>,"Name")
The returned value is a string containing the value of the node text or attribute requested.
SCRIPT CODE
'*********************************************************************************
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' IF YOU WANT THIS FUNCTIONALITY TO BE CONDITIONALLY SUPPORTED,
' PLEASE CONTACT ONE IDENTITY PROFESSIONAL SERVICES.
'*********************************************************************************
Public Function ReadXMLNode(ByVal strNodeName,ByVal strAttribute)
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
If fileexists("ars control.xml") Then
objXMLDoc.load("ars control.xml")
Set Node = objXMLDoc.selectSingleNode(strnodename)
If strAttribute="" Then
ReadXMLNode= Node.text
Else
readxmlnode=node.Attributes.getNamedItem(strAttribute).text
End If
Else
ReadXMLNode="ERROR"
End If
End Function
'***** END OF CODE ***************************************************************