diff options
Diffstat (limited to 'common/entities/entities.xsl')
-rw-r--r-- | common/entities/entities.xsl | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/common/entities/entities.xsl b/common/entities/entities.xsl index b28dbac..0646ca1 100644 --- a/common/entities/entities.xsl +++ b/common/entities/entities.xsl @@ -3,7 +3,16 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" omit-xml-declaration="yes"/> + <xsl:param name="FDPCOMMONDIR">/usr/share/fedora/doc/docs-common/common</xsl:param> + <xsl:template match="/"> + <xsl:comment><xsl:value-of select="' Group: Automatic Entities '"/></xsl:comment> + <xsl:call-template name="do_entity"> + <xsl:with-param name="name">FDPCOMMONDIR</xsl:with-param> + <xsl:with-param name="desc">Base directory</xsl:with-param> + <xsl:with-param name="extra" /> + <xsl:with-param name="body" select="$FDPCOMMONDIR"/> + </xsl:call-template> <xsl:apply-templates/> </xsl:template> @@ -16,7 +25,7 @@ <xsl:variable name="desc"> <xsl:choose> <xsl:when test="comment = ''"> - WHO AM I? WHAT AM I? I CAN'T REMEMBER! + FIXME: PLEASE DEFINE ME </xsl:when> <xsl:otherwise> <xsl:value-of select="comment"/> @@ -28,6 +37,9 @@ <xsl:when test="@kind = 'system'"> <xsl:text> SYSTEM</xsl:text> </xsl:when> + <xsl:when test="@kind = 'fdpcommon'"> + <xsl:text> SYSTEM</xsl:text> + </xsl:when> <xsl:otherwise> <xsl:text></xsl:text> </xsl:otherwise> @@ -36,7 +48,21 @@ <xsl:variable name="body"> <xsl:apply-templates/> </xsl:variable> - <xsl:value-of select="concat( '<!ENTITY ', @name, ' ', normalize-space($extra), ' "', normalize-space($body), '" > <!-- ', normalize-space($desc), ' -->')" disable-output-escaping="yes"/> + <xsl:call-template name="do_entity"> + <xsl:with-param name="name" select="@name"/> + <xsl:with-param name="desc" select="$desc"/> + <xsl:with-param name="extra" select="$extra"/> + <xsl:with-param name="body"> + <xsl:choose> + <xsl:when test="@kind = 'fdpcommon'"> + <xsl:value-of select="concat( $FDPCOMMONDIR, '/', normalize-space($body))"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space($body)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> </xsl:template> <xsl:template match="use"> @@ -67,4 +93,12 @@ <xsl:text disable-output-escaping="yes">'/></xsl:text> </xsl:template> + <xsl:template name="do_entity"> + <xsl:param name="name">NAME</xsl:param> + <xsl:param name="desc">DESC</xsl:param> + <xsl:param name="extra"></xsl:param> + <xsl:param name="body">BODY</xsl:param> + <xsl:value-of select="concat( '<!ENTITY ', $name, ' ', normalize-space($extra), ' "', normalize-space($body), '" > <!-- ', normalize-space($desc), ' -->')" disable-output-escaping="yes"/> + </xsl:template> + </xsl:stylesheet> |