You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by g4 <ja...@root10.net> on 2003/07/14 14:01:00 UTC
Variables in SVG
Hi List,
Quick question, how would I put variables into SVG, so that for example
I could have $Group Logo in SVG text?
Jason Lane
Developer
Root10 developments
Re: [PATCH] Variables in SVG
Posted by g4 <ja...@root10.net>.
Thanks Juan I'll give it a go
On Thursday, Jul 17, 2003, at 08:00 Europe/London, Juan Jose Pablos
wrote:
> Jason,
> if you update to the lastest version you would see the patch applied,
> and it is incompatible with this one.
>
> (mkdir /var/tmp/fs; cd /var/tmp/fs; forrest seed ; forrest run)
>
> on the *.svg
>
> <for:group-name /> and <for:group-name /> will be replaced with
> the same elements on skinconf.xml.
>
> Cheers,
> Cheche
>
> g4 wrote:
>> Hi Juan,
>> Yes I'll check out, I wont be able to do so till later on. I will do
>> it though ;)
>> On Tuesday, Jul 15, 2003, at 09:13 Europe/London, Juan Jose Pablos
>> wrote:
>>> Jason,
>>>
>>> This patch would work if you add id="group-name" or
>>> id="project-name" like this:
>>>
>>> <text id="project-name" />
>>>
>>> Would anyone review this patch?
>>>
>>> Cheers
>>>
>>> Cheche
>>>
>>>
>>> ,eg4 wrote:
>>>
>>>> Hi List,
>>>> Quick question, how would I put variables into SVG, so that for
>>>> example I could have $Group Logo in SVG text?
>>>> Jason Lane
>>>> Developer
>>>> Root10 developments
>>>
>>>
>>> Index: src/resources/conf/resources.xmap
>>> ===================================================================
>>> RCS file:
>>> /home/cvspublic/xml-forrest/src/resources/conf/resources.xmap,v
>>> retrieving revision 1.1
>>> diff -u -r1.1 resources.xmap
>>> --- src/resources/conf/resources.xmap 5 Jul 2003 13:01:02 -0000
>>> 1.1
>>> +++ src/resources/conf/resources.xmap 15 Jul 2003 08:10:38 -0000
>>> @@ -88,6 +88,7 @@
>>> <map:select type="exists">
>>> <map:when test="resources/images/{1}.svg">
>>> <map:generate src="resources/images/{1}.svg" />
>>> + <map:transform
>>> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
>>> <map:serialize type="svg2png" />
>>> </map:when>
>>> <map:otherwise>
>>> <?xml version="1.0"?>
>>>
>>> <!--+
>>> | Replace the <text id"display-name" /> with either
>>> project-name|group-name.
>>> |
>>> | Author: Juan Jose Pablos "cheche@apache.org"
>>> |
>>> | Add <map:transform
>>> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
>>> | on resources.xmap and id="xxx-name" on the svg file to work.
>>> | CVS $Revision: $
>>> +-->
>>>
>>> <xsl:stylesheet version="1.0"
>>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>>
>>> <xsl:param name="config-file" select="'../../skinconf.xml'"/>
>>> <xsl:variable name="config"
>>> select="document($config-file)/skinconfig"/>
>>> <xsl:variable name="project-name"
>>> select="$config/project-name"/>
>>> <xsl:variable name="group-name"
>>> select="$config/group-name"/>
>>>
>>> <xsl:template match="node() [@id='project-name']">
>>> <xsl:copy >
>>> <xsl:apply-templates select="@*"/>
>>> <xsl:value-of select="$project-name"/>
>>> </xsl:copy>
>>> </xsl:template>
>>>
>>> <xsl:template match="node() [@id='group-name']">
>>> <xsl:copy >
>>> <xsl:apply-templates select="@*"/>
>>> <xsl:value-of select="$group-name"/>
>>> </xsl:copy>
>>> </xsl:template>
>>>
>>> <xsl:template match="@*|*|text()|processing-instruction()"
>>> priority="-1">
>>> <xsl:copy>
>>> <xsl:apply-templates
>>> select="@*|*|text()|processing-instruction()"/>
>>> </xsl:copy>
>>> </xsl:template>
>>>
>>>
>>> </xsl:stylesheet>
>>>
>>>
>> Jason Lane
>> Developer
>> Root10 developments
>
>
>
>
Jason Lane
Developer
Root10 developments
Re: [PATCH] Variables in SVG
Posted by Juan Jose Pablos <ch...@che-che.com>.
Jason,
if you update to the lastest version you would see the patch applied,
and it is incompatible with this one.
(mkdir /var/tmp/fs; cd /var/tmp/fs; forrest seed ; forrest run)
on the *.svg
<for:group-name /> and <for:group-name /> will be replaced with the
same elements on skinconf.xml.
Cheers,
Cheche
g4 wrote:
> Hi Juan,
> Yes I'll check out, I wont be able to do so till later on. I will do it
> though ;)
>
> On Tuesday, Jul 15, 2003, at 09:13 Europe/London, Juan Jose Pablos wrote:
>
>> Jason,
>>
>> This patch would work if you add id="group-name" or id="project-name"
>> like this:
>>
>> <text id="project-name" />
>>
>> Would anyone review this patch?
>>
>> Cheers
>>
>> Cheche
>>
>>
>> ,eg4 wrote:
>>
>>> Hi List,
>>> Quick question, how would I put variables into SVG, so that for
>>> example I could have $Group Logo in SVG text?
>>> Jason Lane
>>> Developer
>>> Root10 developments
>>
>>
>> Index: src/resources/conf/resources.xmap
>> ===================================================================
>> RCS file: /home/cvspublic/xml-forrest/src/resources/conf/resources.xmap,v
>> retrieving revision 1.1
>> diff -u -r1.1 resources.xmap
>> --- src/resources/conf/resources.xmap 5 Jul 2003 13:01:02 -0000 1.1
>> +++ src/resources/conf/resources.xmap 15 Jul 2003 08:10:38 -0000
>> @@ -88,6 +88,7 @@
>> <map:select type="exists">
>> <map:when test="resources/images/{1}.svg">
>> <map:generate src="resources/images/{1}.svg" />
>> + <map:transform
>> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
>> <map:serialize type="svg2png" />
>> </map:when>
>> <map:otherwise>
>> <?xml version="1.0"?>
>>
>> <!--+
>> | Replace the <text id"display-name" /> with either
>> project-name|group-name.
>> |
>> | Author: Juan Jose Pablos "cheche@apache.org"
>> |
>> | Add <map:transform
>> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
>> | on resources.xmap and id="xxx-name" on the svg file to work.
>> | CVS $Revision: $
>> +-->
>>
>> <xsl:stylesheet version="1.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>
>> <xsl:param name="config-file" select="'../../skinconf.xml'"/>
>> <xsl:variable name="config"
>> select="document($config-file)/skinconfig"/>
>> <xsl:variable name="project-name"
>> select="$config/project-name"/>
>> <xsl:variable name="group-name"
>> select="$config/group-name"/>
>>
>> <xsl:template match="node() [@id='project-name']">
>> <xsl:copy >
>> <xsl:apply-templates select="@*"/>
>> <xsl:value-of select="$project-name"/>
>> </xsl:copy>
>> </xsl:template>
>>
>> <xsl:template match="node() [@id='group-name']">
>> <xsl:copy >
>> <xsl:apply-templates select="@*"/>
>> <xsl:value-of select="$group-name"/>
>> </xsl:copy>
>> </xsl:template>
>>
>> <xsl:template match="@*|*|text()|processing-instruction()"
>> priority="-1">
>> <xsl:copy>
>> <xsl:apply-templates
>> select="@*|*|text()|processing-instruction()"/>
>> </xsl:copy>
>> </xsl:template>
>>
>>
>> </xsl:stylesheet>
>>
>>
> Jason Lane
>
> Developer
> Root10 developments
Re: [PATCH] Variables in SVG
Posted by g4 <ja...@root10.net>.
Hi Juan,
Yes I'll check out, I wont be able to do so till later on. I will do it
though ;)
On Tuesday, Jul 15, 2003, at 09:13 Europe/London, Juan Jose Pablos
wrote:
> Jason,
>
> This patch would work if you add id="group-name" or id="project-name"
> like this:
>
> <text id="project-name" />
>
> Would anyone review this patch?
>
> Cheers
>
> Cheche
>
>
> ,eg4 wrote:
>> Hi List,
>> Quick question, how would I put variables into SVG, so that for
>> example I could have $Group Logo in SVG text?
>> Jason Lane
>> Developer
>> Root10 developments
>
> Index: src/resources/conf/resources.xmap
> ===================================================================
> RCS file:
> /home/cvspublic/xml-forrest/src/resources/conf/resources.xmap,v
> retrieving revision 1.1
> diff -u -r1.1 resources.xmap
> --- src/resources/conf/resources.xmap 5 Jul 2003 13:01:02 -0000 1.1
> +++ src/resources/conf/resources.xmap 15 Jul 2003 08:10:38 -0000
> @@ -88,6 +88,7 @@
> <map:select type="exists">
> <map:when test="resources/images/{1}.svg">
> <map:generate src="resources/images/{1}.svg" />
> + <map:transform
> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
> <map:serialize type="svg2png" />
> </map:when>
> <map:otherwise>
> <?xml version="1.0"?>
>
> <!--+
> | Replace the <text id"display-name" /> with either
> project-name|group-name.
> |
> | Author: Juan Jose Pablos "cheche@apache.org"
> |
> | Add <map:transform
> src="resources/stylesheets/svg2svg-renamelogo.xsl" />
> | on resources.xmap and id="xxx-name" on the svg file to work.
> | CVS $Revision: $
> +-->
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:param name="config-file" select="'../../skinconf.xml'"/>
> <xsl:variable name="config"
> select="document($config-file)/skinconfig"/>
> <xsl:variable name="project-name"
> select="$config/project-name"/>
> <xsl:variable name="group-name"
> select="$config/group-name"/>
>
> <xsl:template match="node() [@id='project-name']">
> <xsl:copy >
> <xsl:apply-templates select="@*"/>
> <xsl:value-of select="$project-name"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="node() [@id='group-name']">
> <xsl:copy >
> <xsl:apply-templates select="@*"/>
> <xsl:value-of select="$group-name"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="@*|*|text()|processing-instruction()"
> priority="-1">
> <xsl:copy>
> <xsl:apply-templates
> select="@*|*|text()|processing-instruction()"/>
> </xsl:copy>
> </xsl:template>
>
>
> </xsl:stylesheet>
>
>
Jason Lane
Developer
Root10 developments
[PATCH] Variables in SVG
Posted by Juan Jose Pablos <ch...@che-che.com>.
Jason,
This patch would work if you add id="group-name" or id="project-name"
like this:
<text id="project-name" />
Would anyone review this patch?
Cheers
Cheche
,eg4 wrote:
> Hi List,
>
> Quick question, how would I put variables into SVG, so that for example
> I could have $Group Logo in SVG text?
>
> Jason Lane
>
> Developer
> Root10 developments