cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josep A. Frau" <pept...@uib.es>
Subject Re: SVG > SVG via xslt
Date Wed, 31 Aug 2005 15:18:07 GMT
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" 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 2^nd 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


Mime
View raw message