cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Nappez" <...@natika.com>
Subject NullPointerException in org.apache.cocoon.serialization.AbstractTextSerializer
Date Mon, 04 Feb 2002 18:11:32 GMT
	I'm using Cocoon 2.0.1 with Tomcat 4.0.1 and JDK1.3.1 on Windows.

	I've got the following exception :
FATAL_E (2002-02-04) 19:08.12:218   [core.xslt-processor] (/cocoon/test.xml)
HttpProcessor[8080][4]/TraxErrorHandler: Error in TraxTransformer:
javax.xml.transform.TransformerException: java.lang.NullPointerException
javax.xml.transform.TransformerException: java.lang.NullPointerException
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
725)
	at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:420)
	at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:226)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
	at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2012)
	at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1175)
	at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3139)
	at java.lang.Thread.run(Thread.java:484)
---------
java.lang.NullPointerException
	at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.j
ava:868)
	at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandle
r.java:952)
	at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:306)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
716)
	at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:420)
	at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:226)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
	at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2012)
	at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1175)
	at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3139)
	at java.lang.Thread.run(Thread.java:484)
---------
java.lang.NullPointerException
	at
org.apache.cocoon.serialization.AbstractTextSerializer$NamespaceAsAttributes
.startElement(AbstractTextSerializer.java:386)
	at
org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:88)
	at
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.j
ava:858)
	at
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandle
r.java:952)
	at
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.
java:306)
	at
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:
716)
	at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApp
lyTemplates.java:420)
	at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.jav
a:226)
	at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Transform
erImpl.java:2186)
	at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Transformer
Impl.java:2012)
	at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.j
ava:1175)
	at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3139)
	at java.lang.Thread.run(Thread.java:484)


	This exception is thrown because the variable uri
(AbstractTextSerializer.java:386) is null.

	The concerned part of the sitemap is :
			<map:match pattern="test.xml">
				<map:generate src="test.xml"/>
				<map:transform src="test.xsl"/>
				<map:serialize type="xml"/>
			</map:match>

	The xml source is :
<?xml version="1.0"?>
<chart>
	<entry label="A" value="190" />
	<entry label="B" value="153" />
	<entry label="C" value="148" />
	<entry label="D" value="582" />
</chart>

	And the xslt is :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:math="http://xml.apache.org/xslt/java"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				exclude-result-prefixes="math">
	<xsl:output doctype-public="-//W3C//DTD SVG 1.0//EN"

doctype-system="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
	            indent="yes" />
	<xsl:template match="chart">
		<svg xmlns="http://www.w3.org/2000/svg"
			width="100"
			height="100">
			<g>
				<rect x="0" y="0" width="99" height="99" />
				<g transform="translate(10,10)">
	 				<g transform="translate(0,10)">
						<g 	transform="translate(10,0)">
							<xsl:apply-templates />
						</g>
					</g>
				</g>
			</g>
		</svg>
	</xsl:template>
	<xsl:template match="entry">
		<rect x="1" y="1" height="10" width="10" />
		<g transform="translate(10,20)" stroke="none">
			<text x="0" y="0" transform="rotate(45)">
				<xsl:value-of select="@label"/>
			</text>
		</g>
	</xsl:template>
</xsl:stylesheet>

	Thank you for your help.

Thomas Nappez


---------------------------------------------------------------------
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