You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lincoln Mitchell <li...@interfaces-n-creatives.com> on 2005/09/01 01:13:00 UTC
RE: SVG > SVG via xslt
Ofcourse and yipee it now works - just with that 3 minute delay.
_____
From: Josep A. Frau [mailto:peptoni@uib.es]
Sent: Wednesday, August 31, 2005 11:18 PM
To: users@cocoon.apache.org
Subject: Re: SVG > SVG via xslt
I forget svg:g.
<xsl:stylesheet version="1.0"
xmlns:xsl= <http://www.w3.org/1999/XSL/Transform>
"http://www.w3.org/1999/XSL/Transform"
xmlns:svg= <http://www.w3.org/2000/svg> "http://www.w3.org/2000/svg">
<xsl:template match="//svg:g[@id='myRect']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<svg:rect x="100" y="100" width="165" height="126"
fill="blue"/>
</xsl:copy>
</xsl:template>
The element g without namespace isn't in the source document
The g element in the source element is g in the
<http://www.w3.org/2000/svg> "http://www.w3.org/2000/svg" namespace and you
try math the element g without namespace.
In your XSLT the template match "//g[@id='myRect']" don't match any element.
En/na Lincoln Mitchell ha escrit:
Nothing seemed to change no 2nd rect appears. Do you infer that this will
work after the catalog is implemented (as suggested by Jason Johnston).
Linc
_____
From: Josep A. Frau [mailto:peptoni@uib.es]
Sent: Wednesday, August 31, 2005 10:24 PM
To: users@cocoon.apache.org
Subject: Re: SVG > SVG via xslt
You must generate <rect> in the svg namespace.
Try:
<xsl:stylesheet version="1.0"
xmlns:xsl= <http://www.w3.org/1999/XSL/Transform>
"http://www.w3.org/1999/XSL/Transform"
xmlns:svg= <http://www.w3.org/2000/svg> "http://www.w3.org/2000/svg">
<xsl:template match="//g[@id='myRect']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<svg:rect x="100" y="100" width="165" height="126"
fill="blue"/>
</xsl:copy>
</xsl:template>
--
Josep A. Frau
Centre de Tecnologies de la Informació
Universitat de les Illes Balears