You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by fe...@apache.org on 2005/10/06 10:45:59 UTC

svn commit: r306554 - in /forrest/branches/forrest_07_branch/main/webapp: resources/stylesheets/html2document.xsl skins/common/xslt/html/document2html.xsl skins/pelt/xslt/html/document2html.xsl

Author: ferdinand
Date: Thu Oct  6 01:45:42 2005
New Revision: 306554

URL: http://svn.apache.org/viewcvs?rev=306554&view=rev
Log:
Applied all fixes to these files in 0.8dev to 0.7 (mainly improving class and id handling)

Modified:
    forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
    forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
    forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl

Modified: forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl (original)
+++ forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,31 +56,16 @@
     </xsl:template>
         
     <xsl:template match="meta">
-      <xsl:text disable-output-escaping = "yes"><![CDATA[ <!-- ]]></xsl:text>
         <xsl:copy>
             <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
-      <xsl:text disable-output-escaping = "yes"><![CDATA[ --> ]]></xsl:text> 
     </xsl:template>  
     
     <!--infer structure from sibling headings-->
     <xsl:template match="body">
        <body>
-         <xsl:choose>
-           <xsl:when test="h1">
-             <xsl:call-template name="process_h1"/>
-           </xsl:when>
-           <xsl:otherwise>
-             <section>
-               <xsl:if test="a/@name">
-                 <xsl:attribute name="id"><xsl:value-of select="a/@name"/></xsl:attribute>
-               </xsl:if>
-               <title/>
-               <xsl:apply-templates/>
-               <xsl:call-template name="process_h1"/>
-             </section>
-           </xsl:otherwise>
-         </xsl:choose>
+          <xsl:apply-templates select="*[1]" mode="next"/>
+          <xsl:call-template name="process_h1"/>
        </body>
     </xsl:template>
     
@@ -128,7 +113,7 @@
          </section>
        </xsl:for-each>
     </xsl:template>
-
+    
     <!--process each sibling in order until the next heading level-->
 
     <xsl:template match="*" mode="next">
@@ -258,9 +243,10 @@
     </xsl:template>
     
     <xsl:template match="table">
-      <table>
-            <xsl:apply-templates select="node()"/>
-      </table>
+      <xsl:copy>
+        <xsl:copy-of select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
     </xsl:template>
     
             

Modified: forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl (original)
+++ forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -137,7 +137,7 @@
 
   <xsl:template match="note | warning | fixme">
     <xsl:apply-templates select="@id"/>
-    <div class="frame {local-name()}">
+    <div class="{local-name()}">
       <div class="label">
         <xsl:choose>
           <!-- FIXME: i18n Transformer here -->
@@ -192,6 +192,7 @@
   <xsl:template match="p[@xml:space='preserve']">
     <xsl:apply-templates select="@id"/>
     <div class="pre">
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
     </div>
   </xsl:template>
@@ -200,6 +201,7 @@
     <xsl:apply-templates select="@id"/>
     <pre class="code">
 <!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
 <!--
     <xsl:call-template name="format">
@@ -211,36 +213,59 @@
   </xsl:template>
 
   <xsl:template match="anchor">
-    <a name="{@id}"/>
+    <a name="{@id}">
+      <xsl:copy-of select="@id"/>
+    </a>
   </xsl:template>
 
   <xsl:template match="icon">
     <xsl:apply-templates select="@id"/>
     <img class="icon">
-        <xsl:copy-of select="@height | @width | @src | @alt"/>
+      <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
     </img>
   </xsl:template>
 
   <xsl:template match="code">
     <xsl:apply-templates select="@id"/>
-    <span class="codefrag"><xsl:value-of select="."/></span>
+    <span class="codefrag">
+      <xsl:copy-of select="@id"/>
+      <xsl:value-of select="."/>
+    </span>
   </xsl:template>
 
   <xsl:template match="figure">
     <xsl:apply-templates select="@id"/>
+    
     <div align="center">
