You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ahmed <ah...@baizid.org> on 2002/12/15 02:55:36 UTC

Links view recurse for ever on a SVG linearGradient element

Nagoya seems down...

-------------------------------------------------------

My cocoon.xconf contains:
<xml-parser class="org.apache.avalon.excalibur.xml.JaxpParser"/>

and my sitemap:
<map:views>
    <map:view name="links" from-position="last">
	<map:serialize type="links"/>
    </map:view>
</map:views>
...
<map:pipelines>
    <map:pipeline>   
	<map:match pattern="*.png">
	    <map:generate src="docs/{1}.svg"/>
	    <map:serialize type="svg2png"/>      
	</map:match>
    </map:pipeline>
</map:pipelines>


The Cocoon "live" site is OK. 
When I ask my web browser for
http://localhost:8180/simple_cocoon_site/sample.png, I get the PNG.

When I ask for a link content (same_url?cocoon-view=links), Cocoon goes
recursing until no memory is left. 
Why asking for such a view? Well I am not doing it, the command line
interface blindly does.

The problem is with a gradient definition:
    <linearGradient id="a_gradient">  
	<stop offset="5%" stop-color="red" />  
	<stop offset="95%" stop-color="yellow" />  
    </linearGradient>
I have no problem with:
    <marker id="aTriangle"
	viewBox="0 0 4 4" refX="0" refY="2" 
	markerUnits="strokeWidth"
	markerWidth="1" markerHeight="1"
	orient="auto">
	<path d="M 0 0 L 4 2 L 0 4"/>
    </marker>
in the SVG.

-------------------------------------------------------

I dived in the sources with a debugger. 
Forgive a little, I am new to Java (4 months).

XMLTeePipe().startElement() get called for the linearGradient element.
It calls its first consumer (a LinkTranslator) startElement() method.

LinkTranslator inherits this method from ExtendedXLinkPipe.

ExtendedXLinkPipe.startElement() looks after "href", "src" or
"background". Finding none it finishes calling super.startElement() i.e.
XLinkPipe.startElement().

The attribute value for "type" is "simple".
For all other SVG elements, type is null. 
Why is it so? I do not know.

So the simpleLink() is called. Which one? LinkTranslator one because
"this" is a LinkTranslator.

LinkTranslator.simpleLink() does not do much but calling
super.simpleLink(), i.e. ExtendedXLinkPipe.simpleLink().

This one looks after "href", "src" or "background". Finding none it
finishes calling super.startElement() i.e. XLinkPipe.startElement().

And here is the never ending recursion.

XMLTeePipe().startElement()
  LinkTranslator.startElement() ie. ExtendedXLinkPipe.startElement()
    super.startElement() i.e. XLinkPipe.startElement()     <---+
      simpleLink() i.e. LinkTranslator.simpleLink()            |
        super.simpleLink() ie ExtendedXLinkPipe.simpleLink()   |
          super.startElement() ie XLinkPipe.startElement() >---+

Is it a JaxpParser error? I do not know. 
Anyway. Cocoon relies heavily on external components. It should be
prepared to (unintentional) misbehaviors.

I do not know where to go from here. I am not looking for tricks. I only
want Cocon to be robust. I have got a little time.

I removed gradients from my SVGs.

-- 
Ahmed <ah...@baizid.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>