xsl:import does not work with importStylesheet?

A

alex.iskold

Hi, i am having the following problem:

A style sheet imports another stylesheet:

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:include href="common.template"/>
.....
</xsl:stylesheet>

I try to load this in JavaScript like this:

var doc = load( 'main.template" );
// Load using Mochikit, and i serialze the doc to string to verify
that it loads fine.

var xsltProcessor = new XSLTProcessor();

try {
xsltProcessor.importStylesheet( xsl );
} catch ( e ) {
alert( e );
}

throws exception with errror code: 0x80004005

If i remove import then all is fine.

Is there a way to make this work?

Thanks in advance.

Alex
 
M

Martin Honnen

A style sheet imports another stylesheet:

<xsl:stylesheet version="2.0" ^^^^

I try to load this in JavaScript like this:
var xsltProcessor = new XSLTProcessor();

Note that your stylesheet says version="2.0" which is not so far a W3C
recommendation and which is so far hardly implemented anywhere in
browsers. So I have some doubts that you really want to use XSLT version
2.0 if you want to run transformation with JavaScript in a browser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top