<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output 	method="xml" 
		encoding="ISO-8859-1"
		indent="yes" 
		doctype-system="spybis.dtd"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/">
<Ibis_file>
<xsl:apply-templates select="Ibis_file" />
</Ibis_file>
</xsl:template>

<xsl:template match="Ibis_file">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="File_header_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Component_section"/>
<xsl:apply-templates select="Model_selector_section"/>
<xsl:for-each select="Model_section">	
<xsl:apply-templates  select="."/><xsl:text>
</xsl:text>
</xsl:for-each>
<xsl:apply-templates select="End_section"/>
</xsl:template>

<xsl:template match="End_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[End]</keyword></keysection>
</xsl:template>

<xsl:template match="Comment">
<comment>
<comment_char><xsl:value-of select="Comment_char"/></comment_char>
<comment_line><xsl:value-of select="Comment_line"/></comment_line>
</comment>
<xsl:apply-templates select="Comment"/>
</xsl:template>

<xsl:template name="Comment">
<xsl:param name="type" />
<row_comment>
cmment<comment_char><xsl:value-of select="Comment/Comment_char"/></comment_char>
<comment_line><xsl:value-of select="Comment/Comment_line"/></comment_line>
</row_comment>
</xsl:template>

<xsl:template match="Comment_char_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Comment_char]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Comment_char"/></keydata>
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="File_header_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Ibis_ver_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="File_name_section"/>
<xsl:apply-templates select="File_rev_section"/>
<xsl:apply-templates select="Date_section"/>
<xsl:apply-templates select="Source_section"/>
<xsl:apply-templates select="Notes_section"/>
<xsl:apply-templates select="Disclaimer_section"/>
<xsl:apply-templates select="Copyright_section"/>
</xsl:template>

<xsl:template match="Ibis_ver_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[IBIS ver]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Ibis_ver"/></keydata>
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="File_name_section">
<xsl:apply-templates select="File_name"/>
</xsl:template>

<xsl:template match="File_name">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[File name]</keyword>
<keydata_section>
<keydata><xsl:value-of select="File_name_name"/><xsl:value-of select="File_name_extension/@Value"/></keydata>      
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="File_rev_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[File Rev]</keyword>
<keydata_section>
<keydata><xsl:value-of select="File_rev"/></keydata>       	
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="Date_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Date]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Date"/></keydata>      	
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="Source_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Source]</keyword>&#xa;
<keydata_section>
<xsl:for-each select="Source">	
<xsl:call-template name ="wordwrap">
<xsl:with-param name="sentence" select="."/>
</xsl:call-template>
</xsl:for-each>
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="Notes_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Notes]</keyword>
<keydata_section>
<xsl:for-each select="Notes">
<xsl:call-template name ="wordwrap">
<xsl:with-param name="sentence" select="."/>
</xsl:call-template>
</xsl:for-each>
</keydata_section>
</keysection>
</xsl:template>

<xsl:template match="Disclaimer_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Disclaimer]</keyword>
<keydata_section>
<xsl:for-each select="Disclaimer">
<xsl:call-template name ="wordwrap">
<xsl:with-param name="sentence" select="."/>
</xsl:call-template>
</xsl:for-each>
</keydata_section>
</keysection>
</xsl:template>

<xsl:template name="wordwrap">
<xsl:param name="sentence" />
<xsl:variable name="len" select="string-length($sentence)"/>
<xsl:variable name="sentance" select="normalize-space($sentence)"/>
<xsl:if test="$len + 20 &gt; 80">
<xsl:call-template name ="chksp">
<xsl:with-param name="N">1</xsl:with-param>
<xsl:with-param name="MAX"><xsl:value-of select="$len"/></xsl:with-param>
<xsl:with-param name="line"><xsl:value-of select="$sentance"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:if test="$len + 20 &lt; 80">
<keydata><xsl:value-of select="$sentence"/></keydata>
</xsl:if>
</xsl:template>

<xsl:template name="chksp">
<xsl:param name="N" />
<xsl:param name="MAX" />
<xsl:param name="line" />
<xsl:if test="substring($line,$MAX,$N) != ' '">
<xsl:call-template name ="chksp">
<xsl:with-param name="N">1</xsl:with-param>
<xsl:with-param name="MAX"><xsl:value-of select="$MAX - 1"/></xsl:with-param>
<xsl:with-param name="line"><xsl:value-of select="$line"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
<xsl:if test="substring($line,$MAX,$N) = ' '">
<xsl:variable name="str" select="substring($line,1,$MAX)"/>
<keydata><xsl:value-of select="$str"/></keydata>
<keydata><xsl:value-of select="substring($line,$MAX + 1)"/></keydata>
</xsl:if>
</xsl:template>


<xsl:template match="Copyright_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Copyright]</keyword>
<keydata_section>
<xsl:for-each select="Copyright">
<xsl:call-template name ="wordwrap">
<xsl:with-param name="sentence" select="."/>
</xsl:call-template>
</xsl:for-each>
</keydata_section>
</keysection>
</xsl:template>
           	
