Link to home
Start Free TrialLog in
Avatar of Keith McElroy
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.GLKKeyMaster"" Prop=""TitleDl""/>"
                        strBudgetRows = strBudgetRows & "<Detail BT20OBJ=""BT20.GLOObjMaster"" Prop=""ObjDl""/>"
                    strBudgetRows = strBudgetRows & "</ReportFormat>"
                strBudgetRows = strBudgetRows & "</ReportFetch>"
            strBudgetRows = strBudgetRows & "</Request>"
        strBudgetRows = strBudgetRows & "</NetSightMessage>"
    strBudgetRows = strBudgetRows & "</sbixml>"



    Set curlss = CreateObject("Microsoft.XMLHTTP")
    curlss.Open "POST", "https://", False
    curlss.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    curlss.send ("str=" & strBudgetRows)
   
    'curlss.responseText comes back with no spaces between attributes
    ActiveDocument.Tables(3).Cell(1, 1).Range.Text = curlss.responseText
   


Piece 2: Classic asp code
      dim strBudgetRows
      strBudgetRows = request("str")

      set xmlBudgetRows = Server.CreateObject("Microsoft.XMLDOM") : 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><Connection>bplus</Connection><UserID>BSI</UserID><CurrentLedgersGL="GL"JL="JL"/><Mask>POUPPR</Mask><SubSystem>Purchasing</SubSystem><TraceEna
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial