1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 19:59:02 +00:00
Files
nmap/nping/docs/xsl/common/insertfile.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

112 lines
3.9 KiB
XML

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude"
version='1.0'>
<!-- ********************************************************************
$Id: insertfile.xsl 5262 2005-10-12 14:58:42Z xmldoc $
********************************************************************
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:param name="textdata.default.encoding"></xsl:param>
<!-- * This stylesheet makes a copy of a source tree, replacing all -->
<!-- * instances of the following with corresponding Xinclude instances -->
<!-- * in the result tree. -->
<!-- * -->
<!-- * <textobject><textdata fileref="foo.txt"> -->
<!-- * <imagedata format="linespecific" fileref="foo.txt"> -->
<!-- * <inlinegraphic format="linespecific" fileref="foo.txt"> -->
<!-- * -->
<!-- * Those become: -->
<!-- * -->
<!-- * <xi:include href="foo.txt" parse="text"/> -->
<!-- * -->
<!-- * It also works as expected with entityref in place of fileref, -->
<!-- * and copies over the value of the <textdata>“encoding” atrribute (if -->
<!-- * found). It is basically intended as an alternative to using the -->
<!-- * DocBook XSLT Java insertfile() extension. -->
<!-- ==================================================================== -->
<xsl:template name="get.external.filename">
<xsl:choose>
<xsl:when test="@entityref">
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@fileref"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="textobject[child::textdata[@entityref|@fileref]]">
<xsl:apply-templates select="textdata"/>
</xsl:template>
<xsl:template match="textdata[@entityref|@fileref]">
<xsl:variable name="filename">
<xsl:call-template name="get.external.filename"/>
</xsl:variable>
<xsl:variable name="encoding">
<xsl:choose>
<xsl:when test="@encoding">
<xsl:value-of select="@encoding"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$textdata.default.encoding"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xi:include href="{$filename}" parse="text" encoding="{$encoding}"/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template
match="inlinemediaobject
[child::imageobject
[child::imagedata
[@format = 'linespecific' and
(@entityref|@fileref)]]]">
<xsl:apply-templates select="imageobject/imagedata"/>
</xsl:template>
<xsl:template match="imagedata
[@format = 'linespecific' and
(@entityref|@fileref)]">
<xsl:variable name="filename">
<xsl:call-template name="get.external.filename"/>
</xsl:variable>
<xi:include href="{$filename}" parse="text" encoding="{$textdata.default.encoding}"/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="inlinegraphic
[@format = 'linespecific' and
(@entityref|@fileref)]">
<xsl:variable name="filename">
<xsl:call-template name="get.external.filename"/>
</xsl:variable>
<xi:include href="{$filename}" parse="text" encoding="{$textdata.default.encoding}"/>
</xsl:template>
<!-- ==================================================================== -->
<!-- * copy everything else into result tree as-is -->
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>