cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lincoln Mitchell" <linc...@interfaces-n-creatives.com>
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?
Yes 

> What kind of transform are you running?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="//g[@id='myRect']">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
			 <rect  x="100" y="100" width="165" height="126"
fill="blue"/>
		</xsl:copy>
	</xsl:template>
	<xsl:template match="@*|node()">
		<xsl:copy>
			<xsl:apply-templates select="@*|node()"/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

Here is the original svg (as The one I sent before did not have '<g
id="myRect">'):

<?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"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
	<!ENTITY ns_svg "http://www.w3.org/2000/svg">
	<!ENTITY ns_xlink "http://www.w3.org/1999/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;"
xml:space="preserve">
 <g id="myRect">
	 <rect  width="165" height="126" fill="pink"/>
 </g>
</svg>



> 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"
   src="org.apache.cocoon.serialization.XMLSerializer"
   mime-type="svgxml"  
   doctype-public="-//W3C//DTD SVG 1.0//EN"
   doctype-system="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
   logger="sitemap.serializer.xml" 
   pool-max="32">
   <!-- serializer configurations -->
</map:serializer>

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.

1-----------------------------------------------------

Re: XSLT, Namespaces & SVG
http://www.xslt.com/html/xsl-list/2000-12/msg00075.html

2-----------------------------------------------------
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="http://www.w3.org/1999/xhtml" then
use h:html rather than html etc.
http://www.dpawson.co.uk/xsl/sect2/N2281.html#d3544e292

3-----------------------------------------------------

Re: [xsl] Problem generating combining SVG documents using XSLT
http://xslt.com/html/xsl-list/2001-02/msg00042.html

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

Hope this helps



Thanks again for your help.

Linc



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message