+      <xsl:copy-of select="@id"/>
       <img class="figure">
-        <xsl:copy-of select="@height | @width | @src | @alt"/>
+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
       </img>
     </div>
   </xsl:template>
 
   <xsl:template match="table">
     <xsl:apply-templates select="@id"/>
-    <table cellpadding="4" cellspacing="1" class="ForrestTable">
-      <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor"/>
-      <xsl:apply-templates/>
-    </table>
+    <xsl:choose>
+      <!-- Limit Forrest specific processing to tables without class -->
+      <xsl:when test="not(@class) or @class=''">
+        <table cellpadding="4" cellspacing="1" class="ForrestTable">
+          <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
+          <xsl:apply-templates/>
+        </table>    
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Tables with class are passed without change -->
+        <xsl:copy>
+          <xsl:copy-of select="@*"/>
+          <xsl:apply-templates/>
+        </xsl:copy>    
+        
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="@class = ''">
+      
+    </xsl:if>
   </xsl:template>
 
   <xsl:template match="acronym/@title">
@@ -359,8 +384,13 @@
   <!-- End of "toc" mode templates -->
 
   <xsl:template match="node()|@*" priority="-1">
+    <!-- id processing will create its own a-element so processing has to 
+         happen outside the copied element 
+    -->
+    <xsl:apply-templates select="@id"/>
     <xsl:copy>
-      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="@*[name(.) != 'id']"/>
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
     </xsl:copy>
   </xsl:template>

Modified: forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl (original)
+++ forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -136,8 +136,8 @@
   
   <xsl:template match="figure">
     <xsl:apply-templates select="@id"/>
-    <div style="text-align: center;">
-      <img src="{@src}" alt="{@alt}" class="figure">
+    <div style="text-align: center;" id="{@id}">
+      <img src="{@src}" alt="{@alt}" class="figure"  id="{@id}">
         <xsl:if test="@height">
           <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
         </xsl:if>



potential multiple ID attributes (Was: svn commit: r306554)

Posted by David Crossley <cr...@apache.org>.
Renaming the thread to hopefully remember to ask Ferdinand
when he returns.

-David

Ross Gardler wrote:
[ snip]
> 
> >>          <!-- FIXME: i18n Transformer here -->
> >>@@ -192,6 +192,7 @@
> >>  <xsl:template match="p[@xml:space='preserve']">
> >>    <xsl:apply-templates select="@id"/>
> >>    <div class="pre">
> >>+      <xsl:copy-of select="@id"/>
> >>      <xsl:apply-templates/>
> >>    </div>
> >>  </xsl:template>
> 
> There are a few of changes like this. Won't this result in multiple @id 
> attributes if one is supplied in the orgiinal XML?
> 
> >>    <div align="center">
> >>+      <xsl:copy-of select="@id"/>
> >>      <img class="figure">
> >>-        <xsl:copy-of select="@height | @width | @src | @alt"/>
> >>+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
> >>      </img>
> >>    </div>
> >>  </xsl:template>
> 
> I'm pretty sure this one will result in a duplication of @id values, 
> once from the fist <xsl:copy-of > and once from the second. Sure they 
> will be on different elements, but the result will be two elements with 
> the same ID.
> 
> Ross

Re: svn commit: r306554 - in /forrest/branches/forrest_07_branch/main/webapp: resources/stylesheets/html2document.xsl skins/common/xslt/html/document2html.xsl skins/pelt/xslt/html/document2html.xsl

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> David Crossley wrote:
> >There is something wrong here. The Apache XML project
> >uses forrest_07_branch and they are reporting that the
> >"Note" elements are not rendered anymore. I confirmed
> >that by going back to just before this revision. Also
> >everything is okay using 0.8-dev to build their site.
> >So i presume that something was missed during r306554.
> >I have no idea what sorry, becuase i don't understand
> >these changes.
> 
> in skins/common/xslt/html/document2html.xsl:
> 
> >>  <xsl:template match="note | warning | fixme">
> >>    <xsl:apply-templates select="@id"/>
> >>-    <div class="frame {local-name()}">
> >>+    <div class="{local-name()}">
> >>      <div class="label">
> >>        <xsl:choose>
> 
> The frame class has been removed, I'd be tempted to say this will be the 
> problem, but...
> 
> What confuses me is that the commit message said these were copied over 
> from 0.8-dev so if 0.8-dev is working why isn't 0.7?
> 
> I also note that the zone test site looks just fine.
> 
> Perhaps the frame class was needed in 0.7 but some change in the CSS 
> means it is no longer needed in 0.8-dev.
> 
> Maybe try adding the frame class back in and seeing if that works.