<xsl:template match="Component_section">
<keysection>
<xsl:apply-templates select="Comment"/>
</keysection>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Component_header_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Pin_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Package_model_section"/>
<xsl:apply-templates select="Series_switch_group_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Pin_mapping_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Diff_pin_section"/>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Series_pin_mapping_section"/>
<xsl:apply-templates select="Comment_char_section"/>
</xsl:template>

<xsl:template match="Component_header_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Component]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Component_name"/></keydata>       	
</keydata_section>
</keysection>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Location_section"/>
<keysection>
<keyword>[Manufacturer]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Manufacturer"/></keydata>
</keydata_section>
</keysection>
<xsl:apply-templates select="Comment_char_section"/>
<xsl:apply-templates select="Package"/>

</xsl:template>

<xsl:template match="Package">
<keysection>
<keyword>[Package]</keyword>
<table>
<xsl:apply-templates  select="Comment"/>
<rowdata><xsl:apply-templates  select="R_pkg"/></rowdata>	
<rowdata><xsl:apply-templates  select="L_pkg"/></rowdata>
<rowdata><xsl:apply-templates  select="C_pkg"/></rowdata>	
</table>
</keysection>
</xsl:template>

<xsl:template match="Location_section">
<xsl:apply-templates select="Si_location_section"/>
<xsl:apply-templates select="Timing_location_section"/>	
</xsl:template>

<xsl:template match="Si_location_section">
<xsl:apply-templates select="Comment"/>
<subkeyword>Si_location</subkeyword>
<subdata><xsl:value-of select="Si_location"/></subdata>
</xsl:template>

<xsl:template match="Timing_location_section">
<xsl:apply-templates select="Comment"/>
<subkeyword>Timing_location</subkeyword>
<subdata><xsl:value-of select="Timing_location"/></subdata>
</xsl:template>

<xsl:template match="R_pkg">
<column width="9"><subkeyword>R_pkg</subkeyword></column>
<column width="5"><xsl:value-of select="typ/Number"/></column>       	
<xsl:apply-templates select="min"/>
<xsl:apply-templates select="max"/> 	
<column><xsl:apply-templates select="Comment"/></column>
</xsl:template>

<xsl:template match="L_pkg">
<column width="9"><subkeyword>L_pkg</subkeyword></column>
<column width="5"><xsl:value-of select="typ/Number"/></column>       	
<xsl:apply-templates select="min"/>
<xsl:apply-templates select="max"/>	
<column><xsl:apply-templates select="Comment"/></column>
</xsl:template>

<xsl:template match="C_pkg">
<column width="9"><subkeyword>C_pkg</subkeyword></column>
<column width="5"><xsl:value-of select="typ/Number"/></column>       	
<xsl:apply-templates select="min"/>
<xsl:apply-templates select="max"/> 	
<column><xsl:apply-templates select="Comment"/></column>
</xsl:template>

<xsl:template match="Pin_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<header>
<column width="5"><keyword>[Pin]</keyword></column>
<column width="15"><keyword>signal_name</keyword></column>       	
<column width="15"><keyword>model_name</keyword></column>       	
<column width="9"><keyword>R_pin</keyword> </column>      	
<column width="9"><keyword>L_pin</keyword></column>       	
<column width="9"><keyword>C_pin</keyword> </column>
</header>
<xsl:for-each select="Pin">	
<rowdata><xsl:apply-templates  select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pin">
<column width="5"><xsl:value-of select="Pin_name_section/Pin_name"/></column>
<column width="15"><xsl:value-of select="Signal_name_section/Signal_name"/></column>
<column width="15"><xsl:apply-templates select="Pin_model_name_section"/></column>
<xsl:apply-templates select="Pin_package_info_section"/>
</xsl:template>

<xsl:template match="Pin_model_name_section">
<xsl:if test="*[local-name() = 'Reserved_model_name']">
	<xsl:value-of select="Reserved_model_name/@Value"/>
</xsl:if>
<xsl:if test="*[local-name() = 'Model_name']">
	<xsl:value-of select="."/>
</xsl:if>
</xsl:template>


<xsl:template match="Pin_package_info_section">
<xsl:apply-templates  select="R_pin_section/R_pin"/>
<xsl:apply-templates  select="L_pin_section/L_pin"/>
<xsl:apply-templates  select="C_pin_section/C_pin"/>
</xsl:template>

<xsl:template match="R_pin|L_pin|C_pin">
<xsl:if test="*[local-name() = 'NAelement']">
	<column width="5"><xsl:value-of select="NAelement/@VALUE"/></column>
</xsl:if>
<xsl:if test="*[local-name() = 'Number']">
	<column width="5"><xsl:value-of select="."/></column>
</xsl:if>
</xsl:template>

<xsl:template match="min|max|Tdelay_typ|Tdelay_min|Tdelay_max">
<xsl:if test="*[local-name() = 'NAelement']">
	<column width="13"><xsl:value-of select="NAelement/@VALUE"/></column>
</xsl:if>
<xsl:if test="*[local-name() = 'Number']">
	<column width="13"><xsl:value-of select="."/></column>
</xsl:if>
</xsl:template>

<xsl:template match="Package_model_section">
<keysection>
<keyword>[Package Model]</keyword>
<keydata><xsl:value-of  select="Package_model"/></keydata> 
</keysection>
</xsl:template>

