Anlage des Repos
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
' Version Date: 30.09.2020
|
||||
Function TestIsWebserviceResponseSuccessful(XmlString)
|
||||
' Check if XmlString is actually a xml string
|
||||
If InStr(XmlString, "<?xml") = 1 Then
|
||||
Set Doc = CreateObject("MSXML2.DOMDocument")
|
||||
Doc.loadXML(XmlString)
|
||||
|
||||
Set Nodes = Doc.SelectNodes("MESOWebServiceResult/ResultDetails")
|
||||
Set OverallSuccess = Doc.SelectSingleNode("MESOWebServiceResult/OverallSuccess")
|
||||
|
||||
If OverallSuccess.Text = "true" Then
|
||||
Dim IsSuccess : IsSuccess = True
|
||||
|
||||
For Each Node in Nodes
|
||||
Set Success = Node.SelectSingleNode("Success")
|
||||
|
||||
If Success.Text <> "true" Then
|
||||
IsSuccess = False
|
||||
End If
|
||||
Next
|
||||
|
||||
TestIsWebserviceResponseSuccessful = IsSuccess
|
||||
Else
|
||||
TestIsWebserviceResponseSuccessful = False
|
||||
End If
|
||||
Else
|
||||
TestIsWebserviceResponseSuccessful = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function prettyXml(ByVal sDirty)
|
||||
' Put whitespace between tags. (Required for XSL transformation.)
|
||||
sDirty = Replace(sDirty, "><", ">" & vbCrLf & "<")
|
||||
' Create an XSL stylesheet for transformation.
|
||||
Dim objXSL : Set objXSL = WScript.CreateObject("Msxml2.DOMDocument")
|
||||
objXSL.loadXML "<xsl:stylesheet version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">" & _
|
||||
"<xsl:output method=""xml"" indent=""yes""/>" & _
|
||||
"<xsl:template match=""/"">" & _
|
||||
"<xsl:copy-of select="".""/>" & _
|
||||
"</xsl:template>" & _
|
||||
"</xsl:stylesheet>"
|
||||
' Transform the XML.
|
||||
Dim objXML : Set objXML = WScript.CreateObject("Msxml2.DOMDocument")
|
||||
objXML.loadXml sDirty
|
||||
objXML.transformNode objXSL
|
||||
prettyXml = objXML.xml
|
||||
End Function
|
||||
Reference in New Issue
Block a user