cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <con...@paradise.net.nz>
Subject SOLUTION: RE: SVG BUG?: The attribute 'xlink:href' of the element <image> is required
Date Tue, 23 Apr 2002 02:09:02 GMT
Thank you very much Andrew - you've solved my problem. It works!

http://localhost:8080/cocoon/nzetc/images/thumbnails/Ba01S000.jpg
http://localhost:8080/cocoon/nzetc/images/thumbnails/Ba01S000_th.jpg

But there is definitely a bug ;-)

I saw Andrew's example below and thought "it's an XSL script, whereas my SVG
documents are static files - but it looks like it will produce exactly the
same kind of content as my documents". A light came on in my head and I
quickly added an XSLT to my pipeline, to apply the identity transform to my
SVG file - and that fixed it!!!

Here's the change to my sitemap:

	<map:match pattern="nzetc/images/thumbnails/*.jpg">
		<map:generate src="nzetc/images/{1}.svg"/>
		<map:transform src="nzetc/nzetc-xsl/identity.xsl"/> <!-- added this
step -->
		<map:serialize type="svg2jpeg"/>
	</map:match>

The identity.xsl is just this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="node()|@*">
		<xsl:copy>
			<xsl:apply-templates select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

So it seems you can't rasterize the SVG until it has been through an XSLT.
The sad thing is that I had always planned to generate my SVG files by
transforming the output of ImageDirectoryGenerator, but I thought I'd start
with some static files first, as a test. I almost avoided this problem
altogether!! ;-)

Cheers

Conal

> -----Original Message-----
> From: Andrew John Savory [mailto:savs@luminas.co.uk]On Behalf
> Of Andrew
> Savory
> Sent: Monday, 22 April 2002 20:11
> To: Conal Tuohy
> Cc: cocoon-users@xml.apache.org
> Subject: RE: SVG BUG?: The attribute 'xlink:href' of the
> element <image>
> is required
>
>
> On Mon, 22 Apr 2002, Conal Tuohy wrote:
>
> > When you say you've had problems with relative hrefs, do
> you mean you have
> > used images in SVG? Or were your href problems in some
> other context?
>
> Yes, it was with SVG. Here's an example that works for me:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:template name="image-details">
>     <svg width="{dimension_x}" height="{dimension_y}"
> xmlns="http://www.w3.org/2000/svg"
> xmlns:xlink="http://www.w3.org/1999/xlink">
>       <image x="0" y="0" width="{dimension_x}px"
> height="{dimension_y}px"
> xlink:href="http://www.luminas.co.uk/images/object_images/{fil
> ename}"/>
>       <text x="10px" y="{dimension_y - 10}px"
> style="font-family:sans; font-size:8pt; fill:#000000">
>          Copyright &#169; <xsl:value-of select="repository"/>
>       </text>
>     </svg>
>   </xsl:template>
> </xsl:stylesheet>
>
>
> Andrew.
>
> --
> Andrew Savory                                Email:
> andrew@luminas.co.uk
> Managing Director                              Tel:  +44
> (0)870 741 6658
> Luminas Internet Applications                  Fax:  +44
> (0)870 28 47489
> This is not an official statement or order.    Web:
www.luminas.co.uk


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

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



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


Mime
View raw message