如何转换“& lt"和“& gt"到xml响应中的xml标记中 [英] How to Convert "&lt" and "&gt" into xml tags in xml response
本文介绍了如何转换“& 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/"><?xml version="1.0" encoding="UTF-8"?>
<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">
<DTX_LEAD_ID>-1</DTX_LEAD_ID>
<SUCCESS>False</SUCCESS>
<CACHED_RESPONSE>False</CACHED_RESPONSE>
<PRICE>0.0</PRICE>
<REASON>UNKNOWN_GEN</REASON>
<REASON_MESSAGE>Invalid Login</REASON_MESSAGE>
<ERROR></ERROR>
<ERROR_MESSAGE></ERROR_MESSAGE>
</PINGGX_RESPONSE></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 < and >
使用字符串.替换以<和>转换为<"和>"
use string.Replace to replace the < and > to convert to "<" and ">" respectively
这篇关于如何转换“& lt"和“& gt"到xml响应中的xml标记中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文