1 <?xml version="1.0" encoding="iso-8859-1"?>
\r
6 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
\r
9 <!-- ******************************************************************* -->
\r
10 <!-- extracts arg x from expression of from 'f(x)' -->
\r
11 <xsl:template name="extract-arg">
\r
12 <xsl:param name="expr" select="@type"/>
\r
13 <xsl:value-of select="normalize-space(substring-after(substring-before($expr,')'),'('))"/>
\r
17 <!-- ******************************************************************* -->
\r
18 <xsl:template name="get-expanded-size">
\r
19 <xsl:param name="fields" select="schema/field"/>
\r
21 <xsl:for-each select="$fields">
\r
23 <!-- RVA special case, PE library type -->
\r
24 <xsl:when test="@type = 'RVA'">
\r
25 <xsl:text>RVA.Size</xsl:text>
\r
27 <!-- table indices -->
\r
28 <xsl:when test="starts-with(@type,'index') or starts-with(@type,'coded-index')">
\r
29 <xsl:text>4</xsl:text>
\r
32 <xsl:value-of select="concat('sizeof (', @type, ')')"/>
\r
35 <xsl:if test="position() != last()">
\r
36 <xsl:text> + </xsl:text>
\r
44 <!-- ******************************************************************* -->
\r
45 <xsl:template name="get-field-type">
\r
46 <xsl:param name="field" select="."/>
\r
49 <!-- table indices -->
\r
50 <xsl:when test="starts-with($field/@type,'index')">
\r
51 <xsl:text>int</xsl:text>
\r
53 <!-- coded token -->
\r
54 <xsl:when test="starts-with($field/@type,'coded-index')">
\r
55 <xsl:text>MDToken</xsl:text>
\r
57 <!-- explicit library type -->
\r
58 <xsl:when test="$field/@cli-type">
\r
59 <xsl:value-of select="$field/@cli-type"/>
\r
61 <!-- primitive type -->
\r
63 <xsl:value-of select="$field/@type"/>
\r