1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

How to display XML on IE8

Discussion in 'Internet Explorer & Microsoft Edge' started by JAOU, 2010/11/01.

  1. 2010/11/01
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    Can someone show me a working example of how to display an XML on IE8? I don't mind what method you use, so long as it works. I copied a Javascript from the W3c school, but it does not work; I've had "Invalid Argument ", "Access is Denied ", "Invalid Syntax" and I have spent the last 4 days reading just about every advise on the web, but still can't get this to work. I need to point out that I am new to the PC computing arena - my background is IBM AS/400, iSeries, Power. So, when replying to me, don't assume that I know PC's - I don't. Thank you in advance.
     
    JAOU,
    #1
  2. 2010/11/01
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,896
    Likes Received:
    389
    To open a .xml file all you need to do is double click on it and it will open in IE8. Attached is a .xml file to try - because of the BBS software restrictions on attachment extensions it has been renamed .txt. After downloading rename to .xml and double click on it.

    If your .xml file is giving errors it may be corrupted.
     

    Attached Files:


  3. to hide this advert.

  4. 2010/11/02
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    I downloaded the object (to main.xml) and did as you say. When I double clicked on it, I saw the raw xml code - just like using NotePad. I was expecting a visual display of colourful and presentable information - not a dump of a data on the screen.
     
    JAOU,
    #3
  5. 2010/11/02
    PeteC

    PeteC SuperGeek Staff

    Joined:
    2002/05/10
    Messages:
    28,896
    Likes Received:
    389
    XML is similar in many respects to HTML - see XML

    AFAIK - and XML is outside of my league - what you saw is all that you will see.
     
  6. 2010/11/02
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    Thanks anyway PeteC.

    ok, the problem is still unresolved.

    If we assume the XML is the database, then what program do you use to display it?

    The example I copied from W3C was a JavaScript, but as I said, I came across a multitiude of technical problems.

    Any ideas anyone?
     
    JAOU,
    #5
  7. 2010/11/02
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    You don't, XML doesn't DO anything by itself, but you can view & edit the XML in any text editor as it's just a text file.. XML was designed to transport and store data. HTML was designed to display data.

    XML is never really a database, but it can store information. XML is used as a means of accessing or formatting data that may be in a database, or an XML file can be used to hold other types of stored data.

    Applications can use XML. XML can be used to hold application settings, interface settings, preferences, etc. These things can be stored in an XML file which is checked when the application is started.

    see http://www.w3schools.com/xml/xml_whatis.asp
     
    Last edited: 2010/11/02
  8. 2010/11/02
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    Thank you TonyT. I guess we are at cross purposes. Let me start again.

    I have an XML and I wish to display the data within using JavaScript.

    Sadly, JavaScript has endless issues with my IE8.

    1) Is there another method to display the data other than JavaScript?

    OR

    2) Is there a JavaScript that works?

    In both cases, a working example please.

    Thanks
     
    JAOU,
    #7
  9. 2010/11/02
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
  10. 2010/11/03
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    I'm sorry to say, but this is the same code that's been giving me a hard time. I copied this from W3C over a week ago. It does not work on IE8. Can you get it to work on IE8? or is there an alternate method to display the data.
     
    JAOU,
    #9
  11. 2010/11/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Works in IE8 just fine. What do you see in the right frame? You should see a table.
    http://www.w3schools.com/xml/tryit.asp?filename=tryxml_display_table
     
  12. 2010/11/03
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    I have 2 objects on my machine. Both copied from W3C. One is the html and the other is the xml. It may work on W3C, but when I click the html, I get one IE8 exception error after another - as I mentioned earlier in this thread. The requirement I have is to get this working on my computer, not on the W3C site.
     
  13. 2010/11/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Yes or No question:
    What do you see in the right frame? You should see a table.
    http://www.w3schools.com/xml/tryit.asp?filename=tryxml_display_table

    It won't work locally for 2 reasons:

    XMLHttpRequest is a function that requires the existence of a Web server.
    MS introduced into IE something called Local Machine Lockdown which prevents the execution of scripts in local documents (cached Internet files and Web development files)

    Possible solutions are:
    Use a real Web server with an actual fully qualified domain name.
    Use IE Mark of the Web
    Use different javascript
    Use Firefox (works)

    Also:
    IE8 does not fully support XML yet. IE9 does, but is still in beta, stay away from it presently.
     
    Last edited: 2010/11/03
    Admin. likes this.
  14. 2010/11/03
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    You're not being helpful and you appear not to undestand my requirements.
     
  15. 2010/11/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Huh?

    From what I gather, you want to be able to load a local html file (saved on your computer) and have its javascript load the XML data in the local XML file (saved on your computer).

    My previous post explains why you cannot do that in Internet Explorer and also I provided links that explain why it cannot be done UNLESS you try some of the possible solutions.

    XML is designed to be loaded FROM a Web server, not from a file you created and store locally on your computer. At least the javascript in the above example is for loading XML data that exists in an XML file on a Web server.

    You will have to use different javascript functions to get local XML data rendered in Internet Explorer. And even then you will have difficulties due to Internet Explorer classifying XML files as Active Content. These are security "features" built into Internet Explorer.

    Though they are really not features, they are in place because Internet Explorer's inherent weaknesses can be used to exploit the local file system by malicious Web sites.

    I am NOT going to sit down and write the javascript you need to use. You can find that info using Google.

    Getting Active Content to run locally in Internet Explorer (any version after IE6) is a task that can take hours of testing and debugging, and goes far beyond the purposes of this forum.

    Firefox does not hove those "security features" like IE does and so will render the XML content readily. This is because Firefox is not tied into the operating system like IE is so tied.
     
    Last edited: 2010/11/03
    Admin. likes this.
  16. 2010/11/03
    JAOU

    JAOU Inactive Thread Starter

    Joined:
    2010/10/31
    Messages:
    8
    Likes Received:
    0
    I thank you for all you have done.

    May I suggest we put aside xml, javascript, IE8 and let me ask my question another way.

    How do you take locally stored data and display the information on a browser in a formatted rich colour presentation?

    I have installed Firefox, because I have grown extremely tired of IE8.
     
  17. 2010/11/03
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    It depends upon where the locally stored data is.

    For example, the data can be stored directly in the html file itself and the browser will display it.

    If the data is not already in the html file then it has to somehow get written to the html file "on the fly ". This is done using some type of programming language such as java or javascript. Or for data stored on a Web server other languages can be used, such as perl, php, etc.

    The above w3schools example works in Firefox when both the html and xml files are on the local computer.

    Maybe if you stated exactly what you want to accomplish, in detail, your problem could get remedied faster.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.