diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2004-02-11 08:46:57 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2004-02-11 08:46:57 +0000 |
commit | d433441efee525e7ce5e09a6cd666efad9c014a0 (patch) | |
tree | 188776b64767c461375b7ae31b360bf343f2898f /stylesheets | |
parent | 6a6db878ed1c11c967230eb1d817f0f48d9ee18b (diff) | |
download | yelp-d433441efee525e7ce5e09a6cd666efad9c014a0.tar.gz |
- More cmdsynopsis work.
* stylesheets/db2html-synopsis.xsl:
* test/testdoc1/testdoc1.xml:
- More cmdsynopsis work.
Diffstat (limited to 'stylesheets')
-rw-r--r-- | stylesheets/db2html-synopsis.xsl | 88 |
1 files changed, 72 insertions, 16 deletions
diff --git a/stylesheets/db2html-synopsis.xsl b/stylesheets/db2html-synopsis.xsl index 40caa2d5..35c3aa34 100644 --- a/stylesheets/db2html-synopsis.xsl +++ b/stylesheets/db2html-synopsis.xsl @@ -85,27 +85,41 @@ <!-- == cmdsynopsis ======================================================== --> <xsl:template match="cmdsynopsis"> + <xsl:param name="sepchar"> + <xsl:choose> + <xsl:when test="@sepchar"> + <xsl:value-of select="@sepchar"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:param> <div class="{name(.)}"> <xsl:call-template name="anchor"/> - <xsl:apply-templates mode="cmdsynopsis.mode"/> + <xsl:apply-templates mode="cmdsynopsis.mode"> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </div> </xsl:template> <xsl:template match="arg | group"> - <xsl:variable name="sepchar"> + <xsl:param name="sepchar"> <xsl:choose> - <xsl:when test="ancestor-or-self::*[@sepchar]"> - <xsl:value-of select="ancestor-or-self::*[@sepchar][1]/@sepchar"/> + <xsl:when test="ancestor::cmdsynopsis[1][@sepchar]"> + <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> - </xsl:variable> - <xsl:value-of select="$sepchar"/> + </xsl:param> + <xsl:choose> <xsl:when test="@choice = 'plain'"> - <xsl:text> </xsl:text> + <xsl:if test="name(.) = 'group'"> + <xsl:text>(</xsl:text> + </xsl:if> </xsl:when> <xsl:when test="@choice = 'req'"> <xsl:text>{</xsl:text> @@ -118,22 +132,27 @@ <xsl:when test="name(.) = 'group'"> <xsl:for-each select="*"> <xsl:if test="name(.) = 'arg' and position() != 1"> - <xsl:text> |</xsl:text> + <xsl:value-of select="concat($sepchar, '|', $sepchar)"/> </xsl:if> - <xsl:apply-templates select="."/> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </xsl:for-each> </xsl:when> <xsl:otherwise> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </xsl:otherwise> </xsl:choose> + <xsl:if test="name(.) = 'group' and @choice = 'plain'"> + <xsl:text>)</xsl:text> + </xsl:if> <xsl:if test="@rep = 'repeat'"> <xsl:text>...</xsl:text> </xsl:if> <xsl:choose> - <xsl:when test="@choice = 'plain'"> - <xsl:text> </xsl:text> - </xsl:when> + <xsl:when test="@choice = 'plain'"/> <xsl:when test="@choice = 'req'"> <xsl:text>}</xsl:text> </xsl:when> @@ -144,7 +163,20 @@ </xsl:template> <xsl:template mode="cmdsynopsis.mode" match="arg | group"> - <xsl:apply-templates select="."/> + <xsl:param name="sepchar"> + <xsl:choose> + <xsl:when test="ancestor::cmdsynopsis[1][@sepchar]"> + <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + <xsl:value-of select="$sepchar"/> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </xsl:template> <xsl:template mode="cmdsynopsis.mode" match="command"> @@ -162,15 +194,39 @@ </xsl:template> <xsl:template match="synopfragment"> + <xsl:param name="sepchar"> + <xsl:choose> + <xsl:when test="ancestor::cmdsynopsis[1][@sepchar]"> + <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:param> <div class="{name(.)}"> <xsl:call-template name="anchor"/> <i><xsl:call-template name="header"/></i> - <xsl:apply-templates/> + <xsl:apply-templates> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </div> </xsl:template> <xsl:template mode="cmdsynopsis.mode" match="synopfragment"> - <xsl:apply-templates select="."/> + <xsl:param name="sepchar"> + <xsl:choose> + <xsl:when test="ancestor::cmdsynopsis[1][@sepchar]"> + <xsl:value-of select="ancestor::cmdsynopsis[1]/@sepchar"/> + </xsl:when> + <xsl:otherwise> + <xsl:text> </xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + <xsl:apply-templates select="."> + <xsl:with-param name="sepchar" select="$sepchar"/> + </xsl:apply-templates> </xsl:template> <xsl:template match="synopfragmentref"> |