1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 19:59:02 +00:00
Files
nmap/nping/docs/xsl/html/index.xsl
david ed2ba4e168 Copy nping, nsock, nbase, zenmap, ncat from their homes in /.
If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:

svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'

This is caused by the replacement of SVN externals.

Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.

Then run these commands:

rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup

If all else fails, you can just delete your whole working directory and
check out anew:

svn co --username guest --password "" svn://svn.insecure.org/nmap

There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.
2011-11-16 21:49:44 +00:00

289 lines
10 KiB
XML

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<!-- ********************************************************************
$Id: index.xsl 8421 2009-05-04 07:49:49Z bobstayton $
********************************************************************
This file is part of the XSL DocBook Stylesheet distribution.
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
******************************************************************** -->
<!-- ==================================================================== -->
<xsl:template match="index">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="index.titlepage"/>
<xsl:choose>
<xsl:when test="indexdiv">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<!-- Because it's actually valid for Index to have neither any -->
<!-- Indexdivs nor any Indexentries, we need to check and make -->
<!-- sure that at least one Indexentry exists, and generate a -->
<!-- wrapper dl if there is at least one; otherwise, do nothing. -->
<xsl:if test="indexentry">
<!-- The indexentry template assumes a parent dl wrapper has -->
<!-- been generated; for Indexes that have Indexdivs, the dl -->
<!-- wrapper is generated by the indexdiv template; however, -->
<!-- for Indexes that lack Indexdivs, if we don't generate a -->
<!-- dl here, HTML output will not be valid. -->
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="(ancestor::book|/)[last()]"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="setindex">
<!-- some implementations use completely empty index tags to indicate -->
<!-- where an automatically generated index should be inserted. so -->
<!-- if the index is completely empty, skip it. Unless generate.index -->
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
<xsl:call-template name="id.warning"/>
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="setindex.titlepage"/>
<xsl:apply-templates/>
<xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">
<xsl:call-template name="generate-index">
<xsl:with-param name="scope" select="/"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(parent::article)">
<xsl:call-template name="process.footnotes"/>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="index/indexinfo"></xsl:template>
<xsl:template match="index/info"></xsl:template>
<xsl:template match="index/title"></xsl:template>
<xsl:template match="index/subtitle"></xsl:template>
<xsl:template match="index/titleabbrev"></xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexdiv">
<xsl:call-template name="id.warning"/>
<div>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<xsl:call-template name="object.id"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="anchor"/>
<xsl:apply-templates select="*[not(self::indexentry)]"/>
<dl>
<xsl:apply-templates select="indexentry"/>
</dl>
</div>
</xsl:template>
<xsl:template match="indexdiv/title">
<h3>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexterm">
<!-- this one must have a name, even if it doesn't have an ID -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<a class="indexterm" name="{$id}"/>
</xsl:template>
<xsl:template match="primary|secondary|tertiary|see|seealso">
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexentry">
<xsl:apply-templates select="primaryie"/>
</xsl:template>
<xsl:template match="primaryie">
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<xsl:apply-templates select="following-sibling::seeie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie
[not(preceding-sibling::secondaryie)]"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::secondaryie"
mode="indexentry"/>
</dd>
</xsl:template>
<!-- Handled in mode to convert flat list to structured output -->
<xsl:template match="secondaryie">
</xsl:template>
<xsl:template match="tertiaryie">
</xsl:template>
<xsl:template match="seeie|seealsoie">
</xsl:template>
<xsl:template match="secondaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
<!-- now process any tertiaryie before the next secondaryie -->
<xsl:variable name="before.next.secondary"
select="following-sibling::secondaryie[1]/preceding-sibling::*"/>
<xsl:variable name="tertiary.intersection"
select="$after.this[count(.|$before.next.secondary) =
count($before.next.secondary)]
[not(self::seeie) and not(self::seealsoie)]"/>
<xsl:choose>
<xsl:when test="count($tertiary.intersection) != 0">
<xsl:apply-templates select="$tertiary.intersection"
mode="indexentry"/>
</xsl:when>
<xsl:when test="not(following-sibling::secondaryie)">
<xsl:apply-templates select="following-sibling::tertiaryie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="tertiaryie" mode="indexentry">
<dl>
<dt>
<xsl:apply-templates/>
</dt>
<dd>
<!-- select following see* elements up to next secondaryie or tertiary or end -->
<xsl:variable name="after.this"
select="following-sibling::*"/>
<xsl:variable name="next.entry"
select="(following-sibling::secondaryie|following-sibling::tertiaryie)[1]"/>
<xsl:variable name="before.entry"
select="$next.entry/preceding-sibling::*"/>
<xsl:variable name="see.intersection"
select="$after.this[count(.|$before.entry) = count($before.entry)]
[self::seeie or self::seealsoie]"/>
<xsl:choose>
<xsl:when test="count($see.intersection) != 0">
<xsl:apply-templates select="$see.intersection" mode="indexentry"/>
</xsl:when>
<xsl:when test="count($next.entry) = 0">
<xsl:apply-templates select="following-sibling::seeie"
mode="indexentry"/>
<xsl:apply-templates select="following-sibling::seealsoie"
mode="indexentry"/>
</xsl:when>
</xsl:choose>
</dd>
</dl>
</xsl:template>
<xsl:template match="seeie" mode="indexentry">
<dt>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'see'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</dt>
</xsl:template>
<xsl:template match="seealsoie" mode="indexentry">
<div>
<xsl:text>(</xsl:text>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'seealso'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<xsl:text>)</xsl:text>
</div>
</xsl:template>
</xsl:stylesheet>