<xsl:template match="Series_switch_group_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Series Switch Groups]</keyword>
<table><xsl:for-each select="Series_switch_group">	
<rowdata><xsl:apply-templates  select="."/></rowdata>
</xsl:for-each></table>
</keysection>
</xsl:template>

<xsl:template match="Series_switch_group">
<column width="3"><xsl:value-of select="Group_state_section/Group_state/@Value"/></column>
<xsl:for-each select="Group_names_section">
<column width="2"><xsl:value-of select="Group_name"/></column>
</xsl:for-each>
<column width="2">&#47;</column>
<column><xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="Series_pin_mapping_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<header>
<column width="22"><keyword>[Series Pin Mapping]</keyword></column>
<column width="6"><subkeyword>pin_2</subkeyword></column>
<column width="20"><subkeyword>model_name</subkeyword></column>
<column width="20"><subkeyword>function_table_group</subkeyword></column>
</header>
<xsl:for-each select="Series_pin_mapping">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>


<xsl:template match="Series_pin_mapping">	
<column width="22"><xsl:value-of select="Pin_name_section/Pin_name"/></column>
<column width="6"><xsl:value-of select="Pin_2_section/Pin_name"/></column>
<column width="20"><xsl:value-of select="Model_name_section/Model_name"/></column>
<column width="20"><xsl:value-of select="Function_table_group_section/Function_table_group"/></column>
<column><xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="Pin_mapping_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<table>
<header>
<column width="12"><keyword>[Pin Mapping]</keyword></column>
<column width="15"><subkeyword>pulldown_ref</subkeyword></column>       	
<column width="15"><subkeyword>pullup_ref</subkeyword></column>       	
<column width="15"><subkeyword>gnd_clamp_ref</subkeyword></column>       	
<column width="15"><subkeyword>power_clamp_ref</subkeyword></column>
</header>
<xsl:for-each select="Pin_mapping">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pin_mapping">
<column width="5"><xsl:value-of select="Pin_name_section/Pin_name"/></column>
<xsl:apply-templates select="Ref_section"/>
<xsl:apply-templates  select="Clamp_section"/>
</xsl:template>

<xsl:template match="Ref_section">
<xsl:apply-templates select="Comment"/><xsl:text/>
<column width="15"><xsl:apply-templates select="Pulldown_ref_section/Pulldown_ref"/></column>	
<column width="15"><xsl:apply-templates  select="Pullup_ref_section/Pullup_ref"/></column>
</xsl:template>

<xsl:template match="Clamp_section">
<xsl:apply-templates select="Comment"/><xsl:text/>
<column width="15"><xsl:apply-templates select="Gnd_clamp_ref_section/Gnd_clamp_ref"/></column>
<column width="15"><xsl:apply-templates  select="Power_clamp_ref_section/Power_clamp_ref"/></column>
</xsl:template>

<xsl:template match="Pulldown_ref|Pullup_ref|Gnd_clamp_ref|Power_clamp_ref">
<xsl:if test="*[local-name() = 'NCelement']">
	<comment><xsl:value-of select="."/></comment>
</xsl:if>
<xsl:if test="*[local-name() = 'Bus_name']">
	<comment><xsl:value-of select="."/></comment>
</xsl:if>
</xsl:template>

<xsl:template match="Diff_pin_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<table>
<header>
<column width="10"><keyword>[Diff Pin]</keyword></column>
<column width="7"><subkeyword>inv_pin</subkeyword></column>
<column width="5"><subkeyword>vdiff</subkeyword></column>
<column width="10"><subkeyword>tdelay_typ</subkeyword></column>
<column width="10"><subkeyword>tdelay_min</subkeyword></column>
<column width="10"><subkeyword>tdelay_max</subkeyword></column>
</header>

<xsl:for-each select="Diff_pin">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Diff_pin">
<xsl:choose>
<xsl:when test="child::Comment">
<xsl:call-template name ="Comment">
<xsl:with-param name="type" select="rowtype"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<column width="5"><xsl:value-of select="Non_inv_pin_section/Pin_name"/></column>	
<column width="5"><xsl:value-of select="Inv_pin_section/Pin_name"/></column>	
<column width="9"><xsl:value-of select="Vdiff_section/Vdiff/Number"/></column>		
<xsl:apply-templates select="Tdelay_typ_section/Tdelay_typ"/>
<xsl:apply-templates select="Tdelay_min_max_section"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="Tdelay_min_max_section">
<xsl:apply-templates  select="Tdelay_min_section/Tdelay_min"/>
<xsl:apply-templates  select="Tdelay_max_section/Tdelay_max"/>
</xsl:template>


