error Cannot view XML input using style sheet.

Posted on 2006-05-01
Last Modified: 2013-11-19
I create a new website in 2.0 with one page containing a label.
I created a virtual directory for it in my comuter in inetpub\wwwroot.
I publish the website to that location and when I browse the default page I get the followinf error:

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'http://localhost/test2/Default.aspx'. Line 1, Positio...

This is a marker file generated by the precompilation tool, and should not be deleted!

What is the problem here?
Please help!!!
Question by:ANAT2403
    LVL 60

    Expert Comment

    by:Geert Bormans
    Hi ANAT2403,

    It seems that you are giving a text file a text/xml mimetype
    The browser assumes he is getting an XML file,
    but what he gets is a text line
    He is waiting for the XML declaration or a root XML tag

    maybe your default is pointing to the wrong file,
    or the XML you create isn't XML at all


    Author Comment

    I repeat again:
    I create a new website, add a new item default2.aspx and in it put a label.
    That's it. I don't have any xml files. then I build the wesite and publish the the website to my computer
    in Inetpub\wwwroot to a new folder I created and made it to be a virtual directory.
    (this is all for testing before I do it with my real website).
    Then in the explorer I write:
    That's it I don't have any xml file. maybe the dot net create something.
    I have the feeling that the problem is in the properties of the explorer but I don't know. Anyhow
    I spend a lot of time on this . Do you know what is the problem?
    LVL 60

    Expert Comment

    by:Geert Bormans
    I repeat again:
    It seems that you are giving a text file a text/xml mimetype

    it could be that this index page has a mime-type XML.
    That is the setting you should be looking for

    Author Comment

    Hi Gertone,
    Sorry if I was a bit rude with the repeat but the thing is I just take the standart page without changing anything.
    where is the mime-type  setting is given? I don't even know what it is?
    Hope you can help me.
    This is my page while the first 3 lines are given automatically. Is ther something I have to change there?
    This is the first time I try to publish something.

    %@ Page Language="C#" AutoEventWireup="true" CodeFile="def2.aspx.cs" Inherits="def2" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" >
    <head runat="server">
        <title>Untitled Page</title>
        <form id="form1" runat="server">
            <asp:Label ID="Label1" runat="server" Font-Size="XX-Large" Height="59px" Style="z-index: 100;
                left: 322px; position: absolute; top: 95px" Text="this is a test " Width="164px"></asp:Label>

    LVL 60

    Expert Comment

    by:Geert Bormans
    %@ Page Language

    I assume you dropped the "<" in copying the page
    it should be "<%@ Page Language..." if that is not the case

    you can try to set this page to single-file page model for a start

    <%@ Page Language="C#" %>

    I don't think you are using the CodeFiles yet

    then you could set the ContentType in this header, like this

    so your first line should be
    <%@ Page ContentType="text/html" Language="C#" %>

    hope this helps


    Author Comment

    Hi Gertone,
    I finally solve the problem in my compuer by the commands:
    aspnet_regiis  -u  and then  aspnet_regiis -i. so I didn't need the text/html.
    But now I have problems in running in the server.
    I get the error :

    The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'

    In the users of the server do I have to have a user named ASPNET? because I don't have one. Is this the problem?
    And if it is do I have to insert it myself or it has to be entered automatically?
    LVL 60

    Accepted Solution

    > The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access

    well, I have seen this before, but I am not sure what the resolution was.
    The ASP runs as the Network Service, so you have to set write permissions for the Network Service on this temp folder
    You would expect the installer to do this automatically.
    Likely this happened correctly, but general system group permissions might have altered this on reapplying

    Try to set this manually
    if it goes wrong again after some time, you need to look at your general rules

    if this doesn't get resolved with this simple explanation,
    it might be wise to post a question in the ASP or the .net TA


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Any free tool for develop PHP web sites 6 38
    Specific format 21 118
    Grunt No Clean Targets 6 20
    Problem to ToolkitScriptManager 2 6
    Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
    There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now