1

Chrome wont load my XML file with the style sheet and I have no idea why! Firefox loads it fine but chrome seems to have problems. Loading the XML and then the Stylesheet individually seems to work fine (no errors) but when they are linked I get a blank screen. I know chrome has issues when loading from local files but the style sheet is stored in my public drop box. Also before anyone asks, the XML documents are being generated by a game where you buy/sell drugs for a profit.

You can see the Stylesheet here: https://dl.dropboxusercontent.com/u/61439040/style.xsl

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://dl.dropboxusercontent.com/u/61439040/style.xsl"?>
<game>
   <DAY>
      <playerstats>
         <day>1</day>
         <cash>500</cash>
         <health>100</health>
         <rank>1</rank>
      </playerstats>
      <dailynotifications>
         <item>You have decided to start your own drug dealing business.</item>
         <item>But with no money Tuco has managed to spot you 500. But owing him money? Thats bad...</item>
         <item>Tuco has given you 10 days to pay him back his money plus intrest</item>
      </dailynotifications>
      <invs>
         <drug>
            <player />
            <store>
               <item>
                  <name>Weed</name>
                  <price>41</price>
                  <quantity>38</quantity>
               </item>
               <item>
                  <name>Heroin</name>
                  <price>52</price>
                  <quantity>8</quantity>
               </item>
               <item>
                  <name>Meth</name>
                  <price>195</price>
                  <quantity>141</quantity>
               </item>
               <item>
                  <name>Sky Blue</name>
                  <price>1109</price>
                  <quantity>2241</quantity>
               </item>
               <item>
                  <name>Steroids</name>
                  <price>51</price>
                  <quantity>52</quantity>
               </item>
               <item>
                  <name>Mushrooms</name>
                  <price>28</price>
                  <quantity>36</quantity>
               </item>
            </store>
         </drug>
         <upgrade>
            <player />
         </upgrade>
      </invs>
   </DAY>
</game>
rpax
  • 4,468
  • 7
  • 33
  • 57
Liam Ure
  • 13
  • 5
  • The browsers vary in their default security policies. Generally, if you are trying to load stuff from local machine filestore rather than from an HTTP connection, you will need to configure the browser accordingly. Using HTTP is generally simpler, even when accessing local files it's easy enough to set up a little web server to access them. – Michael Kay Aug 26 '16 at 21:08
  • I have it loading from a HTTP in the code above. It still doesnt work :/ – Liam Ure Aug 26 '16 at 21:23
  • Then sorry, I don't know. – Michael Kay Aug 26 '16 at 21:36

1 Answers1

1

The reason this is happening is explained here: How can I make XSLT work in chrome?

I had the same problem a several years ago. If you launch chrome with the flag '--allow-file-access-from-files' it should give the desired result.

Community
  • 1
  • 1
madl
  • 11
  • 1