cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: RTREEFRAG problem
Date Mon, 19 Mar 2001 09:29:57 GMT
Hi!

>
> I'm getting the error "Can not convert #RTREEFRAG to a NodeList!" and I
> cannot figure out what I'm doing wrong.  I've searched the archives of
this
> mailing list and found a similar situation, but I swear my code looks just
> like the person recommended.  I've read all the XSL and XPath docs I can
> find and I can't find anything that suggests I'm doing anything wrong.
I'm
> using Cocoon 1.8.2.  Any help would be greatly appreciated.
>
> Here's my XML:
> <?xml version="1.0"?>
>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet type="text/xsl" href="simple.xsl"?>
>
> <page>
>         <junk>
>                 <one>1</one>
>                 <two>2</two>
>         </junk>
>         <morejunk>
>                 blah
>         </morejunk>
> </page>
>
> And here's simple.xsl:
> <xsl:stylesheet
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   version="1.0"
> >
>
> <xsl:variable name="stored-junk"/>
>
> <xsl:template match="/page">
>         <xsl:variable name="stored-junk" select="junk"/>
>         <xsl:apply-templates select="morejunk"/>
> </xsl:template>
>
> <xsl:template match="morejunk">
>         <html><h1>
>                 <xsl:value-of select="$stored-junk/one"/>
>         </h1></html>
> </xsl:template>
>
> </xsl:stylesheet>

AFAIR, you cannot use variables in XPath expressions, except in predicates.
e.g.:
<xsl:value-of select="$stored-junk/one"/> - will give a n error, but
<xsl:value-of select="one[name(..) = $stored-junk]"/> will work (I didn't
test it)

Also, you are not allowed to specify a top-level variable. Use <xsl:param>
for that.

Please, let me know if this helps.


Regards,
    Konstantin Piroumian.



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message