You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex McLintock <al...@OWAL.co.uk> on 2002/05/01 22:32:23 UTC

XSLT exception: bug or my mistake

Hi folks,

I am getting data from XIndice and piping it through Cocoon. I'm getting an 
exception I don't understand when I do something particular in XSLT.



I have a bunch of book reviews in my XML database and am listing the book 
authors. I'm using the "not preceding" trick to remove duplicate authors. 
This works.

I'm now trying to list the number of reviews we have for each of those 
unique authors.

I'm doing this with two variables - one is the current author fullname, and 
the other is supposed to be the count of reviews with that author. So I'm 
doing this

           <xsl:variable name="thisauthor">
             <xsl:value-of select="fullname"/>
           </xsl:variable>

           <xsl:variable name="numarticles">
             <xsl:value-of select="count(//author[fullname==$thisauthor])"/>
           </xsl:variable>

Now I'm pretty sure I've got this count line wrong, but should it cause the 
following exception?

org.apache.cocoon.ProcessingException: Exception in creating Transform 
Handler: java.lang.RuntimeException: Programmer's assertion in 
getNextStepPos: unknown stepType: -1

If I comment out the count line I don't get the exception.

Any ideas for a relevant tutorial, or can anyone see what I'm doing wrong.



This is the basic structure of the xml I'm processing.

<collection:results>
<collection:result>
<review>
<author>
<fullname>
etc etc


I'm using a CVS build of Cocoon which is several weeks old. Tomcat 
4.0.something, Java 1.3, RedHatLinux 7.2


org.apache.cocoon.ProcessingException: Exception in creating Transform 
Handler: java.lang.RuntimeException: Programmer's assertion in 
getNextStepPos: unknown stepType: -1
at 
org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransformerHandler(XSLTProcessorImpl.java:276)
at 
org.apache.cocoon.transformation.TraxTransformer.setup(TraxTransformer.java:306)
at 
org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:215)
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
at 
org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
at 
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:320)
at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:153)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:156)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:140)
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:144)









Openweb Analysts Ltd, London: Software For Complex Websites 
http://www.OWAL.co.uk/
Free Consultancy for London Companies thinking of Open Source Software.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: XSLT exception: bug or my mistake

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Alex McLintock wrote:
>   <xsl:value-of select="count(//author[fullname==$thisauthor])"/>
Try
     <xsl:value-of select="count(//author[fullname=$thisauthor])"/>
                                                 ^^^^
Remember, XSLT is neither Java nor C. :-)

J.Pietschmann


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: XSLT exception: bug or my mistake

Posted by Conal Tuohy <co...@paradise.net.nz>.
double equal signs in the xpath expression? 

> -----Original Message-----
> From: Alex McLintock [mailto:alex@OWAL.co.uk]
> Sent: Thursday, 2 May 2002 08:32
> To: cocoon-users@xml.apache.org
> Subject: XSLT exception: bug or my mistake
> 
> 
> Hi folks,
> 
> I am getting data from XIndice and piping it through Cocoon. 
> I'm getting an 
> exception I don't understand when I do something particular in XSLT.
> 
> 
> 
> I have a bunch of book reviews in my XML database and am 
> listing the book 
> authors. I'm using the "not preceding" trick to remove 
> duplicate authors. 
> This works.
> 
> I'm now trying to list the number of reviews we have for each 
> of those 
> unique authors.
> 
> I'm doing this with two variables - one is the current author 
> fullname, and 
> the other is supposed to be the count of reviews with that 
> author. So I'm 
> doing this
> 
>            <xsl:variable name="thisauthor">
>              <xsl:value-of select="fullname"/>
>            </xsl:variable>
> 
>            <xsl:variable name="numarticles">
>              <xsl:value-of 
> select="count(//author[fullname==$thisauthor])"/>
>            </xsl:variable>
> 
> Now I'm pretty sure I've got this count line wrong, but 
> should it cause the 
> following exception?
> 
> org.apache.cocoon.ProcessingException: Exception in creating 
> Transform 
> Handler: java.lang.RuntimeException: Programmer's assertion in 
> getNextStepPos: unknown stepType: -1
> 
> If I comment out the count line I don't get the exception.
> 
> Any ideas for a relevant tutorial, or can anyone see what I'm 
> doing wrong.
> 
> 
> 
> This is the basic structure of the xml I'm processing.
> 
> <collection:results>
> <collection:result>
> <review>
> <author>
> <fullname>
> etc etc
> 
> 
> I'm using a CVS build of Cocoon which is several weeks old. Tomcat 
> 4.0.something, Java 1.3, RedHatLinux 7.2
> 
> 
> org.apache.cocoon.ProcessingException: Exception in creating 
> Transform 
> Handler: java.lang.RuntimeException: Programmer's assertion in 
> getNextStepPos: unknown stepType: -1
> at 
> org.apache.cocoon.components.xslt.XSLTProcessorImpl.getTransfo
> rmerHandler(XSLTProcessorImpl.java:276)
> at 
> org.apache.cocoon.transformation.TraxTransformer.setup(TraxTra
> nsformer.java:306)
> at 
> org.apache.cocoon.components.pipeline.AbstractEventPipeline.se
> tupPipeline(AbstractEventPipeline.java:215)
> at 
> org.apache.cocoon.components.pipeline.CachingEventPipeline.set
> up(CachingEventPipeline.java:278)
> at 
> org.apache.cocoon.components.pipeline.CachingEventPipeline.gen
> erateKey(CachingEventPipeline.java:141)
> at 
> org.apache.cocoon.components.pipeline.CachingStreamPipeline.pr
> ocess(CachingStreamPipeline.java:320)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNo
> de.invoke(SerializeNode.java:153)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:85)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PreparableM
> atchNode.invoke(PreparableMatchNode.java:156)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:109)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNod
> e.invoke(PipelineNode.java:140)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProce
> ssingNode.invokeNodes(AbstractParentProcessingNode.java:109)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNo
> de.invoke(PipelinesNode.java:144)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Openweb Analysts Ltd, London: Software For Complex Websites 
> http://www.OWAL.co.uk/
> Free Consultancy for London Companies thinking of Open Source 
> Software.
> 
> 
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>