cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: SVG > SVG via xslt
Date Wed, 31 Aug 2005 14:15:20 GMT
Lincoln Mitchell wrote:
> Hmmm! I will investigate the 'catalogs' but the xsl does create the extra
> rect if the doctype (and namespaces on the svg tag) is removed! Why would
> that be?

I'm not sure; the SVG serializer may have a fallback mode where if the 
top-level <svg/> element is in the null namespace then it treats that 
null namespace as SVG.  The important thing may be that the namespaces 
of the original SVG and the rect you insert are the same.  This is 
entirely conjecture of course.

>>-----Original Message-----
>>From: Jason Johnston []
>>Sent: Wednesday, August 31, 2005 10:04 PM
>>Subject: Re: SVG > SVG via xslt
>>Lincoln Mitchell wrote:
>>>Not sure that would help as I just removed the namespaces from the
>>>like this:
>>><?xml version="1.0" standalone="yes"?>
>>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>>>"" []>
>>><svg width="400px" height="250px" >
>>>	 <rect  width="165" height="126" fill="pink"/>
>>>And the result is that only the original SVG appears LESS the additional
>>>elements added via the xslt. However, the original svg takes a few
>>>to appear onscreen.
>>>Again, removing the doctype works instantly but I don't want to do that.
>>It seems to me like the problem is Cocoon (or the parser specifically)
>>is actually trying to fetch the DTD from the Web, which obviously takes
>>some time.  Cocoon has a mechanism for this situation called "catalogs"
>>that allows you to map DTD URIs to local files so they're always quickly
>>accessible.  See
>>As for the elements added by your XSLT not showing up: you need to make
>>sure they are also in the SVG namespace.  It looks like the XSLT you
>>posted in another part of this thread is creating the <rect/> in the
>>null namespace so it's probably getting ignored as an unrecognized
>>>-----Original Message-----
>>>From: Christoph Hermann []
>>>Sent: Tuesday, August 30, 2005 10:01 PM
>>>Subject: Re: SVG > SVG via xslt
>>>Lincoln Mitchell schrieb:
>>>>I am trying to generate an SVG file from an Adobe illustrator SVG file
>>>>via XSLT/Cocoon.
>>>>If I delete the DOCTYPE (and the xmlns' on the svg tag) then all works
>>>>fine - but I want the file to stay intact - so that's not an option.
>>>How about stripping the namespaces with an additional xsl file? This way
>>>your first file remains intact?
>>><xsl:stylesheet xmlns:xsl=""
>>><xsl:strip-space elements="*"/>
>>><xsl:template match="/">
>>>	<xsl:apply-templates mode="copy"/>
>>><xsl:template match="*" priority="-1" mode="copy">
>>>	<xsl:element name="{name()}">
>>>		<xsl:copy-of select="@*"/>
>>>		<xsl:apply-templates mode="copy"/>
>>>	</xsl:element>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message