Quantcast
Viewing latest article 1
Browse Latest Browse All 6

VBScript XML pretty print

I don't know if this would ever be useful to anyone, but anyway:

Option Explicit

Dim xmlDoc
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.loadXML("<GetList><a><b attr=""5"">a node</b></a></GetList>")

DisplayNode xmlDoc.childNodes


' =================== Helper Routines ==================

Sub DisplayNode(Nodes)
  DisplayNode_ Nodes, 0
End Sub

Sub DisplayNode_(Nodes, Indent)
   Dim xNode
   For Each xNode In Nodes
      Select Case xNode.nodeType
        Case 1:   ' NODE_ELEMENT
          If xNode.nodeName <> "#document" Then

read more


Viewing latest article 1
Browse Latest Browse All 6

Trending Articles