开发者

Escaping double quotes and the Web

开发者 https://www.devze.com 2023-01-17 22:49 出处:网络
I am trying to get the following sent in an xml. <Request xmlns=\"http://abc.org/1.1/Listener.wsdl\">&lt;serverstatusinquiry xmlns=\"http://abc.org/messages\"/&gt;</Request>

I am trying to get the following sent in an xml.

<Request xmlns="http://abc.org/1.1/Listener.wsdl">&lt;serverstatusinquiry xmlns="http://abc.org/messages"/&gt;</Request>

The problem I am facing is the text part of the Request node. I am printing the text as follows.

"<serverstatusinquiry xmlns=\"http://abc.org/messages\"/>"

But I end up with:

&lt;serverstatusinquiry xmlns=&quot;http://abc.org/messages&quot;/&gt;

I understand &quot; stands for double quotes, is there a way I can force it to actually output " instead of &quot;? Is there anything wrong with what I开发者_如何学运维 am doing?


Use &#60; for < (Less than), > &#62; for > (Greater than), and &#34; for "

<Request xmlns="http://abc.org/1.1/Listener.wsdl">&#60;serverstatusinquiry xmlns=&#34http://abc.org/messages&#34/&#62;</Request>Quotation).
0

精彩评论

暂无评论...
验证码 换一张
取 消