This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/BLFS/libs/dependencies.xsl

48 lines
1.3 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!-- $Id$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:param name="dependencies" select="2"/>
<xsl:template match="/">
<xsl:apply-templates select="//para[@role='optional']"/>
<xsl:apply-templates select="//para[@role='recommended']"/>
<xsl:apply-templates select="//para[@role='required']"/>
</xsl:template>
<xsl:template match="//text()"/>
<xsl:template match="para[@role='required']">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="para[@role='recommended']">
<xsl:if test="$dependencies != '1'">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="para[@role='optional']">
<xsl:if test="$dependencies = '3'">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="xref">
<xsl:value-of select="@linkend"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>