there is nothing wrong the XSLT itself, so "Errors in XSLT" is not a correct message. But I can't tell you, what the error is.
I "refactored" the stylesheet using templates instead of for-each. If there is a bug in Xalan 2.3.1 (this should be the version used in Cocoon 2.0.4), it will maybe already work. Another suggestion is to update the Xalan version to 2.4.1. This sometimes solves some problems.
Regards,
Joerg
Don Saxton wrote:
Geoff
this pipe works and results in the p1.xml attached. generate type="session-attr" serialize type="xml" result is p1.xml (attached)
Yet this pipe does not generate type="session-attr" transform src="person.xsl" (attached ) serialize type="html" (never gets here) result is this error
Original exception : java.lang.RuntimeException: Errors in XSLT transformation: Fatal: java.lang.NullPointerException
at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3170) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:91) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer .java:575) at org.apache.cocoon.generation.SessionAttributeGenerator.generate(SessionAttri buteGenerator.java:189) at org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEv entPipeline.java:250) at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingS treamPipeline.java:395)
Yet when I test the transform outside of cocoon, the xsl is fine. And if other working xsl are substituted they will produce this same error.
Don
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/"> <HTML> <HEAD> <TITLE>Title</TITLE> </HEAD> <BODY> <xsl:apply-templates select="//person"/> </BODY> </HTML> </xsl:template> <xsl:template match="person"> <h3><xsl:value-of select="@name"/></h3> <i>(id=<xsl:value-of select="@id"/>) <a href="edit/person/[EMAIL PROTECTED]"> edit </a></i> <table border="1" cellspacing="0"> <tr><td>born</td><td><xsl:value-of select="@born"/></td></tr> <xsl:apply-templates select="*[not(self::documentref)]"/> <tr> <td>documents</td> <td> <ul> <xsl:for-each select="documentref"> <li> <a href="[EMAIL PROTECTED]"><xsl:value-of select="@ref"/></a> </li> </xsl:for-each> </ul> </td> </tr> </table> <div align="center"><a href="?list=persons">Back to List</a></div> <b>I need some way to resolve idrefs i.e. get the person's name instead of the id. What is showing here is the text node of the ref element only if it is present.</b> </xsl:template> <xsl:template match="*[personref]"> <tr> <td> <xsl:value-of select="name()"/> <xsl:if test="self::marriage"> <xsl:value-of select="concat(' ', @begin, ' to ', @end)"/> </xsl:if> </td> <td> <ul> <xsl:apply-templates select="personref"/> </ul> </td> </tr> </xsl:template> <xsl:template match="personref"> <li> <a href="[EMAIL PROTECTED]"> <xsl:if test="not(normalize-space())"> <xsl:value-of select="@person"/> </xsl:if> <xsl:value-of select="text()"/> </a> </li> </xsl:template> <xsl:template match="description"> <tr> <td>description</td> <td><xsl:value-of select="text()"/></td> </tr> </xsl:template> </xsl:stylesheet>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]