4 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" version=
"1.0">
5 <xsl:output method=
"text" encoding=
"UTF-8"/>
7 <xsl:template match=
"text()"/>
9 <xsl:template match=
"fields">
10 static const fix_field fix_fields[] = {
11 <xsl:for-each select=
"field">
12 <xsl:sort select=
"@number" data-type=
"number"/>
14 <xsl:when test=
"count( value ) != 0">
15 <xsl:variable name=
"val_type" >
17 <xsl:when test=
"@type='INT'">0</xsl:when>
18 <xsl:when test=
"@type='STRING'">1</xsl:when>
19 <xsl:otherwise>2</xsl:otherwise>
22 {
<xsl:value-of select=
"@number"/>,
<xsl:copy-of select=
"$val_type" />,
<xsl:value-of select=
"@name"/>_val },
</xsl:when>
24 {
<xsl:value-of select=
"@number"/>,
0, NULL }, /*
<xsl:value-of select=
"@name"/> */
</xsl:otherwise>
29 <xsl:text>static int fix_hf[
</xsl:text>
30 <xsl:value-of select=
"count( field )"/>
31 <xsl:text>];
</xsl:text>