Author: gmcdonald Date: Mon May 11 02:57:58 2009 New Revision: 773453 URL: http://svn.apache.org/viewvc?rev=773453&view=rev Log: Do not generate id if empty, make id unique for div and img elements. FOR-1154
Modified: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/sample.xml forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl forrest/trunk/main/webapp/skins/pelt/xslt/html/document-to-html.xsl Modified: forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/sample.xml URL: http://svn.apache.org/viewvc/forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/sample.xml?rev=773453&r1=773452&r2=773453&view=diff ============================================================================== --- forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/sample.xml (original) +++ forrest/trunk/main/fresh-site/src/documentation/content/xdocs/samples-b/sample.xml Mon May 11 02:57:58 2009 @@ -347,7 +347,7 @@ And a <code><figure></code> to end all of this. Note that this can also be implemented with an <code><img></code> element. </p> - <figure src="images/project-logo.png" alt="The fine Forrest logo" width="220" height="65"/> + <figure src="images/project-logo.png" alt="The fine Forrest logo" id="forrest-logo" width="220" height="65"/> </section> <section id="area-map"> <title>Using map and area</title> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl?rev=773453&r1=773452&r2=773453&view=diff ============================================================================== --- forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl (original) +++ forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl Mon May 11 02:57:58 2009 @@ -215,9 +215,14 @@ <xsl:template match="figure"> <xsl:apply-templates select="@id"/> <div align="center"> - <xsl:copy-of select="@id"/> + <xsl:if test="@id"> + <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> + </xsl:if> <img class="figure"> - <xsl:copy-of select="@height | @width | @src | @alt | @id"/> + <xsl:copy-of select="@height | @width | @src | @alt"/> + <xsl:if test="@id"> + <xsl:attribute name="id"><xsl:value-of select="@id"/>-figure</xsl:attribute> + </xsl:if> </img> </div> </xsl:template> Modified: forrest/trunk/main/webapp/skins/pelt/xslt/html/document-to-html.xsl URL: http://svn.apache.org/viewvc/forrest/trunk/main/webapp/skins/pelt/xslt/html/document-to-html.xsl?rev=773453&r1=773452&r2=773453&view=diff ============================================================================== --- forrest/trunk/main/webapp/skins/pelt/xslt/html/document-to-html.xsl (original) +++ forrest/trunk/main/webapp/skins/pelt/xslt/html/document-to-html.xsl Mon May 11 02:57:58 2009 @@ -140,8 +140,17 @@ </xsl:template> <xsl:template match="figure"> <xsl:apply-templates select="@id"/> - <div style="text-align: center;" id="{...@id}"> - <img src="{...@src}" alt="{...@alt}" class="figure" id="{...@id}"> + <div style="text-align: center;"> + <xsl:if test="@id"> + <xsl:attribute name="id"> + <xsl:value-of select="@id"/> + </xsl:attribute> + </xsl:if> + <img src="{...@src}" alt="{...@alt}" class="figure"> + <xsl:if test="@id"> + <xsl:attribute name="id"> + <xsl:value-of select="@id"/>-figure</xsl:attribute> + </xsl:if> <xsl:if test="@height"> <xsl:attribute name="height"> <xsl:value-of select="@height"/>