<xsl:template match="Model_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
</keysection>
<xsl:apply-templates select="Model_header_section"/>
<xsl:apply-templates select="Model_spec_section/Model_spec"/>
<xsl:apply-templates select="Add_submodel_section"/>
<xsl:apply-templates select="Driver_schedule_section"/>
<xsl:apply-templates select="Temperature_range_section"/>
<xsl:apply-templates select="Reference_section"/>
<xsl:apply-templates select="TTpower_section"/> 
<xsl:apply-templates select="Pulldown_section"/>
<xsl:apply-templates select="Pullup_section"/>
<xsl:apply-templates select="Gnd_clamp_section"/>
<xsl:apply-templates select="Power_clamp_section"/>
<xsl:apply-templates select="Rgnd_section"/>
<xsl:apply-templates select="Rpower_section"/>
<xsl:apply-templates select="Rac_section"/>
<xsl:apply-templates select="Cac_section"/>
<xsl:apply-templates select="On_state_section"/>
<xsl:apply-templates select="Off_state_section"/>
<xsl:apply-templates select="Ramp_section"/>
<xsl:apply-templates select ="Rising_waveform_section"/>
<xsl:apply-templates select="Falling_waveform_section"/>
</xsl:template>

<xsl:template match="Model_header_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
</keysection>
<keysection>
<keyword>[Model]</keyword>
<keydata_section>
<keydata><xsl:value-of select="Model_name_section/Model_name"/></keydata>       	
</keydata_section>
</keysection>
<keysection>
<subkeyword>Model_type</subkeyword>
<subdata><xsl:value-of select="../@Model_type"/></subdata>
</keysection>
<keysection>
<xsl:apply-templates select="Polarity_section"/>
</keysection>
<keysection>
<xsl:apply-templates select="Enable_section"/>
</keysection>
<keysection>
<xsl:apply-templates select="Model_vinl_section/Model_vinl"/>
</keysection>
<keysection>
<xsl:apply-templates select="Model_vinh_section/Model_vinh"/>
</keysection>
<keysection>
<xsl:apply-templates select="Model_vmeas_section/Model_vmeas"/>
</keysection>
<keysection>
<xsl:apply-templates select="Cref_section/Cref"/>
</keysection>
<keysection>
<xsl:apply-templates select="Vref_section/Vref"/>
</keysection>
<keysection>
<xsl:apply-templates select="Rref_section/Rref"/>
</keysection>
<keysection>
<xsl:apply-templates select="C_comp_section"/>
</keysection>
</xsl:template>

<xsl:template match="Polarity_section|Enable_section">
<subkeyword><xsl:value-of select="name(node())"/></subkeyword>
<subdata><xsl:value-of select="node()/@Value"/></subdata>	
</xsl:template>

<xsl:template match="Model_vinl">
<subkeyword>Vinl</subkeyword>
<xsl:if test="name(node()) = 'Number'">
	 <subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
<xsl:if test="name(node()) = 'NAelement'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
</xsl:template>

<xsl:template match="Model_vinh">
<subkeyword>Vinh</subkeyword>
<xsl:if test="name(node()) = 'Number'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
<xsl:if test="name(node()) = 'NAelement'">
	<subdata> = <xsl:value-of select="."/></subdata>
</xsl:if>
</xsl:template>

<xsl:template match="Model_vmeas">
<subkeyword>Vmeas</subkeyword>
<xsl:if test="name(node()) = 'Number'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
<xsl:if test="name(node()) = 'NAelement'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
</xsl:template>

<xsl:template match="Cref|Vref|Rref">
<subkeyword><xsl:value-of select="name(.)"/></subkeyword>
<xsl:if test="name(node()) = 'Number'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
<xsl:if test="name(node()) = 'NAelement'">
	<subdata>= <xsl:value-of select="."/></subdata>
</xsl:if>
</xsl:template>

<xsl:template match="C_comp_section">
<xsl:apply-templates  select="Comment"/>
<table>
<rowdata>
<column width="9"><subkeyword>C_comp</subkeyword></column>
<column width="5"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates  select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata></table>
</xsl:template>

<xsl:template match="Model_spec">
<keyword>[Model Spec]</keyword>
<table>
<xsl:call-template name="comment_typ_min_max"/>
<xsl:apply-templates select="Threshold_section"/>
<xsl:apply-templates select="Hysteresis_threshold_section"/>
<xsl:apply-templates select="Overshoot_section"/>
<xsl:apply-templates select="Pulse_section"/>
<xsl:apply-templates select="Timing_threshold_section"/>
</table>
</xsl:template>

<xsl:template match="Threshold_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Vinl_section"/>
<xsl:apply-templates select="Vinh_section"/>
</xsl:template>

<xsl:template match="Vinl_section|Vinh_section|Vinh_plus_section|
Vinh_minus_section|Vinl_plus_section|Vinl_minus_section
|Vmeas_section|S_overshoot_high|S_overshoot_low|D_overshoot_low|
D_overshoot_high|Pulse_high|Pulse_low|Pulse_time">
<rowdata>
<column><xsl:value-of select="name(node())"/></column>
<column><xsl:value-of    select="typ/Number"/></column>
<column><xsl:apply-templates   select="min"/></column>
<column><xsl:apply-templates  select="max"/></column>
<column><xsl:apply-templates  select="Comment"/></column>
</rowdata>
</xsl:template>


<xsl:template match="Hysteresis_threshold_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Vinh_plus_section"/>
<xsl:apply-templates select="Vinh_minus_section"/>
<xsl:apply-templates select="Vinl_plus_section"/>
<xsl:apply-templates select="Vinl_minus_section"/>
<xsl:apply-templates select="Comment"/>
</xsl:template>

