cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject [C2][PATCH] Showstopper: Error in Content Aggregation code!
Date Tue, 15 May 2001 13:59:34 GMT
Hi Everybody,

Whant to bring attention to the problem I found couple of days ago:

There is one reproducible error in content aggregation code,
and I was able to reproduce this error using stock C2 files.

Here is sitemap snippet to reproduce the problem:
(this is a modification of existing news aggregation sample,
the only change is an extra transformation step)
--------------------8<-----------------------------
   <map:match pattern="slashdot/slashdot.xml">
    <map:generate src="http://www.slashdot.org/slashdot.xml"/>
    <map:transform src="stylesheets/news/slashdot.xsl"/>
    <map:transform src="stylesheets/fragment-extractor.xsl"/>
    <map:serialize/>
   </map:match>
   <map:match pattern="moreover/moreover.xml">
    <map:generate src="http://www.moreover.com/cgi-local/page?o=xml&amp;c=Developer%20news"/>
    <map:transform src="stylesheets/news/moreover.xsl"/>
    <map:transform src="stylesheets/fragment-extractor.xsl"/>
    <map:serialize/>
   </map:match>
   <map:match pattern="isyndicate/news.xml">
    <map:generate src="http://headlines.isyndicate.com/pages/cui/news.xml"/>
    <map:transform src="stylesheets/news/isyndicate.xsl"/>
    <map:transform src="stylesheets/fragment-extractor.xsl"/>
    <map:serialize/>
   </map:match>
--------------------8<-----------------------------


Here is from console window after hitting this pipeline:
(three times, for every extra transformation step)
--------------------8<-----------------------------
javax.xml.transform.TransformerException
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1242)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
        at java.lang.Thread.run(Thread.java:484)
---------
java.lang.NullPointerException
        at org.apache.cocoon.sitemap.ContentAggregator.startElement(ContentAggregator.java:360)
        at org.apache.cocoon.components.sax.XMLTeePipe.startElement(XMLTeePipe.java:98)
        at org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:90)
        at org.apache.cocoon.components.saxconnector.CIncludeSAXConnector.startElement(CIncludeSAXConnector.java:94)
        at org.apache.xalan.transformer.QueuedStartElement.flush(QueuedStartElement.java:357)
        at org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:770)
        at org.apache.xalan.transformer.ResultTreeHandler.startElement(ResultTreeHandler.java:241)
        at org.apache.xalan.transformer.ClonerToResultTree.cloneToResultTree(ClonerToResultTree.java:215)
        at org.apache.xalan.transformer.ResultTreeHandler.cloneToResultTree(ResultTreeHandler.java:819)
        at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:145)
        at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:498)
        at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2202)
        at org.apache.xalan.templates.ElemCopy.execute(ElemCopy.java:151)
        at org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:498)
        at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2202)
        at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2085)
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1219)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:2942)
        at java.lang.Thread.run(Thread.java:484)
--------------------8<-----------------------------

This is the resulting page:
--------------------8<-----------------------------
<HTML xmlns:ns3="http://foo.bar.com/isyndicate" xmlns:ns2="http://foo.bar.com/moreover"
xmlns:ns1="http://foo.bar.com/slashdot">
<BODY>
<page xmlns="http://foo.bar.com/myspace">
<slashdot xmlns="http://foo.bar.com/slashdot"/>
<moreover xmlns="http://foo.bar.com/moreover"/>
<isyndicate xmlns="http://foo.bar.com/isyndicate"/>
</page>
</BODY>
</HTML>
--------------------8<-----------------------------

If anyone wants to see it, Cocoon's log file is attached. But it
have no errors at all.


I'm not sure how this should be fixed, but I managed
to fix it with the attached patch. Content aggregation
and namespace experts should check is this correct patch
or not.


--
Vadim Gritsenko
301-428-5500 x 3253
http://www.brainbench.com/transcript.jsp?pid=5907

Mime
View raw message