Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml file has been encoded to use &quote; instead of "

Status
Not open for further replies.

Sniipe

Programmer
Oct 9, 2006
115
IE
I have an xml file which I am passing from one page to another. I don't have access to the page its being passed to so I can't change anything there.

The XML is in string format and posted to form by a button to its destination page.
<form id="frmGenerateReport" method="post">
<input type="hidden" id="xml" NAME="xml" runat="server">
</form>

On the submitting page I did an alert on the value and its fine, but on the recieving page I viewed the source and saw that it had swapped the " for &quote;

Any ideas?
 
can anyone help me with this? I am still having difficulty with it.

also its &quot; not &quote; which I posed.
 
I don't really understand the flow here, but if you want to get through two levels of entity resolution you might try:
Code:
&amp;quot;

Tom Morrison
 
Try not post as a riddle. If the receiving page escape the quote by replacing it to &quot;, what can you do? (as you don't have control over it.)
 
*posted (misspelt posed)

I'm definately not explaining things correctly. I'll try again.

I have a dummy page (I don't have access to the clients page, but I assume its along these lines...)
The client complains that he gets his xml files and they are not formed correctly. Instead they have to replace &quot; with ' to get it working.

So on my dummy page I go:

ReturnXML = Request.Form("NNECXML")
' Write out the returned XML
if ReturnXML <> "" then
Response.Write("XML Generated")
Response.Write("<BR>-----------------<BR>")
Response.Write(Server.HTMLEncode(ReturnXML))
end if

This is what it looks like on the web page

XML Generated
-----------------
<?xml version="1.0" encoding="utf-8"?><xiEngineering:NNEC_XML xsi:schemaLocation="xiEngineering xiEngineering.xsd" xmlns:xiEngineering="xiEngineering" xmlns:gl="Global" xmlns:xsi=" Item="User ID" Value="a1234"></Info><Info Item="Distributor ID" Value="dist1234"></Info><Info Item="Site ID" Value=""></Info><Info Item="Quote Type" Value="SMB"></Info><Info Item="Quote Number"...

And this is what the source looks like - Its the source I'm more interested in. It needs to be correct, because they are taking from the form value.

XML Generated<BR>-----------------<BR>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;xiEngineering:NNEC_XML xsi:schemaLocation=&quot;xiEngineering xiEngineering.xsd&quot; xmlns:xiEngineering=&quot;xiEngineering&quot; xmlns:gl=&quot;Global&quot; xmlns:xsi=&quot; Item=&quot;User ID&quot; Value=&quot;a1234&quot;&gt;&lt;/Info&gt;&lt;Info Item=&quot;Distributor ID&quot; Value=&quot;dist1234&quot;&gt;&lt;/Info&gt;&lt;Info Item=&quot;Site ID&quot; Value=&quot;&quot;&gt;&lt;/Info&gt;&lt;Info Item=&quot;Quote Type&quot;...


Now I'll also say that they are not complaining about &gt; or &alt; ...
 
What is the reason behind not to send the string back plain?
>Response.Write(Server.HTMLEncode(ReturnXML))
[tt]Response.Write ReturnXML[/tt]
 
Upon re-read what you think your client page might look with those messages and formatting like Response.Write("XML Generated") and Response.Write("<BR>-----------------<BR>"), maybe clients really want to highlight-copy-and-paste to save the xml source. In that case, the simplest with to put up a textarea for them to do that.
[tt]
ReturnXML = Request.Form("NNECXML")
' Write out the returned XML
if ReturnXML <> "" then
Response.Write("XML Generated")
Response.Write("<BR>-----------------<BR>")
[red]'[/red]Response.Write(Server.HTMLEncode(ReturnXML))
[blue]response.write vbcrlf
response.write "<textarea cols='60' rows='30'>" & ReturnXML & "</textarea>" & "<br />" & vbcrlf[/blue]
end if
[/tt]
 
The stuff on this page:
ReturnXML = Request.Form("NNECXML")
' Write out the returned XML
if ReturnXML <> "" then
Response.Write("XML Generated")
Response.Write("<BR>-----------------<BR>")
'Response.Write(Server.HTMLEncode(ReturnXML))
response.write vbcrlf
response.write "<textarea cols='60' rows='30'>" & ReturnXML & "</textarea>" & "<br />" & vbcrlf
end if

^^ this is my dummy page. I don't know what the clients page is like. I can't change anything at the destination, I can only change stuff from the source:

<form id="frmGenerateReport" method="post">
<input type="hidden" id="xml" NAME="xml" runat="server">
</form>
 
I don't understand what message you mean to convey in the last post. But if you don't know what clients complaint about, why don't you ascertain it first?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top