<xsl:template match="Overshoot_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Static_overshoot_section"/>
<xsl:apply-templates select="Dynamic_overshoot_section"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>

<xsl:template match="Static_overshoot_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="S_overshoot_high_section/S_overshoot_high"/>
<xsl:apply-templates select="S_overshoot_low_section/S_overshoot_low"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>

<xsl:template match="Dynamic_overshoot_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="D_overshoot_low"/>
<xsl:apply-templates select="D_overshoot_low"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>

<xsl:template match="Pulse_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Pulse_high"/>
<xsl:apply-templates select="Pulse_low"/>
<xsl:apply-templates select="Pulse_time"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>
<xsl:template match="Timing_threshold_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Vmeas_section"/>
</xsl:template>


<xsl:template match="Add_submodel_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Add Submodel]</keyword>
<table>
<comment>
<comment_char><xsl:value-of select="Comment_char"/></comment_char>
</comment>
<header>
<column width="9">submodel_name</column>
<column width="5">mode</column>
<column><xsl:apply-templates  select="Comment"/></column>
</header>
<rowdata>
<column><xsl:value-of select="Model_name_section/Model_name"/></column>       	
<column><xsl:value-of select="Mode/@Value"/></column>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Driver_schedule_section">
<keysection>
<xsl:apply-templates select="Comment"/>
<keyword>[Driver Schedule]</keyword>
<table>
<xsl:apply-templates select="Comment"/>
<header>
<column width="20">Model_name</column>
<column width="12">Rise_on_dly</column>
<column width="12">Rise_off_dly</column>
<column width="12">Fall_on_dly</column>
<column width="12">Fall_off_dly</column>
</header>
<xsl:for-each select="Driver_schedule">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Driver_schedule">
<column width="20"><xsl:value-of select="Model_name_section/Model_name"/></column>
<xsl:apply-templates select="Rise_on_delay_section/Rise_on_delay"/>
<xsl:apply-templates select="Rise_off_delay_section/Rise_off_delay"/>
<xsl:apply-templates select="Fall_on_delay_section/Fall_on_delay"/>
<xsl:apply-templates select="Fall_off_delay_section/Fall_off_delay"/>
</xsl:template>

<xsl:template match="Rise_on_delay|Rise_off_delay|Fall_on_delay|Fall_off_delay">
<xsl:if test="name(node()) = 'Number'">
	<column width="12"><xsl:value-of select="."/></column>
</xsl:if>
<xsl:if test="name(node()) = 'NAelement'">
	<column width="12"><xsl:value-of select="NAelement/@VALUE"/></column>
</xsl:if>
</xsl:template>



<xsl:template match="Reference_section">
<xsl:apply-templates select="Voltage_range"/>
<xsl:apply-templates select="Separate_references_section"/>
<xsl:apply-templates select="All_references_section"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>

<xsl:template match="All_references_section">
<xsl:apply-templates select="Voltage_range"/>
<xsl:apply-templates select="Separate_references_section"/>
</xsl:template>



<xsl:template match="Separate_references_section">
<xsl:apply-templates select="Pullup_reference"/>
<xsl:apply-templates select="Pulldown_reference"/>
<xsl:apply-templates select="Gnd_clamp_reference"/>
<xsl:apply-templates select="Power_clamp_reference"/>
<xsl:apply-templates  select="Comment"/>
</xsl:template>


<xsl:template match="Gnd_clamp_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[GND Clamp]</keyword>
<table>
<xsl:for-each select="Gnd_clamp">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Power_clamp_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[POWER Clamp]</keyword>
<table>
<xsl:for-each select="Power_clamp">
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Temperature_range_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<rowdata>
<column width="25"><keyword>[Temperature Range]</keyword></column>
<column width="9"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata>
</table>
</keysection>
</xsl:template>


<xsl:template match="Voltage_range">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<rowdata>
<column width="25"><keyword>[Voltage Range]</keyword></column>
<column width="9"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pullup_reference">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<rowdata>
<column width="25"><keyword>[Pullup Reference]</keyword></column>
<column width="9"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pulldown_reference">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<rowdata>
<column width="25"><keyword>[Pulldown Reference]</keyword></column>
<column width="9"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata>
</table>
</keysection>
</xsl:template>


