Re: [xsl] xalan error with plain text

Subject: Re: [xsl] xalan error with plain text
From: Christian Roth <roth@xxxxxxxxxxxxxx>
Date: Sat, 12 Jan 2002 16:15:29 +0100
Hi Michael,

><xsl:stylesheet version="1.0" 
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>   <xsl:output method="text" />
>
>   <xsl:template match="document">
>     <xsl:apply-templates />
>   </xsl:template>
>
>   <xsl:template match="title">
>     <xsl:value-of select="." />
>   </xsl:template>
>
></xsl:stylesheet>

I don't know about the exception, but I think you do not have a template
for the document root. So, you should at least add

<xsl:template match="/">
    <xsl:apply-templates />
</xsl:template>

This is what cost me some time to figure out: <document /> is not the
document root, but the one and only child of the document root. And it's
the document root where the processor starts to work.

HTH, Christian.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread