Re: SVG12: 6.4 example

On 30/05/2005, at 12:35 PM, Bjoern Hoehrmann wrote:

>
> * Dean Jackson wrote:
>
>>>   In http://www.w3.org/TR/2005/WD-SVGMobile12-20050413/styling.html
>>> section 6.4 the examples do not make much sense to me, a conforming
>>> XSLT 1.0 would not produce the result the draft claims. Please  
>>> change
>>> the draft such that these examples are correct.
>>>
>>
>> Fixed. Thanks.
>>
>
> Could you cite the new examples so I can check them?

Input XSL
---------

<?xml version="1.0" standalone="no"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:svg="http://www.w3.org/2000/svg">
   <xsl:output
     method="xml"
     encoding="utf-8"
     doctype-public="-//W3C//DTD SVG 1.1//EN"
     doctype-system="http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"/>
   <!-- Add version to topmost 'svg' element -->
   <xsl:template match="/svg:svg">
     <xsl:copy>
       <xsl:copy-of select="@*"/>
       <xsl:attribute name="version">1.1</xsl:attribute>
       <xsl:apply-templates/>
     </xsl:copy>
   </xsl:template>
   <!-- Add styling to all 'rect' elements -->
   <xsl:template match="svg:rect">
     <xsl:copy>
       <xsl:copy-of select="@*"/>
       <xsl:attribute name="fill">red</xsl:attribute>
       <xsl:attribute name="stroke">blue</xsl:attribute>
       <xsl:attribute name="stroke-width">3</xsl:attribute>
     </xsl:copy>
   </xsl:template>
</xsl:stylesheet>

Input SVG
---------

<?xml version="1.0"?>
<svg width="10cm" height="5cm" viewBox="0 0 100 50"
      xmlns="http://www.w3.org/2000/svg" baseProfile="tiny">
   <rect x="20" y="10" width="60" height="30"/>
</svg>

Output
------

<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="10cm" height="5cm"
      viewBox="0 0 100 50" version="1.1" baseProfile="tiny">
   <rect x="20" y="10" width="60" height="30" fill="red"  
stroke="blue" stroke-width="3"/>
</svg>

If you disagree with this resolution then please say so within two  
weeks. Otherwise we assume you accept.

Dean

Received on Sunday, 30 October 2005 23:46:09 UTC