smb2-dissector: learn the "REPLAY_OPERATION" flag
[obnox/wireshark/wip.git] / fix / Values.xsl
1 <!--
2 Syntax: xsltproc Values.xsl FIX44.xml
3 -->
4
5 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
6  <xsl:output  method="text" encoding="UTF-8"/>
7
8  <xsl:template match="text()"/>
9  <xsl:template match="/">/* DO NOT EDIT
10  * This file is autogenerated
11  *
12  * $Id$
13  *
14  */
15
16 typedef struct _fix_field {
17   int      tag;         /* FIX tag */
18   int      hf_id;
19   int      type;        /* */
20   const void *table;
21 } fix_field;
22
23   <xsl:apply-templates/>
24
25 </xsl:template>
26  
27 <!--
28 translate(@description,$uppercase,$smallcase)  
29 -->
30
31 <xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
32 <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
33
34 <xsl:template match="fix/fields">
35 <xsl:for-each select="field[value]">
36     <xsl:variable name="val_type"  >
37     <xsl:choose>   
38            <xsl:when test="@type='STRING'"> string_string </xsl:when>
39            <xsl:otherwise> value_string </xsl:otherwise>
40     </xsl:choose>
41     </xsl:variable>
42    static const <xsl:copy-of select="$val_type" /> <xsl:value-of select="@name"/>_val[] = { <xsl:for-each select="value"> <xsl:choose>
43              <xsl:when test="../@type='INT'">
44        { <xsl:value-of select="@enum"/>, "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
45              <xsl:when test="../@type='STRING'">
46        { "<xsl:value-of select="@enum"/>", "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
47              <xsl:otherwise>
48        { '<xsl:value-of select="@enum"/>', "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:otherwise>
49            </xsl:choose>
50         </xsl:for-each>
51        { 0, NULL }
52    };
53
54 </xsl:for-each>
55 </xsl:template>
56
57 <xsl:template match="fix/messages">
58    static const string_string messages_val[] = { <xsl:for-each select="message">
59        { "<xsl:value-of select="@msgtype"/>", "<xsl:value-of select="@name"/>" }, </xsl:for-each>
60        { "", NULL }
61    };
62 </xsl:template>
63
64 </xsl:stylesheet>