diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-05-26 00:49:38 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-05-26 00:49:38 +0000 |
commit | 8a6daf2a1cae5b59bacf30bef62fc63245009e21 (patch) | |
tree | 9d96d69c98284159294894ee7ca20dad2fc25336 /fix/Values.xsl | |
parent | e718dc79ea8b7a6e619f53031dc0191f7549cdf9 (diff) |
From Didier Gautheron via bug 3052:
Add:
- FIX 4.0 to 4.4 fields, auto generated with XSLT stylesheets applied on
http://www.quickfixengine.org/ xml files (not included quickfixengine code is
BSD but xml files have no copyright).
- value_string functions for string keys, added to value_string.c.
- FIX desegmentation, it doesn't work well with malformed FIX PDU.
svn path=/trunk/; revision=28478
Diffstat (limited to 'fix/Values.xsl')
-rw-r--r-- | fix/Values.xsl | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/fix/Values.xsl b/fix/Values.xsl new file mode 100644 index 0000000000..01c6d5b87c --- /dev/null +++ b/fix/Values.xsl @@ -0,0 +1,54 @@ +<!-- +Syntax: xsltproc Values.xsl FIX44.xml +--> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="text" encoding="UTF-8"/> + + <xsl:template match="text()"/> + <xsl:template match="/">/* DO NOT EDIT + * This file is autogenerated + */ + + <xsl:apply-templates/> + +</xsl:template> + +<!-- +translate(@description,$uppercase,$smallcase) +--> + +<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" /> +<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> + +<xsl:template match="fix/fields"> +<xsl:for-each select="field[value]"> + <xsl:variable name="val_type" > + <xsl:choose> + <xsl:when test="@type='STRING'"> string_string </xsl:when> + <xsl:otherwise> value_string </xsl:otherwise> + </xsl:choose> + </xsl:variable> + static const <xsl:copy-of select="$val_type" /> <xsl:value-of select="@name"/>_val[] = { <xsl:for-each select="value"> <xsl:choose> + <xsl:when test="../@type='INT'"> + { <xsl:value-of select="@enum"/>, "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when> + <xsl:when test="../@type='STRING'"> + { "<xsl:value-of select="@enum"/>", "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:when> + <xsl:otherwise> + { '<xsl:value-of select="@enum"/>', "<xsl:value-of select="translate(@description,'_',' ')"/>" },</xsl:otherwise> + </xsl:choose> + </xsl:for-each> + { 0, NULL } + }; + +</xsl:for-each> +</xsl:template> + +<xsl:template match="fix/messages"> + static const string_string messages_val[] = { <xsl:for-each select="message"> + { "<xsl:value-of select="@msgtype"/>", "<xsl:value-of select="@name"/>" }, </xsl:for-each> + { "", NULL } + }; +</xsl:template> + +</xsl:stylesheet> |