2 Syntax: xsltproc Values.xsl FIX44.xml
5 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
6 <xsl:output method="text" encoding="UTF-8"/>
8 <xsl:template match="text()"/>
9 <xsl:template match="/">/* DO NOT EDIT
10 * This file is autogenerated
11 * Look fix/README for more information how to generate this file
15 typedef struct _fix_field {
16 int tag; /* FIX tag */
22 <xsl:apply-templates/>
27 translate(@description,$uppercase,$smallcase)
30 <xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
31 <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
33 <xsl:template match="fix/fields">
34 <xsl:for-each select="field[value]">
35 <xsl:variable name="val_type" >
37 <xsl:when test="@type='STRING'"> string_string </xsl:when>
38 <xsl:when test="@type='MULTIPLESTRINGVALUE'"> string_string </xsl:when>
39 <xsl:otherwise> value_string </xsl:otherwise>
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:when test="../@type='MULTIPLESTRINGVALUE'">
48 { "<xsl:value-of select="@enum"/>", "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when>
50 { '<xsl:value-of select="@enum"/>', "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:otherwise>
59 <xsl:template match="fix/messages">
60 static const string_string messages_val[] = {<xsl:for-each select="message">
61 { "<xsl:value-of select="@msgtype"/>", "<xsl:value-of select="@name"/>" },</xsl:for-each>