![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Correct syntax for selectnode I am trying to extract specific items from a MSINFO32.nfo file. I can extract all the data I need except the drives and respective drive sizes. I have decided to show the whole parent node /category of Storage/Drives What should be the correct syntax for this command? sHardisks = oXML.SelectNode("Data[Item='Drives']/value").text Error I get is Object does not support this property or method. Many thanks in advance |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Correct syntax for selectnode On 14 Jun, 09:27, "Joe Fawcett" <joefawc...@xxxxxx> wrote: Quote: > "drunkeninja" <shaolindri...@xxxxxx> wrote in message > > news:9aa14afe-49da-445c-997a-be534d8c782d@xxxxxx> I am trying to extract specific items from a MSINFO32.nfo file. I can Quote: > > extract all the data I need except the drives and respective drive > > sizes. I have decided to show the whole parent node /category of > > Storage/Drives Quote: > > What should be the correct syntax for this command? Quote: > > sHardisks = oXML.SelectNode("Data[Item='Drives']/value").text Quote: > > Error I get is Object does not support this property or method. Quote: > > Many thanks in advance > Can you show, or point to, an example of the XML? > > -- > > Joe Fawcett (MVP - XML)http://joe.fawcett.name would like to show the whole category storage/drives ie drive letter with drive size and free space etc. sNFOFile = "C:\test\EuropeFP001.NFO" Set oXML = CreateObject("MSXML2.DOMDocument") oXML.async = False oXML.load(sNFOFile) sName= oXML.SelectSingleNode("//Data[Item='System Name']/Value").Text sOS= oXML.SelectSingleNode("//Data[Item='OS Name']/Value").Text sMemory = oXML.SelectSingleNode _ ("//Data[Item='Total Physical Memory']/Value").Text sCPU = EnumNode("CPU", 2, "//Data[Item='Processor']/Value", oXML) sHardDisks = EnumNode("Hard Drive", 1, _ "//Category[@name='Disks']/Data[Item='Size']/Value", oXML) MsgBox sCPU & vbCr & _ "Memory:" & vbTab & vbTab & sMemory & vbCr & sHardDisks Function EnumNode(ByVal sTitle, ByVal iTabs, ByVal oNode, ByVal oXML) Dim oCnt, oElem Set oNode = oXML.SelectNodes(oNode) iCnt = 0 For Each oElem in oNode iCnt = iCnt + 1 EnumNode = EnumNode & sTitle & " #" & iCnt & ":" & _ String(iTabs, vbTab) & oElem.Text & vbCrLf Next EnumNode = Left(EnumNode, Len(EnumNode) - 2) End Function |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Generic Interface syntax in VS 2005 using Old syntax | .NET General | |||
| Help with syntax | PowerShell | |||
| "invalid STORE command syntax invalid message set syntax" | Vista mail | |||
| Help with Powershell syntax | PowerShell | |||
| need syntax | Vista hardware & devices | |||