如何转换“& lt"和“& gt"到xml响应中的xml标记中 [英] How to Convert "&lt" and "&gt" into xml tags in xml response

查看:57
本文介绍了如何转换“& lt"和“& gt"到xml响应中的xml标记中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试获取xml响应.
它给了我答复,但格式不正确
它将xml标记转换为<"和>"

它以以下方式给出响应

Hi,
I am trying to get xml response.
It gives me response but not in proper format
It converts the xml tag into "<" and ">"

It give the response in following manner

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="www.detroittradingexchange.com/">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;PINGGX_RESPONSE xmlns="www.detroittradingexchange.com/SellerMessages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="www.detroittradingexchange.com/SellerMessages
http://www.detroittradingexchange.com/SellerMessages/SellGx_response.xsd"&gt;
  &lt;DTX_LEAD_ID&gt;-1&lt;/DTX_LEAD_ID&gt;
  &lt;SUCCESS&gt;False&lt;/SUCCESS&gt;
  &lt;CACHED_RESPONSE&gt;False&lt;/CACHED_RESPONSE&gt;
  &lt;PRICE&gt;0.0&lt;/PRICE&gt;
  &lt;REASON&gt;UNKNOWN_GEN&lt;/REASON&gt;
  &lt;REASON_MESSAGE&gt;Invalid Login&lt;/REASON_MESSAGE&gt;
  &lt;ERROR&gt;&lt;/ERROR&gt;
  &lt;ERROR_MESSAGE&gt;&lt;/ERROR_MESSAGE&gt;
&lt;/PINGGX_RESPONSE&gt;</string>



我想转换成正确的xml格式,例如


请帮助我



I want to convert into proper xml format like


Please help me

推荐答案

以下文章可能会对您有所帮助:
转义和不转义文本 [
The following article may help you:
Escape and unescape text[^]


您可以使用转义文字& lt;和& gt
You can use the escape text &lt; and &gt;


使用字符串.替换以<和>转换为<"和>"
use string.Replace to replace the < and > to convert to "<" and ">" respectively


这篇关于如何转换“&amp; lt"和“&amp; gt"到xml响应中的xml标记中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