-
-
Notifications
You must be signed in to change notification settings - Fork 494
XML Support in 4.0
Tim Hall edited this page Apr 8, 2015
·
4 revisions
Currently, XML is not supported in 4.0.0 due to lack of Mac support. An updated parser is being created that supports Mac and Windows, but in order to avoid future breaking changes, ParseXml
and ConvertToXml
are not currently implemented.
To use XML in Windows in the meantime, follow these steps:
In a new or existing module, add the following:
' ModuleName.bas
Public Function ParseXml(Value As String) As Object
Set ParseXml = CreateObject("MSXML2.DOMDocument")
ParseXml.Async = False
ParseXml.LoadXML Value
End Function
Public Function ConvertToXml(Value As Variant) As String
ConvertToXml = Trim(Replace(Value.Xml, vbCrLf, ""))
End Function
Register converter before it is used in WebRequest
WebHelpers.RegisterConverter "xml", "application/xml", "ModuleName.ConvertToXml", "ModuleName.ParseXml"
Request.CustomRequestFormat = "xml"
Request.CustomResponseFormat = "xml"