2009-05-26 00:49:38 +00:00
|
|
|
<!--
|
|
|
|
-->
|
|
|
|
|
|
|
|
<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="fields">
|
2024-04-05 20:40:37 +10:00
|
|
|
static const fix_field fix_fields[] = {
|
2009-05-26 00:49:38 +00:00
|
|
|
<xsl:for-each select="field">
|
2013-01-20 18:32:23 +00:00
|
|
|
<xsl:sort select="@number" data-type="number"/>
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="count( value ) != 0">
|
|
|
|
<xsl:variable name="val_type" >
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="@type='INT'">0</xsl:when>
|
|
|
|
<xsl:when test="@type='STRING'">1</xsl:when>
|
|
|
|
<xsl:otherwise>2</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
2009-05-26 00:49:38 +00:00
|
|
|
</xsl:variable>
|
2024-04-05 20:40:37 +10:00
|
|
|
{ <xsl:value-of select="@number"/>, <xsl:copy-of select="$val_type" />, <xsl:value-of select="@name"/>_val },</xsl:when>
|
2013-01-20 18:32:23 +00:00
|
|
|
<xsl:otherwise>
|
2024-04-05 20:40:37 +10:00
|
|
|
{ <xsl:value-of select="@number"/>, 0, NULL }, /* <xsl:value-of select="@name"/> */</xsl:otherwise>
|
2013-01-20 18:32:23 +00:00
|
|
|
</xsl:choose>
|
2009-05-26 00:49:38 +00:00
|
|
|
</xsl:for-each>
|
2024-04-05 20:40:37 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
<xsl:text>static int fix_hf[</xsl:text>
|
|
|
|
<xsl:value-of select="count( field )"/>
|
|
|
|
<xsl:text>];</xsl:text>
|
2013-01-20 18:32:23 +00:00
|
|
|
</xsl:template>
|
2009-05-26 00:49:38 +00:00
|
|
|
</xsl:stylesheet>
|