Found it. There were earlier changes to basic.css in trunk
which had not been applied to the branch. Done now.

-David

Re: svn commit: r306554 - in /forrest/branches/forrest_07_branch/main/webapp: resources/stylesheets/html2document.xsl skins/common/xslt/html/document2html.xsl skins/pelt/xslt/html/document2html.xsl

Posted by Ross Gardler <rg...@apache.org>.
David Crossley wrote:
> There is something wrong here. The Apache XML project
> uses forrest_07_branch and they are reporting that the
> "Note" elements are not rendered anymore. I confirmed
> that by going back to just before this revision. Also
> everything is okay using 0.8-dev to build their site.
> So i presume that something was missed during r306554.
> I have no idea what sorry, becuase i don't understand
> these changes.


in skins/common/xslt/html/document2html.xsl:

>>   <xsl:template match="note | warning | fixme">
>>     <xsl:apply-templates select="@id"/>
>>-    <div class="frame {local-name()}">
>>+    <div class="{local-name()}">
>>       <div class="label">
>>         <xsl:choose>


The frame class has been removed, I'd be tempted to say this will be the 
problem, but...

What confuses me is that the commit message said these were copied over 
from 0.8-dev so if 0.8-dev is working why isn't 0.7?

I also note that the zone test site looks just fine.

Perhaps the frame class was needed in 0.7 but some change in the CSS 
means it is no longer needed in 0.8-dev.

Maybe try adding the frame class back in and seeing if that works.

>>           <!-- FIXME: i18n Transformer here -->
>>@@ -192,6 +192,7 @@
>>   <xsl:template match="p[@xml:space='preserve']">
>>     <xsl:apply-templates select="@id"/>
>>     <div class="pre">
>>+      <xsl:copy-of select="@id"/>
>>       <xsl:apply-templates/>
>>     </div>
>>   </xsl:template>

There are a few of changes like this. Won't this result in multiple @id 
attributes if one is supplied in the orgiinal XML?

>>     <div align="center">
>>+      <xsl:copy-of select="@id"/>
>>       <img class="figure">
>>-        <xsl:copy-of select="@height | @width | @src | @alt"/>
>>+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
>>       </img>
>>     </div>
>>   </xsl:template>

I'm pretty sure this one will result in a duplication of @id values, 
once from the fist <xsl:copy-of > and once from the second. Sure they 
will be on different elements, but the result will be two elements with 
the same ID.

Ross

Re: svn commit: r306554 - in /forrest/branches/forrest_07_branch/main/webapp: resources/stylesheets/html2document.xsl skins/common/xslt/html/document2html.xsl skins/pelt/xslt/html/document2html.xsl

Posted by David Crossley <cr...@apache.org>.
There is something wrong here. The Apache XML project
uses forrest_07_branch and they are reporting that the
"Note" elements are not rendered anymore. I confirmed
that by going back to just before this revision. Also
everything is okay using 0.8-dev to build their site.
So i presume that something was missed during r306554.
I have no idea what sorry, becuase i don't understand
these changes.

-David

