2010-01-20 4 views
1

XSL 변환을 사용하는 Firefox 확장 기능을 개발 중입니다. 내가 XSL 스타일 시트에서 xsl : include해야 할 때까지 문제없이 XSLTProcessor를 사용하고 있습니다. 나는 XSL 스타일 시트에 XSL 사용 가져올 때 : 파이어 폭스 확장에서 코드 을 실행할 때 나는 "정상"에서 실행 경우xsl : Firefox 확장 기능에서 작동하지 않습니다.

Error: Component returned failure code: 0x80600001 [nsIXSLTProcessor.importStylesheet] = Source file: chrome://myextension/content/functions.js Line: 632

이 만, 어떻게 HTML : 포함을, 파이어 폭스 오류를 제공합니다 페이지 코드가 완벽하게 작동합니다. xsl : import를 사용하여 을 시도했으며 같은 결과를 얻었습니다. 나 또한 chrome:\\myextension\content\xsl\test2.xsl 같은 절대 URI를 시도하고 같은 오류가 발생합니다.

내가 뭘 잘못하고 있는지 알 수 있습니까?

파일을 functions.js :

function testXSL(){ 
     var processor = new XSLTProcessor(); 
     var xsl = document.implementation.createDocument("", "test", null); 
     xsl.addEventListener("load", onXSLLoaded, false); 

     xsl.load("test1.xsl"); 
     function onXSLLoaded() { 
      processor.importStylesheet(xsl); 
     } 
} 

파일 test1.xsl :

을 여기

사전

감사 (모든 파일이 동일한 폴더에있는)을 재현하기 위해 코드를 간다
<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet version="1.0" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
       xmlns:xlink="http://www.w3.org/1999/xlink"> 

<xsl:include href="test2.xsl" /> 

</xsl:stylesheet> 

파일 test2.xsl :

<?xml version="1.0" encoding="utf-8"?> 
<xsl:stylesheet version="1.0" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
       xmlns:xlink="http://www.w3.org/1999/xlink"> 

    <xsl:template match="/"> 
       <h1>Included!!</h1> 
     </xsl:template> 

</xsl:stylesheet> 

답변

1

Firefox 회귀 버그 인 것 같습니다. 나는 this one on Mozilla bugzilla을 발견했다. 버그가 패치되지 않는 한 아무도 당신을 도울 수 없을 것 같아요. 그리고 그 냄새는 좋지 않습니다 ... 2 년 전만해도 6 개월이 지나서야 업데이트됩니다.

+0

감사합니다. 게시하기 전에 bugzilla를 확인 했어야합니다. 버그가 주목 받기를 바랍니다. – amercader

관련 문제