Bu XML dosyasının belirli özniteliklerinin içine metin girmeye çalışıyorum.XML dosyasındaki belirli özniteliğe eriş
Line: 23
Error: Object required: 'objNode.attributes.getNameItem(....)'
nasıl yük XML dosyasının belirli özelliklerini erişebilir: Örneğin vb
açıklama, türü içindeki metin, Şu anda bir hata alıyorum? açıklama, ayrıntıları-> serviceName, tip
<!DOCTYPE html>
<html lang="en">
<head>
<title>XML</title>
<HTA:APPLICATION
APPLICATIONNAME = "XPOS removal tool"
/>
</head>
<script language="VBScript">
Sub Window_onLoad
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.Load("programs1.xml")
strQuery = "/steps/step"
Set colNodes = xmlDoc.selectNodes(strQuery)
htmlString = "<table><tr><th>Description</th><th>Type</th><th>Status</th></tr>"
For Each objNode in colNodes
htmlString = htmlString & "<tr><td>"& objNode.attributes.getNamedItem("description").value &"</td><td>test</td></tr>"
// htmlString = htmlString & "<tr><td>"& objNode.text &"</td><td>test</td></tr>"
Next
htmlString = htmlString & "</table>"
DataArea.innerHTML = htmlString
End Sub
</script>
<body>
<div id="DataArea"></div>
</body>
</html>
XML veri:
<?xml version='1.0'?>
<steps>
<step>
<description>Description 1</description>
<type>Type 5</type>
<details>
<runFolder>c:\windows</runFolder>
<runFile>v3-x86.exe</runFile>
</details>
</step>
<step>
<description>Description 2</description>
<type>Type 4</type>
<details>
<serviceName>COMRedirector</serviceName>
<processName>COMRedirectorServ</processName>
</details>
</step>
<step>
<description>Description 3</description>
<type>Type 3</type>
<details>
<serviceName>OSUpdate</serviceName>
<processName>OSUpdateServ</processName>
</details>
</step>
</steps>