Click to See Complete Forum and Search --> : Creating XML Dynamically using ASP


Jster
10-06-2006, 12:36 PM
I've been playing around with creating XML and HTTP Request and I am running into an issue. When I try to look at my user table and pull in a lot of information, I receive the Following Error at the end of my XML Document. "Whitespace is not allowed at this location. Error processing resource " My Code to generate the XML Document is as followed.

Response.ContentType = "text/xml"
Response.write "<?xml version=""1.0"" encoding=""iso-8859-1"" standalone=""no""?>"
Response.write "<ADMINUSERS>"
DO WHILE NOT RS.EOF
Response.write " <PERSON>"
Response.write " <NAME>"&TRIM(RS("FullName"))&"</NAME>"
Response.write " <EMAIL>"&TRIM(RS("Email"))&"</EMAIL>"
Response.write " <USERNAME>"&TRIM(RS("Username"))&"</USERNAME>"
Response.write " <LOCATION>"&TRIM(RS("Location"))&"</LOCATION>"
Response.write " <PHONE>"&TRIM(RS("PHONE"))&"</PHONE>"
Response.write " </PERSON>"
RS.MoveNext
LOOP
Response.write "</ADMINUSERS>"



I'm not putting any white spaces at the end of the string like it says. Is there a limit to the amount of records to display in xml? I can pull like 75 records but when I point it to pull around 2593 records it throws this error. Or am I missing something obvious.

Thanks,
Josh

Jster
10-06-2006, 02:42 PM
Found my issue, Special characters "ë" and "&" exist in the records data. Any idea how to not error out on special characters?

TNO
10-14-2006, 04:28 AM
The only way I know of is to refer to them according to their HTML entity code. example: &quot;, &amp;, &lt;, and &gt;,