Re: [xsl] xsl:attribute vs "expected comment or PI"?

Subject: Re: [xsl] xsl:attribute vs "expected comment or PI"?
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Sun, 22 Jan 2006 15:35:38 +0000
On 1/22/06, Eric Scheid <eric.scheid@xxxxxxxxxxxxxxx> wrote:
> I'm baffled. Why is this not working? The error I'm getting is "expected
> comment or processing instruction". The problem is somewhere within the
> second xsl:attribute ... if I take it out, no error. I've tried switching
> the two xsl:attributes around, I've tried jamming it all onto one line,
I've
> tried taking the other xsl:attribute out ... no luck.
>
> <xsl:template match="fmp:FMPXMLRESULT">
> <ul>
> <xsl:for-each select="fmp:RESULTSET/fmp:ROW">
>  <li>
>   <a>
>    <xsl:attribute name="href">authors-<xsl:value-of
> select="fmp:COL[1]/fmp:DATA[1]"/>.html</xsl:attribute>
>    <xsl:attribute name="title">
>     <xsl:value-of select="fmp:COL[2]/fmp:DATA[1]"/> author
>     <xsl:if test="fmp:COL[2]/fmp:DATA[1]!='1'">s</xsl:if>,
>     <xsl:value-of select="fmp:COL[3]/fmp:DATA[1]"/> article
>     <xsl:if test="fmp:COL[3]/fmp:DATA[1]!='1'">s</xsl:if>
>    </xsl:attribute>
>    <xsl:value-of select="fmp:COL[2]/fmp:DATA[1]"/></a></li>
> </xsl:for-each>
> </ul>
> </xsl:template>

There's nothing that should cause an error with the code you've
posted, maybe try and separate it out into a small complete stylesheet
and post that (along with details about the processor you are using)

Current Thread