Defindit Docs and Howto Home

This page last modified: Jan 31 2013
title:XSLT Hints and examples
description:Sample XSLT scripts

This is an example xslt script that turns the mass spec peptide
hits in an NCBI Omssa run into CSV text. Adding column headers
and using tabs instead of commas should be trivial. 

Note the xmlns:ncbi namespace declaration. This is necessary to match
the namespace declared in the MSResponse element in the data file.

    <?xml version="1.0"?>
    <xsl:stylesheet version = "1.0"
    xmlns:xsl = ""
    <xsl:output method="text"/>
      <xsl:template match="/">
        <xsl:for-each select="//ncbi:MSPepHit">
          <xsl:value-of select="ncbi:MSPepHit_gi"/>,<xsl:value-of select="ncbi:MSPepHit_accession"/>,<xsl:value-of select="ncbi:MSPepHit_defline"/>