Re: XSL Problems

"Nickolay Ponomarev" <[email protected]> Fri, 29 Dec 2006 15:10:50 +0300
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
On 12/29/06, Leon Bezuidenhout <[email protected]> wrote:
> [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]
>
That's NS_ERROR_XSLT_PARSE_FAILURE (see
http://silver.warwickcompsoc.co.uk/mozilla/misc/nserror). Did you
check that your
stylesheet is correct?

It seems to me that you have a "<choose" element without a namespace.

And iirc, you need a select="" attribute on <value-of/> (after putting
that into right namespace too). I don't remember much about XSLT.

Nickolay

> 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
>
>
> _______________________________________________
> dev-tech-xml mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-xml
>