2016-08-26 9 views
1

크롬은 내 XML 파일을 스타일 시트와 함께로드하지 않으므로 이유가 없습니다. Firefox는 잘로드하지만 크롬에 문제가있는 것 같습니다. XML을로드 한 다음 스타일 시트를 개별적으로로드하면 오류는 발생하지 않지만 링크되어 있으면 빈 화면이 표시됩니다. 로컬 파일에서로드 할 때 크롬에 문제가 있지만 스타일 시트가 공용 드롭 상자에 저장된다는 것을 알고 있습니다. 또한 누군가가 묻기 전에 XML 문서는 이익을 위해 마약을 사고 파는 게임에 의해 생성됩니다. https://dl.dropboxusercontent.com/u/61439040/style.xsl내 XML 및 XSLT 스타일 시트가 Chrome에로드되지 않는 이유는 무엇입니까?

<?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> 
+0

브라우저는 기본 보안 정책이 다릅니다. 일반적으로 HTTP 연결이 아닌 로컬 시스템 파일 저장소에서 항목을로드하려는 경우 이에 따라 브라우저를 구성해야합니다. HTTP를 사용하면 일반적으로 로컬 파일에 액세스 할 때조차도 간단한 웹 서버를 설정하여 액세스 할 수 있습니다. –

+0

위의 코드에서 HTTP로로드했습니다. 아직도 작동하지 않습니다./ –

+0

그러면 죄송합니다. 잘 모르겠습니다. –

답변

1

이 일어나고있는 이유는 여기에 설명 :

How can I make XSLT work in chrome?은 내가 몇 년 전에 같은 문제가 있었다

당신은 여기에 스타일 시트를 볼 수 있습니다. '--allow-file-access-from-files'플래그로 크롬을 실행하면 원하는 결과를 얻을 수 있습니다.