Re: Exception during importStylesheet()
Marco Baumgartl <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Message-ID | <[email protected]> |
Peter Van der Beken wrote:
> Wrong namespace (should be http://www.w3.org/1999/XSL/Transform).
What a silly mistake :-( Thank you!
With your help I continued to transform the document using:
var fragment = processor.transformToFragment(xmlDoc, document);
The result of the transformation is than appended to a html element:
var div = document.getElementById("output");
div.append(fragment);
Unfortunately this only gives me the two text nodes "item 1 item 2" in
my div element.
Here is my stylesheet:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="itemizedlist">
<ul>
<xsl:apply-templates />
</ul>
</xsl:template>
<xsl:template match="listitem">
<li>
<xsl:apply-templates />
</li>
</xsl:template>
</xsl:transform>
And this is the xml file I'm trying to transform:
<?xml version="1.0" encoding="iso-8859-1"?>
<itemizedlist>
<listitem>item 1</listitem>
<listitem>item 2</listitem>
</itemizedlist>
The expected result should be:
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
If I transform the source document using my style sheet and the Saxon
XSLT processor, I get the expected result.
It seems to me that no template rule is applied and just the text nodes
are copied from source to destination document. I think this is the
default behavior if the style sheet is empty, isn't it?
Can you give me an advice on more time, please?
regards
Marco