forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject SVG from skinconf issues
Date Fri, 04 Jun 2004 10:45:40 GMT

I'm not able to see the project and group logos of the test site 
generated using Batik. Commenting out the DTD from the skinconf.xml file 
fixes it.

Any idea about how to fix it?

Wait, there's more that IMHO is relevant to this.

We have now two methods of injecting skinconf values in svg files:

- the "old" one that uses a for: namespace to identify special tags that
   get substituted from the skinconf
- the "newer" one that uses xslt.svg files to create svgs from
   skinconf.xml using that file as an xslt

I don't like the old one as it "pollutes" the svg with extra namespaces.
In essence, this is what happens: the file is passed through this 
strylesheet:

<xsl:param name="config-file" />
   <xsl:variable name="config"
                  select="document($config-file)/skinconfig"/>

<xsl:template match="for:project-name">
     <xsl:value-of select="$config/project-name"/>
   </xsl:template>

<xsl:template match="for:group-name">
     <xsl:value-of select="$config/group-name"/>
   </xsl:template>

which of course does not deal with all skinconf values, and does not 
give us colors.

We could simply use the xslt.svg system and deprecate the <for:> usage, 
but I'm not sure.

Here is how it is now and after how it can be with xslt.svg:

<svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:for="http://xml.apache.org/forrest" width="220" height="65" >
   <title>Anteater logo</title>

   <defs>...</defs>

   <g filter="url(#shadowFilter)" fill="url(#gradient)">
     <text x="40%" y="60%" style="blahblah">
     <for:group-name />
     </text>
   </g>
</svg>

<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:template match="skinconfig">

<svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">
   <title>Anteater logo</title>

   <defs>...</defs>

   <g filter="url(#shadowFilter)" fill="url(#gradient)">
     <text x="40%" y="60%" style="blahblah">
       <xsl:value-of select="group-name"/>
     </text>
   </g>
</svg>

   </xsl:template>
</xsl:stylesheet>

What changes is the fact that now the file is enclosed in two other tags 
and the use of value-of instead of <for:>, and the for namespace is no more.

An alternative is to do this:

<svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:skinconf="http://xml.apache.org/forrest/sf">
   <title>Anteater logo</title>

   <defs>...</defs>

   <g filter="url(#shadowFilter)" fill="url(#gradient)">
     <text x="40%" y="60%" style="blahblah">
       <skinconf:value-of select="group-name"/>
     </text>
   </g>
</svg>

Where a stylesheet encloses this file in the xsl stylesheet tags and 
transforms that skinconf: tags in xslt values.

But this basically creates our templating language... we've been through 
this already, and at that time we said to try the xslt.svg way.

Now, WDOT?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Mime
View raw message