<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mostco="http://www.mostcooperation.com" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:exslt="http://exslt.org/common" version="1.0" exclude-result-prefixes="msxsl exslt mostco xs">
<xsl:output method="html" indent="yes" encoding="utf-8" omit-xml-declaration="no" version="3.2" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd" />
<!---->
<!---->
<xsl:variable name="fcatschema" select="document('mostfcat_3_1_0.xsd')" />
<xsl:variable name="default-unit" select="$fcatschema//xs:complexType[@name='Number']//xs:attribute[@name='Unit']/@default" />
<xsl:variable name="default-step" select="$fcatschema//xs:complexType[@name='Integer']//xs:attribute[@name='Step']/@default" />
<xsl:variable name="default-exponent" select="$fcatschema//xs:complexType[@name='Integer']//xs:attribute[@name='Exponent']/@default" />
<xsl:variable name="default-enum-size" select="$fcatschema//xs:complexType[@name='TEnum']//xs:attribute[@name='TotalByteLength']/@default" />
<xsl:variable name="default-bitlength" select="$fcatschema//xs:complexType[@name='BitBase']//xs:attribute[@name='BitLength']/@default" />
<!---->
<!---->
<xsl:key name="parameter-references" match="mostco:ParameterReference" use="concat(generate-id(ancestor::mostco:Function),'::',@Name)" />
<!---->
<xsl:key name="stream-parameter-references" match="mostco:StreamParamReference|mostco:StreamParamReferenceRepeated" use="concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',@Name)" />
<!---->
<xsl:key name="parameter-definitions" match="mostco:Function/mostco:Parameters/mostco:Parameter|mostco:Function/mostco:Parameters/mostco:SharedParameterReference|mostco:Function/mostco:Parameters/mostco:NamedSharedParameterReference" use="concat(generate-id(ancestor::mostco:Function),'::',@Name)" />
<!---->
<xsl:key name="stream-parameter-definitions" match="mostco:TStream/mostco:Parameters/mostco:Parameter|mostco:TShortStream/mostco:Parameters/mostco:Parameter|mostco:TStream/mostco:Parameters/mostco:SharedParameterReference|mostco:TShortStream/mostco:Parameters/mostco:SharedParameterReference|mostco:TStream/mostco:Parameters/mostco:NamedSharedParameterReference|mostco:TShortStream/mostco:Parameters/mostco:NamedSharedParameterReference" use="concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',@Name)" />
<!---->
<xsl:key name="shared-parameter-definitions" match="mostco:SharedParameter" use="@Name" />
<!---->
<mostco:OPTypeNum name="Set">1</mostco:OPTypeNum>
<mostco:OPTypeNum name="Get">2</mostco:OPTypeNum>
<mostco:OPTypeNum name="SetGet">3</mostco:OPTypeNum>
<mostco:OPTypeNum name="Increment">4</mostco:OPTypeNum>
<mostco:OPTypeNum name="Decrement">5</mostco:OPTypeNum>
<mostco:OPTypeNum name="Status">6</mostco:OPTypeNum>
<mostco:OPTypeNum name="Start">7</mostco:OPTypeNum>
<mostco:OPTypeNum name="Abort">8</mostco:OPTypeNum>
<mostco:OPTypeNum name="StartResult">9</mostco:OPTypeNum>
<mostco:OPTypeNum name="StartResultAck">10</mostco:OPTypeNum>
<mostco:OPTypeNum name="AbortAck">11</mostco:OPTypeNum>
<mostco:OPTypeNum name="StartAck">12</mostco:OPTypeNum>
<mostco:OPTypeNum name="ErrorAck">13</mostco:OPTypeNum>
<mostco:OPTypeNum name="ProcessingAck">14</mostco:OPTypeNum>
<mostco:OPTypeNum name="Processing">15</mostco:OPTypeNum>
<mostco:OPTypeNum name="Result">16</mostco:OPTypeNum>
<mostco:OPTypeNum name="ResultAck">17</mostco:OPTypeNum>
<mostco:OPTypeNum name="Error">18</mostco:OPTypeNum>
<!---->
<xsl:strip-space elements="FunctionCatalog CatalogVersion Modification FBlock FBlockVersion Function FunctionVersion FunctionClass Property Method TArray TArrayType TStream TShortStream TCStream StreamCase StreamParam TRecord TRecordType TRecordField TNumber Unit TBool BitValue TBitField TUByte TSByte TUWord TSWord TULong TULongLong TSLong TSLongLong TEnum TString" />
<!---->
<!---->
<!---->
<xsl:template name="repeat-output">
<xsl:param name="output" />
<xsl:param name="count" />
<xsl:value-of select="$output" />
<xsl:if test="$count > 1">
<xsl:call-template name="repeat-output">
<xsl:with-param name="output" select="$output" />
<xsl:with-param name="count" select="$count - 1" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<!---->
<xsl:template name="convert-dec-to-hex">
<xsl:param name="value" />
<xsl:if test="$value > 0">
<xsl:call-template name="convert-dec-to-hex">
<xsl:with-param name="value" select="floor($value div 16)" />
</xsl:call-template>
<xsl:choose>
<xsl:when test="$value mod 16 < 10">
<xsl:value-of select="$value mod 16" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$value mod 16 = 10">A</xsl:when>
<xsl:when test="$value mod 16 = 11">B</xsl:when>
<xsl:when test="$value mod 16 = 12">C</xsl:when>
<xsl:when test="$value mod 16 = 13">D</xsl:when>
<xsl:when test="$value mod 16 = 14">E</xsl:when>
<xsl:when test="$value mod 16 = 15">F</xsl:when>
<xsl:otherwise>A</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!---->
<xsl:template name="dec-to-hex">
<xsl:param name="value" />
<xsl:choose>
<xsl:when test="$value > 0">
<xsl:text>0x</xsl:text>
<!---->
<xsl:call-template name="convert-dec-to-hex">
<xsl:with-param name="value" select="$value" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>0x0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template name="dec-to-hex-padded">
<xsl:param name="value" />
<xsl:param name="digits" />
<!---->
<xsl:variable name="value-as-hex">
<xsl:call-template name="convert-dec-to-hex">
<xsl:with-param name="value" select="$value" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value-as-hex-digits" select="string-length($value-as-hex)" />
<xsl:variable name="required-padding-zeros" select="$digits - $value-as-hex-digits" />
<xsl:choose>
<!---->
<xsl:when test="$value > 0">
<xsl:text>0x</xsl:text>
<!---->
<xsl:if test="$required-padding-zeros > 0">
<xsl:call-template name="repeat-output">
<xsl:with-param name="output" select="0" />
<xsl:with-param name="count" select="$required-padding-zeros" />
</xsl:call-template>
</xsl:if>
<!---->
<xsl:call-template name="convert-dec-to-hex">
<xsl:with-param name="value" select="$value" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>0x</xsl:text>
<!---->
<xsl:call-template name="repeat-output">
<xsl:with-param name="output" select="0" />
<xsl:with-param name="count" select="$required-padding-zeros" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="get-param-type-name" match="*">
<xsl:choose>
<xsl:when test="self::mostco:TBitField">BitField</xsl:when>
<xsl:when test="self::mostco:TBoolean">Boolean</xsl:when>
<xsl:when test="self::mostco:TEnum">Enum</xsl:when>
<xsl:when test="self::mostco:TString">String</xsl:when>
<xsl:when test="self::mostco:TLengthCodedString">Length-coded String</xsl:when>
<xsl:when test="self::mostco:TArrayLegacy">
<xsl:apply-templates mode="class-array" select="." />
</xsl:when>
<xsl:when test="self::mostco:TArrayType">Array Type</xsl:when>
<xsl:when test="self::mostco:TRecordLegacy">
<xsl:apply-templates mode="class-record" select="." />
</xsl:when>
<xsl:when test="self::mostco:TRecordType">Record Type</xsl:when>
<xsl:when test="self::mostco:TStream">Stream</xsl:when>
<xsl:when test="self::mostco:TCStream">Classified Stream</xsl:when>
<xsl:when test="self::mostco:TShortStream">Short Stream</xsl:when>
<xsl:when test="self::mostco:TUByte">Unsigned Byte</xsl:when>
<xsl:when test="self::mostco:TSByte">Signed Byte</xsl:when>
<xsl:when test="self::mostco:TUWord">Unsigned Word</xsl:when>
<xsl:when test="self::mostco:TSWord">Signed Word</xsl:when>
<xsl:when test="self::mostco:TULong">Unsigned Long</xsl:when>
<xsl:when test="self::mostco:TSLong">Signed Long</xsl:when>
</xsl:choose>
<xsl:text> </xsl:text>
<!---->
<!---->
<!---->
</xsl:template>
<!---->
<!---->
<!---->
<xsl:template mode="choose-class" match="*">
<xsl:variable name="parameter-name" select="mostco:Status/mostco:ParameterReference[2]/@Name" />
<xsl:variable name="tagged-parameter-name" select="mostco:Status/mostco:ParameterReference[3]/@Name" />
<xsl:variable name="longarray-parameter-name" select="mostco:Status/mostco:ParameterReference[5]/@Name" />
<xsl:variable name="parameter-definition" select="../mostco:Parameters/mostco:Parameter[@Name=$parameter-name]/mostco:DataType" />
<xsl:variable name="shared-parameter-definition" select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=$parameter-name]/mostco:Parameter/mostco:DataType" />
<xsl:variable name="tagged-parameter-definition" select="../mostco:Parameters/mostco:Parameter[@Name=$tagged-parameter-name]/mostco:DataType" />
<xsl:variable name="tagged-shared-parameter-definition" select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=$tagged-parameter-name]/mostco:Parameter/mostco:DataType" />
<xsl:variable name="longarray-parameter-definition" select="../mostco:Parameters/mostco:Parameter[@Name=$longarray-parameter-name]/mostco:DataType" />
<xsl:variable name="longarray-shared-parameter-definition" select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=$longarray-parameter-name]/mostco:Parameter/mostco:DataType" />
<xsl:choose>
<xsl:when test="@Class='Record'">
<xsl:choose>
<xsl:when test="$shared-parameter-definition">
<xsl:apply-templates mode="class-record" select="$shared-parameter-definition" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="class-record" select="$parameter-definition" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@Class='Array'">
<xsl:choose>
<xsl:when test="$shared-parameter-definition">
<xsl:apply-templates mode="class-array" select="$shared-parameter-definition" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="class-array" select="$parameter-definition" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@Class='DynamicArray'">
<xsl:choose>
<xsl:when test="$tagged-shared-parameter-definition">
<xsl:apply-templates mode="class-dynamicarray" select="$tagged-shared-parameter-definition" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="class-dynamicarray" select="$tagged-parameter-definition" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@Class='LongArray'">
<xsl:choose>
<xsl:when test="$longarray-shared-parameter-definition">
<xsl:apply-templates mode="class-longarray" select="$longarray-shared-parameter-definition" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="class-longarray" select="$longarray-parameter-definition" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@Class='Map'">
<xsl:choose>
<xsl:when test="$tagged-shared-parameter-definition">
<xsl:apply-templates mode="class-map" select="$tagged-shared-parameter-definition" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="class-map" select="$tagged-parameter-definition" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Class" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="class-record" match="mostco:TRecordLegacy">
<xsl:text>Record of { </xsl:text>
<!---->
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:choose>
<xsl:when test="self::mostco:TRecordField">
<xsl:apply-templates select="mostco:DataType/*" mode="get-param-type-name" />
</xsl:when>
<xsl:when test="self::mostco:SharedRecordFieldReference">
<xsl:apply-templates select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
</xsl:when>
<xsl:when test="self::mostco:NamedSharedRecordFieldReference">
<xsl:apply-templates select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@NameRef]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
</xsl:when>
</xsl:choose>
</xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:template>
<!---->
<xsl:template mode="class-array" match="mostco:TArrayLegacy">
<xsl:text>Array of { </xsl:text>
<xsl:apply-templates select="mostco:DataType/*|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
<xsl:text>}</xsl:text>
</xsl:template>
<!---->
<xsl:template mode="class-dynamicarray" match="mostco:TArrayLegacy">
<xsl:text>DynamicArray of { </xsl:text>
<xsl:apply-templates select="mostco:DataType/*|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
<xsl:text>}</xsl:text>
</xsl:template>
<!---->
<xsl:template mode="class-longarray" match="mostco:TArrayLegacy">
<xsl:text>LongArray of { </xsl:text>
<xsl:apply-templates select="mostco:DataType/*|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
<xsl:text>}</xsl:text>
</xsl:template>
<!---->
<xsl:template mode="class-map" match="mostco:TArrayLegacy">
<xsl:text>Map of { </xsl:text>
<xsl:apply-templates select="mostco:DataType/*|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" mode="get-param-type-name" />
<xsl:text>}</xsl:text>
</xsl:template>
<!---->
<!---->
<xsl:template match="mostco:FunctionCatalog">
<!---->
<html>
<head>
<title>Function Catalog</title>
<link rel="stylesheet" type="text/css" href="most.css" />
</head>
<body>
<h1>Function Catalog</h1>
<!---->
<xsl:apply-templates select="mostco:CatalogVersion" />
<!---->
<xsl:variable name="fblock-exists" select="count(mostco:FBlock) > 0" />
<xsl:choose>
<xsl:when test="mostco:FBlock">
<!---->
<table border="2" cellpadding="3" cellspacing="0">
<!---->
<tr>
<th colspan="2" class="functiontable">FBlock Overview</th>
</tr>
<tr>
<th class="functiontable">FBlockID</th>
<th class="functiontable">Name</th>
</tr>
<!---->
<xsl:apply-templates mode="fblock-table" select="mostco:FBlock">
<xsl:sort data-type="number" select="@Id" />
</xsl:apply-templates>
</table>
<!---->
<xsl:apply-templates select="mostco:FBlock">
<xsl:sort data-type="number" select="@Id" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:variable name="function-group-exists" select="count(/*/mostco:SharedFunctions/mostco:SharedFunction/mostco:Function/@FunctionGroup) > 0" />
<!---->
<table border="2" cellpadding="3" cellspacing="0">
<!---->
<tr>
<xsl:choose>
<xsl:when test="$function-group-exists = true()">
<th colspan="4" class="functiontable">Function Overview</th>
</xsl:when>
<xsl:otherwise>
<th colspan="3" class="functiontable">Function Overview</th>
</xsl:otherwise>
</xsl:choose>
</tr>
<tr>
<th class="functiontable">FktID</th>
<th class="functiontable">Name</th>
<th class="functiontable">Occurrence</th>
<xsl:if test="$function-group-exists = true()">
<th class="functiontable">FunctionGroup</th>
</xsl:if>
</tr>
<!---->
<xsl:apply-templates mode="function-overview-table-row" select="/mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction/mostco:Function">
<xsl:with-param name="function-group-exists" select="$function-group-exists" />
<xsl:with-param name="fblock-exists" select="$fblock-exists" />
<xsl:with-param name="fblock-id" select="@Id" />
<xsl:sort data-type="number" order="ascending" select="@Id" />
</xsl:apply-templates>
</table>
<!---->
<xsl:apply-templates select="/mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction/mostco:Function" mode="zero-fblocks">
<xsl:sort data-type="number" order="ascending" select="@Id" />
<!---->
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<!---->
<!---->
</body>
</html>
</xsl:template>
<!---->
<xsl:template match="mostco:FBlock" mode="fblock-table">
<tr>
<!---->
<td class="functionformat">
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="@Id" />
<xsl:with-param name="digits" select="2" />
</xsl:call-template>
</td>
<!---->
<td class="functionformat">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="@Id" /></xsl:attribute>
<xsl:value-of select="@Name" />
</xsl:element>
</td>
</tr>
</xsl:template>
<!---->
<!---->
<xsl:template match="mostco:FBlock">
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="@Id" /></xsl:attribute>
</xsl:element>
<h2>
<xsl:value-of select="@Name" />
<!---->
<xsl:if test="@Id">
<xsl:text> </xsl:text>
<xsl:text>(FBlockID = </xsl:text>
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="@Id" />
<xsl:with-param name="digits" select="2" />
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:if>
</h2>
<!---->
<xsl:apply-templates select="mostco:FBlockVersion" />
<!---->
<xsl:if test="mostco:Description/text()">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description/text()" />
</p>
</xsl:if>
<xsl:variable name="function-group-exists" select="count(mostco:Function/@FunctionGroup | /*/mostco:SharedFunctions/mostco:SharedFunction[@Name = current()/mostco:SharedFunctionReference/@Name]/mostco:Function/@FunctionGroup) > 0" />
<!---->
<table border="2" cellpadding="3" cellspacing="0">
<!---->
<tr>
<xsl:choose>
<xsl:when test="$function-group-exists = true()">
<th colspan="4" class="functiontable">Function Overview</th>
</xsl:when>
<xsl:otherwise>
<th colspan="3" class="functiontable">Function Overview</th>
</xsl:otherwise>
</xsl:choose>
</tr>
<tr>
<th class="functiontable">FktID</th>
<th class="functiontable">Name</th>
<th class="functiontable">Occurrence</th>
<xsl:if test="$function-group-exists = true()">
<th class="functiontable">FunctionGroup</th>
</xsl:if>
</tr>
<!---->
<!---->
<xsl:apply-templates mode="function-overview-table-row" select="mostco:Function | mostco:SharedFunctionReference[@Id] | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name = current()/mostco:SharedFunctionReference/@Name]/mostco:Function">
<xsl:with-param name="function-group-exists" select="$function-group-exists" />
<xsl:with-param name="fblock-exists" select="true()" />
<xsl:with-param name="fblock-id" select="@Id" />
<xsl:sort data-type="number" order="ascending" select="@Id" />
</xsl:apply-templates>
</table>
<!---->
<xsl:apply-templates select="mostco:Function | mostco:SharedFunctionReference[@Id] | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name = current()/mostco:SharedFunctionReference/@Name]/mostco:Function">
<xsl:sort data-type="number" order="ascending" select="@Id" />
<xsl:with-param name="fblock-id" select="@Id" />
</xsl:apply-templates>
<p class="PageBreakPossible">
<xsl:text> </xsl:text>
</p>
</xsl:template>
<!---->
<!---->
<xsl:template match="mostco:CatalogVersion|mostco:FBlockVersion|mostco:FunctionVersion">
<xsl:choose>
<xsl:when test="self::mostco:CatalogVersion or @Access='public'">
<table border="0">
<tr>
<td class="VerInfo">Release:</td>
<td class="VerInfo">
<xsl:choose>
<xsl:when test="@Release">
<xsl:value-of select="@Release" />
</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="VerInfo">Date:</td>
<td class="VerInfo">
<xsl:choose>
<xsl:when test="@Date">
<xsl:value-of select="@Date" />
</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="VerInfo">Author:</td>
<td class="VerInfo">
<xsl:choose>
<xsl:when test="mostco:Author/text()">
<xsl:value-of select="mostco:Author/text()" />
</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="VerInfo">Company:</td>
<td class="VerInfo">
<xsl:choose>
<xsl:when test="mostco:Company/text()">
<xsl:value-of select="mostco:Company/text()" />
</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</table>
<table border="2" cellpadding="3" cellspacing="0">
<xsl:variable name="AuthorCount">
<xsl:choose>
<xsl:when test="mostco:Modification/@Author">
<xsl:value-of select="1" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="DateCount">
<xsl:choose>
<xsl:when test="mostco:Modification/@Date">
<xsl:value-of select="1" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="TimeCount">
<xsl:choose>
<xsl:when test="mostco:Modification/@Time">
<xsl:value-of select="1" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="0" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr>
<th colspan="{2 + $AuthorCount+ $DateCount+ $TimeCount}" class="functiontable">Modifications</th>
</tr>
<tr>
<th class="functiontable">Change</th>
<th class="functiontable">Reason</th>
<xsl:if test="mostco:Modification/@Author">
<th class="functiontable">Author</th>
</xsl:if>
<xsl:if test="mostco:Modification/@Date">
<th class="functiontable">Date</th>
</xsl:if>
<xsl:if test="mostco:Modification/@Time">
<th class="functiontable">Time</th>
</xsl:if>
</tr>
<xsl:apply-templates mode="list-modifications" select="mostco:Modification" />
</table>
<br />
</xsl:when>
<xsl:otherwise>
<p class="VerInfo">(The version information is not publicly available.)</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="list-modifications" match="mostco:Modification">
<tr>
<td class="VerInfo">
<xsl:value-of select="mostco:Change/text()" />
</td>
<td class="VerInfo">
<xsl:value-of select="mostco:Reason/text()" />
</td>
<xsl:if test="../mostco:Modification/@Author">
<td class="VerInfo">
<xsl:value-of select="@Author" />
</td>
</xsl:if>
<xsl:if test="../mostco:Modification/@Date">
<td class="VerInfo">
<xsl:value-of select="@Date" />
</td>
</xsl:if>
<xsl:if test="../mostco:Modification/@Time">
<td class="VerInfo">
<xsl:value-of select="@Time" />
</td>
</xsl:if>
</tr>
</xsl:template>
<!---->
<!---->
<xsl:template mode="function-overview-table-row" match="mostco:Function|mostco:SharedFunctionReference">
<xsl:param name="function-group-exists" />
<xsl:param name="fblock-exists" />
<xsl:param name="fblock-id" />
<xsl:variable name="is-function-reference" select="boolean(self::mostco:SharedFunctionReference)" />
<!---->
<xsl:variable name="function-node" select="self::node() [not($is-function-reference)] | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name=current()/@Name]/mostco:Function [$is-function-reference]" />
<!---->
<xsl:variable name="id-attribute-exists" select="boolean(@Id)" />
<xsl:variable name="resulting-function-id" select="self::node() [$id-attribute-exists]/@Id | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name=current()/@Name]/mostco:Function [not($id-attribute-exists)]/@Id" />
<tr>
<td class="functionformat">
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$resulting-function-id" />
<xsl:with-param name="digits" select="3" />
</xsl:call-template>
</td>
<td class="functionformat">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text>
<xsl:choose>
<!---->
<xsl:when test="$fblock-exists = true()">
<xsl:call-template name="function-anchor"><xsl:with-param name="fblock-id" select="$fblock-id" /><xsl:with-param name="resulting-function-id" select="$resulting-function-id" /></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="shared-function-anchor"><xsl:with-param name="fblock-id" select="$fblock-id" /><xsl:with-param name="resulting-function-id" select="$resulting-function-id" /></xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$function-node/@Name" />
</xsl:element>
</td>
<td class="functionformat">
<xsl:value-of select="$function-node/@Occurrence" />
</td>
<xsl:if test="$function-group-exists = true()">
<td class="functionformat">
<xsl:value-of select="$function-node/@FunctionGroup" />
</td>
</xsl:if>
</tr>
</xsl:template>
<!---->
<xsl:template name="function-anchor">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:value-of select="$fblock-id" />
<xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text>
<xsl:value-of select="ancestor-or-self::mostco:Function/@Name | @Name" />
</xsl:template>
<!---->
<xsl:template name="shared-function-anchor">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:value-of select="$fblock-id" />
<xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text>
<xsl:value-of select="ancestor-or-self::mostco:SharedFunction/@Name" />
</xsl:template>
<!---->
<!---->
<xsl:template match="mostco:Function|mostco:SharedFunctionReference">
<xsl:param name="fblock-id" />
<xsl:variable name="is-function-reference" select="boolean(self::mostco:SharedFunctionReference)" />
<!---->
<xsl:variable name="function-node" select="self::node() [not($is-function-reference)] | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name=current()/@Name]/mostco:Function [$is-function-reference]" />
<xsl:variable name="id-attribute-exists" select="boolean(@Id)" />
<xsl:variable name="resulting-function-id" select="self::node() [$id-attribute-exists]/@Id | /mostco:FunctionCatalog/mostco:SharedFunctions/mostco:SharedFunction[@Name=current()/@Name]/mostco:Function [not($id-attribute-exists)]/@Id" />
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:call-template name="function-anchor"><xsl:with-param name="fblock-id" select="$fblock-id" /><xsl:with-param name="resulting-function-id" select="$resulting-function-id" /></xsl:call-template></xsl:attribute>
</xsl:element>
<h3>
<xsl:value-of select="$function-node/@Name" /> (<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$resulting-function-id" />
<xsl:with-param name="digits" select="3" />
</xsl:call-template>
<xsl:if test="@FunctionGroup">
<xsl:text> - Function Group: </xsl:text>
<xsl:value-of select="@FunctionGroup" />
</xsl:if>
<xsl:text>)</xsl:text>
</h3>
<p class="description">Occurrence: <xsl:value-of select="$function-node/@Occurrence" />
</p>
<xsl:if test="$function-node/mostco:Description/text()">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="$function-node/mostco:Description/text()" />
</p>
</xsl:if>
<h4>Format of Function</h4>
<p class="functionformat">
<b>Function class: </b>
<!---->
<xsl:apply-templates mode="choose-class" select="$function-node/mostco:Property|$function-node/mostco:Method" />
</p>
<!---->
<table width="100%" border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="functionformat" width="15%">FBlock</th>
<th class="functionformat" width="15%">Function</th>
<th class="functionformat" width="15%">OPType</th>
<xsl:if test="count(($function-node/mostco:Property|$function-node/mostco:Method)/*[@Channel])">
<th class="functionformat" width="15%">Channel</th>
</xsl:if>
<th class="functionformat">Parameter</th>
</tr>
<!---->
<xsl:apply-templates mode="function-table" select="$function-node/mostco:Property|$function-node/mostco:Method">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
</xsl:apply-templates>
</table>
<!---->
<!---->
<xsl:if test="count($function-node/mostco:Parameters/mostco:Parameter|$function-node/mostco:Parameters/mostco:SharedParameterReference|$function-node/mostco:Parameters/mostco:NamedSharedParameterReference) > 0">
<h4>Parameter</h4>
<xsl:variable name="function-name" select="ancestor::mostco:SharedFunction/@Name | @Name[not(ancestor::mostco:SharedFunction)]" />
<xsl:for-each select="$function-node/*/*/mostco:ParameterReference">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current()/parent::*)]" />
<!---->
<xsl:variable name="first-parameter-reference">
<xsl:for-each select="../../*/mostco:ParameterReference[@Name = current()/@Name]">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current()/parent::*)]" />
<xsl:if test="position()=1">
<xsl:value-of select="generate-id(.)" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="generate-id(.) = $first-parameter-reference">
<xsl:choose>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::', @Name))/self::mostco:Parameter">
<xsl:apply-templates mode="parameter-description" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:SharedParameterReference">
<xsl:apply-templates mode="shared-parameter-description" select="key('shared-parameter-definitions',./@Name)/mostco:Parameter">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference">
<xsl:apply-templates mode="named-shared-parameter-description" select="key('shared-parameter-definitions', key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/@NameRef)/mostco:Parameter">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="name-substitute" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/@Name" />
<xsl:with-param name="description-substitute" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/mostco:Description" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<!---->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!---->
<xsl:template match="mostco:Function" mode="zero-fblocks">
<xsl:param name="fblock-id" />
<xsl:variable name="function-node" select="self::node()" />
<xsl:variable name="resulting-function-id" select="self::node()/@Id" />
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:call-template name="shared-function-anchor"><xsl:with-param name="fblock-id" select="$fblock-id" /><xsl:with-param name="resulting-function-id" select="$resulting-function-id" /></xsl:call-template></xsl:attribute>
</xsl:element>
<h3>
<xsl:value-of select="$function-node/@Name" /> (<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$resulting-function-id" />
<xsl:with-param name="digits" select="3" />
</xsl:call-template>
<xsl:if test="@FunctionGroup">
<xsl:text> - Function Group: </xsl:text>
<xsl:value-of select="@FunctionGroup" />
</xsl:if>
<xsl:text>)</xsl:text>
</h3>
<p class="description">Occurrence: <xsl:value-of select="$function-node/@Occurrence" />
</p>
<xsl:if test="$function-node/mostco:Description/text()">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="$function-node/mostco:Description/text()" />
</p>
</xsl:if>
<h4>Format of Function</h4>
<p class="functionformat">
<b>Function class: </b>
<!---->
<xsl:apply-templates mode="choose-class" select="$function-node/mostco:Property|$function-node/mostco:Method" />
</p>
<!---->
<table width="100%" border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="functionformat" width="15%">FBlock</th>
<th class="functionformat" width="15%">Function</th>
<th class="functionformat" width="15%">OPType</th>
<xsl:if test="count(($function-node/mostco:Property|$function-node/mostco:Method)/*[@Channel])">
<th class="functionformat" width="15%">Channel</th>
</xsl:if>
<th class="functionformat">Parameter</th>
</tr>
<!---->
<xsl:apply-templates mode="zero-fblocks-function-table" select="$function-node/mostco:Property|$function-node/mostco:Method">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
</xsl:apply-templates>
</table>
<!---->
<!---->
<xsl:if test="count($function-node/mostco:Parameters/mostco:Parameter|$function-node/mostco:Parameters/mostco:SharedParameterReference|$function-node/mostco:Parameters/mostco:NamedSharedParameterReference) > 0">
<h4>Parameter</h4>
<xsl:variable name="function-name" select="ancestor::mostco:SharedFunction/@Name | ancestor-or-self::mostco:Function/@Name[not(ancestor::mostco:SharedFunction)]" />
<xsl:for-each select="$function-node/*/*/mostco:ParameterReference">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current()/parent::*)]" />
<!---->
<xsl:variable name="first-parameter-reference">
<xsl:for-each select="../../*/mostco:ParameterReference[@Name = current()/@Name]">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current()/parent::*)]" />
<xsl:if test="position()=1">
<xsl:value-of select="generate-id(.)" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:if test="generate-id(.) = $first-parameter-reference">
<xsl:choose>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::', @Name))/self::mostco:Parameter">
<xsl:apply-templates mode="parameter-description" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:SharedParameterReference">
<xsl:apply-templates mode="shared-parameter-description" select="key('shared-parameter-definitions',./@Name)/mostco:Parameter">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference">
<xsl:apply-templates mode="named-shared-parameter-description" select="key('shared-parameter-definitions', key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/@NameRef)/mostco:Parameter">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="name-substitute" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/@Name" />
<xsl:with-param name="description-substitute" select="key('parameter-definitions', concat(generate-id(ancestor::mostco:Function),'::',@Name))/self::mostco:NamedSharedParameterReference/mostco:Description" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<!---->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
<!---->
<xsl:template match="mostco:Method|mostco:Property" mode="function-table">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<!---->
<xsl:variable name="used-optypes-sorted">
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<!---->
<xsl:variable name="number-of-used-optypes" select="count(*)" />
<xsl:variable name="number-of-channel-attributes" select="count(*[@Channel])" />
<xsl:variable name="first-used-optype">
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:if test="position()=1">
<xsl:value-of select="name(.)" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<!---->
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:call-template name="function-table-entry">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="optype-node" select="." />
<xsl:with-param name="optype-name" select="name(.)" />
<xsl:with-param name="first-used-optype" select="$first-used-optype" />
<xsl:with-param name="number-of-used-optypes" select="$number-of-used-optypes" />
<xsl:with-param name="number-of-channel-attributes" select="$number-of-channel-attributes" />
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!---->
<xsl:template match="mostco:Method|mostco:Property" mode="zero-fblocks-function-table">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<!---->
<xsl:variable name="used-optypes-sorted">
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<!---->
<xsl:variable name="number-of-used-optypes" select="count(*)" />
<xsl:variable name="number-of-channel-attributes" select="count(*[@Channel])" />
<xsl:variable name="first-used-optype">
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:if test="position()=1">
<xsl:value-of select="name(.)" />
</xsl:if>
</xsl:for-each>
</xsl:variable>
<!---->
<xsl:for-each select="*">
<xsl:sort data-type="number" order="ascending" select="document('')/*/mostco:OPTypeNum[@name=name(current())]" />
<xsl:call-template name="zero-fblocks-function-table-entry">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="optype-node" select="." />
<xsl:with-param name="optype-name" select="name(.)" />
<xsl:with-param name="first-used-optype" select="$first-used-optype" />
<xsl:with-param name="number-of-used-optypes" select="$number-of-used-optypes" />
<xsl:with-param name="number-of-channel-attributes" select="$number-of-channel-attributes" />
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<!---->
<xsl:template name="function-table-entry">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="optype-node" />
<xsl:param name="optype-name" />
<xsl:param name="first-used-optype" />
<xsl:param name="number-of-used-optypes" />
<xsl:param name="number-of-channel-attributes" />
<xsl:if test="$optype-node">
<tr>
<!---->
<xsl:if test="name($optype-node)=$first-used-optype">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>functionformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-used-optypes" /></xsl:attribute>
<xsl:text />
<xsl:value-of select="ancestor::mostco:FBlock/@Name" />
<xsl:text> (</xsl:text>
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$fblock-id" />
<xsl:with-param name="digits" select="2" />
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>functionformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-used-optypes" /></xsl:attribute>
<xsl:text />
<xsl:value-of select="ancestor::mostco:Function/@Name" />
<xsl:text> (</xsl:text>
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$resulting-function-id" />
<xsl:with-param name="digits" select="3" />
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:element>
</xsl:if>
<td class="functionformat">
<xsl:value-of select="$optype-name" />
</td>
<xsl:if test="$number-of-channel-attributes > 0">
<xsl:choose>
<xsl:when test="@Channel">
<td class="functionformat">
<xsl:value-of select="@Channel" />
</td>
</xsl:when>
<xsl:otherwise>
<td class="functionformat" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<td class="functionformat">
<xsl:for-each select="mostco:ParameterReference">
<xsl:if test="position() > 1">, </xsl:if>
<xsl:element name="a">
<!---->
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="ancestor::mostco:SharedFunction/@Name | ancestor-or-self::mostco:Function/@Name[not(ancestor::mostco:SharedFunction)]" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
<xsl:apply-templates mode="actual-parameter-name" select="." />
</xsl:element>
</xsl:for-each>
<!---->
<xsl:choose>
<xsl:when test="$optype-name='Error' and count(mostco:ParameterReference)=0 and count(../mostco:ErrorAck/*)<3">ErrorCode, ErrorInfo</xsl:when>
<xsl:when test="$optype-name='ErrorAck' and count(mostco:ParameterReference)=1 and count(../mostco:Error/*)=0">, ErrorCode, ErrorInfo</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:if>
</xsl:template>
<!---->
<xsl:template name="zero-fblocks-function-table-entry">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="optype-node" />
<xsl:param name="optype-name" />
<xsl:param name="first-used-optype" />
<xsl:param name="number-of-used-optypes" />
<xsl:param name="number-of-channel-attributes" />
<xsl:if test="$optype-node">
<tr>
<!---->
<xsl:if test="name($optype-node)=$first-used-optype">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>functionformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-used-optypes" /></xsl:attribute>
<xsl:text />
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>functionformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-used-optypes" /></xsl:attribute>
<xsl:text />
<xsl:value-of select="ancestor::mostco:Function/@Name" />
<xsl:text> (</xsl:text>
<xsl:call-template name="dec-to-hex-padded">
<xsl:with-param name="value" select="$resulting-function-id" />
<xsl:with-param name="digits" select="3" />
</xsl:call-template>
<xsl:text>)</xsl:text>
</xsl:element>
</xsl:if>
<td class="functionformat">
<xsl:value-of select="$optype-name" />
</td>
<xsl:if test="$number-of-channel-attributes > 0">
<xsl:choose>
<xsl:when test="@Channel">
<td class="functionformat">
<xsl:value-of select="@Channel" />
</td>
</xsl:when>
<xsl:otherwise>
<td class="functionformat" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<td class="functionformat">
<xsl:for-each select="mostco:ParameterReference">
<xsl:if test="position() > 1">, </xsl:if>
<xsl:element name="a">
<!---->
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="ancestor::mostco:SharedFunction/@Name | ancestor-or-self::mostco:Function/@Name[not(ancestor::mostco:SharedFunction)]" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
<xsl:apply-templates mode="actual-parameter-name" select="." />
</xsl:element>
</xsl:for-each>
<!---->
<xsl:choose>
<xsl:when test="$optype-name='Error' and count(mostco:ParameterReference)=0 and count(../mostco:ErrorAck/*)<3">ErrorCode, ErrorInfo</xsl:when>
<xsl:when test="$optype-name='ErrorAck' and count(mostco:ParameterReference)=1 and count(../mostco:Error/*)=0">, ErrorCode, ErrorInfo</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:if>
</xsl:template>
<!---->
<!---->
<xsl:template match="*" mode="parameter-description">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
</xsl:element>
<!---->
<p class="parameter">
<xsl:value-of select="@Name" />
<xsl:if test="@DataElementGroup">
(Data Element Group: <xsl:value-of select="@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<xsl:if test="mostco:Description">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description/text()" />
</p>
</xsl:if>
<xsl:apply-templates select="mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template match="*" mode="shared-parameter-description">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="parent::*/@Name" /></xsl:attribute>
</xsl:element>
<!---->
<p class="parameter">
<xsl:value-of select="@Name" />
<xsl:if test="@DataElementGroup">
(Data Element Group: <xsl:value-of select="@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<!---->
<xsl:if test="mostco:Description">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description" />
</p>
</xsl:if>
<!---->
<xsl:apply-templates select="mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template match="*" mode="named-shared-parameter-description">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:param name="name-substitute" />
<xsl:param name="description-substitute" />
<!---->
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="parent::*/@Name" /></xsl:attribute>
</xsl:element>
<!---->
<p class="parameter">
<xsl:value-of select="@Name[not($name-substitute)]|$name-substitute[$name-substitute]" />
<xsl:if test="@DataElementGroup">
(Data Element Group: <xsl:value-of select="@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<!---->
<xsl:if test="mostco:Description|$description-substitute">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description[not($description-substitute)]|$description-substitute[$description-substitute]" />
</p>
</xsl:if>
<!---->
<xsl:apply-templates select="mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TRecordLegacy | mostco:TRecordType">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:apply-templates select="." mode="record-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<!---->
<xsl:apply-templates select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference" mode="record-member-description">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template mode="record-table" match="mostco:TRecordLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="PosCount" select="count(mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference)" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat" colspan="2">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$PosCount+2" /></xsl:attribute>
<xsl:text>Record</xsl:text>
</xsl:element>
<td class="paramformat">Pos</td>
<td class="paramformat">Data</td>
</tr>
<tr>
<td class="paramformat">
<!---->
<xsl:text>{ x=0 }</xsl:text>
</td>
<td class="paramformat2">
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:choose>
<xsl:when test="last()=position()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
<!---->
<xsl:apply-templates mode="record-table-row" select="mostco:TRecordField">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</table>
</xsl:template>
<!---->
<xsl:template mode="record-table" match="mostco:TRecordType">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="PosCount" select="count(mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference)" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat" colspan="2">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:text>Record Type</xsl:text>
</xsl:element>
<td class="paramformat2">
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:choose>
<xsl:when test="last()=position()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
</table>
</xsl:template>
<!---->
<xsl:template mode="record-table-row" match="mostco:TRecordField">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<tr>
<td class="paramformat">
<!---->
<xsl:text>{ x=</xsl:text>
<xsl:value-of select="position()" />
<xsl:text> }</xsl:text>
</td>
<td class="paramformat2">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
<xsl:value-of select="@Name" />
</xsl:element>
</td>
</tr>
</xsl:template>
<!---->
<xsl:template mode="record-member-description" match="mostco:TRecordField">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<p class="parameter">
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
</xsl:element>
<xsl:value-of select="@Name" />
<xsl:if test="@DataElementGroup">
(Data Element Group: <xsl:value-of select="@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<xsl:if test="mostco:Description">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description" />
</p>
</xsl:if>
<!---->
<xsl:apply-templates select="mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="ancestor-array-or-record" select="ancestor::mostco:TArrayLegacy|ancestor::mostco:TRecordLegacy" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template mode="record-member-description" match="mostco:SharedRecordFieldReference">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="resulting-parameter-name">
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@Name" />
</xsl:variable>
<xsl:variable name="resulting-parameter-description">
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/mostco:Description" />
</xsl:variable>
<p class="parameter">
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="$resulting-parameter-name" /></xsl:attribute>
</xsl:element>
<xsl:value-of select="$resulting-parameter-name" />
<xsl:if test="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@DataElementGroup">
(Data Element Group: <xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<xsl:if test="not($resulting-parameter-description = '')">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="$resulting-parameter-description" />
</p>
</xsl:if>
<!---->
<xsl:apply-templates select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<!---->
<xsl:with-param name="ancestor-array-or-record" select="ancestor::mostco:TArrayLegacy|ancestor::mostco:TRecordLegacy" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template mode="record-member-description" match="mostco:NamedSharedRecordFieldReference">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="resulting-parameter-name">
<xsl:value-of select="@Name" />
</xsl:variable>
<xsl:variable name="resulting-parameter-description">
<xsl:choose>
<xsl:when test="mostco:Description">
<!---->
<xsl:value-of select="mostco:Description" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@NameRef]/mostco:Parameter/mostco:Description" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<p class="parameter">
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="$resulting-parameter-name" /></xsl:attribute>
</xsl:element>
<xsl:value-of select="$resulting-parameter-name" />
<xsl:if test="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@NameRef]/mostco:Parameter/@DataElementGroup">
(Data Element Group: <xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@NameRef]/mostco:Parameter/@DataElementGroup" />)
</xsl:if>
</p>
<hr size="2" noshade="true" />
<xsl:if test="not($resulting-parameter-description = '')">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="$resulting-parameter-description" />
</p>
</xsl:if>
<!---->
<xsl:apply-templates select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@NameRef]/mostco:Parameter/mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<!---->
<xsl:with-param name="ancestor-array-or-record" select="ancestor::mostco:TArrayLegacy|ancestor::mostco:TRecordLegacy" />
</xsl:apply-templates>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TArrayLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:param name="ancestor-array-or-record" />
<xsl:choose>
<!---->
<xsl:when test="$ancestor-array-or-record">
<xsl:apply-templates select="." mode="simple-array-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:apply-templates select="." mode="array-parameter-description">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="mostco:DataType/mostco:TRecordLegacy|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy">
<xsl:apply-templates select="." mode="array-of-record-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:apply-templates select="mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference" mode="record-member-description">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="structured-array-parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:apply-templates select="." mode="array-parameter-description">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="resulting-record-field-name" match="*">
<xsl:choose>
<xsl:when test="self::mostco:SharedRecordFieldReference">
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@Name" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="resulting-data-element-name" match="*">
<xsl:choose>
<xsl:when test="self::mostco:TArrayType|self::mostco:TArrayLegacy and @Name">
<xsl:value-of select="@Name" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="mostco:SharedDataElementReference">
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/@Name" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="actual-parameter-name" match="*">
<xsl:choose>
<xsl:when test="../../../mostco:Parameters/mostco:Parameter[@Name=current()/@Name]">
<!---->
<xsl:value-of select="@Name" />
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="../../../mostco:Parameters/mostco:NamedSharedParameterReference[@Name=current()/@Name]">
<!---->
<xsl:value-of select="../../../mostco:Parameters/mostco:NamedSharedParameterReference[@Name=current()/@Name]/@Name" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<!---->
<xsl:template mode="structured-array-parameter-table" match="mostco:TArrayLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<xsl:if test="@MaxElementCount">
<th class="paramformat">Max. element count</th>
</xsl:if>
<th class="paramformat" colspan="2">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="4" /></xsl:attribute>
<xsl:text>Array</xsl:text>
</xsl:element>
<xsl:if test="@MaxElementCount">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="4" /></xsl:attribute>
<xsl:value-of select="@MaxElementCount" />
</xsl:element>
</xsl:if>
<td class="paramformat">Pos</td>
<td class="paramformat">Data</td>
</tr>
<!---->
<tr>
<td class="paramformat">
<xsl:text>{ x=0 }</xsl:text>
</td>
<td class="paramformat2">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
<xsl:text>[1]</xsl:text>
<xsl:text>, </xsl:text>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
<xsl:text>[2]</xsl:text>
<xsl:text>,..., </xsl:text>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
<xsl:choose>
<xsl:when test="@MaxElementCount">[<xsl:value-of select="@MaxElementCount" />]</xsl:when>
<xsl:otherwise>
<xsl:text>[NMax]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<!---->
<tr>
<td class="paramformat">
<xsl:text>{ x>0 }</xsl:text>
</td>
<td class="paramformat2">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
<xsl:text>[x]</xsl:text>
</td>
</tr>
</table>
</xsl:template>
<!---->
<xsl:template mode="simple-array-table" match="mostco:TArrayLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<xsl:if test="@MaxElementCount">
<th class="paramformat">Max. element count</th>
</xsl:if>
<th class="paramformat">Element type</th>
<th class="paramformat">Element name</th>
</tr>
<tr>
<td class="paramformat">Array</td>
<xsl:if test="@MaxElementCount">
<td class="paramformat">
<xsl:value-of select="@MaxElementCount" />
</td>
</xsl:if>
<td class="paramformat">
<xsl:apply-templates mode="get-param-type-name" select="mostco:DataType/*|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" />
</td>
<td class="paramformat">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="array-of-record-table" match="mostco:TArrayLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="PosCount" select="count(descendant::mostco:TRecordField| descendant::mostco:SharedRecordFieldReference| descendant::mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]//mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]//mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]//mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]//mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]//mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]//mostco:NamedSharedRecordFieldReference)" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<xsl:if test="@MaxElementCount">
<th class="paramformat">Max. element count</th>
</xsl:if>
<th class="paramformat" colspan="2">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$PosCount+3" /></xsl:attribute>
<xsl:text>Array</xsl:text>
</xsl:element>
<xsl:if test="@MaxElementCount">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$PosCount+3" /></xsl:attribute>
<xsl:value-of select="@MaxElementCount" />
</xsl:element>
</xsl:if>
<td class="paramformat">Pos</td>
<td class="paramformat">Data</td>
</tr>
<xsl:apply-templates mode="first-row-array-of-record" select="mostco:DataType/mostco:TRecordLegacy|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="max-element-count" select="@MaxElementCount" />
</xsl:apply-templates>
<xsl:apply-templates mode="second-row-array-of-record" select="mostco:DataType/mostco:TRecordLegacy|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:apply-templates mode="row-array-of-record" select="mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:TRecordField| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:SharedRecordFieldReference| /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:NamedSharedDataElementReference/@NameRef]/mostco:Parameter/mostco:DataType/mostco:TRecordLegacy/mostco:NamedSharedRecordFieldReference">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</table>
</xsl:template>
<!---->
<xsl:template mode="first-row-array-of-record" match="mostco:TRecordLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:param name="max-element-count" />
<tr>
<td class="paramformat">
<!---->
<xsl:text>{ x=0, y=0 }</xsl:text>
</td>
<td class="paramformat2">
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:text>[1]</xsl:text>
<xsl:choose>
<xsl:when test="position() = last()">
<xsl:text>,</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>..., </xsl:text>
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:choose>
<xsl:when test="$max-element-count">[<xsl:value-of select="$max-element-count" />]</xsl:when>
<xsl:otherwise>
<xsl:text>[NMax]</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="last()=position()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
</xsl:template>
<!---->
<xsl:template mode="second-row-array-of-record" match="mostco:TRecordLegacy">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<tr>
<td class="paramformat">
<!---->
<xsl:text>{ x>0, y=0 }</xsl:text>
</td>
<td class="paramformat2">
<xsl:for-each select="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:text>[x]</xsl:text>
<xsl:choose>
<xsl:when test="position() = last()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</td>
</tr>
</xsl:template>
<!---->
<xsl:template mode="row-array-of-record" match="mostco:TRecordField|mostco:SharedRecordFieldReference|mostco:NamedSharedRecordFieldReference">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<tr>
<td class="paramformat">
<!---->
<xsl:text>{ x>0, y=</xsl:text>
<xsl:value-of select="position()" />
<xsl:text> }</xsl:text>
</td>
<td class="paramformat2">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-record-field-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-record-field-name" select="." />
</xsl:element>
<xsl:text>[x]</xsl:text>
</td>
</tr>
<!---->
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TArrayType">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:apply-templates select="." mode="simple-array-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:apply-templates select="." mode="array-parameter-description">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<xsl:template mode="simple-array-table" match="mostco:TArrayType">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">ElementCount size</th>
<xsl:if test="@MaxElementCount">
<th class="paramformat">Max. element count</th>
</xsl:if>
<th class="paramformat">Element type</th>
<th class="paramformat">Element name</th>
</tr>
<tr>
<td class="paramformat">Array Type</td>
<td class="paramcode2">
<xsl:value-of select="@ElementCountByteLength" />
</td>
<xsl:if test="@MaxElementCount">
<td class="paramcode2">
<xsl:value-of select="@MaxElementCount" />
</td>
</xsl:if>
<td class="paramformat">
<xsl:apply-templates mode="get-param-type-name" select="mostco:DataType/* | /mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/*[@Name]/@Name]/mostco:Parameter/mostco:DataType/*" />
</td>
<td class="paramformat">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</xsl:element>
</td>
</tr>
</table>
</xsl:template>
<!---->
<xsl:template mode="array-parameter-description" match="mostco:TArrayLegacy|mostco:TArrayType">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<p class="parameter">
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:apply-templates mode="resulting-data-element-name" select="." /></xsl:attribute>
</xsl:element>
<xsl:apply-templates mode="resulting-data-element-name" select="." />
</p>
<hr size="2" noshade="true" />
<xsl:variable name="resulting-parameter-description">
<xsl:choose>
<xsl:when test="mostco:SharedDataElementReference">
<!---->
<xsl:choose>
<xsl:when test="mostco:SharedDataElementReference/mostco:Description">
<!---->
<xsl:value-of select="mostco:SharedDataElementReference/mostco:Description" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/*[@Name]/@Name]/mostco:Parameter/mostco:Description" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="SharedDataElementReference/@NameSubstitute" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not($resulting-parameter-description = '')">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="$resulting-parameter-description" />
</p>
</xsl:if>
<xsl:apply-templates select="mostco:DataType/*[not(current()/mostco:SharedDataElementReference)]|/mostco:FunctionCatalog/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/mostco:SharedDataElementReference/@Name]/mostco:Parameter/mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TBoolean">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
</tr>
<tr>
<td class="paramformat">Boolean</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TBitField">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="BitValueCount" select="count(mostco:BitValue)" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">Name</th>
<th class="paramformat">Position (Bit)</th>
<th class="paramformat">Length (Bit)</th>
<th class="paramformat">Value</th>
<th class="paramformat">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$BitValueCount*2" /></xsl:attribute>
<xsl:text>BitField</xsl:text>
<br />
<xsl:text>Size: </xsl:text>
<xsl:value-of select="@TotalByteLength" />
</xsl:element>
<td rowspan="2" class="paramformat"><xsl:value-of select="mostco:BitValue[1]/@Name" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="mostco:BitValue[1]/@BitPos" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="mostco:BitValue[1]/@BitLength|$default-bitlength[not(mostco:BitValue[1]/@BitLength)]" /></td>
<td class="paramformat">False</td>
<td class="paramformat2">
<xsl:value-of select="mostco:BitValue[1]/@FalseDisplayName" />
</td>
</tr>
<tr>
<td class="paramformat">True</td>
<td class="paramformat2">
<xsl:value-of select="mostco:BitValue[1]/@TrueDisplayName" />
</td>
</tr>
<xsl:if test="$BitValueCount > 1">
<xsl:apply-templates mode="row-bool-field" select="mostco:BitValue[position()>1 and last()>position()]" />
<xsl:variable name="range" select="mostco:BitValue[last()]/@FalseDisplayName" />
<tr>
<td rowspan="2" class="paramformat"><xsl:value-of select="mostco:BitValue[last()]/@Name" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="mostco:BitValue[last()]/@BitPos" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="mostco:BitValue[last()]/@BitLength|$default-bitlength[not(mostco:BitValue[last()]/@BitLength)]" /></td>
<td class="paramformat">False</td>
<td class="paramformat2">
<xsl:value-of select="mostco:BitValue[last()]/@FalseDisplayName" />
</td>
</tr>
<tr>
<td class="paramformat">True</td>
<td class="paramformat2">
<xsl:value-of select="mostco:BitValue[last()]/@TrueDisplayName" />
</td>
</tr>
</xsl:if>
</table>
</xsl:template>
<!---->
<xsl:template mode="row-bool-field" match="mostco:BitValue[position()>1 and last()>position()]">
<tr>
<td rowspan="2" class="paramformat"><xsl:value-of select="@Name" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="@BitPos" /></td>
<td rowspan="2" class="paramcode2"><xsl:value-of select="@BitLength|$default-bitlength[not (@BitLength)]" /></td>
<td class="paramformat">False</td>
<td class="paramformat2">
<xsl:value-of select="@FalseDisplayName" />
</td>
</tr>
<tr>
<td class="paramformat">True</td>
<td class="paramformat2">
<xsl:value-of select="@TrueDisplayName" />
</td>
</tr>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TString">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">MaxSize</th>
</tr>
<tr>
<td class="paramformat">String</td>
<td class="paramformat">
<xsl:value-of select="@MaxSize" />
</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TLengthCodedString">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">MaxSize</th>
</tr>
<tr>
<td class="paramformat">Length-coded String</td>
<td class="paramformat">
<xsl:value-of select="@MaxSize" />
</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TUByte | mostco:TSByte | mostco:TUWord | mostco:TSWord | mostco:TULong | mostco:TSLong | mostco:TULongLong | mostco:TSLongLong">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="number-of-rows">
<xsl:choose>
<xsl:when test="count(mostco:ValueRange) = 0">
<xsl:number value="1" />
</xsl:when>
<xsl:otherwise>
<xsl:number value="count(mostco:ValueRange)" />
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="value-name-exists" select="mostco:ValueRange/@Name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">Unit</th>
<th class="paramformat">Exp.</th>
<th class="paramformat">Step</th>
<xsl:if test="mostco:ValueRange">
<th class="paramformat">Range of values</th>
<xsl:if test="$value-name-exists = true()">
<th class="paramformat">Name</th>
</xsl:if>
<th class="paramformat">Range description</th>
</xsl:if>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="name(.)='TUByte'">
<xsl:text>Unsigned Byte</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TSByte'">
<xsl:text>Signed Byte</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TUWord'">
<xsl:text>Unsigned Word</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TSWord'">
<xsl:text>Signed Word</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TULong'">
<xsl:text>Unsigned Long</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TSLong'">
<xsl:text>Signed Long</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TULongLong'">
<xsl:text>Unsigned Long Long</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TSLongLong'">
<xsl:text>Signed Long Long</xsl:text>
</xsl:when>
<xsl:otherwise>
<ERROR-TAG />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="@Unit">
<xsl:value-of select="@Unit" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default-unit" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="@Exponent">
<xsl:value-of select="@Exponent" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default-exponent" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="@Step">
<xsl:value-of select="@Step" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default-step" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:if test="mostco:ValueRange">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/@Min" />
<xsl:if test="mostco:ValueRange[1]/@Min != mostco:ValueRange[1]/@Max">
<xsl:text>...</xsl:text>
<xsl:value-of select="mostco:ValueRange[1]/@Max" />
</xsl:if>
</xsl:element>
<xsl:if test="$value-name-exists">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/@Name" />
</xsl:element>
</xsl:if>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/mostco:Description" />
</xsl:element>
</xsl:if>
</tr>
<xsl:if test="mostco:ValueRange">
<xsl:apply-templates mode="parameter-table-row" select="mostco:ValueRange[position() > 1]">
<xsl:with-param name="value-name-exists" select="$value-name-exists" />
</xsl:apply-templates>
</xsl:if>
</table>
<!---->
<xsl:if test="mostco:BitOriented">
<p class="emphasis">
<xsl:text>Bit-oriented values for </xsl:text><xsl:value-of select="../../@Name" />
</p>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Name</th>
<th class="paramformat">Position (Bit)</th>
<th class="paramformat">Length (Bit)</th>
<th class="paramformat">Description</th>
</tr>
<xsl:apply-templates mode="bit-oriented-table-row" select="mostco:BitOriented" />
</table>
</xsl:if>
</xsl:template>
<!---->
<xsl:template mode="bit-oriented-table-row" match="mostco:BitOriented">
<tr>
<td class="paramformat2"><xsl:value-of select="@Name" /></td>
<td class="paramcode2"><xsl:value-of select="@BitPos" /></td>
<td class="paramcode2"><xsl:value-of select="@BitLength|$default-bitlength[not (@BitLength)]" /></td>
<td class="paramformat2"><xsl:value-of select="mostco:Description" /></td>
</tr>
</xsl:template>
<!---->
<xsl:template mode="parameter-table-row" match="mostco:ValueRange">
<xsl:param name="value-name-exists" />
<tr>
<td class="paramcode2">
<xsl:value-of select="@Min" />
<xsl:if test="@Min != @Max">
<xsl:text>...</xsl:text>
<xsl:value-of select="@Max" />
</xsl:if>
</td>
<xsl:if test="$value-name-exists">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:value-of select="@Name" />
</xsl:element>
</xsl:if>
<td class="paramformat2">
<xsl:value-of select="mostco:Description" />
</td>
</tr>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TFloat|mostco:TDouble">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="number-of-rows">
<xsl:choose>
<xsl:when test="count(mostco:ValueRange) = 0">
<xsl:number value="1" />
</xsl:when>
<xsl:otherwise>
<xsl:number value="count(mostco:ValueRange)" />
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="value-name-exists" select="mostco:ValueRange/@Name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">Unit</th>
<xsl:if test="mostco:ValueRange">
<th class="paramformat">Range of values</th>
<xsl:if test="$value-name-exists = true()">
<th class="paramformat">Name</th>
</xsl:if>
<th class="paramformat">Range description</th>
</xsl:if>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="name(.)='TFloat'">
<xsl:text>Float</xsl:text>
</xsl:when>
<xsl:when test="name(.)='TDouble'">
<xsl:text>Double</xsl:text>
</xsl:when>
<xsl:otherwise>
<ERROR-TAG />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="@Unit">
<xsl:value-of select="@Unit" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$default-unit" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:if test="mostco:ValueRange">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/@Min" />
<xsl:if test="mostco:ValueRange[1]/@Min != mostco:ValueRange[1]/@Max">
<xsl:text>...</xsl:text>
<xsl:value-of select="mostco:ValueRange[1]/@Max" />
</xsl:if>
</xsl:element>
<xsl:if test="$value-name-exists">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/@Name" />
</xsl:element>
</xsl:if>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:value-of select="mostco:ValueRange[1]/mostco:Description" />
</xsl:element>
</xsl:if>
</tr>
<xsl:if test="mostco:ValueRange">
<xsl:apply-templates mode="parameter-table-row" select="mostco:ValueRange[position() > 1]">
<xsl:with-param name="value-name-exists" select="$value-name-exists" />
</xsl:apply-templates>
</xsl:if>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TCStream">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">Length</th>
<th class="paramformat">Media type</th>
</tr>
<tr>
<td class="paramformat">Classified Stream</td>
<td class="paramcode2">
<xsl:value-of select="@MaxLength" />
</td>
<td class="paramformat">
<xsl:value-of select="@MediaType" />
</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TShortStream|mostco:TStream">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="StreamCaseCount" select="count(mostco:StreamSwitch/mostco:ParamStreamCase)" />
<xsl:choose>
<xsl:when test="$StreamCaseCount=0">
<!---->
<xsl:apply-templates mode="zero-stream-case-table" select=".">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:if test="count(mostco:SignalSequence/mostco:StreamSignalReference|mostco:SignalSequence/mostco:StreamSignalReferenceRepeated) > 0">
<xsl:apply-templates mode="stream-signal-sequence-description" select="mostco:SignalSequence">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:if>
<xsl:if test="count(mostco:ParameterSequence/mostco:StreamParamReference|mostco:ParameterSequence/mostco:StreamParamReferenceRepeated) > 0">
<xsl:for-each select="./*/mostco:StreamParamReference|./*/mostco:StreamParamReferenceRepeated">
<xsl:if test="1 = count(.|key('stream-parameter-references', concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',./@Name))[1])">
<xsl:apply-templates mode="stream-parameter-description" select="key('stream-parameter-definitions', concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',@Name))">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="parent-parameter-name" select="(ancestor::mostco:Parameter)[last()]/@Name" />
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:when>
<!---->
<xsl:otherwise>
<xsl:apply-templates mode="multi-stream-case-table" select=".">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<!---->
<!---->
<!---->
<xsl:for-each select="./*/*/mostco:StreamParamReference">
<xsl:if test="1 = count(.|key('stream-parameter-references', concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',./@Name))[1])">
<xsl:apply-templates mode="stream-parameter-description" select="key('stream-parameter-definitions', concat(generate-id((ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]),'::',@Name))">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="parent-parameter-name" select="(ancestor::mostco:Parameter)[last()]/@Name" />
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<!---->
<xsl:template mode="zero-stream-case-table" match="mostco:TShortStream|mostco:TStream">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">
<xsl:choose>
<xsl:when test="self::mostco:TShortStream">Max. Length</xsl:when>
<xsl:when test="self::mostco:TStream">Length</xsl:when>
</xsl:choose>
</th>
<xsl:if test="self::mostco:TStream and @MinLength">
<th class="paramformat">Min. Length</th>
</xsl:if>
<th class="paramformat">Description</th>
</tr>
<tr>
<td class="paramformat">
<xsl:choose>
<xsl:when test="self::mostco:TShortStream">Short Stream</xsl:when>
<xsl:when test="self::mostco:TStream">Stream</xsl:when>
</xsl:choose>
</td>
<td class="paramcode2">
<xsl:choose>
<xsl:when test="self::mostco:TShortStream">
<xsl:value-of select="@MaxLength" />
</xsl:when>
<xsl:when test="self::mostco:TStream">
<xsl:value-of select="@Length" />
</xsl:when>
</xsl:choose>
</td>
<xsl:if test="self::mostco:TStream and @MinLength">
<td class="paramcode2">
<xsl:value-of select="@MinLength" />
</td>
</xsl:if>
<td class="paramformat2">
<xsl:if test="count(mostco:ParameterSequence/mostco:StreamParamReference|mostco:ParameterSequence/mostco:StreamParamReferenceRepeated) > 0">
<xsl:text>Content: </xsl:text>
<xsl:if test="count(mostco:ParameterSequence/mostco:StreamParamReference) > 0">
<xsl:apply-templates mode="output-stream-parameter-name" select="mostco:ParameterSequence/mostco:StreamParamReference">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:if>
<xsl:if test="count(mostco:ParameterSequence/mostco:StreamParamReferenceRepeated) > 0">
<xsl:if test="count(mostco:ParameterSequence/mostco:StreamParamReference) > 0">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>{</xsl:text>
<xsl:apply-templates mode="output-stream-parameter-name" select="mostco:ParameterSequence/mostco:StreamParamReferenceRepeated">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<xsl:text>}[repeated]</xsl:text>
</xsl:if>
<br />
</xsl:if>
<xsl:if test="count(mostco:SignalSequence/mostco:StreamSignalReference|mostco:SignalSequence/mostco:StreamSignalReferenceRepeated) > 0">
<xsl:text>Stream signals: </xsl:text>
<xsl:if test="count(mostco:SignalSequence/mostco:StreamSignalReference) > 0">
<xsl:apply-templates mode="output-stream-parameter-name" select="mostco:SignalSequence/mostco:StreamSignalReference" />
</xsl:if>
<xsl:if test="count(mostco:SignalSequence/mostco:StreamSignalReferenceRepeated) > 0">
<xsl:if test="count(mostco:SignalSequence/mostco:StreamSignalReference) > 0">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:text>{</xsl:text>
<xsl:apply-templates mode="output-stream-parameter-name" select="mostco:SignalSequence/mostco:StreamSignalReferenceRepeated" />
<xsl:text>}[repeated]</xsl:text>
</xsl:if>
<br />
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="mostco:ParameterSequence/mostco:Description/text()|mostco:SignalSequence/mostco:Description/text()" />
</td>
</tr>
</table>
</xsl:template>
<!---->
<!---->
<xsl:template mode="multi-stream-case-table" match="mostco:TShortStream|mostco:TStream">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<table border="1" cellpadding="3" cellspacing="0">
<!---->
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">
<xsl:choose>
<xsl:when test="self::mostco:TShortStream">Max. Length</xsl:when>
<xsl:when test="self::mostco:TStream">Length</xsl:when>
</xsl:choose>
</th>
<!---->
<xsl:if test="self::mostco:TStream and @MinLength">
<th class="paramformat">Min. Length</th>
</xsl:if>
<th class="paramformat">Condition</th>
<th class="paramformat">Description</th>
</tr>
<!---->
<xsl:apply-templates mode="stream-case-table-row" select="mostco:StreamSwitch/mostco:ParamStreamCase">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</table>
</xsl:template>
<!---->
<xsl:template mode="stream-case-table-row" match="mostco:ParamStreamCase">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="StreamCaseCount" select="count(../*)" />
<tr>
<xsl:if test="position() = 1">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$StreamCaseCount" /></xsl:attribute>
<xsl:choose>
<!---->
<xsl:when test="parent::mostco:StreamSwitch/parent::mostco:TShortStream">Short Stream</xsl:when>
<xsl:when test="parent::mostco:StreamSwitch/parent::mostco:TStream">Stream</xsl:when>
</xsl:choose>
</xsl:element>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:attribute name="valign"><xsl:text>top</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$StreamCaseCount" /></xsl:attribute>
<!---->
<xsl:choose>
<!---->
<xsl:when test="parent::mostco:StreamSwitch/parent::mostco:TShortStream">
<xsl:value-of select="parent::mostco:StreamSwitch/parent::mostco:TShortStream/@MaxLength" />
</xsl:when>
<xsl:when test="parent::mostco:StreamSwitch/parent::mostco:TStream">
<xsl:value-of select="parent::mostco:StreamSwitch/parent::mostco:TStream/@Length" />
</xsl:when>
</xsl:choose>
</xsl:element>
<!---->
<xsl:if test="parent::mostco:StreamSwitch/parent::mostco:TStream and parent::mostco:StreamSwitch/parent::mostco:TStream/@MinLength">
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:attribute name="valign"><xsl:text>top</xsl:text></xsl:attribute>
<xsl:attribute name="rowspan"><xsl:value-of select="$StreamCaseCount" /></xsl:attribute>
<xsl:value-of select="parent::mostco:StreamSwitch/parent::mostco:TStream/@MinLength" />
</xsl:element>
</xsl:if>
</xsl:if>
<xsl:variable name="actual-parameter-name">
<xsl:variable name="parameter-definition" select="ancestor::mostco:Parameters/mostco:Parameter[@Name=current()/parent::mostco:StreamSwitch/@SelectorName]" />
<xsl:variable name="shared-parameter-definition" select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/parent::mostco:StreamSwitch/@SelectorName]" />
<xsl:choose>
<xsl:when test="$parameter-definition">
<xsl:value-of select="parent::mostco:StreamSwitch/@SelectorName" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$shared-parameter-definition/mostco:Parameter/@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramformat2</xsl:text></xsl:attribute>
<xsl:attribute name="valign"><xsl:text>top</xsl:text></xsl:attribute>
<xsl:value-of select="$actual-parameter-name" />
<xsl:text> = </xsl:text>
<xsl:choose>
<xsl:when test="string(number(@MinSelectorValue))='NaN'">
<xsl:value-of select="@MinSelectorValue" />
<xsl:if test="@MinSelectorValue!=@MaxSelectorValue">
<xsl:text>...</xsl:text>
<xsl:value-of select="@MaxSelectorValue" />
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dec-to-hex">
<xsl:with-param name="value" select="@MinSelectorValue" />
</xsl:call-template>
<xsl:if test="@MinSelectorValue!=@MaxSelectorValue">
<xsl:text>...</xsl:text>
<xsl:choose>
<xsl:when test="string(number(@MaxSelectorValue))='NaN'">
<xsl:value-of select="@MaxSelectorValue" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dec-to-hex">
<xsl:with-param name="value" select="@MaxSelectorValue" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<td class="paramformat2">
<xsl:if test="count(mostco:StreamParamReference|mostco:StreamParamReferenceRepeated) > 0">
<xsl:text>Content: </xsl:text>
<xsl:apply-templates mode="output-stream-parameter-name" select="mostco:StreamParamReference|mostco:StreamParamReferenceRepeated">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
<br />
</xsl:if>
<xsl:value-of disable-output-escaping="yes" select="mostco:Description/text()" />
</td>
</tr>
</xsl:template>
<!---->
<!---->
<xsl:template mode="stream-parameter-description" match="mostco:StreamParamReference">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:param name="parent-parameter-name" />
<xsl:choose>
<xsl:when test="parent::mostco:ParameterSequence">
<xsl:apply-templates mode="stream-parameter-description" select="../../mostco:Parameters/mostco:Parameter[@Name = current()/@Name]">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="parent-parameter-name" select="$parent-parameter-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:apply-templates mode="stream-parameter-description" select="../../../mostco:Parameters/mostco:Parameter[@Name = current()/@Name]">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="parent-parameter-name" select="$parent-parameter-name" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="output-stream-parameter-name" match="mostco:StreamParamReference|mostco:StreamParamReferenceRepeated">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:element name="a">
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="(ancestor::mostco:Parameter)[last()]/@Name" /><xsl:text>_</xsl:text><xsl:choose><xsl:when test="ancestor::*/mostco:Parameters/mostco:SharedParameterReference[@Name = current()/@Name]"><xsl:value-of select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@Name" /></xsl:when><xsl:otherwise><xsl:value-of disable-output-escaping="yes" select="@Name" /></xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:choose>
<xsl:when test="ancestor::*/mostco:Parameters/mostco:SharedParameterReference[@Name = current()/@Name]">
<xsl:value-of select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name=current()/@Name]/mostco:Parameter/@Name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:choose>
<xsl:when test="last()=position()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="stream-parameter-description" match="mostco:Parameter">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:param name="parent-parameter-name" />
<xsl:variable name="titel" select="@Name" />
<!---->
<xsl:choose>
<xsl:when test="$titel">
<!---->
<p class="parameter">
<xsl:element name="a">
<xsl:attribute name="name"><xsl:number value="$fblock-id" /><xsl:text>_</xsl:text><xsl:number value="$resulting-function-id" /><xsl:text>_</xsl:text><xsl:value-of select="$function-name" /><xsl:text>_</xsl:text><xsl:value-of select="$parent-parameter-name" /><xsl:text>_</xsl:text><xsl:value-of select="@Name" /></xsl:attribute>
</xsl:element>
<xsl:value-of select="$parent-parameter-name" />
<xsl:text>.</xsl:text>
<xsl:value-of select="@Name" />
</p>
<hr size="2" noshade="true" />
<xsl:if test="mostco:Description">
<p class="description">
<xsl:value-of disable-output-escaping="yes" select="mostco:Description" />
</p>
</xsl:if>
<xsl:apply-templates select="mostco:DataType/*" mode="parameter-table">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:comment> ERROR in Stream Parameter (no Name or ErrorName) </xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<!---->
<xsl:template mode="stream-signal-sequence-description" match="mostco:SignalSequence">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<!---->
<xsl:variable name="signal-nodes">
<xsl:for-each select="mostco:StreamSignalReference|mostco:StreamSignalReferenceRepeated">
<xsl:choose>
<xsl:when test="(ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]/mostco:StreamSignals/mostco:SharedSignalReference[@Name = current()/@Name]">
<xsl:copy-of select="/*/mostco:SharedSignals/mostco:SharedSignal[@Name = current()/@Name]/mostco:StreamSignal[1]" />
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="(ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]/mostco:StreamSignals/mostco:StreamSignal[@Name = current()/@Name][1]" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<p class="emphasis">
<xsl:text>Stream Signals</xsl:text>
</p>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Signal Name</th>
<th class="paramformat">Bit position</th>
<xsl:variable name="signedness-present">
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of select="count(exslt:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of select="count(msxsl:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of select="count(xsl:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count($signal-nodes/mostco:StreamSignal/@Signedness) > 0" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$signedness-present = 'true'">
<th class="paramformat">Signedness</th>
</xsl:if>
<th class="paramformat">Number of bits</th>
<xsl:if test="count(mostco:StreamSignalReferenceRepeated) > 0">
<th class="paramformat">Repetition</th>
</xsl:if>
<th class="paramformat">Description</th>
</tr>
<xsl:apply-templates mode="stream-signal-table-row" select="mostco:StreamSignalReference|mostco:StreamSignalReferenceRepeated">
<xsl:with-param name="signal-nodes" select="$signal-nodes" />
</xsl:apply-templates>
</table>
</xsl:template>
<!---->
<xsl:template mode="stream-signal-table-row" match="mostco:StreamSignalReference|mostco:StreamSignalReferenceRepeated">
<xsl:param name="signal-nodes" />
<tr>
<!---->
<xsl:variable name="current-signal-name">
<xsl:choose>
<xsl:when test="(ancestor::*[self::mostco:TStream|self::mostco:TShortStream])[last()]/mostco:StreamSignals/mostco:SharedSignalReference[@Name = current()/@Name]">
<xsl:value-of select="/*/mostco:SharedSignals/mostco:SharedSignal[@Name=current()/@Name]/mostco:StreamSignal/@Name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Name" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!---->
<xsl:variable name="current-signal-node-position">
<xsl:value-of select="position()" />
</xsl:variable>
<!---->
<xsl:variable name="current-signal-node-sum">
<!---->
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of select="sum(exslt:node-set($signal-nodes)/*[position() < $current-signal-node-position]/@BitLength)" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of select="sum(msxsl:node-set($signal-nodes)/*[position() < $current-signal-node-position]/@BitLength)" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of select="sum(xsl:node-set($signal-nodes)/*[position() < $current-signal-node-position]/@BitLength)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="sum($signal-nodes/*[position() < $current-signal-node-position]/@BitLength)" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<td class="paramformat">
<xsl:value-of select="$current-signal-name" />
</td>
<td class="paramcode2">
<xsl:value-of select="$current-signal-node-sum" />
</td>
<!---->
<xsl:variable name="signedness-present">
<!---->
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of select="count(exslt:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of select="count(msxsl:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of select="count(xsl:node-set($signal-nodes)/mostco:StreamSignal/@Signedness) > 0" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="count($signal-nodes/mostco:StreamSignal/@Signedness) > 0" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$signedness-present = 'true'">
<td class="paramformat">
<xsl:attribute name="class"><xsl:text>paramcode</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of disable-output-escaping="yes" select="exslt:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@Signedness" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of disable-output-escaping="yes" select="msxsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@Signedness" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of disable-output-escaping="yes" select="xsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@Signedness" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="$signal-nodes/mostco:StreamSignal[@Name = $current-signal-name]/@Signedness" />
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:if>
<td class="paramcode2">
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of disable-output-escaping="yes" select="exslt:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@BitLength" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of disable-output-escaping="yes" select="msxsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@BitLength" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of disable-output-escaping="yes" select="xsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/@BitLength" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="$signal-nodes/mostco:StreamSignal[@Name = $current-signal-name]/@BitLength" />
</xsl:otherwise>
</xsl:choose>
</td>
<xsl:if test="count(../mostco:StreamSignalReferenceRepeated) > 0">
<xsl:choose>
<xsl:when test="self::mostco:StreamSignalReferenceRepeated">
<td class="paramformat">X</td>
</xsl:when>
<xsl:otherwise>
<td class="paramformat" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<td class="paramformat2">
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:value-of disable-output-escaping="yes" select="exslt:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/mostco:Description/text()" />
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:value-of select="msxsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/mostco:Description/text()" />
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:value-of disable-output-escaping="yes" select="xsl:node-set($signal-nodes)/mostco:StreamSignal[@Name = $current-signal-name]/mostco:Description/text()" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="$signal-nodes/mostco:StreamSignal[@Name = $current-signal-name]/mostco:Description/text()" />
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
<!---->
<!---->
<!---->
<xsl:template mode="output-stream-parameter-name" match="mostco:StreamSignalReference|mostco:StreamSignalReferenceRepeated">
<xsl:choose>
<xsl:when test="ancestor::*/mostco:StreamSignals/mostco:SharedSignalReference[@Name = current()/@Name]">
<xsl:value-of select="/*/mostco:SharedSignals/mostco:SharedSignal[@Name=current()/@Name]/mostco:StreamSignal/@Name" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of disable-output-escaping="yes" select="@Name" />
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="last()=position()" />
<xsl:otherwise>
<xsl:text>, </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template mode="stream-parameter-description" match="mostco:SharedParameterReference">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:param name="parent-parameter-name" />
<xsl:apply-templates mode="stream-parameter-description" select="/*/mostco:SharedParameters/mostco:SharedParameter[@Name = current()/@Name]/mostco:Parameter">
<xsl:with-param name="fblock-id" select="$fblock-id" />
<xsl:with-param name="resulting-function-id" select="$resulting-function-id" />
<xsl:with-param name="function-name" select="$function-name" />
<xsl:with-param name="parent-parameter-name" select="$parent-parameter-name" />
</xsl:apply-templates>
</xsl:template>
<!---->
<!---->
<xsl:template mode="parameter-table" match="mostco:TEnum">
<xsl:param name="fblock-id" />
<xsl:param name="resulting-function-id" />
<xsl:param name="function-name" />
<xsl:variable name="number-of-rows" select="count(mostco:TEnumValue) + count(mostco:TEnumReserved)" />
<!---->
<xsl:variable name="enum-and-reserved-sorted">
<xsl:for-each select="mostco:TEnumValue|mostco:TEnumReserved">
<xsl:sort data-type="number" order="ascending" select="@Code|@StartCode" />
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<xsl:variable name="enum-sorted">
<xsl:for-each select="mostco:TEnumValue">
<xsl:sort data-type="number" order="ascending" select="@Code" />
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<!---->
<xsl:variable name="required-hex-digits">
<xsl:choose>
<xsl:when test="@TotalByteLength">
<xsl:value-of select="@TotalByteLength * 2" />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:value-of select="2" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th class="paramformat">Basis data type</th>
<th class="paramformat">Code</th>
<th class="paramformat">Name</th>
<th class="paramformat">Description</th>
</tr>
<tr>
<xsl:element name="td">
<xsl:attribute name="rowspan"><xsl:value-of select="$number-of-rows" /></xsl:attribute>
<xsl:attribute name="class"><xsl:text>paramformat</xsl:text></xsl:attribute>
<xsl:text>Enum</xsl:text>
<br />
<xsl:text>(</xsl:text>
<xsl:value-of select="@TotalByteLength|$default-enum-size[not(@TotalByteLength)]" />
<xsl:text> byte</xsl:text>
<xsl:if test="@TotalByteLength > 1"><xsl:text>s</xsl:text></xsl:if>
<xsl:text>)</xsl:text>
</xsl:element>
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:apply-templates mode="parameter-table-row-content" select="exslt:node-set($enum-and-reserved-sorted)/*[1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:apply-templates mode="parameter-table-row-content" select="msxsl:node-set($enum-and-reserved-sorted)/*[1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:apply-templates mode="parameter-table-row-content" select="xsl:node-set($enum-and-reserved-sorted)/*[1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="parameter-table-row-content" select="$enum-and-reserved-sorted/*[1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:choose>
<xsl:when test="function-available('exslt:node-set')or function-available('exslt:nodeSet')">
<xsl:apply-templates mode="parameter-table-row" select="exslt:node-set($enum-and-reserved-sorted)/*[position() > 1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:apply-templates mode="parameter-table-row" select="msxsl:node-set($enum-and-reserved-sorted)/*[position() > 1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:when test="function-available('xsl:node-set')">
<xsl:apply-templates mode="parameter-table-row" select="xsl:node-set($enum-and-reserved-sorted)/*[position() > 1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="parameter-table-row" select="$enum-and-reserved-sorted/*[position() > 1]">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</table>
</xsl:template>
<!---->
<xsl:template mode="parameter-table-row" match="mostco:TEnumValue|mostco:TEnumReserved">
<xsl:param name="required-hex-digits" />
<tr>
<xsl:apply-templates mode="parameter-table-row-content" select=".">
<xsl:with-param name="required-hex-digits" select="$required-hex-digits" />
</xsl:apply-templates>
</tr>
</xsl:template>
<!---->
<xsl:template mode="parameter-table-row-content" match="mostco:TEnumValue">
<xsl:param name="required-hex-digits" />
<td class="paramcode2">
<xsl:call-template name="dec-to-hex">
<xsl:with-param name="value" select="@Code" />
</xsl:call-template>
</td>
<td class="paramformat2">
<xsl:value-of select="@Name" />
</td>
<td class="paramformat2">
<!---->
<xsl:value-of disable-output-escaping="yes" select="mostco:Description/text()" />
</td>
</xsl:template>
<!---->
<xsl:template mode="parameter-table-row-content" match="mostco:TEnumReserved">
<xsl:param name="required-hex-digits" />
<xsl:element name="td">
<xsl:attribute name="class"><xsl:text>paramcode2</xsl:text></xsl:attribute>
<xsl:call-template name="dec-to-hex">
<xsl:with-param name="value" select="@StartCode" />
</xsl:call-template>
<xsl:text>...</xsl:text>
<xsl:call-template name="dec-to-hex">
<xsl:with-param name="value" select="@EndCode" />
</xsl:call-template>
</xsl:element>
<td class="paramformat2">
<xsl:if test="@DisplayName">
<xsl:value-of disable-output-escaping="yes" select="@DisplayName" />
</xsl:if>
</td>
<td class="paramformat2">
<xsl:text>Reserved range.</xsl:text>
</td>
</xsl:template>
<!---->
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()" />
</xsl:template>
</xsl:stylesheet>