[RESOLVED] XML page cannot be displayed. Cannot view XML input using style sheet.-VBForums
Results 1 to 10 of 10

Thread: [RESOLVED] XML page cannot be displayed. Cannot view XML input using style sheet.

  1. #1

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Resolved [RESOLVED] XML page cannot be displayed. Cannot view XML input using style sheet.

    I'm new to XML. If I try to view an XML file that is on my website or on my computer drive I see this :

    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.

    If I try to change Style under Page in IE8 I just have two options. Default Style is selected and the other option is No Style. Selecting No Style doesn't do anything. Not sure of how much of a problem this is because when I viewing an XML file on my computer I see the contents of the file.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    could you post the contents of the XML file? which browser are you using?

  3. #3

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    I had FireFox on Vista but have been working in Windows 7. I just installed FireFox in Windows 7 and if I view the XML file from that I don't see the error that I saw in IE8. This is what I do see from FireFox.


    Code:
    
    XML Parsing Error: syntax error
    Location: file:///K:/Users/Paul/Documents/XML%20Files/Test%20File.xml
    Line Number 1, Column 1:
    
    This is to test.
    ^
    That's an XML file that I created myself using this code but maybe I should do something differently.

    Code:
         Dim PerScrnsData As StreamWriter
            PerScrnsData = New StreamWriter(PathToXMLFile, False, Encoding.Unicode) '
            StringForXMLFile = "This is to test."
            PerScrnsData.Write(StringForXMLFile)
            PerScrnsData.Close()
    I was using that code to create text files and I just basically changed the end to .xml Is that how I should do it?
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  4. #4

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    If I go to the ftp root for my website and view a page in FireFox it looks like this.

    Code:
    XML Parsing Error: not well-formed
    Location: ftp://ftp.taylorentertainment.biz/SiteLayout.aspx
    Line Number 1, Column 2:<&#37;@ Page Language="VB" AutoEventWireup="false" CodeFile="SiteLayout.aspx.vb" Inherits="SiteLayout" %>
    -^
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  5. #5

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    Accidental double post.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  6. #6
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    err, well, just having a file extension of XML with a string of text inside of it does not make it an XML file. however, I was asking for the source of the XML file, not what you see in your browser.

    an example of a well-formed XML file might look like this:
    Code:
    <?xml version="1.0"?>
    
    <parent>
      <child attribute="value" />
    </parent>
    I would also suggest you look up XML for more information, or check the W3C's website.

  7. #7

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    Ok Thanks for your reply. I thought that XML files might be a good alternate way for storing something that you might store in a text file. It says in that wikipedia article, "XML’s design goals emphasize simplicity, generality, and usability over the Internet." That's not what I'm really concerned with so I should probably just leave XML alone, at least for now but as for the error I'm getting I'll try to get the contents of the XML file and then post again. I would still like to be able to see those pages as they are supposed to be displayed.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  8. #8

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    You said you were asking for the source of the XML file. Whatever the source is I get the same message in IE8 which I posted in post #1. When I go to the FTP root for my website and then view it in Windows Explorer if I then double click on any one of my websites pages like for instance Home.aspx I will always get that message. Even if I'm trying to open the improperly created XML file that I created and is on my K drive on my computer I still get the message so I don't think it has to do with the source or contents of the XML file.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

  9. #9
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    .. I don't think you get it. the browser won't display an XML file that isn't well formed, which means you can't just keep creating XML files that are not well formed and expect them to display. furthermore, if you know nothing about XML, why would you be trying to display those files? XML can be used for storing data, but if you're just trying to store a string of text you could just as easily use a text file instead (which would probably suit your purposes more).

    this bit of code that you posted:
    Code:
            Dim PerScrnsData As StreamWriter
            PerScrnsData = New StreamWriter(PathToXMLFile, False, Encoding.Unicode) '
            StringForXMLFile = "This is to test."
            PerScrnsData.Write(StringForXMLFile)
            PerScrnsData.Close()
    says to me that you are trying to write to an XML file the following: "This is to test." if this XML file only had this text in it, it would not be properly formed. XML is a tag-based mark-up language (as demonstrated in my first post showing an example of a well-formed XML document), and further illustrated in the Wikipedia page for XML.

    I still don't know what you're trying to do, but you probably shouldn't be trying to make XML files in this case.

  10. #10

    Thread Starter
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: XML page cannot be displayed. Cannot view XML input using style sheet.

    I'm just trying to get the page to display without the error. That's all. I'll abandon trying to create XML files of my own at this time. The aspx pages on my website were created using Visual Web Developer 2008 Standard and everything on my site works just fine so I don't think that there's an error in the pages. I get that same 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.

    whether I'm trying to view one of my erroneously created XML files or the aspx pages on my website.
    I'm not going to worry about this problem anyway right now though so I'll just mark this thread resolved. As you said why would I be trying to display those files? I don't need to see them so I'm not going to worry about the message.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.