0
response.ContentType="text/xml"

response.write("<?xml version=""1.0"" encoding=""iso-8859-1""?>

And this throws an error:

error on line 9 at column 6: XML declaration allowed only at the start of the document

How to fix this error?

1 Answer 1

1

Start your .asp file with the following lines:

<?xml version="1.0" encoding="iso-8859-1"?>
<% Response.ContentType = "text/xml" %>

OR

with the following lines (everything in the same line):

<% Response.ContentType = "text/xml" %><?xml version="1.0" encoding="iso-8859-1"?>
Sign up to request clarification or add additional context in comments.

4 Comments

Can you provide us the whole .asp file (with the modifications I proposed you)? Do you have other XML declarations in your file?
Don't let any extra space before the lines I have written.
your code worked but now got a new error.error on line 1 at column 373: AttValue: " or ' expected the line is:response.write("<url><![CDATA["&Recordset("ContactWebAddres")&"]]></url>")
What is the value of Recordset("ContactWebAddres")?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.