Convert Kismet netxml to csv

Last Modified: Fri, 22 Jun 2012 21:47:50 +0000 ; Created: Fri, 22 Jun 2012 21:46:28 +0000

The latest version drops CSV output support in Kismet. I just need some basic information for the scan results. A quick and easy way without having to write a script in Perl or Java was to use xslt transformation.
  1. Assuming Linux
  2. Install xsltproc
  3. Create the a file with the below contents and name it transform.xslt (or whatever):
    <xsl:stylesheet version="1.0" xmlns:xsl="">
      <xsl:output method="text" encoding="utf-8" />
      <xsl:param name="delim" select="','" />
      <xsl:param name="quote" select="'&quot;'" />
      <xsl:param name="break" select="'&#xA;'" />
      <xsl:template match="/">
        <xsl:apply-templates select="detection-run/wireless-network" />
      <xsl:template match="wireless-network">
        <xsl:apply-templates />
        <xsl:if test="following-sibling::*">
          <xsl:value-of select="$break" />
      <xsl:template match="*">
        <!-- remove normalize-space() if you want keep white-space at it is --> 
        <xsl:value-of select="concat($quote, normalize-space(), $quote)" />
        <xsl:if test="following-sibling::*">
          <xsl:value-of select="$delim" />
      <xsl:template match="text()" />
  4. xsltproc -o MyKismitOutput.csv transform.xslt Kismet-yyyymmdd-hh-MM-ss-1.netxml