Keith McElroy
asked on
XMLHTTP from Microsoft Word to Classic ASP...XML document looses white space
How do I correct my code so that when I send an xml in string over a post that it does not loose the white space in between the attributes
Abbreviated code is as follows
Piece 1: Word VBA Macro
...
strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLKKeyMaste r"" Prop=""TitleDl""/>"
strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLOObjMaste r"" Prop=""ObjDl""/>"
strBudgetRows = strBudgetRows & "</ReportFormat>"
strBudgetRows = strBudgetRows & "</ReportFetch>"
strBudgetRows = strBudgetRows & "</Request>"
strBudgetRows = strBudgetRows & "</NetSightMessage>"
strBudgetRows = strBudgetRows & "</sbixml>"
Set curlss = CreateObject("Microsoft.XM LHTTP")
curlss.Open "POST", "https://", False
curlss.setRequestHeader "Content-Type", "application/x-www-form-ur lencoded"
curlss.send ("str=" & strBudgetRows)
'curlss.responseText comes back with no spaces between attributes
ActiveDocument.Tables(3).C ell(1, 1).Range.Text = curlss.responseText
Piece 2: Classic asp code
dim strBudgetRows
strBudgetRows = request("str")
set xmlBudgetRows = Server.CreateObject("Micro soft.XMLDO M") : xmlBudgetRows.async = false : xmlBudgetRows.loadXml strBudgetRows
response.write strBudgetRows
Piece 3: XML is consumed in Piece 2 but the white space is gone, thus the .loadxml fails
<sbixml><NetSightMessage>< Header><Co nnection>b plus</Conn ection><Us erID>BSI</ UserID><Cu rrentLedge rsGL="GL"J L="JL"/><M ask>POUPPR </Mask><Su bSystem>Pu rchasing</ SubSystem> <TraceEna
Abbreviated code is as follows
Piece 1: Word VBA Macro
...
strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLKKeyMaste
strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLOObjMaste
strBudgetRows = strBudgetRows & "</ReportFormat>"
strBudgetRows = strBudgetRows & "</ReportFetch>"
strBudgetRows = strBudgetRows & "</Request>"
strBudgetRows = strBudgetRows & "</NetSightMessage>"
strBudgetRows = strBudgetRows & "</sbixml>"
Set curlss = CreateObject("Microsoft.XM
curlss.Open "POST", "https://", False
curlss.setRequestHeader "Content-Type", "application/x-www-form-ur
curlss.send ("str=" & strBudgetRows)
'curlss.responseText comes back with no spaces between attributes
ActiveDocument.Tables(3).C
Piece 2: Classic asp code
dim strBudgetRows
strBudgetRows = request("str")
set xmlBudgetRows = Server.CreateObject("Micro
response.write strBudgetRows
Piece 3: XML is consumed in Piece 2 but the white space is gone, thus the .loadxml fails
<sbixml><NetSightMessage><
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.