skip to Main Content

I have an XML file and associated XSLT file. When I want to open it with Chrome or Edge it says :"This XML file does not appear to have any style information associated with it. The document tree is shown below.". I would like to see the rendered file (like a classical html file). How do I proceed ? This XML file is a documentation file from a project in MS Visual Studio.

I tried to open the XML file with Chrome and Edge, and got the message : This XML file does not appear to have any style information associated with it. The document tree is shown below.

2

Answers


  1. You need to open it from a http server.

    I usually use "python -m http.server 8000" in a terminal in the folder with the files.

    Then open "localhost:8000" in the browser and open the xml file.

    Login or Signup to reply.
  2. The XML document needs to reference the XSLT with e.g. <?xml-stylesheet type="text/xsl" href="file.xsl"?> before the root element of the XML document. Furthermore, these days, for security restrictions in browsers, you need to load the XML document over HTTP(S), loading from the file system and referencing/loading an XSLT is no longer supported.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search