Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 70824 invoked from network); 6 Sep 2000 07:34:27 -0000 Received: from adamo5.supereva.it (HELO mail.supereva.it) (195.110.96.111) by locus.apache.org with SMTP; 6 Sep 2000 07:34:27 -0000 Received: (qmail 24012 invoked from network); 6 Sep 2000 07:33:58 -0000 Received: from unknown (HELO ARES) (151.35.2.252) by mail.supereva.it with SMTP; 6 Sep 2000 07:33:58 -0000 Message-ID: <003901c017d4$e8dc2120$fc022397@ARES> Reply-To: "Nicola Ken Barozzi" From: "Nicola Ken Barozzi" To: References: <014601c0168d$0d8b59d0$bd570a3e@ARES> <39B3DC35.D7179C0C@apache.org> Subject: Re: Namespace problem in C2 Transformer Date: Wed, 6 Sep 2000 09:30:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N ----- Original Message ----- From: "Stefano Mazzocchi" To: Sent: Monday, September 04, 2000 7:30 PM Subject: Re: Namespace problem in C2 Transformer > Nicola Ken Barozzi wrote: > > > > I'm making a C2 Transformer and I have problems with namespaces. > > This is my xml: > > > > > > > > > > > > IT WORKS!!! :) > > > > > > #ffffff > > #666666 > > > > > > > > 0 > > 10 > > > > > > > > > > 1 > > 4 > > > > > > 5 > > 4 > > > > > > 3 > > 7 > > > > > > > > > > > > > > Basically I want to read the > > elements (I just say the transformer to ignore elements out of my element) > > in my transformer. > > The two tags with the namespace declarations: > > > > > > > > > > are giving me a headache. > > If I capture their startElement and endElement events and don't call anything in > > them, they disappear in the output but at the and of the _correct_ output I > > get the following exception: > > > > ********************************************************** > > > > ?????? ?????? ?????? ?????? ?????? ?????? > > ? ? .? ? ? .? ?. ? ? ? > > ?????? ?????? ?????? ?????? ?????? ? ? @version@ > > > > --- Error in the Cocoon 2 pipeline >X==< --- > > > > error - Exception in transformer chart2svg with uri http://apache.org/cocoon/Chart2Svg while ending element. > > > > description - java.lang.NullPointerException > > > > from - org.apache.cocoon.generation.ErrorGenerator > > > > source - org.xml.sax.SAXException > > > > stacktrace - java.lang.NullPointerException > > at org.apache.cocoon.transformation.EventBasedAbstractTransformer.endElement(EventBasedAbstractTransformer.java > > , Compiled Code) > > at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java, Compiled Code) > > at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java, Compiled Code) > > at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java, Compiled > > Code) > > at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java, Compiled Code) > > at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:861) > > at org.apache.cocoon.components.parser.XercesParser.parse(XercesParser.java:40) > > at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:31) > > at org.apache.cocoon.sitemap.ResourcePipeline.process(ResourcePipeline.java, Compiled Code) > > at _C_._jakarta_tomcat._webapps._cocoon._sitemap_xmap.process(_sitemap_xmap.java:1415) > > at org.apache.cocoon.sitemap.SitemapHandler.process(SitemapHandler.java:127) > > at org.apache.cocoon.sitemap.SitemapManager.invoke(SitemapManager.java:83) > > at org.apache.cocoon.Cocoon.process(Cocoon.java:206) > > at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:191) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) > > at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code) > > at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) > > at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160) > > at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338) > > at java.lang.Thread.run(Thread.java:479) > > > > **************** printStream notifications: 1 *************** > > > > The exception disappears only if I call super on both events (two start, two end). > > It also disappears if I only take away xmlns="http://apache.org/cocoon/data" . > > > > I get the same error with: > > > > > > > > > > IT WORKS!!! :) > > > > > > #ffffff > > #666666 > > > > > > > > 0 > > 10 > > > > > > > > > > 1 > > 4 > > > > > > 5 > > 4 > > > > > > 3 > > 7 > > > > > > > > > > > > > > but it stops calling after . > > The strange thing is that in the output I _have_ !!! :-O > > > > So I looked in th AbstractTransformer I extend. > > > > Why is it > > > > /** > > * End the scope of a prefix-URI mapping. > > */ > > public void endPrefixMapping(String prefix) > > throws SAXException { > > } > > > > and not > > > > /** > > * End the scope of a prefix-URI mapping. > > */ > > public void endPrefixMapping(String prefix) > > throws SAXException { > > if (super.contentHandler!=null) > > System.out.println("PM!"+prefix); > > super.contentHandler.endPrefixMapping(prefix); > > } > > > > ? > > > > Thanks guys :-) > > Because you found a bug :) > > Fixing it right away... If it can help, the problem hase gone away with Xerces 1.2 (the latest). Cheers nicola_ken