ruby - How to insert XML into another XML file ( REST API ) -
i need pass application uses rest api parameters in following xml file
paramvalue = "<tag><stillonetag>value</stillonetag></tag>" xmlin = ' <?xml version="1.0" encoding="windows-1251"?> <vco:execution-context xmlns:vco="http://www.vmware.com/vco" xmlns="vco"> <vco:parameters> <vco:parameter name="inputxml" type="string" description="" scope="local"> <vco:string>#{paramvalue}</vco:string> </vco:parameter> </vco:parameters> </vco:execution-context> ' xmlexec = xmlin.gsub(/\>[\s\n\r]+\</, '><') response = httparty.post("/workflows/#{id}/presentation/instances/", { :basic_auth => @auth, :body => xmlexec}) with "normal" strings not have issues, in case parameter inputxml expects value xml string. how can embed such xml string ruby constant above? many in advance.
got it!!!! pass xml text value xml tag inside of xml object without making part of object
need use < , > instead of < , >. in example should be
paramvalue = "<tag><stillonetag>value</stillonetag></tag>" so long, xml experts!
Comments
Post a Comment