-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathshow-comments.xslt
33 lines (32 loc) · 1.11 KB
/
show-comments.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:npo="http://xmlns.sven.to/npo"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str npo">
<npo:comment>
Shows comments added by the comment-* commands.
</npo:comment>
<npo:category>extract</npo:category>
<!-- see http://exslt.org/str/index.html -->
<xsl:output method="text" />
<xsl:strip-space elements="*" />
<xsl:template match="/nmaprun/host/npo-comment">
<xsl:value-of select="../address/@addr"/>
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/nmaprun/host/ports/port/npo-comment">
<xsl:value-of select="../../../address/@addr"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="../@portid"/>
<xsl:text> </xsl:text>
<xsl:value-of select="."/>
<xsl:text>
</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>