<xsl:template match="Gnd_clamp_reference|Power_clamp_reference|TTgnd_section|TTpower_section|Rgnd_section|Rpower_section|Rac_section|Cac_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_typ_min_max"/>
<rowdata>
<column width="25"><keyword>[<xsl:value-of select="name(.)"/>]</keyword></column>
<column width="9"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="TTgnd_section|TTpower_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_TT_typ_min_max"/>
<rowdata>
<column><keyword><xsl:value-of select="name(node())"/></keyword></column>
<column><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
<column><xsl:apply-templates  select="Comment"/></column>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Rgnd_section|Rpower_section|Rac_section|Cac_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_r_typ_min_max"/>
<rowdata>
<column><keyword><xsl:value-of select="name(node())"/></keyword></column>
<column><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
<column><xsl:apply-templates  select="Comment"/></column>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Cac_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_c_typ_min_max"/>
<rowdata>
<column><keyword><xsl:value-of select="name(node())"/></keyword></column>
<column><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
<column><xsl:apply-templates  select="Comment"/></column>
</rowdata>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pulldown_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Pulldown]</keyword>
<table>
<xsl:for-each select="Pulldown">
<rowdata><xsl:apply-templates select ="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pullup_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Pullup]</keyword>
<table>
<xsl:for-each select="Pullup">
<rowdata><xsl:apply-templates select ="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Pulldown|Pullup|Gnd_clamp|Power_clamp">
<xsl:choose>
<xsl:when test="child::Comment">
<xsl:call-template name ="Comment">
<xsl:with-param name="type" select="rowtype"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<column width="12"><xsl:value-of  select="voltage/Number"/></column>
<column width="10"><xsl:value-of  select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template name="comment_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">variable</column>
<column width="5">typ</column>
<column width="5">min</column>
<column width="5">max</column>
</header>
</xsl:template>

<xsl:template name="comment_voltage_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="11">Voltage</column>
<column width="9">I(typ)</column>
<column width="9">I(min)</column>
<column width="9">I(max)</column>
</header>
</xsl:template>

<xsl:template name="comment_TT_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">variable</column>
<column width="5">TT(typ)</column>
<column width="5">TT(min)</column>
<column width="5">TT(max)</column>
<column><xsl:apply-templates  select="Comment"/></column>
</header>
</xsl:template>

<xsl:template name="comment_r_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">variable</column>
<column width="5">R(typ)</column>
<column width="5">R(min)</column>
<column width="5">R(max)</column>
<column><xsl:apply-templates  select="Comment"/></column>
</header>
</xsl:template>

<xsl:template name="comment_c_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">variable</column>
<column width="5">C(typ)</column>
<column width="5">C(min)</column>
<column width="5">C(max)</column>
</header>
</xsl:template>

<xsl:template name="comment_L_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">variable</column>
<column width="5">L(typ)</column>
<column width="5">L(min)</column>
<column width="5">L(max)</column>
</header>
</xsl:template>

<xsl:template match="On_state_section">
<xsl:apply-templates  select="Comment"/>
<keyword>[On]</keyword>
<xsl:apply-templates select="Resistive_path"/>
<xsl:apply-templates select="Inductive_path"/>
<xsl:apply-templates select="Capacitive_path"/>
<xsl:apply-templates select="Series_current_section"/>
<xsl:apply-templates select="Series_mosfet_section"/>
</xsl:template>

<xsl:template match="Off_state_section">
<xsl:apply-templates  select="Comment"/>
<xsl:apply-templates select="Resistive_path"/>
<xsl:apply-templates select="Inductive_path"/>
<xsl:apply-templates select="Capacitive_path"/>
<xsl:apply-templates select="Series_current_section"/>
</xsl:template>

<xsl:template match="Resistive_path">
<keysection>
<xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_r_typ_min_max"/>
<rowdata>
<column width="10"><keyword>[R Series]</keyword></column>
<column width="5"><xsl:value-of    select="R_series/typ/Number"/></column>
<xsl:apply-templates    select="R_series/min"/>
<xsl:apply-templates  select="R_series/max"/>	
<column><xsl:apply-templates  select="R_series/Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>

<xsl:template match="Inductive_path">
<xsl:apply-templates  select="Comment"/>
<xsl:apply-templates select="L_series"/>
<xsl:apply-templates select="Rl_series"/>
</xsl:template>


<xsl:template match="L_series">
<keysection><xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_L_typ_min_max"/>
<rowdata>
<column width="11"><keyword>[L Series]</keyword></column>
<column width="5"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>

<xsl:template match="Rl_series">
<keysection><xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_r_typ_min_max"/>
<rowdata>
<column width="11"><keyword>[Rl Series]</keyword></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates   select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>

<xsl:template match="Capacitive_path">
<xsl:apply-templates  select="Comment"/>
<xsl:apply-templates select="C_series"/>
<xsl:apply-templates select="Lc_series"/>
<xsl:apply-templates select="Rc_series"/>
</xsl:template>

<xsl:template match="C_series">
<keysection><xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_c_typ_min_max"/>
<rowdata>
<column width="11"><keyword>[C Series]</keyword></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>

<xsl:template match="Lc_series">
<keysection><xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_L_typ_min_max"/>
<rowdata>
<column width="11"><keyword>[Lc Series]</keyword></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>

<xsl:template match="Rc_series">
<keysection><xsl:apply-templates  select="Comment"/>
<table>
<xsl:call-template name="comment_r_typ_min_max"/>
<rowdata>
<column width="11"><keyword>[Rc Series]</keyword></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</table></keysection>
</xsl:template>


<xsl:template match="Series_current_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Series Current]</keyword>
<table><xsl:call-template name="comment_voltage_typ_min_max"/>
<xsl:for-each select="Series_current">
<rowdata>
<column width="5"><xsl:value-of    select="voltage/Number"/></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>
<column><xsl:apply-templates  select="Comment"/></column>	
</rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Series_mosfet_section">
<xsl:apply-templates  select="Comment"/>
<keyword>[Series MOSFET]</keyword>
<table>
<xsl:apply-templates  select="Series_mosfet"/>
</table>
</xsl:template>

