XSL Problems

"Leon Bezuidenhout" <[email protected]> Fri, 29 Dec 2006 08:49:51 +0200
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
Hi,

I am trying to transform a docuemnt using XSL, but keep getting an error:

[Exception... "Component returns failure code: 0x80600001 
[nsIXSLTProcess.importStyleSheet]"
nsresult: "0x80600001 (<unkown>)" location: "JS frame ::
http://devmac1/csp/samples/wab/htmlcontrols/commonxml.js :: anonymous :: 
line 49" data: no]

My code looks as follows:

var processor = new XSLTProcessor();
processor.importStylesheet(stylesheet);

And my style sheet looks like htis:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <root>
      <xsl:apply-templates select="/*/*"/>
    </root>
  </xsl:template>
  <xsl:template match="*/*">
    <Record>
      <xsl:attribute name="RecordNo">
        <xsl:value-of select="@rn"/>
      </xsl:attribute>
      <xsl:for-each id="foreach" select="node()">
        <choose xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <when xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
test=".[nodeName() = 'f1']">
            <customerid>
              <value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
            </customerid>
          </when>
          <when xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
test=".[nodeName() = 'f2']">
            <companyname>
              <value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
            </companyname>
          </when>
        </choose>
      </xsl:for-each>
    </Record>
  </xsl:template>
</xsl:transform>

Thanks,
Leon