You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cr...@apache.org on 2007/04/10 07:33:34 UTC
svn commit: r527037 [4/6] - in
/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher:
./ resources/stylesheets/ resources/stylesheets/common/
resources/stylesheets/common/css/ resources/stylesheets/common/images/
resources/sty...
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/html/xhtml2_to_html.xsl Mon Apr 9 22:33:31 2007
@@ -34,957 +34,947 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/2002/06/xhtml2"
exclude-result-prefixes="html xsl"
- >
+ >
<xsl:include href="lm://transform.xml.generateId"/>
- <!-- If imported into another stylesheet, allow the first level heading
+<!-- If imported into another stylesheet, allow the first level heading
- depth to be configured -->
<xsl:param name="xhtml-heading" select="1"/>
-
- <!-- Use XHTML 1.0 as the output schema -->
+<!-- Use XHTML 1.0 as the output schema -->
<xsl:output method="html" version="1.0" encoding="utf-8"
omit-xml-declaration="yes" media-type="text/html"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
-
- <!-- Copy elements by default -->
+<!-- Copy elements by default -->
<xsl:template match="comment()">
- <xsl:comment><xsl:value-of select="."/></xsl:comment>
+ <xsl:comment>
+ <xsl:value-of select="."/>
+ </xsl:comment>
</xsl:template>
-
- <!-- Do not process elements and attributes by default -->
+<!-- Do not process elements and attributes by default -->
<xsl:template match="html:*"/>
<xsl:template match="html:*/@*" priority="0"/>
<xsl:template match="html:*/@*" mode="insdel" priority="0"/>
<xsl:template match="html:*/@*" mode="image" priority="0"/>
<xsl:template match="html:*/@*" mode="quote" priority="0"/>
<xsl:template match="html:*/@*" mode="link" priority="0"/>
-
- <!--
+<!--
- XHTML Attribute Collections
-->
-
- <!-- Core Attribute Collection -->
+<!-- Core Attribute Collection -->
<xsl:template match="@class">
- <xsl:param name="class"/>
- <xsl:attribute name="class">
- <xsl:if test="$class">
- <xsl:value-of select="$class"/>
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:param name="class"/>
+ <xsl:attribute name="class">
+ <xsl:if test="$class">
+ <xsl:value-of select="$class"/>
+<xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="@id|@title">
- <xsl:attribute name="{local-name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- I18N Attribute Collection -->
+<!-- I18N Attribute Collection -->
<xsl:template match="@xml:lang">
- <xsl:attribute name="lang"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="lang">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- Bi-directional Text Collection -->
+<!-- Bi-directional Text Collection -->
<xsl:template match="@dir">
- <!-- TODO: Need to handle lro and rlo. Not in HTML4 -->
- <xsl:attribute name="dir"><xsl:value-of select="."/></xsl:attribute>
+<!-- TODO: Need to handle lro and rlo. Not in HTML4 -->
+ <xsl:attribute name="dir">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- Edit Collection -->
+<!-- Edit Collection -->
<xsl:template match="@edit" mode="insdel"/>
<xsl:template match="@datetime" mode="insdel">
- <xsl:attribute name="datetime"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="datetime">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- Hypertext Attribute Collection -->
+<!-- Hypertext Attribute Collection -->
<xsl:template match="@href|@rel|@rev|@accesskey|@target" mode="link">
- <xsl:attribute name="{local-name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="@navindex" mode="link">
- <xsl:attribute name="tabindex"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="tabindex">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
- <!-- Make sure only one tag gets the cite attribute -->
+<!-- Make sure only one tag gets the cite attribute -->
<xsl:template match="@cite" mode="insdel">
- <xsl:attribute name="cite"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="cite">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="@cite" mode="quote">
- <xsl:if test="count(@edit)=0">
- <xsl:attribute name="cite"><xsl:value-of select="."/></xsl:attribute>
- </xsl:if>
+ <xsl:if test="count(@edit)=0">
+ <xsl:attribute name="cite">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:if>
</xsl:template>
-
- <!-- Embedding Attribute Collection -->
+<!-- Embedding Attribute Collection -->
<xsl:template match="@src" mode="image">
- <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="src">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="html:link/@type" mode="link">
- <xsl:attribute name="type"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="type">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- Image Map Attribute Collection -->
+<!-- Image Map Attribute Collection -->
<xsl:template match="@usemap|@ismap" mode="image">
- <xsl:attribute name="{local-name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!-- Style Attribute Collection -->
+<!-- Style Attribute Collection -->
<xsl:template match="@style">
- <xsl:attribute name="style"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="style">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!--
+<!--
- Block rendering templates
-->
- <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+<!-- If the edit attribute has been used, add a ins or del as appropriate -->
<xsl:template name="block">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- No edit attribute, just call next level -->
- <xsl:when test="count(@edit)=0">
- <xsl:call-template name="block-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Edit attribute set to "deleted", create a del element -->
- <xsl:when test="@edit='deleted'">
- <del>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="block-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </del>
- </xsl:when>
- <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+<!-- Edit attribute set to "inserted", "changed", "moved", create an ins
- element -->
- <xsl:otherwise>
- <ins>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="block-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </ins>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- Create the element before any automatic inline children -->
+<!-- Create the element before any automatic inline children -->
<xsl:template name="block-element">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- The hr element is empty -->
- <xsl:when test="$element='hr'">
- <hr>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </hr>
- </xsl:when>
- <!-- Create element -->
- <xsl:otherwise>
- <xsl:element name="{$element}">
- <xsl:if test="$class">
- <xsl:attribute name="class">
- <xsl:value-of select="$class"/>
- </xsl:attribute>
- <xsl:if test="$class='section'">
- <a>
- <xsl:attribute name="name">
- <xsl:if test="@id">
- <xsl:value-of select="@id"/>
- </xsl:if>
- <xsl:if test="not(@id)">
- <xsl:call-template name="generate-id"/>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- The hr element is empty -->
+ <xsl:when test="$element='hr'">
+ <hr>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </hr>
+ </xsl:when>
+<!-- Create element -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ <xsl:if test="$class='section'"><a>
+ <xsl:attribute name="name">
+ <xsl:if test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:if>
+ <xsl:if test="not(@id)">
+ <xsl:call-template name="generate-id"/>
+ </xsl:if>
+ </xsl:attribute> 
+ </a>
</xsl:if>
- </xsl:attribute> 
- </a>
- </xsl:if>
- </xsl:if>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="block-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the cite attribute appears without edit, create a quote element -->
+<!-- If the cite attribute appears without edit, create a quote element -->
<xsl:template name="block-quote">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no cite attribute or edit was defined, continue to next level -->
- <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)
or ($element='blockquote')">
- <xsl:call-template name="block-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Create the quote element -->
- <xsl:otherwise>
- <q>
- <xsl:apply-templates select="@*" mode="quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="block-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </q>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="block-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the href attribute appears, make a hyperlink -->
+<!-- If the href attribute appears, make a hyperlink -->
<xsl:template name="block-link">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no href attribute appears, continue to next level -->
- <xsl:when test="count(@href)=0">
- <xsl:call-template name="block-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- href has been used, so create an anchor -->
- <xsl:otherwise>
- <a>
- <xsl:apply-templates select="@*" mode="link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="block-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="block-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- href has been used, so create an anchor -->
+ <xsl:otherwise><a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="block-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template></a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the src attribute appears, make an image -->
+<!-- If the src attribute appears, make an image -->
<xsl:template name="block-image">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no src attribute appears, continue to next level -->
- <xsl:when test="count(@src)=0">
- <xsl:apply-templates/>
- </xsl:when>
- <!-- src has been used, so replace with an image -->
- <xsl:otherwise>
- <img alt="{.}">
- <xsl:apply-templates select="@*" mode="image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </img>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:apply-templates/>
+ </xsl:when>
+<!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!--
+<!--
- Inline rendering templates
-->
- <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+<!-- If the edit attribute has been used, add a ins or del as appropriate -->
<xsl:template name="inline">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- No edit attribute, just call next level -->
- <xsl:when test="count(@edit)=0">
- <xsl:call-template name="inline-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Edit attribute set to "deleted", create a del element -->
- <xsl:when test="@edit='deleted'">
- <del>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="inline-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </del>
- </xsl:when>
- <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+<!-- Edit attribute set to "inserted", "changed", "moved", create an ins
- element -->
- <xsl:otherwise>
- <ins>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="inline-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </ins>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the cite attribute appears without edit, create a quote element -->
+<!-- If the cite attribute appears without edit, create a quote element -->
<xsl:template name="inline-quote">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no cite attribute or edit was defined, continue to next level -->
- <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
- <xsl:call-template name="inline-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Create the quote element -->
- <xsl:otherwise>
- <q>
- <xsl:apply-templates select="@*" mode="quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="inline-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </q>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="inline-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the href attribute appears, make a hyperlink -->
+<!-- If the href attribute appears, make a hyperlink -->
<xsl:template name="inline-link">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no href attribute appears, continue to next level -->
- <xsl:when test="count(@href)=0">
- <xsl:call-template name="inline-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- href has been used, so create an anchor -->
- <xsl:otherwise>
- <a>
- <xsl:apply-templates select="@*" mode="link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="inline-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="inline-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- href has been used, so create an anchor -->
+ <xsl:otherwise><a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="inline-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template></a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the src attribute appears, make an image -->
+<!-- If the src attribute appears, make an image -->
<xsl:template name="inline-image">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no src attribute appears, continue to next level -->
- <xsl:when test="count(@src)=0">
- <xsl:call-template name="inline-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- src has been used, so replace with an image -->
- <xsl:otherwise>
- <img alt="{.}">
- <xsl:apply-templates select="@*" mode="image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </img>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:call-template name="inline-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- Finally, create the element (assuming not quote) -->
+<!-- Finally, create the element (assuming not quote) -->
<xsl:template name="inline-element">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If element is 'q' or 'a', it has already been made -->
- <xsl:when test="($element='q') or ($element='a')">
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates/>
- </xsl:when>
- <!-- If element is 'br', make a span and put br at end -->
- <xsl:when test="$element='br'">
- <span class="line">
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates/><br/>
- </span>
- </xsl:when>
- <!-- Create element -->
- <xsl:otherwise>
- <xsl:element name="{$element}">
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If element is 'q' or 'a', it has already been made -->
+ <xsl:when test="($element='q') or ($element='a')">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:when>
+<!-- If element is 'br', make a span and put br at end -->
+ <xsl:when test="$element='br'">
+ <span class="line">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ <br/>
+ </span>
+ </xsl:when>
+<!-- Create element -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!--
+<!--
- List rendering templates
-->
- <!-- If the edit attribute has been used, add a ins or del as appropriate -->
+<!-- If the edit attribute has been used, add a ins or del as appropriate -->
<xsl:template name="list">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- No edit attribute, just call next level -->
- <xsl:when test="count(@edit)=0">
- <xsl:call-template name="list-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Edit attribute set to "deleted", create a del element -->
- <xsl:when test="@edit='deleted'">
- <del>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="list-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </del>
- </xsl:when>
- <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+<!-- Edit attribute set to "inserted", "changed", "moved", create an ins
- element -->
- <xsl:otherwise>
- <ins>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="list-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </ins>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the cite attribute appears without edit, create a quote element -->
+<!-- If the cite attribute appears without edit, create a quote element -->
<xsl:template name="list-quote">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no cite attribute or edit was defined, continue to next level -->
- <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
- <xsl:call-template name="list-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Create the quote element -->
- <xsl:otherwise>
- <blockquote>
- <xsl:apply-templates select="@*" mode="quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="list-element">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </blockquote>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="list-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Create the quote element -->
+ <xsl:otherwise>
+ <blockquote>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-element">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </blockquote>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- Create the element before any automatic inline children -->
+<!-- Create the element before any automatic inline children -->
<xsl:template name="list-element">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If going to be replaced with an image, create a para instead -->
- <xsl:when test="count(@src)">
- <p>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="list-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </p>
- </xsl:when>
- <!-- Create element and continue to children -->
- <xsl:otherwise>
- <xsl:element name="{$element}">
- <xsl:if test="$class">
- <xsl:attribute name="class">
- <xsl:value-of select="$class"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="count(html:summary)">
- <xsl:attribute name="summary">
- <xsl:value-of select="html:summary"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If going to be replaced with an image, create a para instead -->
+ <xsl:when test="count(@src)">
+ <p>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </p>
+ </xsl:when>
+<!-- Create element and continue to children -->
+ <xsl:otherwise>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="count(html:summary)">
+ <xsl:attribute name="summary">
+ <xsl:value-of select="html:summary"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the href and src are provided, make a linked image -->
+<!-- If the href and src are provided, make a linked image -->
<xsl:template name="list-link">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no href attribute appears, continue to next level -->
- <xsl:when test="count(@href)=0">
- <xsl:call-template name="list-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- href has been used, so create an anchor -->
- <xsl:otherwise>
- <a>
- <xsl:apply-templates select="@*" mode="link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="list-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="list-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- href has been used, so create an anchor -->
+ <xsl:otherwise><a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="list-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template></a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the src attribute appears, make an image -->
+<!-- If the src attribute appears, make an image -->
<xsl:template name="list-image">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <img alt="{.}">
- <xsl:apply-templates select="@*" mode="image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </img>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
</xsl:template>
-
- <!--
+<!--
- List Item rendering templates
-->
- <!-- Create the element before any automatic inline children -->
+<!-- Create the element before any automatic inline children -->
<xsl:template name="listitem">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:element name="{$element}">
- <xsl:if test="$class">
- <xsl:attribute name="class">
- <xsl:value-of select="$class"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="listitem-insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
-
- <!-- If the edit attribute has been used, add a ins or del as appropriate -->
- <xsl:template name="listitem-insdel">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- No edit attribute, just call next level -->
- <xsl:when test="count(@edit)=0">
- <xsl:call-template name="listitem-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Edit attribute set to "deleted", create a del element -->
- <xsl:when test="@edit='deleted'">
- <del>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:element name="{$element}">
+ <xsl:if test="$class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
</xsl:apply-templates>
- <xsl:call-template name="listitem-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
+ <xsl:call-template name="listitem-insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
</xsl:call-template>
- </del>
- </xsl:when>
- <!-- Edit attribute set to "inserted", "changed", "moved", create an ins
+ </xsl:element>
+ </xsl:template>
+<!-- If the edit attribute has been used, add a ins or del as appropriate -->
+ <xsl:template name="listitem-insdel">
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- No edit attribute, just call next level -->
+ <xsl:when test="count(@edit)=0">
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Edit attribute set to "deleted", create a del element -->
+ <xsl:when test="@edit='deleted'">
+ <del>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </del>
+ </xsl:when>
+<!-- Edit attribute set to "inserted", "changed", "moved", create an ins
- element -->
- <xsl:otherwise>
- <ins>
- <xsl:apply-templates select="@*" mode="insdel">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="listitem-quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </ins>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:otherwise>
+ <ins>
+ <xsl:apply-templates select="@*" mode="insdel">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </ins>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the cite attribute appears without edit, create a quote element -->
+<!-- If the cite attribute appears without edit, create a quote element -->
<xsl:template name="listitem-quote">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no cite attribute or edit was defined, continue to next level -->
- <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
- <xsl:call-template name="listitem-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Create the quote element -->
- <xsl:otherwise>
- <q>
- <xsl:apply-templates select="@*" mode="quote">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="listitem-link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </q>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no cite attribute or edit was defined, continue to next level -->
+ <xsl:when test="(count(@cite)=0) or (count(@edit)!=0)">
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- Create the quote element -->
+ <xsl:otherwise>
+ <q>
+ <xsl:apply-templates select="@*" mode="quote">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </q>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the href attribute appears, make a hyperlink -->
+<!-- If the href attribute appears, make a hyperlink -->
<xsl:template name="listitem-link">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no href attribute appears, continue to next level -->
- <xsl:when test="count(@href)=0">
- <xsl:call-template name="listitem-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </xsl:when>
- <!-- href has been used, so create an anchor -->
- <xsl:otherwise>
- <a>
- <xsl:apply-templates select="@*" mode="link">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- <xsl:call-template name="listitem-image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:call-template>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no href attribute appears, continue to next level -->
+ <xsl:when test="count(@href)=0">
+ <xsl:call-template name="listitem-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- href has been used, so create an anchor -->
+ <xsl:otherwise><a>
+ <xsl:apply-templates select="@*" mode="link">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="listitem-image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:call-template></a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!-- If the src attribute appears, make an image -->
+<!-- If the src attribute appears, make an image -->
<xsl:template name="listitem-image">
- <xsl:param name="element"/>
- <xsl:param name="class"/>
- <xsl:choose>
- <!-- If no src attribute appears, continue to next level -->
- <xsl:when test="count(@src)=0">
- <xsl:apply-templates/>
- </xsl:when>
- <!-- src has been used, so replace with an image -->
- <xsl:otherwise>
- <img alt="{.}">
- <xsl:apply-templates select="@*" mode="image">
- <xsl:with-param name="element" select="$element"/>
- <xsl:with-param name="class" select="$class"/>
- </xsl:apply-templates>
- </img>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="element"/>
+ <xsl:param name="class"/>
+ <xsl:choose>
+<!-- If no src attribute appears, continue to next level -->
+ <xsl:when test="count(@src)=0">
+ <xsl:apply-templates/>
+ </xsl:when>
+<!-- src has been used, so replace with an image -->
+ <xsl:otherwise>
+ <img alt="{.}">
+ <xsl:apply-templates select="@*" mode="image">
+ <xsl:with-param name="element" select="$element"/>
+ <xsl:with-param name="class" select="$class"/>
+ </xsl:apply-templates>
+ </img>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
-
- <!--
+<!--
- XHTML Structure Module
-->
- <!-- Add our Subversion/CVS Id to the root element -->
+<!-- Add our Subversion/CVS Id to the root element -->
<xsl:template match="html:html">
- <xsl:comment> $Id: xhtml2html.xslt 127 2004-11-14 03:06:21Z etherealwake $ </xsl:comment>
- <html>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </html>
+ <xsl:comment> $Id: xhtml2html.xslt 127 2004-11-14 03:06:21Z etherealwake $ </xsl:comment>
+ <html>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </html>
</xsl:template>
- <!-- Specify namespace for metadata (if not using schema.X links) -->
+<!-- Specify namespace for metadata (if not using schema.X links) -->
<xsl:template match="html:html/@profile">
- <xsl:attribute name="profile"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="profile">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
- <!-- Add a generator tag to the head section -->
+<!-- Add a generator tag to the head section -->
<xsl:template match="html:head">
- <head>
- <xsl:apply-templates select="@*"/>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <xsl:apply-templates/>
- <xsl:if test="count(html:meta[@name='generator'])=0">
- <meta name="generator" content="Ethereal Wake XHTML2 to XHTML1 XSLT"/>
- </xsl:if>
- </head>
+ <head>
+ <xsl:apply-templates select="@*"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <xsl:apply-templates/>
+ <xsl:if test="count(html:meta[@name='generator'])=0">
+ <meta name="generator" content="Ethereal Wake XHTML2 to XHTML1 XSLT"/>
+ </xsl:if>
+ </head>
</xsl:template>
- <!-- <title> and <body> are pretty much copied as is -->
+<!-- <title> and <body> are pretty much copied as is -->
<xsl:template match="html:title|html:body">
- <xsl:element name="{local-name()}">
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:element>
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:template>
-
- <!--
+<!--
- XHTML Block Text Module
-->
- <!-- Handle the elements practically unchanged since XHTML 1.0 -->
+<!-- Handle the elements practically unchanged since XHTML 1.0 -->
<xsl:template match="html:address|html:blockquote|html:div|html:hr
|html:pre|html:hr">
- <xsl:call-template name="block">
- <xsl:with-param name="element" select="local-name(.)"/>
- </xsl:call-template>
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
</xsl:template>
- <!-- In XHTML 2.0, paragraphs are a bit more sophisticated than in 1.X -->
+<!-- In XHTML 2.0, paragraphs are a bit more sophisticated than in 1.X -->
<xsl:template match="html:p">
- <xsl:choose>
- <!-- If we have XHTML 1.0 block children, make us a div -->
- <xsl:when test="count(html:ul|html:ol|html:nl|html:dl|html:blockcode
+ <xsl:choose>
+<!-- If we have XHTML 1.0 block children, make us a div -->
+ <xsl:when test="count(html:ul|html:ol|html:nl|html:dl|html:blockcode
|html:blockquote|html:pre|html:table)>0">
- <xsl:call-template name="block">
- <xsl:with-param name="element" select="'div'"/>
- <xsl:with-param name="class" select="'p'"/>
- </xsl:call-template>
- </xsl:when>
- <!-- If no block children, be a traditional paragraph -->
- <xsl:otherwise>
- <xsl:call-template name="block">
- <xsl:with-param name="element" select="'p'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'div'"/>
+ <xsl:with-param name="class" select="'p'"/>
+ </xsl:call-template>
+ </xsl:when>
+<!-- If no block children, be a traditional paragraph -->
+ <xsl:otherwise>
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'p'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
- <!-- We will treat sections as simple <div>s of class section -->
+<!-- We will treat sections as simple <div>s of class section -->
<xsl:template match="html:section">
- <xsl:call-template name="block">
- <xsl:with-param name="element" select="'div'"/>
- <xsl:with-param name="class" select="'section'"/>
- </xsl:call-template>
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="'div'"/>
+ <xsl:with-param name="class" select="'section'"/>
+ </xsl:call-template>
</xsl:template>
- <!-- <h> gets mapped to a h# based on how many parent sections -->
+<!-- <h> gets mapped to a h# based on how many parent sections -->
<xsl:template match="html:h">
- <!-- Count the number of sections -->
- <xsl:variable name="levelbase">
- <xsl:value-of select="count(ancestor::html:section)+$xhtml-heading"/>
- </xsl:variable>
- <!-- Limit the heading element to h6 -->
- <xsl:variable name="level">
- <xsl:choose>
- <xsl:when test="$levelbase > 6">6</xsl:when>
- <xsl:otherwise><xsl:value-of select="$levelbase"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Create the appropriate element -->
- <xsl:call-template name="block">
- <xsl:with-param name="element" select="concat('h',$level)"/>
- </xsl:call-template>
+<!-- Count the number of sections -->
+ <xsl:variable name="levelbase">
+ <xsl:value-of select="count(ancestor::html:section)+$xhtml-heading"/>
+ </xsl:variable>
+<!-- Limit the heading element to h6 -->
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="$levelbase > 6">6</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$levelbase"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+<!-- Create the appropriate element -->
+ <xsl:call-template name="block">
+ <xsl:with-param name="element" select="concat('h',$level)"/>
+ </xsl:call-template>
</xsl:template>
-
- <!--
+<!--
- XHTML Inline Text Module
-->
- <!-- Handle the elements practically unchanged since XHTML 1.0 -->
+<!-- Handle the elements practically unchanged since XHTML 1.0 -->
<xsl:template match="html:abbr|html:cite|html:code|html:dfn|html:em
|html:kbd|html:samp|html:span|html:strong|html:sub|html:sup
|html:var">
- <xsl:call-template name="inline">
- <xsl:with-param name="element" select="local-name()"/>
- </xsl:call-template>
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="local-name()"/>
+ </xsl:call-template>
</xsl:template>
- <!-- quote maps to the 'q' element from XHTML 1.0 -->
+<!-- quote maps to the 'q' element from XHTML 1.0 -->
<xsl:template match="html:quote">
- <xsl:call-template name="inline">
- <xsl:with-param name="element" select="'q'"/>
- </xsl:call-template>
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'q'"/>
+ </xsl:call-template>
</xsl:template>
- <!-- <l> is a more complex version of HTML's <br> -->
+<!-- <l> is a more complex version of HTML's <br> -->
<xsl:template match="html:l">
- <xsl:call-template name="inline">
- <xsl:with-param name="element" select="'br'"/>
- </xsl:call-template>
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'br'"/>
+ </xsl:call-template>
</xsl:template>
-
- <!--
+<!--
- XHTML Hypertext Module
-->
<xsl:template match="html:a">
- <xsl:call-template name="inline">
- <xsl:with-param name="element" select="'a'"/>
- </xsl:call-template>
+ <xsl:call-template name="inline">
+ <xsl:with-param name="element" select="'a'"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="html:a/@id" mode="link">
- <xsl:attribute name="id"><xsl:value-of select="."/></xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!--
+<!--
- XHTML List Module
-->
<xsl:template match="html:ul|html:ol|html:dl">
- <xsl:call-template name="list">
- <xsl:with-param name="element" select="local-name(.)"/>
- </xsl:call-template>
+ <xsl:call-template name="list">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="html:li|html:dt|html:dd">
- <xsl:call-template name="listitem">
- <xsl:with-param name="element" select="local-name(.)"/>
- </xsl:call-template>
+ <xsl:call-template name="listitem">
+ <xsl:with-param name="element" select="local-name(.)"/>
+ </xsl:call-template>
</xsl:template>
-
- <!--
+<!--
- XHTML Linking Module
-->
- <xsl:template match="html:link">
- <link><xsl:apply-templates select="@*" mode="link"/></link>
+ <xsl:template match="html:link"><link>
+ <xsl:apply-templates select="@*" mode="link"/></link>
</xsl:template>
<xsl:template match="html:link/@media" mode="link">
- <xsl:attribute name="media"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="media">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="html:link/@xml:lang" mode="link">
- <xsl:attribute name="hreflang"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="hreflang">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!--
+<!--
- XHTML Metainformation Module
- -->
+ -->
<xsl:template match="html:meta">
- <meta>
- <xsl:apply-templates select="@*"/>
- <xsl:attribute name="content"><xsl:value-of select="."/></xsl:attribute>
- </meta>
+ <meta>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="content">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </meta>
</xsl:template>
<xsl:template match="html:meta/@name">
- <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!--
+<!--
- XHTML Object Module
-->
- <!--
+<!--
- Ruby Module
-->
- <!--
+<!--
- XHTML Scripting Module
-->
- <!--
+<!--
- XHTML Style Sheet Module
-->
<xsl:template match="html:style">
- <style>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </style>
+ <style>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </style>
</xsl:template>
<xsl:template match="html:style/@media">
- <xsl:attribute name="media"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="media">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
-
- <!--
+<!--
- XHTML Tables Module
-->
- <!-- Some table elements are pretty much left unchanged -->
+<!-- Some table elements are pretty much left unchanged -->
<xsl:template match="html:caption|html:col|html:colgroup|html:thead
|html:tfoot|html:tbody|html:tr">
- <xsl:element name="{local-name()}">
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:element>
+ <xsl:element name="{local-name()}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:template>
<xsl:template match="html:col/@span|html:colspan/@span">
- <xsl:attribute name="span"><xsl:value-of select="."/></xsl:attribute>
+ <xsl:attribute name="span">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
- <!-- td and th are pretty much as they were -->
+<!-- td and th are pretty much as they were -->
<xsl:template match="html:td|html:th">
- <xsl:call-template name="listitem">
- <xsl:with-param name="element" select="local-name()"/>
- </xsl:call-template>
+ <xsl:call-template name="listitem">
+ <xsl:with-param name="element" select="local-name()"/>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="html:td/@abbr|html:td/@axis|html:td/@colspan
|html:td/@headers|html:td/@rowspan|html:td/@scope|html:th/@abbr
|html:th/@axis|html:th/@colspan|html:th/@headers|html:th/@rowspan
|html:th/@scope">
- <xsl:attribute name="{local-name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
</xsl:template>
- <!-- The table element acts a lot like a list -->
+<!-- The table element acts a lot like a list -->
<xsl:template match="html:table">
- <xsl:call-template name="list">
- <xsl:with-param name="element" select="'table'"/>
- </xsl:call-template>
+ <xsl:call-template name="list">
+ <xsl:with-param name="element" select="'table'"/>
+ </xsl:call-template>
</xsl:template>
-
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts-to-document.xsl Mon Apr 9 22:33:31 2007
@@ -20,7 +20,7 @@
xmlns:dir="http://apache.org/cocoon/directory/2.0"
xmlns:session="http://apache.org/cocoon/session/1.0"
xmlns:forrest="http://apache.org/forrest/templates/1.0" >
- <!--
+<!--
Create row for each document. Information about the document is
extracted from the document itself using the document()
function.
@@ -32,9 +32,11 @@
<document>
<header>
<title>ls.contract<xsl:if
- test="$requestedContract='false'">s</xsl:if><xsl:if
+ test="$requestedContract='false'">s</xsl:if>
+ <xsl:if
test="$requestedContract!='false'"> <xsl:value-of
- select="$requestedContract" /></xsl:if> </title>
+ select="$requestedContract" />
+ </xsl:if></title>
</header>
<body>
<xsl:choose>
@@ -57,7 +59,7 @@
<xsl:template match="forrest:theme">
<xsl:variable select="@name" name="name"/>
<section id="{$name}">
- <title> theme name: <xsl:value-of select="@name" /> </title>
+ <title> theme name: <xsl:value-of select="@name" /></title>
<xsl:apply-templates select="./forrest:contract">
<xsl:with-param select="$name" name="theme"/>
</xsl:apply-templates>
@@ -79,9 +81,7 @@
</xsl:choose>
</xsl:template>
<xsl:template name="innerBodyLs">
- <title>
- <xsl:value-of select="@name" />
- </title>
+ <title><xsl:value-of select="@name" /></title>
<p class="file">
<strong>file-name:</strong>
<br/>
@@ -111,4 +111,4 @@
</xsl:template>
<xsl:template match="forrest:template/@*"> <xsl:value-of
select="name()"/>="<xsl:value-of select="."/>"</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/ls.contracts.xsl Mon Apr 9 22:33:31 2007
@@ -40,4 +40,4 @@
<xsl:copy-of select="@*"/>
</forrest:template>
</xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/project-to-text.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/project-to-text.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/project-to-text.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/project-to-text.xsl Mon Apr 9 22:33:31 2007
@@ -15,19 +15,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<!--+
| Replace element for the value on the project descriptor
| xmlns:for has to be replaced for the final version
+-->
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:for="http://apache.org/forrest" version="1.0">
-
<xsl:import href="lm://transform.xml.copyover.helper"/>
-
<xsl:template match="for:*">
<xsl:variable name="ln" select="local-name()"/>
<xsl:value-of select="//*[@name = $ln]/@value"/>
</xsl:template>
-
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/root-strip.xsl Mon Apr 9 22:33:31 2007
@@ -15,13 +15,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:forrest="http://apache.org/forrest/templates/1.0">
-
<xsl:template match="/">
<xsl:copy-of select="*/*"/>
</xsl:template>
-
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/round-corner-hex.svg.xslt
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/round-corner-hex.svg.xslt?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/round-corner-hex.svg.xslt (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/round-corner-hex.svg.xslt Mon Apr 9 22:33:31 2007
@@ -16,82 +16,71 @@
limitations under the License.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
- <xsl:param name="orientation-tb"/>
- <xsl:param name="orientation-lr"/>
- <xsl:param name="size"/>
- <xsl:param name="bg-color-name"/>
- <xsl:param name="stroke-color-name"/>
- <xsl:param name="fg-color-name"/>
-
- <!-- if not all colors are present, don't even try to render the corners -->
- <xsl:variable name="isize">
- <xsl:choose>
- <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name"><xsl:value-of select="$size"/></xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="smallersize" select="number($isize)-1"/>
- <xsl:variable name="biggersize" select="number($isize)+1"/>
- <xsl:variable name="bg">fill:#<xsl:value-of select="$bg-color-name"/>;</xsl:variable>
- <xsl:variable name="fill">fill:#<xsl:value-of select="$fg-color-name"/>;</xsl:variable>
- <xsl:variable name="stroke">stroke:#<xsl:value-of select="$stroke-color-name"/>;</xsl:variable>
-
- <xsl:template match="/">
-
-
-<svg width="{$isize}" height="{$isize}">
+ <xsl:param name="orientation-tb"/>
+ <xsl:param name="orientation-lr"/>
+ <xsl:param name="size"/>
+ <xsl:param name="bg-color-name"/>
+ <xsl:param name="stroke-color-name"/>
+ <xsl:param name="fg-color-name"/>
+<!-- if not all colors are present, don't even try to render the corners -->
+ <xsl:variable name="isize">
+ <xsl:choose>
+ <xsl:when test="$bg-color-name and $stroke-color-name and $fg-color-name">
+ <xsl:value-of select="$size"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smallersize" select="number($isize)-1"/>
+ <xsl:variable name="biggersize" select="number($isize)+1"/>
+ <xsl:variable name="bg">fill:#<xsl:value-of select="$bg-color-name"/>;</xsl:variable>
+ <xsl:variable name="fill">fill:#<xsl:value-of select="$fg-color-name"/>;</xsl:variable>
+ <xsl:variable name="stroke">stroke:#<xsl:value-of select="$stroke-color-name"/>;</xsl:variable>
+ <xsl:template match="/">
+ <svg width="{$isize}" height="{$isize}">
<!-- background -->
- <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
+ <rect x="-1" y="-1" width="{$biggersize}" height="{$biggersize}" style="{$bg}stroke-width:0"/>
<!-- 0,0 0,-4 4,0 4,-4-->
-
- <xsl:variable name="flip-tb-scale">
- <xsl:choose>
- <xsl:when test="$orientation-tb='t'">1</xsl:when>
- <xsl:otherwise>-1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="flip-lr-scale">
- <xsl:choose>
- <xsl:when test="$orientation-lr='l'">1</xsl:when>
- <xsl:otherwise>-1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="flip-tb-translate">
- <xsl:choose>
- <xsl:when test="$orientation-tb='t'">0</xsl:when>
- <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="flip-lr-translate">
- <xsl:choose>
- <xsl:when test="$orientation-lr='l'">0</xsl:when>
- <xsl:otherwise>-<xsl:value-of select="$isize" /></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- flip transform -->
- <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
- <xsl:call-template name="figure" />
- </g>
-</svg>
-</xsl:template>
-
-
+ <xsl:variable name="flip-tb-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="flip-lr-scale">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">1</xsl:when>
+ <xsl:otherwise>-1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="flip-tb-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-tb='t'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="flip-lr-translate">
+ <xsl:choose>
+ <xsl:when test="$orientation-lr='l'">0</xsl:when>
+ <xsl:otherwise>-<xsl:value-of select="$isize" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+<!-- flip transform -->
+ <g transform="scale({$flip-lr-scale},{$flip-tb-scale}) translate({$flip-lr-translate}, {$flip-tb-translate})">
+ <xsl:call-template name="figure" />
+ </g>
+ </svg>
+ </xsl:template>
<xsl:template name="figure">
- <!-- Just change shape here -->
- <g transform="translate(0.5 0.5)">
- <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
+<!-- Just change shape here -->
+ <g transform="translate(0.5 0.5)">
+ <ellipse cx="{$smallersize}" cy="{$smallersize}" rx="{$smallersize}" ry="{$smallersize}"
style="{$fill}{$stroke}stroke-width:1"/>
- </g>
- <!-- end -->
+ </g>
+<!-- end -->
</xsl:template>
-
-
- <!--<xsl:template match="*"></xsl:template>
+<!--<xsl:template match="*"></xsl:template>
<xsl:template match="text()"></xsl:template>-->
-
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-abstract.xsl Mon Apr 9 22:33:31 2007
@@ -19,9 +19,8 @@
This stylesheet contains templates for converting documentv11 to HTML. See the
imported document2html.xsl for details.
-->
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- Templates for "toc" mode. This will generate a complete
+<!-- Templates for "toc" mode. This will generate a complete
Table of Contents for the document. This will then be used
by the site2xhtml to generate a Menu ToC and a Page ToC -->
<xsl:template match="document">
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-authors.xsl Mon Apr 9 22:33:31 2007
@@ -19,9 +19,8 @@
This stylesheet contains templates for converting documentv11 to HTML. See the
imported document2html.xsl for details.
-->
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- Templates for "toc" mode. This will generate a complete
+<!-- Templates for "toc" mode. This will generate a complete
Table of Contents for the document. This will then be used
by the site2xhtml to generate a Menu ToC and a Page ToC -->
<xsl:template match="document">
@@ -31,16 +30,16 @@
</xsl:template>
<xsl:template match="header/authors">
<xsl:if test="person">
- <xsl:for-each select="person">
- <div class="author">
- <div class="name">
- <xsl:value-of select="@name"/>
- </div>
- <div class="email">
- <xsl:value-of select="@email"/>
- </div>
+ <xsl:for-each select="person">
+ <div class="author">
+ <div class="name">
+ <xsl:value-of select="@name"/>
</div>
- </xsl:for-each>
+ <div class="email">
+ <xsl:value-of select="@email"/>
+ </div>
+ </div>
+ </xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-notice.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-notice.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-notice.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-notice.xsl Mon Apr 9 22:33:31 2007
@@ -19,7 +19,6 @@
This stylesheet contains templates for converting documentv11 to HTML. See the
imported document2html.xsl for details.
-->
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="document">
<div class="notice">
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-title.xsl Mon Apr 9 22:33:31 2007
@@ -19,9 +19,8 @@
This stylesheet contains templates for converting documentv11 to HTML. See the
imported document2html.xsl for details.
-->
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- Templates for "toc" mode. This will generate a complete
+<!-- Templates for "toc" mode. This will generate a complete
Table of Contents for the document. This will then be used
by the site2xhtml to generate a Menu ToC and a Page ToC -->
<xsl:template match="document">
@@ -33,7 +32,7 @@
<title>*No* title found</title>
</xsl:otherwise>
</xsl:choose>
- <!-- FIXME - Need to manage the subtitle -->
- <!--xsl:copy-of select="header/subtitle"/-->
+<!-- FIXME - Need to manage the subtitle -->
+<!--xsl:copy-of select="header/subtitle"/-->
</xsl:template>
</xsl:stylesheet>
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl?view=diff&rev=527037&r1=527036&r2=527037
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/xml/document-to-toc.xsl Mon Apr 9 22:33:31 2007
@@ -19,10 +19,9 @@
This stylesheet contains templates for converting documentv11 to HTML. See the
imported document2html.xsl for details.
-->
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="../helper/generateId.xsl"/>
- <!-- Templates for "toc" mode. This will generate a complete
+<!-- Templates for "toc" mode. This will generate a complete
Table of Contents for the document. This will then be used
by the site2xhtml to generate a Menu ToC and a Page ToC -->
<xsl:template match="document">
@@ -39,7 +38,8 @@
<xsl:param name="level"/>
<tocitem level="{$level}">
<xsl:attribute name="href">#<xsl:call-template
- name="generate-id"/></xsl:attribute>
+ name="generate-id"/>
+ </xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title"/>
</xsl:attribute>