<xsl:template match="Series_mosfet">
<subkeyword>Vds</subkeyword>
<subdata><xsl:value-of  select="Vds_section/Vds/Number"/></subdata>
<xsl:call-template name="comment_voltage_typ_min_max"/>
<xsl:for-each select="IVTable">	
<rowdata><xsl:apply-templates  select="."/></rowdata>
</xsl:for-each>
</xsl:template>

<xsl:template match="IVTable">
<column width="5"><xsl:value-of    select="voltage/Number"/></column>
<column width="5"><xsl:value-of    select="typ/Number"/></column>
<xsl:apply-templates    select="min"/>
<xsl:apply-templates  select="max"/>	
<column><xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="Ramp_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Ramp]</keyword>
<table>
<rowdata>
<column width="8"><subkeyword>dV/dt_r</subkeyword></column>
<xsl:apply-templates  select="dV_dt_r"/>
</rowdata>
<rowdata>
<column width="8"><subkeyword>dV/dt_f</subkeyword></column>
<xsl:apply-templates select="dV_dt_f"/>
</rowdata>
<rowdata>
<column width="8"><subkeyword>R_load</subkeyword></column>
<xsl:apply-templates  select="R_load_section"/>
</rowdata>
</table>
</keysection>
</xsl:template>


<xsl:template match="dV_dt_r">
<xsl:apply-templates select="dV_dt_r_typ"/>
<xsl:apply-templates  select="dV_dt_r_min"/>
<xsl:apply-templates  select="dV_dt_r_max"/>	
<column><xsl:apply-templates  select="Comment"/></column>	
</xsl:template>


<xsl:template match="dV_dt_r_typ">
<column width="20"><xsl:value-of select="dV_r_typ/Number"/>/<xsl:value-of select="dt_r_typ/Number"/></column>
</xsl:template>

<xsl:template match="dV_dt_r_min">
<column width="20"><xsl:value-of select="dV_r_min/Number"/>/<xsl:value-of select="dt_r_min/Number"/></column>
</xsl:template>

<xsl:template match="dV_dt_r_max">
<column width="20"><xsl:value-of select="dV_r_max/Number"/>/<xsl:value-of select="dt_r_max/Number"/></column>
</xsl:template>


<xsl:template match="dV_dt_f">
<xsl:apply-templates select="dV_dt_f_typ"/>
<xsl:apply-templates  select="dV_dt_f_min"/>
<xsl:apply-templates  select="dV_dt_f_max"/>	
<column><xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="dV_dt_f_typ">
<column width="20"><xsl:value-of select="dV_f_typ"/>/<xsl:value-of select="dt_f_typ"/></column>
</xsl:template>

<xsl:template match="dV_dt_f_min">
<column width="20"><xsl:value-of select="dV_f_min/Number"/>/<xsl:value-of select="dt_f_min/Number"/></column>
</xsl:template>

<xsl:template match="dV_dt_f_max">
<column width="20"><xsl:value-of select="dV_f_max/Number"/>/<xsl:value-of select="dt_f_max/Number"/></column>
</xsl:template>


<xsl:template match="R_load_section">
<column width="8">= <xsl:value-of    select="R_load/Number"/></column>
<column> <xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="Rising_waveform_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Rising Waveform]</keyword>
<xsl:for-each select="Rising_waveform">	
<xsl:apply-templates  select="."/>
</xsl:for-each>
</keysection>
</xsl:template>

<xsl:template match="Rising_waveform">
<xsl:apply-templates select="Test_fixture"/>
<table>
<xsl:if test="child::Time_plot">
<xsl:apply-templates  select="Comment"/>
<xsl:for-each select="Time_plot">	
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</xsl:if>
</table>
</xsl:template>


<xsl:template match="Falling_waveform_section">
<keysection>
<xsl:apply-templates  select="Comment"/>
<keyword>[Falling Waveform]</keyword>
<xsl:for-each select="Falling_waveform">	
<xsl:apply-templates  select="."/>
</xsl:for-each>
</keysection>
</xsl:template>

<xsl:template match="Falling_waveform">
<xsl:apply-templates select="Test_fixture"/>
<table>
<xsl:if test="child::Time_plot">
<xsl:apply-templates  select="Comment"/>
<xsl:for-each select="Time_plot">	
<rowdata><xsl:apply-templates select="."/></rowdata>
</xsl:for-each>
</xsl:if>
</table>
</xsl:template>

<xsl:template match="R_dut_section|L_dut_section|C_dut_section">
<subkeyword><xsl:value-of select="name(.)"/></subkeyword>
<subdata><xsl:value-of select="."/></subdata>
<xsl:apply-templates  select="Comment"/>
</xsl:template>

<xsl:template match="Test_fixture">
<table>
<xsl:apply-templates  select="Comment"/>
<xsl:apply-templates select="R_fixture_section/R_fixture"/>
<xsl:apply-templates select="V_fixture_section/V_fixture"/>	
<xsl:apply-templates select="V_fixture_min_section/V_fixture_min"/>
<xsl:apply-templates select="V_fixture_max_section/V_fixture_max"/>
<xsl:apply-templates select="C_fixture_section/C_fixture"/>
<xsl:apply-templates select="L_fixture_section/L_fixture"/>
</table>
</xsl:template>

