cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lincoln Mitchell" <>
Subject RE: SVG > SVG via xslt
Date Wed, 31 Aug 2005 13:58:05 GMT

Wendell writes:

> What isn't clear from your question is what you get back from Cocoon.
I get back only the original SVG LESS the additional svg elements added via
the xslt. However, the original svg takes a few minutes to appear onscreen.
Again, removing the doctype works instantly but I don't want to do that.

> This file is your input file?

> What kind of transform are you running?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	<xsl:template match="/">
	<xsl:template match="//g[@id='myRect']">
			<xsl:apply-templates select="@*|node()"/>
			 <rect  x="100" y="100" width="165" height="126"
	<xsl:template match="@*|node()">
			<xsl:apply-templates select="@*|node()"/>

Here is the original svg (as The one I sent before did not have '<g

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version:
6.00 Build 51448)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"" [
	<!ENTITY ns_svg "">
	<!ENTITY ns_xlink "">
<svg  version="1.1" id="square" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;"
width="165" height="126" viewBox="0 0 165 126"
	 style="overflow:visible;enable-background:new 0 0 165 126;"
 <g id="myRect">
	 <rect  width="165" height="126" fill="pink"/>

> Are you getting an error message back, or nothing at all
Again, the 1st SVG appears after 3 minutes but not the second rectangle.

>Is Cocoon's parser simply failing to parse the file?
If you mean failing to parse the xsl - then it would appear so.

> The input is unusual -- entity references for namespace declarations -- 
> but assuming entities are expanded first (as they should be), there's 
> nothing that screams out that it won't work (at least to my eyes at this 
> moment).
I have read that XSL doesn't support DTD and prefer schemas - maybe that's
part of the issue (a Stab in the dark).

> It's not even clear that it's an XSL question. Please be more specific!
Hope this makes it more clear and is now clear it's an xsl question.

Also, I have added this serializer to the xmap:
<map:serializer name="xml"
   doctype-public="-//W3C//DTD SVG 1.0//EN"
   <!-- serializer configurations -->

And finally...

Below is some more info on the issue which may explain clearly the issue but
I may simply not understand enough xsl to appreciate it.


Re: XSLT, Namespaces & SVG

8. Match on an element when Doctype is present
 David Carlisle

> I'm having problems navigating to the html elment and other elements
> when I leave the Doctype and namespace at the top of the xhtml doc. 

this is a FAQ.

To match in the xhtml namespace (which is defaulted by the xhtml dtd even if
you don't make it explicit) you need to declare the xhtml namespace in your
stylesheet with something like xmlns:h="" then
use h:html rather than html etc.


Re: [xsl] Problem generating combining SVG documents using XSLT


Hope this helps

Thanks again for your help.


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

View raw message