Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion xsl:include not working from a Firefox extension

Path: g2news1.google.com!postnews.google.com!b2g2000yqi.googlegroups.com!not-for-mail
From: =?ISO-8859-1?Q?Adri=E0?= <amercad...@gmail.com>
Newsgroups: mozilla.dev.tech.xslt
Subject: xsl:include not working from a Firefox extension
Date: Fri, 15 Jan 2010 07:38:21 -0800 (PST)
Organization: http://groups.google.com
Lines: 64
Message-ID: <d32d5d8e-2c78-4d27-a25a-c77e2c5e25ba@b2g2000yqi.googlegroups.com>
NNTP-Posting-Host: 89.6.11.58
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1263569901 13839 127.0.0.1 (15 Jan 2010 15:38:21 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 15 Jan 2010 15:38:21 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: b2g2000yqi.googlegroups.com; posting-host=89.6.11.58; 
	posting-account=haAZPwoAAADArSoZsmg3nQ4mx2zCLjGV
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ca; rv:1.9.1.7) 
	Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)

Hi everyone,
I am developing a Firefox extension that uses XSL transformations. I
have been using XSLTProcessor without problems until I needed to do an
xsl:include from the XSL stylesheet. When I import the XSL stylesheet
that uses an xsl:include, Firefox gives an error:

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

This only happens when running the code from the Firefox extension, if
I run it in "normal" html page the code works perfectly. I also tried
with xsl:import and got the same result.

Does anyone know what could I be doing wrong?
Thanks in advance


Here is the code to reproduce it:

File 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);

	}

}

File 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>


File 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>