<xsl:template match="R_fixture|V_fixture|V_fixture_min|V_fixture_max|C_fixture|L_fixture">
<rowdata>
<column width="20"><xsl:value-of select="name(.)"/></column>
<column width="10">= <xsl:apply-templates select="Number"/></column>
</rowdata>
</xsl:template>

<xsl:template match="Number">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="Model_selector_section">
<keysection>
<keyword>[Model Selector]</keyword>
<keydata_section>
<keydata><xsl:value-of  select="Model_name"/></keydata>
</keydata_section>
</keysection>
<keysection>
<table>
<xsl:for-each select="Model_selector"><rowdata>
<xsl:apply-templates  select="."/></rowdata>
</xsl:for-each>
</table>
</keysection>
</xsl:template>

<xsl:template match="Model_selector">
<column width="22"><xsl:value-of  select="Model_name_section/Model_name"/></column>
<column width="35"><xsl:value-of  select="Model_selector_desc_section/Model_selector_description"/></column>
</xsl:template>

<xsl:template match="Submodel_section">
<keyword>[Submodel]</keyword>
<keydata><xsl:value-of select="model_name_section/model_name"/></keydata>
<subkeyword>Submodel_type</subkeyword>
<subdata><xsl:value-of select="Submodel_section/@Type"/></subdata>
<keyword>[Submodel Spec]</keyword>
<xsl:apply-templates select="Dynamic_clamp_section"/>
<xsl:apply-templates select="Bus_hold_section"/>
</xsl:template>

<xsl:template match="Dynamic_clamp_section">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="Submodel_spec_dc_r"/>
<xsl:apply-templates select="Dynamic_clamp_power_tables"/>
<xsl:apply-templates select="Submodel_spec_dc_f"/>
<xsl:apply-templates select="Dynamic_clamp_gnd_tables"/>
<xsl:apply-templates select="Submodel_spec_dc"/>
</xsl:template>

<xsl:template match="Submodel_spec_dc_r|Submodel_spec_dc|Submodel_spec_dc_f">
<xsl:apply-templates select="Comment"/>
<xsl:apply-templates select="V_trigger_r"/>
<xsl:apply-templates select="V_trigger_f"/>
</xsl:template>

<xsl:template match="Submodel_spec_bh">
<xsl:apply-templates  select="V_trigger_r"/>
<xsl:apply-templates  select="V_trigger_r"/>
<xsl:apply-templates  select="Off_delay"/>
</xsl:template>

<xsl:template match="V_trigger_r|V_trigger_f|Off_delay">
<column><xsl:value-of select="name(.)"/></column>
<column><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates  select="min"/>
<xsl:apply-templates  select="max"/>
<column><xsl:apply-templates  select="Comment"/></column>
</xsl:template>

<xsl:template match="Bus_hold_pullup_pulldown">
<xsl:apply-templates  select="Pullup_section"/>
<xsl:apply-templates  select="Pulldown_section"/>
</xsl:template>

<xsl:template match="Dynamic_clamp_power_tables">
<xsl:apply-templates  select="Power_clamp_section"/>
<xsl:apply-templates  select="Power_pulse_section"/>
</xsl:template>

<xsl:template match="Dynamic_clamp_gnd_tables">
<xsl:apply-templates  select="Gnd_clamp_section"/>
<xsl:apply-templates  select="Gnd_pulse_section"/>
</xsl:template>

<xsl:template match="Gnd_pulse_section">
<xsl:apply-templates  select="Comment"/>
<keyword>[GND Pulse Table]</keyword>
<table>
<xsl:call-template name="time_typ_min_max"/>
<xsl:for-each select="Time_plot">
<rowdata><xsl:apply-templates  select="."/></rowdata>
</xsl:for-each>
</table>
</xsl:template>


<xsl:template match="Power_pulse_section">
<xsl:apply-templates  select="Comment"/>
<keyword>[POWER Pulse Table]</keyword>
<table>
<xsl:call-template name="time_typ_min_max"/>
<xsl:for-each select="Time_plot">
<rowdata><xsl:apply-templates  select="."/></rowdata>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template match="Time_plot">
<column width="11"><xsl:value-of select="time/Number"/></column>
<column width="11"><xsl:value-of select="typ/Number"/></column>
<xsl:apply-templates select="min"/>
<xsl:apply-templates select="max"/>
<column><xsl:value-of select="Comment"/></column>

</xsl:template>

<xsl:template name="time_vs_vol_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">Time</column>
<column width="5">V(typ)</column>
<column width="5">V(min)</column>
<column width="5">V(max)</column>
</header>
</xsl:template>

<xsl:template name="time_typ_min_max">
<header>
<column><xsl:value-of select="Comment/Comment_char"/></column>
<column width="9">time</column>
<column width="5">typ</column>
<column width="5">min</column>
<column width="5">max</column>
</header>
</xsl:template>


</xsl:stylesheet>