Un-Escaping XML编码字符

时间:2014-05-12 10:39:23

标签: php xml htmlspecialchars xml-entities

嗨我得到了回应而不是STD xml。如何使用PHP将其转换为XML ..

    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><rfc:ZHR_TIMESHEETS_GETLIST.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><ZDAYSUMMARY></ZDAYSUMMARY><ZMESSAGES><item><MANDT></MANDT><PERNR>00956025</PERNR><WKSTRTDT>0000-00-00</WKSTRTDT><WKENDDT>0000-00-00</WKENDDT><ZDAY>0</ZDAY><ZMESSAGE>E</ZMESSAGE><ZCOLOR_CODE></ZCOLOR_CODE><ZMESSAGE_T>You have no reportees.</ZMESSAGE_T></item></ZMESSAGES><ZTSDETAIL></ZTSDETAIL><ZWKSUMMARY></ZWKSUMMARY></rfc:ZHR_TIMESHEETS_GETLIST.Response></SOAP-ENV:Body></SOAP-ENV:Envelope> 

谢谢, Mangesh

2 个答案:

答案 0 :(得分:0)

试试这个:

html_entity_decode("your_string")

答案 1 :(得分:0)

如果您可以修改请求标头,请尝试使用Content-Type: application/soap+xml;

如果没有,只需在响应字符串上使用html_entity_decode()