cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nils Kaiser (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-831) XSLTC doesn't work with nodeset functions
Date Mon, 17 Jul 2006 10:19:15 GMT
    [ http://issues.apache.org/jira/browse/COCOON-831?page=comments#action_12421572 ] 
            
Nils Kaiser commented on COCOON-831:
------------------------------------

The NullPointerException still occurs with cocoon 2.1.8. I tested it under 1.4.2_08 and 1.5.0_05)


Here the xsl I used to test the nodeset function:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:variable name="rtf">
		<docelem>
		  <elem1>elem1</elem1>
		  <elem2>elem2</elem2>
		</docelem>
  </xsl:variable>
	
	<xsl:template match="/">
		<xsl:value-of select="nodeset($rtf)/docelem/elem1"/>
	</xsl:template>
	
</xsl:stylesheet>

The TraxTransformer from cocoon does not give any useful stacktrace (I removed the sitemap
exception):

...
Caused by: org.apache.commons.lang.exception.NestableRuntimeException: javax.xml.transform.TransformerException
	at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:603)
	at org.apache.cocoon.generation.ProfilerGenerator.generate(ProfilerGenerator.java:179)
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:578)
	... 39 more
Caused by: javax.xml.transform.TransformerException
	at org.apache.xalan.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:693)
	at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:636)
	at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:301)
	at org.apache.xalan.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:238)
	at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:55)
	at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:585)
	... 41 more


We also have a custom xslt transformer which uses the excalibur XsltProcessorImpl also used
by TraxTransformer, and this gives us a more useful stacktrace (I removed the sitemap exception):

...
Caused by: javax.xml.transform.TransformerException: java.lang.NullPointerException
        at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:637)
        at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:301)
        at org.apache.xalan.xsltc.trax.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:238)
        ... 71 more
Caused by: java.lang.NullPointerException
        at org.apache.xalan.xsltc.dom.MultiDOM$AxisIterator.setStartNode(MultiDOM.java:96)
        at org.apache.xalan.xsltc.dom.StepIterator.setStartNode(StepIterator.java:91)
        at org.apache.xalan.xsltc.dom.StepIterator.setStartNode(StepIterator.java:95)
        at org.apache.xalan.xsltc.dom.DupFilterIterator.setStartNode(DupFilterIterator.java:93)
        at nodeset.applyTemplates()
        at nodeset.transform()
        at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:593)
        at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:630)
        ... 73 more



> XSLTC doesn't work with nodeset functions
> -----------------------------------------
>
>                 Key: COCOON-831
>                 URL: http://issues.apache.org/jira/browse/COCOON-831
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Components: Sitemap
>    Affects Versions: 2.1
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Peter Broschwitz
>         Assigned To: Cocoon Developers Team
>
> we are using cocoon 2.1 with xsltc (version 1.4, xalan 2.5.0) as default
> transformer. Now we want to use the xalan or exslt nodeset function, but
> this is only possible with xalan xslt.
> For testing purposes we tried a simple nodeset transformation from the
> command line. We did that with the same libraries as cocoon, like:
> 	$>java -Djava.endorsed.dirs=<path/to/endorsed/directory>
> org.apache.xalan.xsltc.cmdline.Transform -x node-set-test.xml node_set_test
> That way, the transformation succeeds. (Compilation before suceeded also, of
> course.)
> Trying to process this stylesheet within the cocoon pipeline throws a null
> pointer exception without any entries in the cocoon-log-files. Changing to
> xalan-xslt the transformation works without any problems.
> The stylesheet we used is from the xsltc-documentation:
> ==============================================
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:xsltc-extension="http://xml.apache.org/xalan/xsltc"
>   xmlns:xalan="http://xml.apache.org/xalan"
>   xmlns:exslt="http://exslt.org/common"
>   version="1.0">
>   <xsl:template match="/">
>     <xsl:variable name="rtf">
>       <docelem>
>         <elem1>elem1 gefunden!</elem1>
>         <elem2>elem2 gefunden!</elem2>
>       </docelem>
>     </xsl:variable>
>     <!-- Use nodeset as an XSLTC extension function -->
>     <xsl:value-of select="xsltc-extension:nodeset($rtf)/docelem/elem1"/>
>     <!-- Use nodeset as a Xalan-Java extension function -->
>     <xsl:value-of select="xalan:nodeset($rtf)/docelem/elem1"/>
>     <!-- Use nodeset as an EXSLT extension function -->
>     <xsl:value-of select="exslt:node-set($rtf)/docelem/elem1"/>
>     <!-- Use nodeset as standard function -->
>     <xsl:value-of select="nodeset($rtf)/docelem/elem1"/>
>   </xsl:template>
> </xsl:stylesheet>
> ==============================================
> I should add, that none of these nodeset-functions worked, i tested every one 
> of his one and commented out the others.
> I posted this message already to the cocoon-user-list, and this behaviour could 
> be reproduced by others.
> Peter

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message