Link to home
Start Free TrialLog in
Avatar of Moony
Moony

asked on

Create a XML Document using an ASP

I am in trouble trying to create a XML Document using an ASP file

I am trying to get this simple XML file:
"
<?xml version="1.0"?>
<data><![CDATA[i]]></data>
"

Well... I write this code in ASP:

"
<% @language=VBScript%>
<%
Response.ContentType = "text/xml"
%>

<%
     response.write "<?xml version=""1.0""?>" & vbCrLf
     Response.write "<dat>"
     response.write "<![CDATA[i]]>"
     response.write "</dat>"
%>
"

and I get the following error message :

"
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

An invalid character was found in text content. Error processing resource 'http://localhost/file001.asp'. Line 2, Position 15
 

<dat><![CDATA[
"

If I specify the codepage for the page:
"
<% @language=VBScript% @codepage=65001>
<%
Response.ContentType = "text/xml"
%>

<%
     response.write "<?xml version=""1.0""?>" & vbCrLf
     Response.write "<dat>"
     response.write "<![CDATA[i]]>"
     response.write "</dat>"
%>

then I get a different error :
"
 <font face="Arial" size=2>
<p>Active Server Pages</font> <font face="Arial" size=2>error 'ASP 0203'</font>
<p>
<font face="Arial" size=2>Invalid Code Page</font>
<p>
<font face="Arial" size=2>/prueba.asp</font><font face="Arial" size=2>, line 1</font>
<p>
<font face="Arial" size=2>The specified code page attribute is invalid.
</font>
"

The ASP file is running under NT workstation 4.0 (service pack 6a) and the last Option Pack(with PWS). Should I upgrade to Windows 2000 to be able to generate XML from ASP? Or maybe install the IIS 4.0...

Thanks in advanced

Avatar of djsputnik
djsputnik
Flag of United States of America image

Hey,
Did you try taking out the 'i'?
<%
    response.write "<?xml version=""1.0""?>" & vbCrLf
    Response.write "<dat>"
    response.write "<![CDATA[]]>"
    response.write "</dat>"
%>
and also at the top you wrote <data>, but then you write <dat>. Try to be consistent.
:)
Avatar of Moony
Moony

ASKER

Well, I wrote this message because the problem is "i". I know if I try to write another thing it works but it doesnt with "i" or "a" or "e"...

And I am consistent...the example was it and the ASP too...
There is nothing wrong with your code at all.. you are using an older version of the browser.  Update to IE 5.5 sp2 or higher.  the parser your version of IE does not understand the code its recieving... this should fix your problem.
dware,

Please dont lock questions, if user feel your answer satisfactory or if he want he will select your comment as answer.

bye
Vijay
Proposed answer rejected.

Netminder
CS Moderator
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[Accept BigRat's comment as answer
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
>S'Plug<
EE Cleanup Volunteer