cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BORGES Charles <charles.borges.prestata...@cegetel.fr>
Subject RE : Problem using SVG serialializer after a transformation
Date Fri, 10 Oct 2003 13:25:07 GMT


> 
> BORGES Charles wrote:
> 
> >Hi,
> >
> >I run into the following problem when serializing to svg after a xsl
> >transformation:
> >
> >Start with a sitemap including something like this
> ><map:match pattern="*.png">
> >  <map:generate src="{1}.svg"/>
> >  <map:transform src="xsl/{1}.xsl" type="xslt"/>
> >  <map:serialize type="svg2png"/>
> ></map:match>
> >
> >
> >Turn the debug on and check for the SVGSerializer logging.
> >You see that serialization of the xsl transformation output produces 
> >the
> >massage:
> >"setDocumentLocator was not called, will use 
> http://localhost/ as base URI".
> >
> >This means that if i have 
> a href in my svg to a css for instance, it 
> >won't be located and the serialization will fail!
> >
> >I fixed it (somehow) by:
> >1.introducing a base-url attribute in the SVGSerializer 
> configuration:
> ><map:serializer logger="sitemap.serializer.svg2png" 
> >                  name="svg2png"
> >                  
> src="fr.cegetel.dsco.gi.svg.serialization.SVGSerializer"
> >                  mime-type="image/png"
> >                  base-url="context://sample/batik"/>
> >
> 
> Be careful: the convention in configurations is that attributes are 
> container-related data. Component-related data should be 
> better located 
> as child elements. So the following should be better:
> 
> <map:serializer ....>
>   <base-url>context://sample/batik</base-url>
> </map:serializer>
>

ok
 
> >3.using the sourceresolver to find out the uri to set in the 
> document locator.
> >
> 
> So do you really need the base-url? Isn't the uri of 
> SourceResolver.resolveURI("") just what you need? Or at least 
> it can be 
> a fallback if base-url is not present.
> 

You're right again


> >2.making the SVGBuilder no more Recyclable.
> >
> 
> Why can it no more be Recyclable?
> 

Well, i use the given uri to set the locator for the SVGBuilder in the
SGVSerializer configure(),
But he current recycle() method of SVGBuilder sets locator to null... And
the component can only be used once.
So either make SVGBuilder not Recyclable or do not set locator=null


> Sylvain
> 
> -- 
> Sylvain Wallez                                  Anyware Technologies
> http://www.apache.org/~sylvain           http://www.anyware-tech.com
> { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
> Orixo, the opensource XML business alliance  -  http://www.orixo.com
> 

Mime
View raw message