1 <xsl:stylesheet 2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 3 xmlns:fo="http://www.w3.org/1999/XSL/Format" 4 version="1.0"> 5 6 <!-- Based on the XSL stylesheet from gtkmm - Lennart --> 7 8 <xsl:output method="xml" version="1.0" indent="yes"/> 9 10 <xsl:param name="reference_prefix">../../../doc/avahi-docs/html/</xsl:param> 11 12 <xsl:template match="/"> 13 <book title="Avahi Reference Manual" 14 name="avahi" 15 link="{$reference_prefix}main.html"> 16 <chapters> 17 <sub name="Headers" link="{$reference_prefix}files.html"> 18 <xsl:apply-templates select="doxygenindex/compound[@kind='file']"> 19 <xsl:sort select="."/> 20 </xsl:apply-templates> 21 </sub> 22 </chapters> 23 24 <functions> 25 <!-- @todo: maybe select only the real functions, ie those with kind=="function"? --> 26 <xsl:apply-templates select="doxygenindex/compound/function" mode="as-function"/> 27 </functions> 28 </book> 29 </xsl:template> 30 31 <xsl:template match="compound"> 32 <xsl:param name="name"><xsl:value-of select="name"/></xsl:param> 33 <xsl:param name="link"><xsl:value-of select="@refid"/>.html</xsl:param> 34 <sub name="{$name}" link="{$reference_prefix}{$link}"> 35 <xsl:apply-templates select="member" mode="as-sub"> 36 <xsl:sort select="."/> 37 </xsl:apply-templates> 38 </sub> 39 </xsl:template> 40 41 <xsl:template match="member" mode="as-function"> 42 <!-- 43 <function name="atk_set_value" link="atk-atkvalue.html#ATK-SET-VALUE"/> 44 --> 45 <xsl:param name="name"><xsl:value-of select="name"/></xsl:param> 46 <!-- Link is refid attribute of parent element + "#" + diff between refid of parent and own refid --> 47 <xsl:param name="refid_parent"><xsl:value-of select="parent::node()/@refid"/></xsl:param> 48 <xsl:param name="own_refid"><xsl:value-of select="@refid"/></xsl:param> 49 <xsl:param name="offset"><xsl:value-of select="string-length($refid_parent) + 3"/></xsl:param> 50 <xsl:param name="ref_diff"><xsl:value-of select="substring($own_refid, $offset, 32)"/></xsl:param> 51 <xsl:param name="link"><xsl:value-of select="$refid_parent"/>.html#<xsl:value-of select="$ref_diff"/></xsl:param> 52 <function name="{$name}" link="{$reference_prefix}{$link}"/> 53 </xsl:template> 54 55 <xsl:template match="member" mode="as-sub"> 56 <xsl:param name="name"><xsl:value-of select="name"/></xsl:param> 57 <!-- Link is refid attribute of parent element + "#" + diff between refid of parent and own refid --> 58 <xsl:param name="refid_parent"><xsl:value-of select="parent::node()/@refid"/></xsl:param> 59 <xsl:param name="own_refid"><xsl:value-of select="@refid"/></xsl:param> 60 <xsl:param name="offset"><xsl:value-of select="string-length($refid_parent) + 3"/></xsl:param> 61 <xsl:param name="ref_diff"><xsl:value-of select="substring($own_refid, $offset, 32)"/></xsl:param> 62 <xsl:param name="link"><xsl:value-of select="$refid_parent"/>.html#<xsl:value-of select="$ref_diff"/></xsl:param> 63 <sub name="{$name}" link="{$reference_prefix}{$link}"/> 64 </xsl:template> 65 66 </xsl:stylesheet> 67