> Author: ferdinand
> Date: Thu Oct  6 01:45:42 2005
> New Revision: 306554
> 
> URL: http://svn.apache.org/viewcvs?rev=306554&view=rev
> Log:
> Applied all fixes to these files in 0.8dev to 0.7 (mainly improving class and id handling)
> 
> Modified:
>     forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
>     forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
>     forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
> 
> Modified: forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
> URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl?rev=306554&r1=306553&r2=306554&view=diff
> ==============================================================================
> --- forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl (original)
> +++ forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl Thu Oct  6 01:45:42 2005
> @@ -1,6 +1,6 @@
>  <?xml version="1.0"?>
>  <!--
> -  Copyright 2002-2004 The Apache Software Foundation or its licensors,
> +  Copyright 2002-2005 The Apache Software Foundation or its licensors,
>    as applicable.
>  
>    Licensed under the Apache License, Version 2.0 (the "License");
> @@ -56,31 +56,16 @@
>      </xsl:template>
>          
>      <xsl:template match="meta">
> -      <xsl:text disable-output-escaping = "yes"><![CDATA[ <!-- ]]></xsl:text>
>          <xsl:copy>
>              <xsl:apply-templates select="node()|@*"/>
>          </xsl:copy>
> -      <xsl:text disable-output-escaping = "yes"><![CDATA[ --> ]]></xsl:text> 
>      </xsl:template>  
>      
>      <!--infer structure from sibling headings-->
>      <xsl:template match="body">
>         <body>
> -         <xsl:choose>
> -           <xsl:when test="h1">
> -             <xsl:call-template name="process_h1"/>
> -           </xsl:when>
> -           <xsl:otherwise>
> -             <section>
> -               <xsl:if test="a/@name">
> -                 <xsl:attribute name="id"><xsl:value-of select="a/@name"/></xsl:attribute>
> -               </xsl:if>
> -               <title/>
> -               <xsl:apply-templates/>
> -               <xsl:call-template name="process_h1"/>
> -             </section>
> -           </xsl:otherwise>
> -         </xsl:choose>
> +          <xsl:apply-templates select="*[1]" mode="next"/>
> +          <xsl:call-template name="process_h1"/>
>         </body>
>      </xsl:template>
>      
> @@ -128,7 +113,7 @@
>           </section>
>         </xsl:for-each>
>      </xsl:template>
> -
> +    
>      <!--process each sibling in order until the next heading level-->
>  
>      <xsl:template match="*" mode="next">
> @@ -258,9 +243,10 @@
>      </xsl:template>
>      
>      <xsl:template match="table">
> -      <table>
> -            <xsl:apply-templates select="node()"/>
> -      </table>
> +      <xsl:copy>
> +        <xsl:copy-of select="@*"/>
> +        <xsl:apply-templates/>
> +      </xsl:copy>    
>      </xsl:template>
>      
>              
> 
> Modified: forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
> URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
> ==============================================================================
> --- forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl (original)
> +++ forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl Thu Oct  6 01:45:42 2005
> @@ -1,6 +1,6 @@
>  <?xml version="1.0"?>
>  <!--
> -  Copyright 2002-2004 The Apache Software Foundation or its licensors,
> +  Copyright 2002-2005 The Apache Software Foundation or its licensors,
>    as applicable.
>  
>    Licensed under the Apache License, Version 2.0 (the "License");
> @@ -137,7 +137,7 @@
>  
>    <xsl:template match="note | warning | fixme">
>      <xsl:apply-templates select="@id"/>
> -    <div class="frame {local-name()}">
> +    <div class="{local-name()}">
>        <div class="label">
>          <xsl:choose>
>            <!-- FIXME: i18n Transformer here -->
> @@ -192,6 +192,7 @@
>    <xsl:template match="p[@xml:space='preserve']">
>      <xsl:apply-templates select="@id"/>
>      <div class="pre">
> +      <xsl:copy-of select="@id"/>
>        <xsl:apply-templates/>
>      </div>
>    </xsl:template>
> @@ -200,6 +201,7 @@
>      <xsl:apply-templates select="@id"/>
>      <pre class="code">
>  <!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
> +      <xsl:copy-of select="@id"/>
>        <xsl:apply-templates/>
>  <!--
>      <xsl:call-template name="format">
> @@ -211,36 +213,59 @@
>    </xsl:template>
>  
>    <xsl:template match="anchor">
> -    <a name="{@id}"/>
> +    <a name="{@id}">
> +      <xsl:copy-of select="@id"/>
> +    </a>
>    </xsl:template>
>  
>    <xsl:template match="icon">
>      <xsl:apply-templates select="@id"/>
>      <img class="icon">
> -        <xsl:copy-of select="@height | @width | @src | @alt"/>
> +      <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
>      </img>
>    </xsl:template>
>  
>    <xsl:template match="code">
>      <xsl:apply-templates select="@id"/>
> -    <span class="codefrag"><xsl:value-of select="."/></span>
> +    <span class="codefrag">
> +      <xsl:copy-of select="@id"/>
> +      <xsl:value-of select="."/>
> +    </span>
>    </xsl:template>
>  
>    <xsl:template match="figure">
>      <xsl:apply-templates select="@id"/>
> +    
>      <div align="center">
> +      <xsl:copy-of select="@id"/>
>        <img class="figure">
> -        <xsl:copy-of select="@height | @width | @src | @alt"/>
> +        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
>        </img>
>      </div>
>    </xsl:template>
>  
>    <xsl:template match="table">
>      <xsl:apply-templates select="@id"/>
> -    <table cellpadding="4" cellspacing="1" class="ForrestTable">
> -      <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor"/>
> -      <xsl:apply-templates/>
> -    </table>
> +    <xsl:choose>
> +      <!-- Limit Forrest specific processing to tables without class -->
> +      <xsl:when test="not(@class) or @class=''">
> +        <table cellpadding="4" cellspacing="1" class="ForrestTable">
> +          <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor |@id"/>
> +          <xsl:apply-templates/>
> +        </table>    
> +      </xsl:when>
> +      <xsl:otherwise>
> +        <!-- Tables with class are passed without change -->
> +        <xsl:copy>
> +          <xsl:copy-of select="@*"/>
> +          <xsl:apply-templates/>
> +        </xsl:copy>    
> +        
> +      </xsl:otherwise>
> +    </xsl:choose>
> +    <xsl:if test="@class = ''">
> +      
> +    </xsl:if>
>    </xsl:template>
>  
>    <xsl:template match="acronym/@title">
> @@ -359,8 +384,13 @@
>    <!-- End of "toc" mode templates -->
>  
>    <xsl:template match="node()|@*" priority="-1">
> +    <!-- id processing will create its own a-element so processing has to 
> +         happen outside the copied element 
> +    -->
> +    <xsl:apply-templates select="@id"/>
>      <xsl:copy>
> -      <xsl:apply-templates select="@*"/>
> +      <xsl:apply-templates select="@*[name(.) != 'id']"/>
> +      <xsl:copy-of select="@id"/>
>        <xsl:apply-templates/>
>      </xsl:copy>
>    </xsl:template>
> 
> Modified: forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
> URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
> ==============================================================================
> --- forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl (original)
> +++ forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl Thu Oct  6 01:45:42 2005
> @@ -1,6 +1,6 @@
>  <?xml version="1.0"?>
>  <!--
> -  Copyright 2002-2004 The Apache Software Foundation or its licensors,
> +  Copyright 2002-2005 The Apache Software Foundation or its licensors,
>    as applicable.
>  
>    Licensed under the Apache License, Version 2.0 (the "License");
> @@ -136,8 +136,8 @@
>    
>    <xsl:template match="figure">
>      <xsl:apply-templates select="@id"/>
> -    <div style="text-align: center;">
> -      <img src="{@src}" alt="{@alt}" class="figure">
> +    <div style="text-align: center;" id="{@id}">
> +      <img src="{@src}" alt="{@alt}" class="figure"  id="{@id}">
>          <xsl:if test="@height">
>            <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
>          </xsl:if>
>