HOWTO: Make XML returned from a propfind easier to read


Here is a sample to reformat XML returned from WebDAV PROPFINDs to make it a little easier to read.


‘  ReformXML – reformats the XML to be more easily readable
Private Function ReformXML(sOriginalXML)
    Dim sXML As String
    sXML = sOriginalXML
    sXML = Replace(sXML, “<“, (vbCrLf & “<“))
    sXML = Replace(sXML, “/>”, (“/>” & vbCrLf))
    sXML = Replace(sXML, (vbCrLf & “</”), (“</”))
    sXML = Replace(sXML, (“></”), (“>” & vbCrLf & “</”))
    sXML = Replace(sXML, (“>” & vbCrLf & vbCrLf & “</”), (“>” & vbCrLf & “</”))
    ReformXML = sXML
End Function


 

Comments (0)

Skip to main content