Below is a vbscript that reads in a xml file and outputs the information. I
m astruggling with how to take the information and create an xml file.
Second, is for each CLASS there are a number of properties I would like to
gather. I don't know when to write a closing tag. For example, the LCD class
has two properties I would like to gather. Once I have pulled infomration I
continue to the next class. I don't know how to create the closing tag
between classes.
CODE
' *************************************************************************
'
Set objPortal=CreateObject("posPortalLib.posPortal")
Const SigName ="expsig061509"
objPortal.Open("pptp://10.128.189.51")
isOnline=(objPortal.ResultString)
WScript.Echo(isOnline)
'Main
Sig()
Function Sig()
'************************************************************
' Name: Sig
' Purpose:
' Inputs: None
' Returns: None
'************************************************************
Const StoreXML_DROPOFF_DIR = "C:\"
Const StoreXML_FileName = "NewXML.xml"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set xml = CreateObject("Microsoft.XMLDOM")
XML.async = False
XML.load StoreXML_DROPOFF_DIR & StoreXML_FileName
Set classes = XML.selectNodes("//SIGInventoryData/Class")
For Each pclass In classes
className=pclass.Attributes.getNamedItem("CName").value
'WScript.Echo (className)
For j = 0 To pclass.childNodes.Length - 1
sPropName = pclass.childNodes(j).selectSingleNode("@PName").Text
WScript.Echo(j)
'WScript.Echo className & Space(1) & sPropName
strValue=objPortal.GetVar("config."& className & "." & sPropName)
WScript.Echo className & "." & sPropName & "=" & strValue
Next
Next
End Function
OUTPUT
LCD.brightness=32
LCD.backlight=1
Audio.volumelevel=2
XML FILE READING INFORAMTION FROM
<SIGInventoryData>
<Class CName="LCD">
<Property PName="brightness"/>
<Property PName="backlight"/>
</Class>
<Class CName="Audio">
<Property PName="volumelevel"/>
</Class>
</SIGInventoryData>