SoFunction
Updated on 2025-04-11

vbscript reads xml configuration file


Class clsGetProfile
' ルートドキュメント
Private rootDoc
' xmlファイルnameとセクションnameをセットする
'Indication: "1" ファイル name NOT NULL
' Sunday:なし
Public Sub setProfile(strFileName)
Set data_xml = CreateObject("")
data_xml.async = False
data_xml.load(strFileName)
Set rootDoc = data_xml.documentElement
End Sub
' キーのWenboるるる
' Quote: "1" キー name NOT NULL
' "2" セクション name NOT NULL
' Sun mouth:キーのOralる
Public Function getItem(strSectionName, itemName)
Set sectionNode = (strSectionName)
getItem = (itemName).attributes(0).nodeValue
End Function
End Class
'Use sai ンプル
' クラスインスススをgenerated
'Dim config : Set config = New clsGetProfile
' Configurationファイルnameとセクションnameをセットする
'Call ("")
' きーのarts するるるるをゲッドる
' ("MessageDefine", "INFO.001")
' ("MessageDefine", "INFO.003")
' ("MessageDefine", "ERROR.009")
' ("MessageDefine", "ERROR.012")
Class clsGetProfile
' ルートドキュメント
Private rootDoc
' xmlファイルnameとセクションnameをセットする
'Indication: "1" ファイル name NOT NULL
' Sunday:なし
Public Sub setProfile(strFileName)
Set data_xml = CreateObject("")
data_xml.async = False
data_xml.load(strFileName)
Set rootDoc = data_xml.documentElement
End Sub
' キーのWenboるるる
' Quote: "1" キー name NOT NULL
' "2" セクション name NOT NULL
' Sun mouth:キーのOralる
Public Function getItem(strSectionName, itemName)
Set sectionNode = (strSectionName)
getItem = (itemName).attributes(0).nodeValue
End Function
End Class
'Use sai ンプル
' クラスインスススをgenerated
'Dim config : Set config = New clsGetProfile
' Configurationファイルnameとセクションnameをセットする
'Call ("")
' きーのarts するるるるをゲッドる
' ("MessageDefine", "INFO.001")
' ("MessageDefine", "INFO.003")
' ("MessageDefine", "ERROR.009")
' ("MessageDefine", "ERROR.012")