Web Connection
Odd error in WWWC Response.Write
Gravatar is a globally recognized avatar based on your email address. Odd error in WWWC Response.Write
  Russell Campbell
  All
  Dec 14, 2025 @ 07:09pm

Rick, in hitting a web app using WWWC 7.35 and returning some XML (generated using CURSORTOXML on a cursor I created as part of the processing during the hit), I got an odd error. First, here's a bit of the "XML" I received back:

	</xsd:schema>
	<msgscursor>
		<id>3</id>
		<direction>I</direction>
		<dtstamp>2025-12-14T17:52:18</dtstamp>
		<body>Here is the first message that I sent
<!-- West Wind Live Reload -->
<script>
(function(retryTimeout) {

Note the schema ends (since this is just a small part of what I got back) and the first record of msgscursor is starting to be detailed in the XML. Note the 4th field (BODY). Right after that I get a bunch of your West Wind Live Reload code. That is not supposed to be there, of course. This cursor had two records in it and the same thing happened in the same place in the XML representation of the second record. So I changed my query to change the field name, selecting BODY AS MSGBODY. That fixed it. As soon as the field name was no longer BODY, the XML came back unadulterated. Not sure exactly what's causing that but I'd bet you could recreate it if you have a cursor with a BODY field, turn it into XML, then try to Response.Write it out the caller. Perhaps you've fixed it since 7.35, though.

Gravatar is a globally recognized avatar based on your email address. re: Odd error in WWWC Response.Write
  Rick Strahl
  Russell Campbell
  Dec 15, 2025 @ 11:54am

Yup that would be caused by <\body> tag in the XML that is being hijacked by the LiveReload script that injects the live reload functionality. You can turn off Live Reload and that should fix the problem (assuming your page will even render with this invalid markup).

FWIW, that is not valid XSD\XML - any angle brackets inside of the XML/XSD should be encoded using < and > which would then also avoid this problem.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Odd error in WWWC Response.Write
  Russell Campbell
  Rick Strahl
  Dec 15, 2025 @ 01:03pm

Mmm, you lost me a bit. What I posted was just a part of the overall response that came back to me. The XML that was generated was generated by the VFP CURSORTOXML function. Of course, once the Live Reload scripting is unintentionally inserted, then it's very invalid. But as for the XML I get now, since I changed BODY to MSGBODY to solve the problem, it's valid as far as I know. Maybe I'm missing what you're saying somehow?

Gravatar is a globally recognized avatar based on your email address. re: Odd error in WWWC Response.Write
  Rick Strahl
  Russell Campbell
  Dec 15, 2025 @ 03:43pm

If the response is not HTML, Live Reload won't look at the file. it only looks at the text/html content type. So if you're returning XML then make sure the content type is correct (ie. text/xml)

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Odd error in WWWC Response.Write
  Russell Campbell
  Rick Strahl
  Dec 15, 2025 @ 04:27pm

Ah, ok. Thanks!

© 1996-2026