Project

Profile

Help

Bug #4478 » problematicXSLTFile.txt

Pranay Deshpande, 2020-03-11 08:33

 
<?xml version="1.0" encoding="UTF-8"?>
<!--Designed and generated by Altova StyleVision Enterprise Edition 2020 sp1 - see http://www.altova.com/stylevision for more information.-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:altova="http://www.altova.com" xmlns:altova-xfi="http://www.altova.com/xslt-extensions/xbrl" xmlns:altovaext="http://www.altova.com/xslt-extensions" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:clitype="clitype" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:java="java" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:sps="http://www.altova.com/StyleVision/user-xpath-functions" xmlns:xbrldi="http://xbrl.org/2006/xbrldi" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xff="http://www.xbrl.org/2010/function/formula" xmlns:xfi="http://www.xbrl.org/2008/function/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="#all">
<xsl:output version="4.0" method="html" indent="no" encoding="UTF-8" use-character-maps="spaces" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:character-map name="spaces">
<xsl:output-character character="&#160;" string="&amp;#160;"/>
</xsl:character-map>
<xsl:param name="altova:bGeneratingFromPxf" select="false()"/>
<xsl:param name="altova:bGeneratingMime" as="xs:boolean" select="false()"/>
<xsl:param name="altova:execution-guid" as="xs:string">
<xsl:sequence select="altovaext:generate-guid()" use-when="function-available('altovaext:generate-guid', 0)"/>
<xsl:sequence select="'00000000-0000-0000-0000-NON0UNIQUE00'" use-when="not(function-available('altovaext:generate-guid', 0))"/>
</xsl:param>
<xsl:param name="SV_OutputFormat" select="'HTML'"/>
<xsl:param name="SV_BaseOutputFileName" as="xs:string?">
<xsl:sequence select="for $i in altovaext:get-base-output-uri(), $j in tokenize( $i, &apos;[/\\]&apos; )[last()] return replace( $j, &apos;\.[^\.\s#%;]*$&apos;, &apos;&apos; )" use-when="function-available(&apos;altovaext:get-base-output-uri&apos;)"/>
</xsl:param>
<xsl:param name="SV_GeneratedFileNamePrefix" select="if ( $SV_BaseOutputFileName ) then $SV_BaseOutputFileName else &apos;usps_850_v4&apos;" as="xs:string?"/>
<xsl:variable name="XML" select="/"/>
<xsl:variable name="altova:nPxPerIn" select="96"/>
<xsl:import-schema schema-location="file:///C:/Users/jprow/Downloads/CPI/USPS/USPS_Order_schema.xsd" use-when="system-property('xsl:is-schema-aware')='yes'"/>
<xsl:variable name="altova:CssImages" select="()"/>
<xsl:template match="/">
<xsl:call-template name="altova:Root"/>
</xsl:template>
<xsl:template name="altova:Root">
<html>
<head>
<title/>
<meta name="generator" content="Altova StyleVision Enterprise Edition 2020 sp1 (http://www.altova.com)"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<style type="text/css">
<xsl:comment>.header { color:#1e2125;
}</xsl:comment>
</style>
<xsl:comment>[if IE]&gt;&lt;STYLE type=&quot;text/css&quot;&gt;.altova-rotate-left-textbox{filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)} .altova-rotate-right-textbox{filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1)} &lt;/STYLE&gt;&lt;![endif]</xsl:comment>
<xsl:comment>[if !IE]&gt;&lt;!</xsl:comment>
<style type="text/css">.altova-rotate-left-textbox{-webkit-transform: rotate(-90deg) translate(-100%, 0%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(-90deg) translate(-100%, 0%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(-90deg) translate(-100%, 0%); -ms-transform-origin: 0% 0%;}.altova-rotate-right-textbox{-webkit-transform: rotate(90deg) translate(0%, -100%); -webkit-transform-origin: 0% 0%;-moz-transform: rotate(90deg) translate(0%, -100%); -moz-transform-origin: 0% 0%;-ms-transform: rotate(90deg) translate(0%, -100%); -ms-transform-origin: 0% 0%;}</style>
<xsl:comment>&lt;![endif]</xsl:comment>
<style type="text/css">@page { margin-left:1.000in; margin-right:1.000in; margin-top:1.000in; margin-bottom:1.000in } @media print { br.altova-page-break { page-break-before: always; } div.altova-page-break { page-break-before: always; } }</style>
</head>
<body style="font-family:Arial; white-space:nowrap; " alink="#f26a21" link="#f26a21" vlink="#3c3c3c">
<br/>
<xsl:for-each select="$XML">
<xsl:variable name="orderdate" select="substring-before(OrderRequestHeader/@orderDate, &apos;T&apos;)"/>
<xsl:variable name="env" select="Message/MessageTenant"/>
<xsl:for-each select="Message">
<br/>
<xsl:variable name="altova:table">
<table style="border-collapse:collapse; empty-cells:hide; " align="center" cellpadding="5" cellspacing="1" width="50%">
<xsl:variable name="altova:CurrContextGrid_0" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody>
<tr>
<td>
<xsl:variable name="altova:table">
<table align="center" width="100%" altova:hide-rows="empty" altova:hide-cols="empty">
<xsl:variable name="altova:CurrContextGrid_1" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody valign="bottom">
<tr>
<td style="color:#323263; text-align:left; width:50%; " valign="bottom">
<xsl:for-each select="cXML">
<xsl:for-each select="format-dateTime(@timestamp, &apos;[M01].[D01].[Y0001]&apos;)">
<span style="font-family:Consolas; font-size:8pt; font-style:italic; ">
<xsl:choose>
<xsl:when test=". instance of element() or . instance of document-node()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="color:#323263; text-align:right; width:50%; " valign="bottom">
<xsl:for-each select="cXML">
<xsl:for-each select="format-dateTime(@timestamp, &apos;[H01]:[m01]:[s01] [P]&apos;)">
<span style="font-family:Consolas; font-size:8pt; font-style:italic; ">
<xsl:choose>
<xsl:when test=". instance of element() or . instance of document-node()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" xpath-default-namespace="">
<xsl:choose>
<xsl:when test="$altova:table/table/@altova:hide-cols = 'empty'">
<xsl:sequence select="for $altova:pos in 1 to $altova:col-count return some $altova:cell in $altova:table/table/(thead | tbody | tfoot)/tr/(th | td)[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] satisfies not( altova:is-cell-empty( $altova:cell ) )"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="for $altova:pos in 1 to $altova:col-count return not( exists( $altova:table/table/tbody/tr/td[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] ) ) or ( some $altova:cell in $altova:table/table/tbody/tr/td[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] satisfies not( altova:is-cell-empty( $altova:cell ) ) )"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
<tr>
<td>
<xsl:variable name="altova:table">
<table style="border-collapse:collapse; empty-cells:hide; " align="center" bgcolor="#323263" cellpadding="5" cellspacing="1" width="100%">
<xsl:variable name="altova:CurrContextGrid_2" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody>
<tr style="background-color:#323263; color:#ffffff; white-space:nowrap; " valign="middle">
<td style="color:#ffffff; text-align:center; width:15%; " valign="bottom">
<xsl:for-each select="MessagePartnerName">
<span style="font-family:Arial Black; font-size:36pt; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</td>
<td style="text-align:center; width:30%; "/>
<td style="text-align:center; "/>
<td style="width:15%; "/>
<td style="text-align:right; width:30%; " valign="middle">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="Total">
<xsl:for-each select="Money">
<span style="font-family:Arial Black; font-size:24pt; ">
<xsl:text>$</xsl:text>
</span>
<span style="font-family:Arial Black; font-size:24pt; ">
<xsl:variable name="altova:seqContentStrings_3">
<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
</xsl:variable>
<xsl:variable name="altova:sContent_3" select="string($altova:seqContentStrings_3)"/>
<xsl:value-of select="$altova:sContent_3"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td/>
</tr>
<tr style="background-color:#fcfafa; color:#3c3c3c; white-space:nowrap; " valign="middle">
<td style="text-align:left; text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>PO Number</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="@orderID">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:value-of select="string(.)"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:right; "/>
<td style="text-align:left; width:15%; ">
<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
<xsl:text>Contact</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="Contact">
<xsl:for-each select="Name">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:right; "/>
</tr>
<tr style="background-color:#EBEBEB; color:#3c3c3c; white-space:nowrap; " valign="middle">
<td style="text-align:left; text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>PO Date</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="@orderDate">
<xsl:for-each select="format-dateTime(., &apos;[M01]/[D01]/[Y0001]&apos;)">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:choose>
<xsl:when test=". instance of element() or . instance of document-node()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:right; "/>
<td style="text-align:left; width:15%; ">
<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
<xsl:text>Email</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="Contact">
<xsl:for-each select="Email">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:right; "/>
</tr>
<tr style="background-color:#fcfafa; color:#3c3c3c; white-space:nowrap; " valign="middle">
<td style="text-align:left; text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>PO Type</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="@type">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:value-of select="string(.)"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:left; "/>
<td style="text-align:left; width:15%; ">
<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
<xsl:text>Phone</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="Contact">
<xsl:for-each select="Phone">
<xsl:for-each select="TelephoneNumber">
<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
<xsl:value-of select="concat(/Message/cXML/Request/OrderRequest/OrderRequestHeader/ShipTo/Address/Phone/TelephoneNumber/AreaOrCityCode,&apos;-&apos;,(substring(/Message/cXML/Request/OrderRequest/OrderRequestHeader/ShipTo/Address/Phone/TelephoneNumber/Number,1,3)),&apos;-&apos;,(substring(/Message/cXML/Request/OrderRequest/OrderRequestHeader/ShipTo/Address/Phone/TelephoneNumber/Number,4,4)))"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:left; "/>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
<tr>
<td>
<xsl:variable name="altova:table">
<table style="border-collapse:collapse; empty-cells:hide; " align="center" bgcolor="#3c3c3c" cellpadding="5" cellspacing="1" width="100%" altova:hide-rows="empty">
<xsl:variable name="altova:CurrContextGrid_4" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody valign="bottom">
<tr style="color:#EBEBEB; ">
<td style="color:#FFFFFF; text-indent:10px; width:15%; " valign="bottom">
<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
<xsl:text>Bill To</xsl:text>
</span>
</td>
<td style="color:#FFFFFF; text-align:left; width:45%; " valign="bottom">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="BillTo">
<xsl:for-each select="Address">
<xsl:for-each select="Name">
<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="color:#FFFFFF; width:5%; "/>
<td style="color:#FFFFFF; width:15%; " valign="bottom">
<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
<xsl:text>Id</xsl:text>
</span>
</td>
<td style="color:#FFFFFF; text-align:left; width:40%; " valign="bottom">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="BillTo">
<xsl:for-each select="Address">
<xsl:for-each select="@addressID">
<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
<xsl:value-of select="string(.)"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="color:#FFFFFF; width:5%; "/>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
<tr>
<td>
<xsl:variable name="altova:table">
<table style="border-collapse:collapse; box-shadow:none; empty-cells:hide; " align="center" bgcolor="#3c3c3c" border="0" cellpadding="5" cellspacing="1" width="100%" altova:hide-rows="empty">
<xsl:variable name="altova:CurrContextGrid_5" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody>
<tr style="border-collapse:collapse; color:#EBEBEB; " valign="bottom">
<td style="border-collapse:collapse; color:#FFFFFF; text-indent:10px; width:15%; " valign="bottom">
<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
<xsl:text>Ship To</xsl:text>
</span>
</td>
<td style="border-collapse:collapse; color:#FFFFFF; text-align:left; width:30%; " valign="bottom">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="DeliverTo">
<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="border-collapse:collapse; color:#FFFFFF; width:5%; "/>
<td style="border-collapse:collapse; color:#FFFFFF; width:15%; "/>
<td style="border-collapse:collapse; color:#FFFFFF; width:30%; "/>
<td style="border-collapse:collapse; color:#FFFFFF; width:5%; "/>
</tr>
<tr style="background-color:#EBEBEB; border-collapse:collapse; color:#3c3c3c; " valign="middle">
<td style="text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>Street</xsl:text>
</span>
</td>
<td style="width:30%; ">
<xsl:choose>
<xsl:when test="string-length(/Message/cXML/Request/OrderRequest/OrderRequestHeader/BillTo/Address/PostalAddress/Street[2]) &gt; 0">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="concat(Street[1],
codepoints-to-string(10),
Street[2])">
<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
<xsl:choose>
<xsl:when test=". instance of element() or . instance of document-node()">
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="Street[1]">
<span style="font-family:Consolas; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</td>
<td style="width:5%; "/>
<td style="width:15%; "/>
<td style="width:30%; "/>
<td style="width:5%; "/>
</tr>
<tr style="background-color:#fcfafa; color:#3c3c3c; " valign="middle">
<td style="text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>City</xsl:text>
</span>
</td>
<td style="width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="City">
<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="width:5%; "/>
<td style="width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>State</xsl:text>
</span>
</td>
<td style="text-align:left; width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="State">
<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="width:5%; "/>
</tr>
<tr style="background-color:#EBEBEB; color:#3c3c3c; " valign="middle">
<td style="text-indent:25px; width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>Postal</xsl:text>
</span>
</td>
<td style="width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="PostalCode">
<span style="font-family:Consolas; font-size:11pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="width:5%; "/>
<td style="width:15%; ">
<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
<xsl:text>Country</xsl:text>
</span>
</td>
<td style="width:30%; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="OrderRequestHeader">
<xsl:for-each select="ShipTo">
<xsl:for-each select="Address">
<xsl:for-each select="PostalAddress">
<xsl:for-each select="Country">
<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
<xsl:apply-templates/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="width:5%; "/>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
<tr>
<td>
<xsl:variable name="altova:table">
<table style="border-collapse:collapse; empty-cells:hide; " align="center" bgcolor="#EBEBEB" cellpadding="5" cellspacing="1" width="100%" altova:hide-rows="empty" altova:hide-cols="empty">
<xsl:variable name="altova:CurrContextGrid_6" select="."/>
<xsl:variable name="altova:ColumnData"/>
<thead style="border-collapse:collapse; height:auto; " valign="bottom">
<tr style="background-color:#E71921; background-size:auto; color:#ebebeb; font-family:Arial Narrow; font-size:12px; height:20px; white-space:nowrap; ">
<th>
<span style="font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Line </xsl:text>
</span>
</th>
<th style="white-space:nowrap; width:auto; ">
<span style="font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Qty</xsl:text>
</span>
</th>
<th style="text-align:center; white-space:nowrap; width:auto; ">
<span style="font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Unit</xsl:text>
</span>
</th>
<th style="white-space:nowrap; width:auto; ">
<span style="font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Unit Price</xsl:text>
</span>
</th>
<th style="white-space:nowrap; width:auto; ">
<span style="font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Supplier Part ID</xsl:text>
</span>
</th>
<th style="white-space:nowrap; width:auto; ">
<span style="background-color:transparent; color:#ebebeb; font-family:Arial Narrow; font-size:12pt; ">
<xsl:text>Line Total</xsl:text>
</span>
</th>
</tr>
</thead>
<tbody style="border-bottom-color:gray; border-bottom-style:dashed; border-bottom-width:thin; border-top-color:gray; border-top-width:thin; ">
<xsl:for-each select="cXML">
<xsl:for-each select="Request">
<xsl:for-each select="OrderRequest">
<xsl:for-each select="ItemOut">
<tr style="font-family:Consolas; font-size:14px; height:auto; white-space:nowrap; " bgcolor="{if ( position() mod 2 = 0 ) then &quot;#EBEBEB&quot; else &quot;#fcfafa&quot; }">
<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
<xsl:for-each select="@lineNumber">
<span style="border-spacing:0; font-family:Consolas; ">
<xsl:value-of select="string(.)"/>
</span>
</xsl:for-each>
</td>
<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
<xsl:for-each select="@quantity">
<span>
<xsl:value-of select="string(.)"/>
</span>
</xsl:for-each>
</td>
<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
<xsl:for-each select="ItemDetail">
<xsl:for-each select="UnitOfMeasure">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:center; white-space:nowrap; width:auto; ">
<xsl:for-each select="ItemDetail">
<xsl:for-each select="UnitPrice">
<xsl:for-each select="Money">
<span>
<xsl:variable name="altova:seqContentStrings_7">
<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
</xsl:variable>
<xsl:variable name="altova:sContent_7" select="string($altova:seqContentStrings_7)"/>
<xsl:value-of select="$altova:sContent_7"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:center; white-space:nowrap; width:auto; ">
<xsl:for-each select="ItemID">
<xsl:for-each select="SupplierPartID">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
<td style="text-align:right; white-space:nowrap; width:auto; ">
<xsl:for-each select="Distribution">
<xsl:for-each select="Charge">
<xsl:for-each select="Money">
<span>
<xsl:variable name="altova:seqContentStrings_8">
<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
</xsl:variable>
<xsl:variable name="altova:sContent_8" select="string($altova:seqContentStrings_8)"/>
<xsl:value-of select="$altova:sContent_8"/>
</span>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" xpath-default-namespace="">
<xsl:choose>
<xsl:when test="$altova:table/table/@altova:hide-cols = 'empty'">
<xsl:sequence select="for $altova:pos in 1 to $altova:col-count return some $altova:cell in $altova:table/table/(thead | tbody | tfoot)/tr/(th | td)[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] satisfies not( altova:is-cell-empty( $altova:cell ) )"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="for $altova:pos in 1 to $altova:col-count return not( exists( $altova:table/table/tbody/tr/td[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] ) ) or ( some $altova:cell in $altova:table/table/tbody/tr/td[ altova:col-position(., $altova:TableIndexInfo) = $altova:pos ] satisfies not( altova:is-cell-empty( $altova:cell ) ) )"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
<br/>
<br/>
<br/>
</xsl:for-each>
<br/>
<br/>
<xsl:variable name="altova:table">
<table style="color:#1e2125; font-size:11px; font-style:italic; " align="center" cellpadding="2" width="50%">
<xsl:variable name="altova:CurrContextGrid_9" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody style="font-size:11px; ">
<tr>
<td style="text-align:center; ">
<span style="font-family:Arial; font-size:16px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>ProcessData</xsl:text>
</span>
</td>
</tr>
<tr>
<td>
<xsl:variable name="altova:table">
<table style="color:#1e2125; font-family:Consolas; font-size:11px; font-style:italic; " align="center" bgcolor="white" cellpadding="5" cellspacing="2" width="50%">
<xsl:variable name="altova:CurrContextGrid_10" select="."/>
<xsl:variable name="altova:ColumnData"/>
<tbody style="background-color:#f9f9f9; font-size:11px; ">
<tr style="height:0.30in; white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>Partner</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessagePartnerName">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-weight:bold; ">
<xsl:text>iFlow</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessageiFlow">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
<xsl:choose>
<xsl:when test="string-length(Message/MessageEndpoint) &gt; 1">
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>Endpoint</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessageEndpoint">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-weight:bold; ">
<xsl:text>Tenant Name</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessageTenant">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
<xsl:choose>
<xsl:when test="string-length(Message/MessageFileName) &gt; 1">
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>Source File Name</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessageFileName">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:choose>
<xsl:when test="string-length(Message/MessageId) &gt; 1">
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-weight:bold; ">
<xsl:text>PayloadID</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<xsl:for-each select="Message">
<xsl:for-each select="MessageName">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<tr style="white-space:nowrap; ">
<td>
<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>Date Time</xsl:text>
</span>
</td>
<td>
<xsl:for-each select="Message">
<xsl:for-each select="MessageTime">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</td>
</tr>
<tr style="white-space:nowrap; ">
<td style="font-size:12px; white-space:nowrap; ">
<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
<xsl:text>Message ID</xsl:text>
</span>
</td>
<td style="font-size:12px; ">
<a>
<xsl:choose>
<xsl:when test="not(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)))">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="substring(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), 1, 1) = '#'">
<xsl:attribute name="href">
<xsl:value-of select="concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:if test="substring(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), 2, 1) = ':'">
<xsl:text>file:///</xsl:text>
</xsl:if>
<xsl:value-of select="translate(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), '&#x5c;', '/')"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="Message">
<xsl:for-each select="MessageId">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:for-each>
</a>
</td>
</tr>
<tr style="white-space:nowrap; ">
<td>
<span style="font-weight:bold; ">
<xsl:text>Archive</xsl:text>
</span>
</td>
<td>
<xsl:choose>
<xsl:when test="Message/MessageTenant = &quot;l250804&quot;">
<a>
<xsl:choose>
<xsl:when test="not(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;))">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="substring(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), 1, 1) = '#'">
<xsl:attribute name="href">
<xsl:value-of select="&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:if test="substring(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), 2, 1) = ':'">
<xsl:text>file:///</xsl:text>
</xsl:if>
<xsl:value-of select="translate(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), '&#x5c;', '/')"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<span>
<xsl:text>\\idcpsi01\ARCHIVE\CPI</xsl:text>
</span>
</a>
</xsl:when>
<xsl:when test="$env = &quot;l250805&quot;">
<a>
<xsl:choose>
<xsl:when test="not(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;))">
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="substring(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), 1, 1) = '#'">
<xsl:attribute name="href">
<xsl:value-of select="&apos;\\idcpsi01\ARCHIVE\CPI&apos;"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:if test="substring(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), 2, 1) = ':'">
<xsl:text>file:///</xsl:text>
</xsl:if>
<xsl:value-of select="translate(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), '&#x5c;', '/')"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<span>
<xsl:text>\\idcpsi01\ARCHIVE\CPI</xsl:text>
</span>
</a>
</xsl:when>
</xsl:choose>
</td>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
</td>
</tr>
</tbody>
</table>
</xsl:variable>
<xsl:variable name="altova:col-count" select="sum( for $altova:cell in $altova:table/table/(thead | tbody | tfoot)[ 1 ]/tr[ 1 ]/(th | td) return altova:col-span( $altova:cell ) )" xpath-default-namespace=""/>
<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:variable>
<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
<br/>
</xsl:for-each>
<br/>
<br/>
<br/>
</body>
</html>
</xsl:template>
<xsl:template name="Template1">
<img>
<xsl:attribute name="src">
<xsl:variable name="altova:img_src" select="altova:reluri-to-content-id( translate(string(&apos;https://www.usps.com/global-elements/header/images/utility-header/logo-sb.svg&apos;), '&#x5c;', '/') )"/>
<xsl:if test="substring( $altova:img_src, 2, 1) = ':'">
<xsl:text>file:///</xsl:text>
</xsl:if>
<xsl:value-of select="$altova:img_src"/>
</xsl:attribute>
<xsl:attribute name="alt"/>
</img>
</xsl:template>
<xsl:function name="altova:is-cell-empty" as="xs:boolean">
<xsl:param name="altova:cell" as="element()"/>
<xsl:sequence select="altova:is-node-empty( $altova:cell )"/>
</xsl:function>
<xsl:function name="altova:is-node-empty" as="xs:boolean" xpath-default-namespace="">
<xsl:param name="altova:node" as="element()"/>
<xsl:sequence select="every $altova:child in $altova:node/child::node() satisfies ( ( boolean( $altova:child/self::text() ) and string-length( $altova:child ) = 0 ) or ( ( boolean( $altova:child/self::div ) or boolean( $altova:child/self::span ) or boolean( $altova:child/self::a ) ) and altova:is-node-empty( $altova:child ) ) )"/>
</xsl:function>
<xsl:function name="altova:col-position" as="xs:integer" xpath-default-namespace="">
<xsl:param name="altova:Cell" as="element()"/>
<xsl:param name="altova:TableIndexInfo" as="element()"/>
<xsl:variable name="altova:nRow" select="altova:GetGridRowNumForCell($altova:Cell)"/>
<xsl:variable name="altova:nCell" select="count($altova:Cell/preceding-sibling::th) + count($altova:Cell/preceding-sibling::td) + 1" as="xs:integer"/>
<xsl:sequence select="$altova:TableIndexInfo/altova:Row[$altova:nRow]/altova:ColumnIndex[$altova:nCell]"/>
</xsl:function>
<xsl:template match="@*" mode="altova:copy-table-cell-properties">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="@colspan" mode="altova:copy-table-cell-properties"/>
<xsl:function name="altova:col-span" as="xs:integer">
<xsl:param name="altova:cell" as="element()"/>
<xsl:sequence select="if ( exists( $altova:cell/@colspan ) ) then xs:integer( $altova:cell/@colspan ) else 1"/>
</xsl:function>
<xsl:template match="@* | node()" mode="altova:generate-table">
<xsl:param name="altova:generate-cols"/>
<xsl:param name="altova:TableIndexInfo"/>
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="tbody" mode="altova:generate-table" xpath-default-namespace="">
<xsl:param name="altova:generate-cols"/>
<xsl:param name="altova:TableIndexInfo"/>
<xsl:choose>
<xsl:when test="empty(tr)">
<xsl:copy>
<tr>
<td/>
</tr>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tr" mode="altova:generate-table" xpath-default-namespace="">
<xsl:param name="altova:generate-cols"/>
<xsl:param name="altova:TableIndexInfo"/>
<xsl:choose>
<xsl:when test="ancestor::table[1]/@altova:hide-rows = 'empty'">
<xsl:if test="some $altova:cell in (th | td) satisfies not(altova:is-cell-empty($altova:cell))">
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:if>
</xsl:when>
<xsl:when test="ancestor::table[1]/@altova:hide-rows = 'body-empty'">
<xsl:if test="not(exists(parent::tbody)) or (some $altova:cell in td satisfies not(altova:is-cell-empty($altova:cell)))">
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@* | node()" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="th | td" mode="altova:generate-table" xpath-default-namespace="">
<xsl:param name="altova:generate-cols"/>
<xsl:param name="altova:TableIndexInfo"/>
<xsl:variable name="altova:this-cell" select="."/>
<xsl:variable name="altova:col-index" select="altova:col-position($altova:this-cell, $altova:TableIndexInfo)"/>
<xsl:choose>
<xsl:when test="$altova:generate-cols[$altova:col-index]">
<xsl:copy>
<xsl:apply-templates select="@*" mode="#current">
<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
</xsl:apply-templates>
<xsl:choose>
<xsl:when test="altova:is-cell-empty($altova:this-cell)">
<xsl:text>&#160;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:when>
<xsl:when test="altova:col-span($altova:this-cell) > 1">
<xsl:for-each select="for $altova:pos in $altova:col-index to ($altova:col-index + altova:col-span($altova:this-cell) - 1) return if ($altova:generate-cols[$altova:pos]) then true() else ()">
<xsl:for-each select="$altova:this-cell">
<xsl:copy>
<xsl:apply-templates select="@*" mode="altova:copy-table-cell-properties"/>
<xsl:text>&#160;</xsl:text>
</xsl:copy>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="@colspan" mode="altova:generate-table" xpath-default-namespace="">
<xsl:param name="altova:generate-cols"/>
<xsl:param name="altova:TableIndexInfo"/>
<xsl:choose>
<xsl:when test="exists( ancestor::table[ 1 ]/@altova:hide-cols )">
<xsl:variable name="altova:col-index" select="altova:col-position(.., $altova:TableIndexInfo)"/>
<xsl:attribute name="colspan" select="sum( for $altova:pos in $altova:col-index to ( $altova:col-index + xs:integer( . ) - 1 ) return if ( $altova:generate-cols[ $altova:pos ] ) then 1 else 0 )"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="colspan" select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="@altova:hide-rows | @altova:hide-cols" mode="altova:generate-table"/>
<xsl:function name="altova:CountLeadingTrueValues">
<xsl:param name="seqBools"/>
<xsl:sequence select="if (not($seqBools[1] = true())) then 0 else 1 + altova:CountLeadingTrueValues($seqBools[position() gt 1])"/>
</xsl:function>
<xsl:function name="altova:GetCellFromRow" as="node()?" xpath-default-namespace="">
<xsl:param name="nodeTableRow" as="node()"/>
<xsl:param name="nCell" as="xs:integer"/>
<xsl:sequence select="$nodeTableRow/(th | td)[$nCell]"/>
</xsl:function>
<xsl:function name="altova:GetCellsFromRow" as="node()*" xpath-default-namespace="">
<xsl:param name="nodeTableRow" as="node()"/>
<xsl:sequence select="$nodeTableRow/(th | td)"/>
</xsl:function>
<xsl:function name="altova:GetRowsFromTable" as="node()*" xpath-default-namespace="">
<xsl:param name="nodeTable" as="node()"/>
<xsl:sequence select="$nodeTable/(thead | tbody | tfoot)/tr"/>
</xsl:function>
<xsl:function name="altova:GetRowspanFromCell" as="xs:integer" xpath-default-namespace="">
<xsl:param name="altova:nodeCell" as="node()"/>
<xsl:variable name="altova:sRowSpan" select="$altova:nodeCell/@rowspan" as="xs:string?"/>
<xsl:variable name="altova:nRowSpan" select="if ($altova:sRowSpan) then xs:integer($altova:sRowSpan) else 1" as="xs:integer"/>
<xsl:sequence select="$altova:nRowSpan"/>
</xsl:function>
<!-- In HTML and FO, the table section order is header, footer, body. This function determines, for a given cell, the number its row would have if the section order were header, body, footer -->
<xsl:function name="altova:GetGridRowNumForCell" xpath-default-namespace="">
<xsl:param name="altova:nodeTableCell" as="node()"/>
<xsl:variable name="altova:nodeTableRow" select="$altova:nodeTableCell/.." as="node()"/>
<xsl:variable name="altova:nodeTableSection" select="$altova:nodeTableRow/.." as="node()"/>
<xsl:variable name="altova:sTableSection" select="fn:local-name($altova:nodeTableSection)" as="xs:string"/>
<xsl:variable name="altova:nodeTable" select="$altova:nodeTableSection/.." as="node()"/>
<xsl:variable name="altova:nRowNumInSection" select="count($altova:nodeTableRow/preceding-sibling::tr) + 1" as="xs:integer"/>
<xsl:choose>
<xsl:when test="$altova:sTableSection eq 'tbody'">
<xsl:sequence select="count($altova:nodeTable/thead/tr) + $altova:nRowNumInSection"/>
</xsl:when>
<xsl:when test="$altova:sTableSection eq 'thead'">
<xsl:sequence select="$altova:nRowNumInSection"/>
</xsl:when>
<xsl:when test="$altova:sTableSection eq 'tfoot'">
<xsl:sequence select="count($altova:nodeTable/thead/tr) + count($altova:nodeTable/tbody/tr) + $altova:nRowNumInSection"/>
</xsl:when>
<xsl:otherwise>
<xsl:message select="'Internal Error'" terminate="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="altova:BuildTableIndexInfo" as="node()" xpath-default-namespace="">
<xsl:param name="altova:nodeTable" as="node()"/>
<altova:ColumnIndices>
<xsl:variable name="altova:nodeAllRows" select="altova:GetRowsFromTable($altova:nodeTable/table)" as="node()*"/>
<xsl:if test="$altova:nodeAllRows">
<xsl:variable name="altova:seqCellsInFirstRow" select="altova:GetCellsFromRow($altova:nodeAllRows[1])" as="node()*"/>
<xsl:variable name="altova:nColumnsInTable" select="sum(for $nodeCell in $altova:seqCellsInFirstRow return altova:col-span($nodeCell))" as="xs:integer"/>
<xsl:variable name="altova:seqActiveRowSpans" select="for $Cell in 1 to $altova:nColumnsInTable return 0" as="xs:integer*"/>
<!--xsl:sequence select="altova:BuildTableIndexInfo_Recursive($altova:nodeAllRows, 1, $altova:seqActiveRowSpans)"/-->
<xsl:call-template name="altova:BuildTableIndexInfo_Recursive">
<xsl:with-param name="altova:nodeTableRows" select="$altova:nodeAllRows"/>
<xsl:with-param name="altova:nRow" select="1"/>
<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
</xsl:call-template>
</xsl:if>
</altova:ColumnIndices>
</xsl:function>
<!--xsl:template name="altova:BuildTableIndexInfo_Recursive" as="node()*" xpath-default-namespace=""-->
<xsl:template name="altova:BuildTableIndexInfo_Recursive" xpath-default-namespace="">
<xsl:param name="altova:nodeTableRows" as="node()*"/>
<xsl:param name="altova:nRow" as="xs:integer"/>
<xsl:param name="altova:seqActiveRowSpans" as="xs:integer*"/>
<xsl:variable name="altova:nodeRow" select="$altova:nodeTableRows[$altova:nRow]" as="node()?"/>
<xsl:choose>
<xsl:when test="empty($altova:nodeRow)">
<xsl:sequence select="()"/>
</xsl:when>
<xsl:when test="empty(altova:GetCellFromRow($altova:nodeRow, 1))">
<xsl:sequence select="()"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="altova:nodeCell1" select="altova:GetCellFromRow($altova:nodeRow, 1)" as="node()?"/>
<xsl:variable name="altova:nColSpan" select="altova:col-span($altova:nodeCell1)" as="xs:integer"/>
<altova:Row>
<!--xsl:variable name="altova:seqColumnIndicesOfCurrentRow" select="altova:BuildTableIndexInfo_SingleRow_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, 1, 1, $altova:nColSpan, true(), 0, 0)" as="node()*"/>
<xsl:sequence select="$altova:seqColumnIndicesOfCurrentRow"/-->
<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
<xsl:with-param name="altova:nColumn" select="1"/>
<xsl:with-param name="altova:nCellInCurrentRow" select="1"/>
<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpan"/>
<xsl:with-param name="altova:bColSpanBegins" select="true()"/>
<xsl:with-param name="altova:nCurrentSum" select="0"/>
<xsl:with-param name="altova:nRowSpansToAdd" select="0"/>
</xsl:call-template>
</altova:Row>
<xsl:variable name="altova:seqActiveRowSpans_New" select="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, 1, 1, $altova:nColSpan)" as="xs:integer*"/>
<!--xsl:sequence select="altova:BuildTableIndexInfo_Recursive($altova:nodeTableRows, $altova:nRow + 1, $altova:seqActiveRowSpans_New)"/-->
<xsl:call-template name="altova:BuildTableIndexInfo_Recursive">
<xsl:with-param name="altova:nodeTableRows" select="$altova:nodeTableRows"/>
<xsl:with-param name="altova:nRow" select="$altova:nRow + 1"/>
<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans_New"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--xsl:template name="altova:BuildTableIndexInfo_SingleRow_Recursive" as="node()*" xpath-default-namespace=""-->
<xsl:template name="altova:BuildTableIndexInfo_SingleRow_Recursive" xpath-default-namespace="">
<xsl:param name="altova:seqActiveRowSpans" as="xs:integer*"/>
<xsl:param name="altova:nodeRow" as="node()"/>
<xsl:param name="altova:nColumn" as="xs:integer"/>
<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
<xsl:param name="altova:nColSpanInCellRemaining" as="xs:integer"/>
<xsl:param name="altova:bColSpanBegins" as="xs:boolean"/>
<!-- Also true if it's just a single cell -->
<xsl:param name="altova:nCurrentSum" as="xs:integer"/>
<xsl:param name="altova:nRowSpansToAdd" as="xs:integer"/>
<xsl:choose>
<xsl:when test="$altova:nColumn gt count($altova:seqActiveRowSpans)">
<xsl:sequence select="()"/>
</xsl:when>
<!-- If the cell is not under a rowspan -->
<xsl:when test="$altova:seqActiveRowSpans[$altova:nColumn] eq 0">
<!-- If the cell is not under a colspan -->
<xsl:if test="$altova:bColSpanBegins eq true()">
<!-- A non-spanned cell starts in this column -->
<altova:ColumnIndex>
<xsl:sequence select="$altova:nCurrentSum + 1"/>
</altova:ColumnIndex>
</xsl:if>
<xsl:variable name="altova:nCellInCurrentRow_New" select="if ($altova:nColSpanInCellRemaining gt 1) then $altova:nCellInCurrentRow else $altova:nCellInCurrentRow + 1" as="xs:integer"/>
<xsl:variable name="altova:nColSpanInCell_New" select="if ($altova:nColSpanInCellRemaining gt 1) then $altova:nColSpanInCellRemaining - 1 else if (empty(altova:GetCellFromRow($altova:nodeRow, $altova:nCellInCurrentRow_New))) then 1 else altova:col-span(altova:GetCellFromRow($altova:nodeRow, $altova:nCellInCurrentRow_New))" as="xs:integer"/>
<xsl:variable name="altova:bColSpanBegins_New" select="$altova:nCellInCurrentRow ne $altova:nCellInCurrentRow_New" as="xs:boolean"/>
<!--xsl:sequence select="altova:BuildTableIndexInfo_SingleRow_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, $altova:nColumn + 1, $altova:nCellInCurrentRow_New, $altova:nColSpanInCell_New, $altova:bColSpanBegins_New, $altova:nCurrentSum + 1, $altova:nRowSpansToAdd)"/-->
<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
<xsl:with-param name="altova:nColumn" select="$altova:nColumn + 1"/>
<xsl:with-param name="altova:nCellInCurrentRow" select="$altova:nCellInCurrentRow_New"/>
<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpanInCell_New"/>
<xsl:with-param name="altova:bColSpanBegins" select="$altova:bColSpanBegins_New"/>
<xsl:with-param name="altova:nCurrentSum" select="$altova:nCurrentSum + 1"/>
<xsl:with-param name="altova:nRowSpansToAdd" select="$altova:nRowSpansToAdd"/>
</xsl:call-template>
</xsl:when>
<!-- The cell is under a rowspan -->
<xsl:otherwise>
<!--xsl:sequence select="altova:BuildTableIndexInfo_SingleRow_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, $altova:nColumn + 1, $altova:nCellInCurrentRow, $altova:nColSpanInCellRemaining, $altova:bColSpanBegins, $altova:nCurrentSum + 1, $altova:nRowSpansToAdd + 1)"/-->
<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
<xsl:with-param name="altova:nColumn" select="$altova:nColumn + 1"/>
<xsl:with-param name="altova:nCellInCurrentRow" select="$altova:nCellInCurrentRow"/>
<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpanInCellRemaining"/>
<xsl:with-param name="altova:bColSpanBegins" select="$altova:bColSpanBegins"/>
<xsl:with-param name="altova:nCurrentSum" select="$altova:nCurrentSum + 1"/>
<xsl:with-param name="altova:nRowSpansToAdd" select="$altova:nRowSpansToAdd + 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:function name="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive" as="xs:integer*" xpath-default-namespace="">
<xsl:param name="altova:seqRowSpans" as="xs:integer*"/>
<xsl:param name="altova:nodeCurrentRow" as="node()"/>
<xsl:param name="altova:nColumn" as="xs:integer"/>
<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
<xsl:param name="altova:nColSpanInCellRemaining" as="xs:integer"/>
<xsl:choose>
<xsl:when test="$altova:nColumn gt count($altova:seqRowSpans)">
<xsl:sequence select="()"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="altova:nRowSpanForCurrentColumn" select="altova:BuildTableIndexInfo_ActiveRowSpans_SingleColumn($altova:seqRowSpans, $altova:nodeCurrentRow, $altova:nColumn, $altova:nCellInCurrentRow)" as="xs:integer?"/>
<xsl:sequence select="$altova:nRowSpanForCurrentColumn"/>
<xsl:variable name="altova:nCellInCurrentRow_New" select="if ($altova:seqRowSpans[$altova:nColumn] eq 0 and $altova:nColSpanInCellRemaining eq 1) then $altova:nCellInCurrentRow + 1 else $altova:nCellInCurrentRow" as="xs:integer"/>
<xsl:variable name="altova:nColSpanInCell_New" select="if ($altova:seqRowSpans[$altova:nColumn] eq 0 and $altova:nCellInCurrentRow eq $altova:nCellInCurrentRow_New) then $altova:nColSpanInCellRemaining - 1 else if (empty(altova:GetCellFromRow($altova:nodeCurrentRow, $altova:nCellInCurrentRow_New))) then 1 else altova:col-span(altova:GetCellFromRow($altova:nodeCurrentRow, $altova:nCellInCurrentRow_New))" as="xs:integer"/>
<xsl:sequence select="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive($altova:seqRowSpans, $altova:nodeCurrentRow, $altova:nColumn + 1, $altova:nCellInCurrentRow_New, $altova:nColSpanInCell_New)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="altova:BuildTableIndexInfo_ActiveRowSpans_SingleColumn" as="xs:integer?" xpath-default-namespace="">
<xsl:param name="altova:seqRowSpans" as="xs:integer*"/>
<xsl:param name="altova:nodeCurrentRow" as="node()"/>
<xsl:param name="altova:nColumn" as="xs:integer"/>
<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
<xsl:choose>
<xsl:when test="$altova:seqRowSpans[$altova:nColumn] gt 0">
<xsl:sequence select="$altova:seqRowSpans[$altova:nColumn] - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="altova:nodeCell" select="altova:GetCellFromRow($altova:nodeCurrentRow, $altova:nCellInCurrentRow)" as="node()"/>
<xsl:sequence select="altova:GetRowspanFromCell($altova:nodeCell) - 1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="altova:reluri-to-content-id" as="xs:string">
<xsl:param name="input"/>
<xsl:choose>
<xsl:when test="$altova:bGeneratingMime and not(contains($input, '://') or starts-with($input, '/') or contains($input, ':/') or contains($input, ':\'))">
<xsl:sequence select="string-join(('cid:', encode-for-uri($input), '@', $altova:execution-guid, '.Altova.StyleVision'), '')"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$input"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
<xsl:param name="pos"/>
<xsl:param name="endpos"/>
<xsl:param name="rowinfo"/>
<xsl:variable name="rowspan">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="($pos - 1) * 2 + 2"/>
<xsl:with-param name="vector" select="$rowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($rowspan) > 0">
<xsl:if test="$endpos = -1 or $pos &lt; $endpos">
<xsl:variable name="colspan">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="($pos - 1) * 2 + 1"/>
<xsl:with-param name="vector" select="$rowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat($colspan,';',number($rowspan) - 1,';')"/>
<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="endpos" select="$endpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$endpos != -1 and $pos &lt; $endpos">
<xsl:value-of select="'0;0;'"/>
<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="endpos" select="$endpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:param name="pos"/>
<xsl:param name="endpos"/>
<xsl:param name="rowinfo"/>
<xsl:variable name="rowspan">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="($pos - 1) * 2 + 2"/>
<xsl:with-param name="vector" select="$rowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($rowspan) > 0">
<xsl:if test="$endpos = -1 or $pos &lt; $endpos">
<xsl:variable name="colspan">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="($pos - 1) * 2 + 1"/>
<xsl:with-param name="vector" select="$rowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($colspan) > 0">5</xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="endpos" select="$endpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$endpos != -1 and $pos &lt; $endpos">
<xsl:value-of select="'2'"/>
<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="endpos" select="$endpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-get-master-cell-colnum">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
<xsl:choose>
<xsl:when test="$entry-type='4' or $entry-type='5'">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
<xsl:with-param name="colnum" select="$colnum - 1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$colnum"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-get-master-cell-rownum">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
<xsl:choose>
<xsl:when test="$entry-type='3'">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum - 1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$rownum"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-calc-spanned-cols">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="table-matrix"/>
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
<xsl:with-param name="spanned-cols" select="0"/>
<xsl:with-param name="colnum" select="$colnum + 1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
<xsl:param name="spanned-cols"/>
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="table-matrix"/>
<xsl:choose>
<xsl:when test="$colnum &lt;= $col-count">
<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
<xsl:choose>
<xsl:when test="$entry-type='4' or $entry-type='5'">
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
<xsl:with-param name="spanned-cols" select="$spanned-cols + 1"/>
<xsl:with-param name="colnum" select="$colnum + 1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spanned-cols"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spanned-cols"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-calc-spanned-rows">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="table-matrix"/>
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
<xsl:with-param name="spanned-rows" select="0"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum + 1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
<xsl:param name="spanned-rows"/>
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="table-matrix"/>
<xsl:choose>
<xsl:when test="$rownum &lt;= $row-count">
<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
<xsl:choose>
<xsl:when test="$entry-type='3' or $entry-type='5'">
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
<xsl:with-param name="spanned-rows" select="$spanned-rows + 1"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum + 1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spanned-rows"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spanned-rows"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-count">
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:call-template name="altova:vector-count-helper">
<xsl:with-param name="vector" select="$vector"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="count" select="0"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:vector-count-helper">
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:param name="count"/>
<xsl:choose>
<xsl:when test="not($vector)">
<xsl:value-of select="$count"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:vector-count-helper">
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-count-value">
<xsl:param name="value"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:call-template name="altova:vector-count-value-helper">
<xsl:with-param name="value" select="$value"/>
<xsl:with-param name="vector" select="$vector"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="count" select="0"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:vector-count-value-helper">
<xsl:param name="value"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:param name="count"/>
<xsl:choose>
<xsl:when test="string($vector)">
<xsl:variable name="current-value">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="new-count">
<xsl:choose>
<xsl:when test="$value=string($current-value)">
<xsl:value-of select="$count + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="altova:vector-count-value-helper">
<xsl:with-param name="value" select="$value"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
<xsl:with-param name="count" select="number($new-count)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-multiply-values">
<xsl:param name="multiplier"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:if test="string($vector)">
<xsl:variable name="current-value">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="string($current-value)">
<xsl:value-of select="number($current-value) * $multiplier"/>
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:call-template name="altova:vector-multiply-values">
<xsl:with-param name="multiplier" select="$multiplier"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:vector-replace-value">
<xsl:param name="old-value"/>
<xsl:param name="new-value"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:if test="string($vector)">
<xsl:variable name="current-value">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$current-value = $old-value">
<xsl:value-of select="$new-value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$current-value"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$separator"/>
<xsl:call-template name="altova:vector-replace-value">
<xsl:with-param name="old-value" select="$old-value"/>
<xsl:with-param name="new-value" select="$new-value"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:vector-reverse">
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:if test="$vector">
<xsl:call-template name="altova:vector-reverse">
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="concat(substring-before($vector,$separator),$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($vector,$separator)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="altova:vector-get-value">
<xsl:param name="index"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:choose>
<xsl:when test="$index = 1">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="$index - 1"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-append">
<xsl:param name="count"/>
<xsl:param name="value"/>
<xsl:param name="separator"/>
<xsl:if test="$count > 0">
<xsl:value-of select="concat($value,$separator)"/>
<xsl:call-template name="altova:vector-append">
<xsl:with-param name="count" select="$count - 1"/>
<xsl:with-param name="value" select="$value"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:vector-calc-sum">
<xsl:param name="start-sum"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:choose>
<xsl:when test="string($vector)">
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="altova:vector-calc-sum">
<xsl:with-param name="start-sum" select="$start-sum + number($value)"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$start-sum"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-calc-sum-range">
<xsl:param name="start-sum"/>
<xsl:param name="from"/>
<xsl:param name="to"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:call-template name="altova:vector-calc-sum-range-helper">
<xsl:with-param name="start-sum" select="$start-sum"/>
<xsl:with-param name="pos" select="1"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
<xsl:with-param name="vector" select="$vector"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:vector-calc-sum-range-helper">
<xsl:param name="start-sum"/>
<xsl:param name="pos"/>
<xsl:param name="from"/>
<xsl:param name="to"/>
<xsl:param name="vector"/>
<xsl:param name="separator"/>
<xsl:choose>
<xsl:when test="$pos &lt; $from">
<xsl:call-template name="altova:vector-calc-sum-range-helper">
<xsl:with-param name="start-sum" select="$start-sum"/>
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$pos &gt; $to">
<xsl:value-of select="$start-sum"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="contains($vector,$separator)">
<xsl:value-of select="substring-before($vector,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="altova:vector-calc-sum-range-helper">
<xsl:with-param name="start-sum" select="$start-sum + number($value)"/>
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="from" select="$from"/>
<xsl:with-param name="to" select="$to"/>
<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:vector-merge-vectors-using-max-value">
<xsl:param name="vector1"/>
<xsl:param name="vector2"/>
<xsl:param name="separator"/>
<xsl:choose>
<xsl:when test="string($vector1) and string($vector2)">
<xsl:variable name="value1">
<xsl:choose>
<xsl:when test="contains($vector1,$separator)">
<xsl:value-of select="substring-before($vector1,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="value2">
<xsl:choose>
<xsl:when test="contains($vector2,$separator)">
<xsl:value-of select="substring-before($vector2,$separator)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$vector2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($value1) > number($value2)">
<xsl:value-of select="$value1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value2"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$separator"/>
<xsl:call-template name="altova:vector-merge-vectors-using-max-value">
<xsl:with-param name="vector1" select="substring-after($vector1,$separator)"/>
<xsl:with-param name="vector2" select="substring-after($vector2,$separator)"/>
<xsl:with-param name="separator" select="$separator"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="string($vector1)">
<xsl:value-of select="$vector1"/>
</xsl:when>
<xsl:when test="string($vector2)">
<xsl:value-of select="$vector2"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:char-vector-append">
<xsl:param name="count"/>
<xsl:param name="char"/>
<xsl:if test="$count > 0">
<xsl:value-of select="$char"/>
<xsl:call-template name="altova:char-vector-append">
<xsl:with-param name="count" select="$count - 1"/>
<xsl:with-param name="char" select="$char"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:char-vector-calc-index-of-nth-char">
<xsl:param name="n"/>
<xsl:param name="char"/>
<xsl:param name="char-vector"/>
<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
<xsl:with-param name="pos" select="1"/>
<xsl:with-param name="count" select="0"/>
<xsl:with-param name="n" select="$n"/>
<xsl:with-param name="char" select="$char"/>
<xsl:with-param name="char-vector" select="$char-vector"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:char-vector-calc-index-of-nth-char-helper">
<xsl:param name="pos"/>
<xsl:param name="count"/>
<xsl:param name="n"/>
<xsl:param name="char"/>
<xsl:param name="char-vector"/>
<xsl:choose>
<xsl:when test="substring($char-vector,$pos,1)=$char">
<xsl:choose>
<xsl:when test="$n = $count+1">
<xsl:value-of select="$pos"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$pos &lt; string-length($char-vector)">
<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="count" select="$count + 1"/>
<xsl:with-param name="n" select="$n"/>
<xsl:with-param name="char" select="$char"/>
<xsl:with-param name="char-vector" select="$char-vector"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="$pos &lt; string-length($char-vector)">
<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
<xsl:with-param name="pos" select="$pos + 1"/>
<xsl:with-param name="count" select="$count"/>
<xsl:with-param name="n" select="$n"/>
<xsl:with-param name="char" select="$char"/>
<xsl:with-param name="char-vector" select="$char-vector"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-get-property">
<xsl:param name="property"/>
<xsl:param name="css-styles"/>
<xsl:choose>
<xsl:when test="not($css-styles)"/>
<xsl:when test="normalize-space(substring-before($css-styles,':'))=$property">
<xsl:choose>
<xsl:when test="contains($css-styles,';')">
<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="$property"/>
<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-remove-property">
<xsl:param name="property"/>
<xsl:param name="css-styles"/>
<xsl:if test="string($css-styles)">
<xsl:variable name="actual-property" select="normalize-space(substring-before($css-styles,':'))"/>
<xsl:if test="not(contains($actual-property,';'))">
<xsl:if test="$actual-property!=$property">
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="contains($css-styles,';')">
<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($actual-property,':',$value,';')"/>
</xsl:if>
</xsl:if>
<xsl:call-template name="altova:css-styles-remove-property">
<xsl:with-param name="property" select="$property"/>
<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-get-inherited-styles-for-table-cell">
<xsl:param name="css-styles"/>
<xsl:if test="string($css-styles)">
<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="contains($css-styles,';')">
<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property='background'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='background-color'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='color'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font-family'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font-size'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font-style'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font-variant'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='font-weight'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='letter-spacing'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='text-align'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='text-decoration'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='text-indent'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='text-transform'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
<xsl:when test="$property='vertical-align'">
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-get-inherited-styles-for-table-cell">
<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-shorthand-styles">
<xsl:param name="css-styles"/>
<xsl:if test="string($css-styles)">
<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
<xsl:if test="string($property) and not(contains($property,';'))">
<xsl:variable name="value">
<xsl:choose>
<xsl:when test="contains($css-styles,';')">
<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$property='background'">
<xsl:call-template name="altova:css-styles-split-background">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border'">
<xsl:call-template name="altova:css-styles-split-border">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-top'">
<xsl:call-template name="altova:css-styles-split-border-top">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-right'">
<xsl:call-template name="altova:css-styles-split-border-right">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-bottom'">
<xsl:call-template name="altova:css-styles-split-border-bottom">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-left'">
<xsl:call-template name="altova:css-styles-split-border-left">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-color'">
<xsl:call-template name="altova:css-styles-split-border-color">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-style'">
<xsl:call-template name="altova:css-styles-split-border-style">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='border-width'">
<xsl:call-template name="altova:css-styles-split-border-width">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='font'">
<xsl:call-template name="altova:css-styles-split-font-style">
<xsl:with-param name="value" select="string($value)"/>
<xsl:with-param name="font-style" select="'normal'"/>
<xsl:with-param name="font-variant" select="'normal'"/>
<xsl:with-param name="font-weight" select="'normal'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='margin'">
<xsl:call-template name="altova:css-styles-split-margin-style">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$property='padding'">
<xsl:call-template name="altova:css-styles-split-padding-style">
<xsl:with-param name="value" select="string($value)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($property,':',$value,';')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-length">
<xsl:param name="value"/>
<xsl:variable name="unit" select="translate($value,'0123456789+-.','')"/>
<xsl:choose>
<xsl:when test="$unit='em'">1</xsl:when>
<xsl:when test="$unit='ex'">1</xsl:when>
<xsl:when test="$unit='px'">1</xsl:when>
<xsl:when test="$unit='in'">1</xsl:when>
<xsl:when test="$unit='cm'">1</xsl:when>
<xsl:when test="$unit='mm'">1</xsl:when>
<xsl:when test="$unit='pt'">1</xsl:when>
<xsl:when test="$unit='pc'">1</xsl:when>
<xsl:when test="$unit=''">
<xsl:variable name="number" select="translate($value,'ceimnptx','')"/>
<xsl:choose>
<xsl:when test="number($number)=0">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-background-color">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='transparent'">1</xsl:when>
<xsl:otherwise>
<xsl:variable name="is-color">
<xsl:call-template name="altova:css-styles-is-value-color">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-color='1'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-background-image">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='none'">1</xsl:when>
<xsl:otherwise>
<xsl:variable name="is-uri">
<xsl:call-template name="altova:css-styles-is-value-uri">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-uri='1'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-background-repeat">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='repeat'">1</xsl:when>
<xsl:when test="$value='repeat-x'">1</xsl:when>
<xsl:when test="$value='repeat-y'">1</xsl:when>
<xsl:when test="$value='no-repeat'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-background-attachment">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='scroll'">1</xsl:when>
<xsl:when test="$value='fixed'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-color">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='aqua'">1</xsl:when>
<xsl:when test="$value='black'">1</xsl:when>
<xsl:when test="$value='blue'">1</xsl:when>
<xsl:when test="$value='fuchsia'">1</xsl:when>
<xsl:when test="$value='gray'">1</xsl:when>
<xsl:when test="$value='green'">1</xsl:when>
<xsl:when test="$value='lime'">1</xsl:when>
<xsl:when test="$value='maroon'">1</xsl:when>
<xsl:when test="$value='navy'">1</xsl:when>
<xsl:when test="$value='olive'">1</xsl:when>
<xsl:when test="$value='orange'">1</xsl:when>
<xsl:when test="$value='purple'">1</xsl:when>
<xsl:when test="$value='red'">1</xsl:when>
<xsl:when test="$value='silver'">1</xsl:when>
<xsl:when test="$value='teal'">1</xsl:when>
<xsl:when test="$value='white'">1</xsl:when>
<xsl:when test="$value='yellow'">1</xsl:when>
<xsl:when test="starts-with($value,'#')">1</xsl:when>
<xsl:when test="starts-with($value,'rgb(')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-border-width">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='thin'">1</xsl:when>
<xsl:when test="$value='medium'">1</xsl:when>
<xsl:when test="$value='thick'">1</xsl:when>
<xsl:otherwise>
<xsl:variable name="is-length">
<xsl:call-template name="altova:css-styles-is-value-length">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-length='1'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-border-style">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='none'">1</xsl:when>
<xsl:when test="$value='hidden'">1</xsl:when>
<xsl:when test="$value='dotted'">1</xsl:when>
<xsl:when test="$value='dashed'">1</xsl:when>
<xsl:when test="$value='solid'">1</xsl:when>
<xsl:when test="$value='double'">1</xsl:when>
<xsl:when test="$value='groove'">1</xsl:when>
<xsl:when test="$value='ridge'">1</xsl:when>
<xsl:when test="$value='inset'">1</xsl:when>
<xsl:when test="$value='outset'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-border-color">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='transparent'">1</xsl:when>
<xsl:otherwise>
<xsl:variable name="is-color">
<xsl:call-template name="altova:css-styles-is-value-color">
<xsl:with-param name="value" select="$value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-color='1'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-font-style">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='normal'">1</xsl:when>
<xsl:when test="$value='italic'">1</xsl:when>
<xsl:when test="$value='oblique'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-font-variant">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='normal'">1</xsl:when>
<xsl:when test="$value='small-caps'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-font-weight">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="$value='normal'">1</xsl:when>
<xsl:when test="$value='bold'">1</xsl:when>
<xsl:when test="$value='bolder'">1</xsl:when>
<xsl:when test="$value='lighter'">1</xsl:when>
<xsl:when test="$value='100'">1</xsl:when>
<xsl:when test="$value='200'">1</xsl:when>
<xsl:when test="$value='300'">1</xsl:when>
<xsl:when test="$value='400'">1</xsl:when>
<xsl:when test="$value='500'">1</xsl:when>
<xsl:when test="$value='600'">1</xsl:when>
<xsl:when test="$value='700'">1</xsl:when>
<xsl:when test="$value='800'">1</xsl:when>
<xsl:when test="$value='900'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-is-value-uri">
<xsl:param name="value"/>
<xsl:choose>
<xsl:when test="starts-with($value,'url(')">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-split-background">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-background-color">
<xsl:call-template name="altova:css-styles-is-value-background-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-background-image">
<xsl:call-template name="altova:css-styles-is-value-background-image">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-background-repeat">
<xsl:call-template name="altova:css-styles-is-value-background-repeat">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-background-attachment">
<xsl:call-template name="altova:css-styles-is-value-background-attachment">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-background-color='1'">
<xsl:value-of select="concat('background-color:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-background-image='1'">
<xsl:value-of select="concat('background-image:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-background-repeat='1'">
<xsl:value-of select="concat('background-repeat:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-background-attachment='1'">
<xsl:value-of select="concat('background-attachment:',$first-value,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('background-position:',$first-value,';')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-background">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-border-width">
<xsl:call-template name="altova:css-styles-is-value-border-width">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-style">
<xsl:call-template name="altova:css-styles-is-value-border-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-color">
<xsl:call-template name="altova:css-styles-is-value-border-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-border-width='1'">
<xsl:value-of select="concat('border-top-width:',$first-value,';')"/>
<xsl:value-of select="concat('border-right-width:',$first-value,';')"/>
<xsl:value-of select="concat('border-bottom-width:',$first-value,';')"/>
<xsl:value-of select="concat('border-left-width:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-style='1'">
<xsl:value-of select="concat('border-top-style:',$first-value,';')"/>
<xsl:value-of select="concat('border-right-style:',$first-value,';')"/>
<xsl:value-of select="concat('border-bottom-style:',$first-value,';')"/>
<xsl:value-of select="concat('border-left-style:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-color='1'">
<xsl:value-of select="concat('border-top-color:',$first-value,';')"/>
<xsl:value-of select="concat('border-right-color:',$first-value,';')"/>
<xsl:value-of select="concat('border-bottom-color:',$first-value,';')"/>
<xsl:value-of select="concat('border-left-color:',$first-value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-border">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-top">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-border-width">
<xsl:call-template name="altova:css-styles-is-value-border-width">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-style">
<xsl:call-template name="altova:css-styles-is-value-border-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-color">
<xsl:call-template name="altova:css-styles-is-value-border-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-border-width='1'">
<xsl:value-of select="concat('border-top-width:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-style='1'">
<xsl:value-of select="concat('border-top-style:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-color='1'">
<xsl:value-of select="concat('border-top-color:',$first-value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-border-top">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-right">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-border-width">
<xsl:call-template name="altova:css-styles-is-value-border-width">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-style">
<xsl:call-template name="altova:css-styles-is-value-border-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-color">
<xsl:call-template name="altova:css-styles-is-value-border-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-border-width='1'">
<xsl:value-of select="concat('border-right-width:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-style='1'">
<xsl:value-of select="concat('border-right-style:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-color='1'">
<xsl:value-of select="concat('border-right-color:',$first-value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-border-right">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-bottom">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-border-width">
<xsl:call-template name="altova:css-styles-is-value-border-width">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-style">
<xsl:call-template name="altova:css-styles-is-value-border-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-color">
<xsl:call-template name="altova:css-styles-is-value-border-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-border-width='1'">
<xsl:value-of select="concat('border-bottom-width:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-style='1'">
<xsl:value-of select="concat('border-bottom-style:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-color='1'">
<xsl:value-of select="concat('border-bottom-color:',$first-value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-border-bottom">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-left">
<xsl:param name="value"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-border-width">
<xsl:call-template name="altova:css-styles-is-value-border-width">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-style">
<xsl:call-template name="altova:css-styles-is-value-border-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-border-color">
<xsl:call-template name="altova:css-styles-is-value-border-color">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-border-width='1'">
<xsl:value-of select="concat('border-left-width:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-style='1'">
<xsl:value-of select="concat('border-left-style:',$first-value,';')"/>
</xsl:when>
<xsl:when test="$is-border-color='1'">
<xsl:value-of select="concat('border-left-color:',$first-value,';')"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="altova:css-styles-split-border-left">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-color">
<xsl:param name="value"/>
<xsl:variable name="count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($count)=1">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
<xsl:value-of select="concat('border-right-color:',$value1,';')"/>
<xsl:value-of select="concat('border-bottom-color:',$value1,';')"/>
<xsl:value-of select="concat('border-left-color:',$value1,';')"/>
</xsl:when>
<xsl:when test="number($count)=2">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-color:',$value1,';')"/>
<xsl:value-of select="concat('border-left-color:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=3">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-color:',$value3,';')"/>
<xsl:value-of select="concat('border-left-color:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=4">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value4">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="4"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-color:',$value3,';')"/>
<xsl:value-of select="concat('border-left-color:',$value4,';')"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-style">
<xsl:param name="value"/>
<xsl:variable name="count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($count)=1">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
<xsl:value-of select="concat('border-right-style:',$value1,';')"/>
<xsl:value-of select="concat('border-bottom-style:',$value1,';')"/>
<xsl:value-of select="concat('border-left-style:',$value1,';')"/>
</xsl:when>
<xsl:when test="number($count)=2">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-style:',$value1,';')"/>
<xsl:value-of select="concat('border-left-style:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=3">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-style:',$value3,';')"/>
<xsl:value-of select="concat('border-left-style:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=4">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value4">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="4"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-style:',$value3,';')"/>
<xsl:value-of select="concat('border-left-style:',$value4,';')"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-split-border-width">
<xsl:param name="value"/>
<xsl:variable name="count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($count)=1">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
<xsl:value-of select="concat('border-right-width:',$value1,';')"/>
<xsl:value-of select="concat('border-bottom-width:',$value1,';')"/>
<xsl:value-of select="concat('border-left-width:',$value1,';')"/>
</xsl:when>
<xsl:when test="number($count)=2">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-width:',$value1,';')"/>
<xsl:value-of select="concat('border-left-width:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=3">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-width:',$value3,';')"/>
<xsl:value-of select="concat('border-left-width:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=4">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value4">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="4"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
<xsl:value-of select="concat('border-bottom-width:',$value3,';')"/>
<xsl:value-of select="concat('border-left-width:',$value4,';')"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-split-font-style">
<xsl:param name="value"/>
<xsl:param name="font-style"/>
<xsl:param name="font-variant"/>
<xsl:param name="font-weight"/>
<xsl:if test="$value">
<xsl:variable name="first-value">
<xsl:choose>
<xsl:when test="contains($value,' ')">
<xsl:value-of select="substring-before($value,' ')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is-font-style">
<xsl:call-template name="altova:css-styles-is-value-font-style">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-font-variant">
<xsl:call-template name="altova:css-styles-is-value-font-variant">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="is-font-weight">
<xsl:call-template name="altova:css-styles-is-value-font-weight">
<xsl:with-param name="value" select="$first-value"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$is-font-style='1' and $is-font-variant='1' and $is-font-weight='1'">
<xsl:call-template name="altova:css-styles-split-font-style">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
<xsl:with-param name="font-style" select="$font-style"/>
<xsl:with-param name="font-variant" select="$font-variant"/>
<xsl:with-param name="font-weight" select="$font-weight"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$is-font-style='1'">
<xsl:call-template name="altova:css-styles-split-font-style">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
<xsl:with-param name="font-style" select="$first-value"/>
<xsl:with-param name="font-variant" select="$font-variant"/>
<xsl:with-param name="font-weight" select="$font-weight"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$is-font-variant='1'">
<xsl:call-template name="altova:css-styles-split-font-style">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
<xsl:with-param name="font-style" select="$font-style"/>
<xsl:with-param name="font-variant" select="$first-value"/>
<xsl:with-param name="font-weight" select="$font-weight"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$is-font-weight='1'">
<xsl:call-template name="altova:css-styles-split-font-style">
<xsl:with-param name="value" select="substring-after($value,' ')"/>
<xsl:with-param name="font-style" select="$font-style"/>
<xsl:with-param name="font-variant" select="$font-variant"/>
<xsl:with-param name="font-weight" select="$first-value"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('font-style:',$font-style,';')"/>
<xsl:value-of select="concat('font-variant:',$font-variant,';')"/>
<xsl:value-of select="concat('font-weight:',$font-weight,';')"/>
<xsl:choose>
<xsl:when test="contains($first-value,'/')">
<xsl:value-of select="concat('font-size:',substring-before($first-value,'/'),';')"/>
<xsl:value-of select="concat('line-height:',substring-after($first-value,'/'),';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('font-size:',$first-value,';')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="concat('font-family:',substring-after($value,' '),';')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-split-margin-style">
<xsl:param name="value"/>
<xsl:variable name="count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($count)=1">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('margin-top:',$value1,';')"/>
<xsl:value-of select="concat('margin-right:',$value1,';')"/>
<xsl:value-of select="concat('margin-bottom:',$value1,';')"/>
<xsl:value-of select="concat('margin-left:',$value1,';')"/>
</xsl:when>
<xsl:when test="number($count)=2">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('margin-top:',$value1,';')"/>
<xsl:value-of select="concat('margin-right:',$value2,';')"/>
<xsl:value-of select="concat('margin-bottom:',$value1,';')"/>
<xsl:value-of select="concat('margin-left:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=3">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('margin-top:',$value1,';')"/>
<xsl:value-of select="concat('margin-right:',$value2,';')"/>
<xsl:value-of select="concat('margin-bottom:',$value3,';')"/>
<xsl:value-of select="concat('margin-left:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=4">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value4">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="4"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('margin-top:',$value1,';')"/>
<xsl:value-of select="concat('margin-right:',$value2,';')"/>
<xsl:value-of select="concat('margin-bottom:',$value3,';')"/>
<xsl:value-of select="concat('margin-left:',$value4,';')"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-split-padding-style">
<xsl:param name="value"/>
<xsl:variable name="count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="number($count)=1">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('padding-top:',$value1,';')"/>
<xsl:value-of select="concat('padding-right:',$value1,';')"/>
<xsl:value-of select="concat('padding-bottom:',$value1,';')"/>
<xsl:value-of select="concat('padding-left:',$value1,';')"/>
</xsl:when>
<xsl:when test="number($count)=2">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('padding-top:',$value1,';')"/>
<xsl:value-of select="concat('padding-right:',$value2,';')"/>
<xsl:value-of select="concat('padding-bottom:',$value1,';')"/>
<xsl:value-of select="concat('padding-left:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=3">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('padding-top:',$value1,';')"/>
<xsl:value-of select="concat('padding-right:',$value2,';')"/>
<xsl:value-of select="concat('padding-bottom:',$value3,';')"/>
<xsl:value-of select="concat('padding-left:',$value2,';')"/>
</xsl:when>
<xsl:when test="number($count)=4">
<xsl:variable name="value1">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="1"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value2">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="2"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value3">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="3"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="value4">
<xsl:call-template name="altova:vector-get-value">
<xsl:with-param name="index" select="4"/>
<xsl:with-param name="vector" select="$value"/>
<xsl:with-param name="separator" select="' '"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('padding-top:',$value1,';')"/>
<xsl:value-of select="concat('padding-right:',$value2,';')"/>
<xsl:value-of select="concat('padding-bottom:',$value3,';')"/>
<xsl:value-of select="concat('padding-left:',$value4,';')"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:css-styles-output-fo-attributes">
<xsl:param name="css-styles"/>
<xsl:variable name="splitted-styles">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($css-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:css-styles-output-fo-attributes-helper">
<xsl:with-param name="css-styles" select="$splitted-styles"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:css-styles-output-fo-attributes-helper">
<xsl:param name="css-styles"/>
<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
<xsl:if test="string($property) and not(contains($property,';'))">
<xsl:choose>
<xsl:when test="$property='html-table-align'"/>
<xsl:when test="$property='vertical-align'">
<xsl:attribute name="display-align">
<xsl:variable name="value" select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
<xsl:choose>
<xsl:when test="$value='top'">before</xsl:when>
<xsl:when test="$value='middle'">center</xsl:when>
<xsl:when test="$value='bottom'">after</xsl:when>
<xsl:otherwise>auto</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="{$property}">
<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="altova:css-styles-output-fo-attributes-helper">
<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:css-styles-convert-length-to-twips">
<xsl:param name="css-length"/>
<xsl:param name="dpi" select="96"/>
<xsl:param name="em-height-pt" select="12"/>
<xsl:param name="parent-length-twips" select="0"/>
<xsl:choose>
<xsl:when test="contains($css-length,'cm')">
<xsl:value-of select="(number(substring-before($css-length,'cm')) * 1440) div 2.54"/>
</xsl:when>
<xsl:when test="contains($css-length,'mm')">
<xsl:value-of select="(number(substring-before($css-length,'mm')) * 1440) div 25.4"/>
</xsl:when>
<xsl:when test="contains($css-length,'in')">
<xsl:value-of select="number(substring-before($css-length,'in')) * 1440"/>
</xsl:when>
<xsl:when test="contains($css-length,'pc')">
<xsl:value-of select="number(substring-before($css-length,'pc')) * 240"/>
</xsl:when>
<xsl:when test="contains($css-length,'pt')">
<xsl:value-of select="number(substring-before($css-length,'pt')) * 20"/>
</xsl:when>
<xsl:when test="contains($css-length,'px')">
<xsl:value-of select="(number(substring-before($css-length,'px')) * 1440) div $dpi"/>
</xsl:when>
<xsl:when test="contains($css-length,'em')">
<xsl:value-of select="number(substring-before($css-length,'em')) * 20 * $em-height-pt"/>
</xsl:when>
<xsl:when test="contains($css-length,'ex')">
<xsl:value-of select="number(substring-before($css-length,'ex')) * 10 * $em-height-pt"/>
</xsl:when>
<xsl:when test="contains($css-length,'%')">
<xsl:value-of select="(number(substring-before($css-length,'%')) * $parent-length-twips) div 100"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-calc-entry-spanned-cols">
<xsl:param name="entry"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:when test="$entry/@colspan">
<xsl:value-of select="number($entry/@colspan) - 1"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-calc-entry-spanned-rows">
<xsl:param name="entry"/>
<xsl:choose>
<xsl:when test="$entry">
<xsl:choose>
<xsl:when test="$entry/@rowspan">
<xsl:value-of select="number($entry/@rowspan) - 1"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-get-table-user-styles"/>
<xsl:template name="altova:html-table-table-get-caption-user-styles"/>
<xsl:template name="altova:html-table-table-get-thead-user-styles">
<xsl:text>background-color:#d2d2d2;</xsl:text>
</xsl:template>
<xsl:template name="altova:html-table-table-get-tfoot-user-styles"/>
<xsl:template name="altova:html-table-table-get-tbody-user-styles"/>
<xsl:template name="altova:html-table-table-get-tr-user-styles">
<xsl:param name="rownum"/>
</xsl:template>
<xsl:template name="altova:html-table-table-get-td-user-styles">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
</xsl:template>
<xsl:template name="altova:html-table-table-get-th-user-styles">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:text>font-family:Arial;</xsl:text>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-table-effective-styles">
<xsl:param name="table"/>
<xsl:text>border-collapse:separate;</xsl:text>
<xsl:text>border-spacing:2px;</xsl:text>
<xsl:variable name="align" select="normalize-space(string($table/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('html-table-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="bgcolor" select="normalize-space(string($table/@bgcolor))"/>
<xsl:if test="string-length($bgcolor) > 0">
<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
</xsl:if>
<xsl:variable name="effective-border">
<xsl:variable name="border" select="normalize-space(string($table/@border))"/>
<xsl:choose>
<xsl:when test="string-length($border) > 0">
<xsl:value-of select="$border"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="effective-frame">
<xsl:variable name="frame" select="normalize-space(string($table/@frame))"/>
<xsl:choose>
<xsl:when test="string-length($frame) > 0">
<xsl:value-of select="$frame"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$effective-border='0'">void</xsl:when>
<xsl:otherwise>border</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$effective-frame='above' or $effective-frame='hsides' or $effective-frame='box' or $effective-frame='border'">
<xsl:text>border-top-style:solid;</xsl:text>
<xsl:value-of select="concat('border-top-width:',$effective-border,'px;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-top-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$effective-frame='rhs' or $effective-frame='vsides' or $effective-frame='box' or $effective-frame='border'">
<xsl:text>border-right-style:solid;</xsl:text>
<xsl:value-of select="concat('border-right-width:',$effective-border,'px;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-right-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$effective-frame='below' or $effective-frame='hsides' or $effective-frame='box' or $effective-frame='border'">
<xsl:text>border-bottom-style:solid;</xsl:text>
<xsl:value-of select="concat('border-bottom-width:',$effective-border,'px;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-bottom-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$effective-frame='lhs' or $effective-frame='vsides' or $effective-frame='box' or $effective-frame='border'">
<xsl:text>border-left-style:solid;</xsl:text>
<xsl:value-of select="concat('border-left-width:',$effective-border,'px;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-left-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="cellspacing" select="normalize-space(string($table/@cellspacing))"/>
<xsl:if test="string-length($cellspacing) > 0">
<xsl:value-of select="concat('border-spacing:',$cellspacing,'px;')"/>
</xsl:if>
<xsl:variable name="height" select="normalize-space(string($table/@height))"/>
<xsl:if test="string-length($height) > 0">
<xsl:choose>
<xsl:when test="contains($height,'%')">
<xsl:value-of select="concat('height:',$height,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('height:',$height,'px;')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:variable name="width" select="normalize-space(string($table/@width))"/>
<xsl:if test="string-length($width) > 0">
<xsl:choose>
<xsl:when test="contains($width,'%')">
<xsl:value-of select="concat('width:',$width,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('width:',$width,'px;')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:for-each select="$table">
<xsl:call-template name="altova:html-table-table-get-table-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($table/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-table-align">
<xsl:param name="effective-styles"/>
<xsl:variable name="html-table-align">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'html-table-align'"/>
<xsl:with-param name="css-styles" select="string($effective-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="margin-left">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'margin-left'"/>
<xsl:with-param name="css-styles" select="string($effective-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="margin-right">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'margin-right'"/>
<xsl:with-param name="css-styles" select="string($effective-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$margin-left='auto' and $margin-right='auto'">center</xsl:when>
<xsl:when test="$margin-left='auto'">right</xsl:when>
<xsl:when test="$margin-right='auto'">left</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$html-table-align"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-caption-effective-styles">
<xsl:param name="caption"/>
<xsl:text>text-align:center;</xsl:text>
<xsl:variable name="align" select="normalize-space(string($caption/@align))"/>
<xsl:choose>
<xsl:when test="$align='top'">caption-side:top;</xsl:when>
<xsl:when test="$align='bottom'">caption-side:bottom;</xsl:when>
<xsl:otherwise>caption-side:top;</xsl:otherwise>
</xsl:choose>
<xsl:variable name="user-styles">
<xsl:for-each select="$caption">
<xsl:call-template name="altova:html-table-table-get-caption-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($caption/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-thead-effective-styles">
<xsl:param name="thead"/>
<xsl:variable name="align" select="normalize-space(string($thead/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('text-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="valign" select="normalize-space(string($thead/@valign))"/>
<xsl:if test="string-length($valign) > 0">
<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:for-each select="$thead">
<xsl:call-template name="altova:html-table-table-get-thead-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($thead/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-tfoot-effective-styles">
<xsl:param name="tfoot"/>
<xsl:variable name="align" select="normalize-space(string($tfoot/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('text-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="valign" select="normalize-space(string($tfoot/@valign))"/>
<xsl:if test="string-length($valign) > 0">
<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:for-each select="$tfoot">
<xsl:call-template name="altova:html-table-table-get-tfoot-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($tfoot/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-tbody-effective-styles">
<xsl:param name="tbody"/>
<xsl:variable name="align" select="normalize-space(string($tbody/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('text-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="valign" select="normalize-space(string($tbody/@valign))"/>
<xsl:if test="string-length($valign) > 0">
<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:for-each select="$tbody">
<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($tbody/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-row-effective-styles">
<xsl:param name="rownum"/>
<xsl:param name="row"/>
<xsl:variable name="align" select="normalize-space(string($row/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('text-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="bgcolor" select="normalize-space(string($row/@bgcolor))"/>
<xsl:if test="string-length($bgcolor) > 0">
<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
</xsl:if>
<xsl:variable name="valign" select="normalize-space(string($row/@valign))"/>
<xsl:if test="string-length($valign) > 0">
<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
</xsl:if>
<xsl:variable name="height" select="normalize-space(string($row/@height))"/>
<xsl:if test="string($height)">
<xsl:choose>
<xsl:when test="contains($height,'%')">
<xsl:value-of select="concat('height:',$height,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('height:',$height,'px;')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:for-each select="$row">
<xsl:call-template name="altova:html-table-table-get-tr-user-styles">
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:for-each>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($row/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-cell-effective-styles">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="is-first-table-row"/>
<xsl:param name="is-last-table-row"/>
<xsl:param name="row"/>
<xsl:param name="entry"/>
<xsl:param name="parent-user-styles"/>
<xsl:choose>
<xsl:when test="$entry/self::th">
<xsl:text>text-align:center;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>text-align:left;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="altova:css-styles-get-inherited-styles-for-table-cell">
<xsl:with-param name="css-styles" select="$parent-user-styles"/>
</xsl:call-template>
<xsl:text>padding-top:1px;</xsl:text>
<xsl:text>padding-right:1px;</xsl:text>
<xsl:text>padding-bottom:1px;</xsl:text>
<xsl:text>padding-left:1px;</xsl:text>
<xsl:text>vertical-align:middle;</xsl:text>
<xsl:if test="$entry/self::th">
<xsl:text>font-weight:bold;</xsl:text>
</xsl:if>
<xsl:variable name="cellpadding" select="normalize-space(string($row/ancestor::table[1]/@cellpadding))"/>
<xsl:if test="string($cellpadding)">
<xsl:value-of select="concat('padding-top:',$cellpadding,'px;')"/>
<xsl:value-of select="concat('padding-right:',$cellpadding,'px;')"/>
<xsl:value-of select="concat('padding-bottom:',$cellpadding,'px;')"/>
<xsl:value-of select="concat('padding-left:',$cellpadding,'px;')"/>
</xsl:if>
<xsl:variable name="effective-border">
<xsl:variable name="border" select="normalize-space(string($row/ancestor::table[1]/@border))"/>
<xsl:choose>
<xsl:when test="string-length($border) > 0">
<xsl:value-of select="$border"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="effective-frame">
<xsl:variable name="frame" select="normalize-space(string($row/ancestor::table[1]/@frame))"/>
<xsl:choose>
<xsl:when test="string-length($frame) > 0">
<xsl:value-of select="$frame"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$effective-border='0'">void</xsl:when>
<xsl:otherwise>border</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="effective-rules">
<xsl:variable name="rules" select="normalize-space(string($row/ancestor::table[1]/@rules))"/>
<xsl:choose>
<xsl:when test="string-length($rules) > 0">
<xsl:value-of select="$rules"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$effective-border='0'">none</xsl:when>
<xsl:otherwise>all</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="show-border-top">
<xsl:choose>
<xsl:when test="$is-first-table-row">
<xsl:choose>
<xsl:when test="$effective-frame='above'">1</xsl:when>
<xsl:when test="$effective-frame='hsides'">1</xsl:when>
<xsl:when test="$effective-frame='box'">1</xsl:when>
<xsl:when test="$effective-frame='border'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$effective-rules='all'">1</xsl:when>
<xsl:when test="$effective-rules='rows'">1</xsl:when>
<xsl:when test="$effective-rules='groups'">
<xsl:choose>
<xsl:when test="$rownum=1">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$show-border-top='1'">
<xsl:text>border-top-style:solid;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-top-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="show-border-right">
<xsl:choose>
<xsl:when test="$colnum=$col-count">
<xsl:choose>
<xsl:when test="$effective-frame='rhs'">1</xsl:when>
<xsl:when test="$effective-frame='vsides'">1</xsl:when>
<xsl:when test="$effective-frame='box'">1</xsl:when>
<xsl:when test="$effective-frame='border'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$effective-rules='all'">1</xsl:when>
<xsl:when test="$effective-rules='cols'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$show-border-right='1'">
<xsl:text>border-right-style:solid;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-right-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="show-border-bottom">
<xsl:choose>
<xsl:when test="$is-last-table-row">
<xsl:choose>
<xsl:when test="$effective-frame='below'">1</xsl:when>
<xsl:when test="$effective-frame='hsides'">1</xsl:when>
<xsl:when test="$effective-frame='box'">1</xsl:when>
<xsl:when test="$effective-frame='border'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$effective-rules='all'">1</xsl:when>
<xsl:when test="$effective-rules='rows'">1</xsl:when>
<xsl:when test="$effective-rules='groups'">
<xsl:choose>
<xsl:when test="$rownum=$row-count">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$show-border-bottom='1'">
<xsl:text>border-bottom-style:solid;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-bottom-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="show-border-left">
<xsl:choose>
<xsl:when test="$colnum=1">
<xsl:choose>
<xsl:when test="$effective-frame='lhs'">1</xsl:when>
<xsl:when test="$effective-frame='vsides'">1</xsl:when>
<xsl:when test="$effective-frame='box'">1</xsl:when>
<xsl:when test="$effective-frame='border'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$effective-rules='all'">1</xsl:when>
<xsl:when test="$effective-rules='cols'">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$show-border-left='1'">
<xsl:text>border-left-style:solid;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>border-left-style:none;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="align" select="normalize-space(string($entry/@align))"/>
<xsl:if test="string-length($align) > 0">
<xsl:value-of select="concat('text-align:',$align,';')"/>
</xsl:if>
<xsl:variable name="bgcolor" select="normalize-space(string($entry/@bgcolor))"/>
<xsl:if test="string-length($bgcolor) > 0">
<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
</xsl:if>
<xsl:variable name="valign" select="normalize-space(string($entry/@valign))"/>
<xsl:if test="string-length($valign) > 0">
<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
</xsl:if>
<xsl:variable name="height" select="normalize-space(string($entry/@height))"/>
<xsl:if test="string($height)">
<xsl:choose>
<xsl:when test="contains($height,'%')">
<xsl:value-of select="concat('height:',$height,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('height:',$height,'px;')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:variable name="width" select="normalize-space(string($entry/@width))"/>
<xsl:if test="string($width)">
<xsl:choose>
<xsl:when test="contains($width,'%')">
<xsl:value-of select="concat('width:',$width,';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('width:',$width,'px;')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:variable name="user-styles">
<xsl:choose>
<xsl:when test="$entry/self::th">
<xsl:for-each select="$entry">
<xsl:call-template name="altova:html-table-table-get-th-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="$entry/self::td">
<xsl:for-each select="$entry">
<xsl:call-template name="altova:html-table-table-get-td-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:html-table-table-get-td-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($user-styles)"/>
</xsl:call-template>
<xsl:variable name="style" select="normalize-space(string($entry/@style))"/>
<xsl:if test="string-length($style) > 0">
<xsl:call-template name="altova:css-styles-split-shorthand-styles">
<xsl:with-param name="css-styles" select="string($style)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-is-first-table-row">
<xsl:param name="row"/>
<xsl:choose>
<xsl:when test="$row/parent::thead">
<xsl:choose>
<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$row/parent::tfoot">0</xsl:when>
<xsl:when test="$row/parent::tbody">
<xsl:choose>
<xsl:when test="$row/../preceding-sibling::thead">0</xsl:when>
<xsl:when test="$row/../preceding-sibling::tbody">0</xsl:when>
<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$row/parent::table">
<xsl:choose>
<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-is-last-table-row">
<xsl:param name="row"/>
<xsl:choose>
<xsl:when test="$row/parent::thead">0</xsl:when>
<xsl:when test="$row/parent::tfoot">
<xsl:choose>
<xsl:when test="$row/following-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$row/parent::tbody">
<xsl:choose>
<xsl:when test="$row/../preceding-sibling::tfoot">0</xsl:when>
<xsl:when test="$row/../following-sibling::tbody">0</xsl:when>
<xsl:when test="$row/following-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$row/parent::table">
<xsl:choose>
<xsl:when test="$row/following-sibling::tr">0</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-count">
<xsl:param name="table"/>
<xsl:variable name="col-count">
<xsl:choose>
<xsl:when test="$table/tr[1]">
<xsl:call-template name="altova:html-table-table-calc-col-count-row">
<xsl:with-param name="row" select="$table/tr[1]"/>
<xsl:with-param name="rowinfo" select="''"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="($table/thead|$table/tfoot|$table/tbody)[1]">
<xsl:call-template name="altova:html-table-table-calc-col-count-tbody">
<xsl:with-param name="tbody" select="($table/thead|$table/tfoot|$table/tbody)[1]"/>
<xsl:with-param name="col-count-max" select="number($col-count)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$col-count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-count-tbody">
<xsl:param name="tbody"/>
<xsl:param name="col-count-max"/>
<xsl:variable name="col-count">
<xsl:call-template name="altova:html-table-table-calc-col-count-row">
<xsl:with-param name="row" select="$tbody/tr[1]"/>
<xsl:with-param name="rowinfo" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="new-col-count-max">
<xsl:choose>
<xsl:when test="$col-count-max >= number($col-count)">
<xsl:value-of select="$col-count-max"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$col-count"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="next-tbody" select="($tbody/following-sibling::thead|$tbody/following-sibling::tfoot|$tbody/following-sibling::tbody)[1]"/>
<xsl:choose>
<xsl:when test="$next-tbody">
<xsl:call-template name="altova:html-table-table-calc-col-count-tbody">
<xsl:with-param name="tbody" select="$next-tbody"/>
<xsl:with-param name="col-count-max" select="number($new-col-count-max)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$new-col-count-max"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-count-row">
<xsl:param name="row"/>
<xsl:param name="rowinfo"/>
<xsl:variable name="rowinfo-count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$rowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="first-entry" select="($row/td|$row/th)[1]"/>
<xsl:variable name="nextrowinfo">
<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
<xsl:with-param name="entry" select="$first-entry"/>
<xsl:with-param name="pos" select="1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="number($rowinfo-count) div 2"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$row/following-sibling::tr[1]">
<xsl:call-template name="altova:html-table-table-calc-col-count-row">
<xsl:with-param name="row" select="$row/following-sibling::tr[1]"/>
<xsl:with-param name="rowinfo" select="$nextrowinfo"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="nextrowinfo-count">
<xsl:call-template name="altova:vector-count">
<xsl:with-param name="vector" select="$nextrowinfo"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="number($nextrowinfo-count) div 2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-generate-table-matrix">
<xsl:param name="tbody"/>
<xsl:param name="col-count"/>
<xsl:variable name="rowinfo">
<xsl:call-template name="altova:vector-append">
<xsl:with-param name="count" select="$col-count * 2"/>
<xsl:with-param name="value" select="'0'"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-generate-table-matrix-row">
<xsl:with-param name="row" select="$tbody/tr[1]"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:html-table-table-generate-table-matrix-row">
<xsl:param name="row"/>
<xsl:param name="rowinfo"/>
<xsl:param name="col-count"/>
<xsl:variable name="first-entry" select="($row/td|$row/th)[1]"/>
<xsl:call-template name="altova:html-table-table-generate-table-matrix-entry">
<xsl:with-param name="entry" select="$first-entry"/>
<xsl:with-param name="pos" select="1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
<xsl:variable name="nextrowinfo">
<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
<xsl:with-param name="entry" select="$first-entry"/>
<xsl:with-param name="pos" select="1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:for-each select="$row/following-sibling::tr[1]">
<xsl:call-template name="altova:html-table-table-generate-table-matrix-row">
<xsl:with-param name="row" select="."/>
<xsl:with-param name="rowinfo" select="$nextrowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
<xsl:template name="altova:html-table-table-generate-table-matrix-entry">
<xsl:param name="entry"/>
<xsl:param name="pos"/>
<xsl:param name="rowinfo"/>
<xsl:param name="col-count"/>
<xsl:variable name="dummy-cells">
<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:with-param name="pos" select="$pos"/>
<xsl:with-param name="endpos" select="-1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$dummy-cells"/>
<xsl:value-of select="'1'"/>
<xsl:variable name="colspan">
<xsl:call-template name="altova:html-table-calc-entry-spanned-cols">
<xsl:with-param name="entry" select="$entry"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:char-vector-append">
<xsl:with-param name="count" select="number($colspan)"/>
<xsl:with-param name="char" select="'4'"/>
</xsl:call-template>
<xsl:variable name="nextpos" select="$pos + string-length($dummy-cells) + 1 + number($colspan)"/>
<xsl:choose>
<xsl:when test="($entry/following-sibling::td|$entry/following-sibling::th)[1]">
<xsl:call-template name="altova:html-table-table-generate-table-matrix-entry">
<xsl:with-param name="entry" select="($entry/following-sibling::td|$entry/following-sibling::th)[1]"/>
<xsl:with-param name="pos" select="$nextpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:with-param name="pos" select="$nextpos"/>
<xsl:with-param name="endpos" select="$col-count + 1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
<xsl:param name="entry"/>
<xsl:param name="pos"/>
<xsl:param name="rowinfo"/>
<xsl:param name="col-count"/>
<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
<xsl:with-param name="pos" select="$pos"/>
<xsl:with-param name="endpos" select="-1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
<xsl:variable name="dummy-cells">
<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
<xsl:with-param name="pos" select="$pos"/>
<xsl:with-param name="endpos" select="-1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="colspan">
<xsl:call-template name="altova:html-table-calc-entry-spanned-cols">
<xsl:with-param name="entry" select="$entry"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="rowspan">
<xsl:call-template name="altova:html-table-calc-entry-spanned-rows">
<xsl:with-param name="entry" select="$entry"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:vector-append">
<xsl:with-param name="count" select="1"/>
<xsl:with-param name="value" select="concat('0;',$rowspan)"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
<xsl:call-template name="altova:vector-append">
<xsl:with-param name="count" select="number($colspan)"/>
<xsl:with-param name="value" select="concat('1;',$rowspan)"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
<xsl:variable name="nextpos" select="$pos + string-length($dummy-cells) + 1 + number($colspan)"/>
<xsl:choose>
<xsl:when test="($entry/following-sibling::td|$entry/following-sibling::th)[1]">
<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
<xsl:with-param name="entry" select="($entry/following-sibling::td|$entry/following-sibling::th)[1]"/>
<xsl:with-param name="pos" select="$nextpos"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
<xsl:with-param name="pos" select="$nextpos"/>
<xsl:with-param name="endpos" select="$col-count + 1"/>
<xsl:with-param name="rowinfo" select="$rowinfo"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-width-vector">
<xsl:param name="unit"/>
<xsl:param name="col-count"/>
<xsl:param name="table"/>
<xsl:param name="table-width-twips"/>
<xsl:variable name="col-width-vector">
<xsl:choose>
<xsl:when test="$table/tr">
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="$table"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="colnum" select="1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="count($table/tr)"/>
<xsl:with-param name="tbody" select="$table"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:vector-append">
<xsl:with-param name="count" select="$col-count"/>
<xsl:with-param name="value" select="0"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="col-width-vector" select="$col-width-vector"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="tbody" select="($table/thead|$table/tfoot|$table/tbody)[1]"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-width-vector-helper">
<xsl:param name="unit"/>
<xsl:param name="col-width-vector"/>
<xsl:param name="col-count"/>
<xsl:param name="tbody"/>
<xsl:param name="table-width-twips"/>
<xsl:choose>
<xsl:when test="$tbody">
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="new-col-width-vector">
<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="colnum" select="1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="count($tbody/tr)"/>
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="max-col-width-vector">
<xsl:call-template name="altova:vector-merge-vectors-using-max-value">
<xsl:with-param name="vector1" select="$col-width-vector"/>
<xsl:with-param name="vector2" select="$new-col-width-vector"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="col-width-vector" select="$max-col-width-vector"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="tbody" select="($tbody/following-sibling::thead|$tbody/following-sibling::tfoot|$tbody/following-sibling::tbody)[1]"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$col-width-vector"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-col-width-vector-helper2">
<xsl:param name="unit"/>
<xsl:param name="colnum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="tbody"/>
<xsl:param name="table-width-twips"/>
<xsl:param name="table-matrix"/>
<xsl:call-template name="altova:html-table-table-calc-effective-col-width">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
<xsl:text>;</xsl:text>
<xsl:if test="$colnum &lt; $col-count">
<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="colnum" select="$colnum + 1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-effective-col-width">
<xsl:param name="unit"/>
<xsl:param name="colnum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="tbody"/>
<xsl:param name="table-width-twips"/>
<xsl:param name="table-matrix"/>
<xsl:call-template name="altova:html-table-table-calc-effective-col-width-helper">
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="max-col-width" select="0"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-effective-col-width-helper">
<xsl:param name="max-col-width"/>
<xsl:param name="unit"/>
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="tbody"/>
<xsl:param name="table-width-twips"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="master-colnum">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="master-rownum">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="master-entry-type" select="substring($table-matrix,$col-count * ($master-rownum - 1) + $master-colnum,1)"/>
<xsl:variable name="master-row" select="$tbody/tr[position()=number($master-rownum)]"/>
<xsl:variable name="master-pos-in-xml">
<xsl:choose>
<xsl:when test="$master-entry-type='1'">
<xsl:value-of select="string-length(translate(substring($table-matrix,$col-count * ($master-rownum - 1) + 1,$colnum),'102345','1'))"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="master-entry" select="($master-row/td|$master-row/th)[position()=number($master-pos-in-xml)]"/>
<xsl:variable name="spanned-cols">
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$master-rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="effective-styles">
<xsl:call-template name="altova:html-table-table-calc-cell-effective-styles">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$master-rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="is-first-table-row" select="false()"/>
<xsl:with-param name="is-last-table-row" select="false()"/>
<xsl:with-param name="row" select="$master-row"/>
<xsl:with-param name="entry" select="$master-entry"/>
<xsl:with-param name="parent-user-styles" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="reversed-styles">
<xsl:call-template name="altova:vector-reverse">
<xsl:with-param name="vector" select="$effective-styles"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="width">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'width'"/>
<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="cell-width">
<xsl:choose>
<xsl:when test="$unit='twips'">
<xsl:call-template name="altova:css-styles-convert-length-to-twips">
<xsl:with-param name="css-length" select="$width"/>
<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
<xsl:with-param name="em-height-pt" select="12"/>
<xsl:with-param name="parent-length-twips" select="$table-width-twips"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$unit='percent'">
<xsl:choose>
<xsl:when test="contains($width,'%')">
<xsl:value-of select="substring-before($width,'%')"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="col-width" select="number($cell-width) div (number($spanned-cols) + 1)"/>
<xsl:variable name="new-max-col-width">
<xsl:choose>
<xsl:when test="number($col-width) > number($max-col-width)">
<xsl:value-of select="$col-width"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$max-col-width"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$rownum &lt; $row-count">
<xsl:call-template name="altova:html-table-table-calc-effective-col-width-helper">
<xsl:with-param name="max-col-width" select="number($new-max-col-width)"/>
<xsl:with-param name="unit" select="$unit"/>
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum + 1"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="tbody" select="$tbody"/>
<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($new-max-col-width)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-effective-row-height-twips">
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="row"/>
<xsl:param name="row-styles"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="reversed-styles">
<xsl:call-template name="altova:vector-reverse">
<xsl:with-param name="vector" select="$row-styles"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="height">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'height'"/>
<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="row-height-twips">
<xsl:call-template name="altova:css-styles-convert-length-to-twips">
<xsl:with-param name="css-length" select="$height"/>
<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
<xsl:with-param name="em-height-pt" select="12"/>
<xsl:with-param name="parent-length-twips" select="0"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-calc-effective-row-height-twips-helper">
<xsl:with-param name="max-row-height-twips" select="$row-height-twips"/>
<xsl:with-param name="colnum" select="1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="row" select="$row"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="altova:html-table-table-calc-effective-row-height-twips-helper">
<xsl:param name="max-row-height-twips"/>
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="row"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="master-colnum">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="master-rownum">
<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="master-entry-type" select="substring($table-matrix,$col-count * ($master-rownum - 1) + $master-colnum,1)"/>
<xsl:variable name="master-row" select="$row/../tr[position()=number($master-rownum)]"/>
<xsl:variable name="master-pos-in-xml">
<xsl:choose>
<xsl:when test="$master-entry-type='1'">
<xsl:value-of select="string-length(translate(substring($table-matrix,$col-count * ($master-rownum - 1) + 1,$colnum),'102345','1'))"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="master-entry" select="($master-row/td|$master-row/th)[position()=number($master-pos-in-xml)]"/>
<xsl:variable name="spanned-rows">
<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$master-rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="effective-styles">
<xsl:call-template name="altova:html-table-table-calc-cell-effective-styles">
<xsl:with-param name="colnum" select="$master-colnum"/>
<xsl:with-param name="rownum" select="$master-rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="is-first-table-row" select="false()"/>
<xsl:with-param name="is-last-table-row" select="false()"/>
<xsl:with-param name="row" select="$master-row"/>
<xsl:with-param name="entry" select="$master-entry"/>
<xsl:with-param name="parent-user-styles" select="''"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="reversed-styles">
<xsl:call-template name="altova:vector-reverse">
<xsl:with-param name="vector" select="$effective-styles"/>
<xsl:with-param name="separator" select="';'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="height">
<xsl:call-template name="altova:css-styles-get-property">
<xsl:with-param name="property" select="'height'"/>
<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="cell-height-twips">
<xsl:call-template name="altova:css-styles-convert-length-to-twips">
<xsl:with-param name="css-length" select="$height"/>
<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
<xsl:with-param name="em-height-pt" select="12"/>
<xsl:with-param name="parent-length-twips" select="0"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="row-height-twips" select="number($cell-height-twips) div (number($spanned-rows) + 1)"/>
<xsl:variable name="new-max-row-height-twips">
<xsl:choose>
<xsl:when test="number($row-height-twips) > number($max-row-height-twips)">
<xsl:value-of select="$row-height-twips"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$max-row-height-twips"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$colnum &lt; $col-count">
<xsl:call-template name="altova:html-table-table-calc-effective-row-height-twips-helper">
<xsl:with-param name="max-row-height-twips" select="number($new-max-row-height-twips)"/>
<xsl:with-param name="colnum" select="$colnum + 1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="row" select="$row"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="round($new-max-row-height-twips)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:html-table-table-output-table">
<xsl:param name="table"/>
<table>
<xsl:copy-of select="$table/@id|$table/@class|$table/@lang|$table/@dir|$table/@title|$table/@onclick|$table/@ondblclick|$table/@onmousedown|$table/@onmouseup|$table/@onmouseover|$table/@onmousemove|$table/@onmouseout|$table/@onkeypress|$table/@onkeydown|$table/@onkeyup|$table/@bgcolor|$table/@frame|$table/@rules|$table/@border|$table/@cellspacing|$table/@cellpadding|$table/@summary|$table/@align|$table/@width|$table/@height"/>
<xsl:variable name="user-styles">
<xsl:for-each select="$table">
<xsl:call-template name="altova:html-table-table-get-table-user-styles"/>
</xsl:for-each>
</xsl:variable>
<xsl:if test="string($user-styles) or $table/@style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,string($table/@style))"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="col-count">
<xsl:call-template name="altova:html-table-table-calc-col-count">
<xsl:with-param name="table" select="$table"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-output-caption">
<xsl:with-param name="table" select="$table"/>
</xsl:call-template>
<xsl:call-template name="altova:html-table-table-output-thead">
<xsl:with-param name="table" select="$table"/>
<xsl:with-param name="col-count" select="number($col-count)"/>
</xsl:call-template>
<xsl:call-template name="altova:html-table-table-output-tfoot">
<xsl:with-param name="table" select="$table"/>
<xsl:with-param name="col-count" select="number($col-count)"/>
</xsl:call-template>
<xsl:call-template name="altova:html-table-table-output-tbody">
<xsl:with-param name="table" select="$table"/>
<xsl:with-param name="col-count" select="number($col-count)"/>
</xsl:call-template>
</table>
</xsl:template>
<xsl:template name="altova:html-table-table-output-caption">
<xsl:param name="table"/>
<xsl:for-each select="$table/caption">
<caption>
<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align"/>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-caption-user-styles"/>
</xsl:variable>
<xsl:if test="string($user-styles) or @style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,@style)"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="."/>
</caption>
</xsl:for-each>
</xsl:template>
<xsl:template name="altova:html-table-table-output-thead">
<xsl:param name="table"/>
<xsl:param name="col-count"/>
<xsl:for-each select="$table/thead">
<thead>
<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-thead-user-styles"/>
</xsl:variable>
<xsl:if test="string($user-styles) or @style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,@style)"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-output-rows">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</thead>
</xsl:for-each>
</xsl:template>
<xsl:template name="altova:html-table-table-output-tfoot">
<xsl:param name="table"/>
<xsl:param name="col-count"/>
<xsl:for-each select="$table/tfoot">
<tfoot>
<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-tfoot-user-styles"/>
</xsl:variable>
<xsl:if test="string($user-styles) or @style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,@style)"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-output-rows">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</tfoot>
</xsl:for-each>
</xsl:template>
<xsl:template name="altova:html-table-table-output-tbody">
<xsl:param name="table"/>
<xsl:param name="col-count"/>
<xsl:for-each select="$table/tbody">
<tbody>
<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
</xsl:variable>
<xsl:if test="string($user-styles) or @style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,@style)"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-output-rows">
<xsl:with-param name="tbody" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</tbody>
</xsl:for-each>
<xsl:if test="$table/tr">
<tbody>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
</xsl:variable>
<xsl:if test="string($user-styles)">
<xsl:attribute name="style">
<xsl:value-of select="$user-styles"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="table-matrix">
<xsl:call-template name="altova:html-table-table-generate-table-matrix">
<xsl:with-param name="tbody" select="$table"/>
<xsl:with-param name="col-count" select="$col-count"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="altova:html-table-table-output-rows">
<xsl:with-param name="tbody" select="$table"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</tbody>
</xsl:if>
</xsl:template>
<xsl:template name="altova:html-table-table-output-rows">
<xsl:param name="tbody"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="table-matrix"/>
<xsl:for-each select="$tbody/tr">
<tr>
<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@bgcolor|@align|@char|@charoff|@valign|@height"/>
<xsl:variable name="user-styles">
<xsl:call-template name="altova:html-table-table-get-tr-user-styles">
<xsl:with-param name="rownum" select="position()"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string($user-styles) or @style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,@style)"/>
</xsl:attribute>
</xsl:if>
<xsl:call-template name="altova:html-table-table-output-cells">
<xsl:with-param name="colnum" select="1"/>
<xsl:with-param name="rownum" select="position()"/>
<xsl:with-param name="row" select="."/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</tr>
</xsl:for-each>
</xsl:template>
<xsl:template name="altova:html-table-table-output-cells">
<xsl:param name="colnum"/>
<xsl:param name="rownum"/>
<xsl:param name="row"/>
<xsl:param name="col-count"/>
<xsl:param name="row-count"/>
<xsl:param name="table-matrix"/>
<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
<xsl:variable name="pos-in-xml">
<xsl:choose>
<xsl:when test="$entry-type='1'">
<xsl:value-of select="string-length(translate(substring($table-matrix,$rowstart+1,$colnum),'102345','1'))"/>
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="entry" select="($row/td|$row/th)[position()=number($pos-in-xml)]"/>
<xsl:if test="$entry-type='1' or $entry-type='2'">
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="$entry/self::th">th</xsl:when>
<xsl:otherwise>td</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$name}">
<xsl:copy-of select="$entry/@id|$entry/@class|$entry/@lang|$entry/@dir|$entry/@title|$entry/@onclick|$entry/@ondblclick|$entry/@onmousedown|$entry/@onmouseup|$entry/@onmouseover|$entry/@onmousemove|$entry/@onmouseout|$entry/@onkeypress|$entry/@onkeydown|$entry/@onkeyup|$entry/@bgcolor|$entry/@align|$entry/@char|$entry/@charoff|$entry/@valign|$entry/@headers|$entry/@scope|$entry/@abbr|$entry/@axis|$entry/@rowspan|$entry/@colspan|$entry/@nowrap|$entry/@width|$entry/@height"/>
<xsl:variable name="user-styles">
<xsl:choose>
<xsl:when test="$entry/self::th">
<xsl:for-each select="$entry">
<xsl:call-template name="altova:html-table-table-get-th-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:when test="$entry/self::td">
<xsl:for-each select="$entry">
<xsl:call-template name="altova:html-table-table-get-td-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="altova:html-table-table-get-td-user-styles">
<xsl:with-param name="colnum" select="$colnum"/>
<xsl:with-param name="rownum" select="$rownum"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="string($user-styles) or $entry/@style">
<xsl:attribute name="style">
<xsl:value-of select="concat($user-styles,string($entry/@style))"/>
</xsl:attribute>
</xsl:if>
<xsl:variable name="value">
<xsl:for-each select="$entry">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:variable>
<xsl:if test="string-length($value)=0">
<xsl:text>&#x200B;</xsl:text>
</xsl:if>
<xsl:copy-of select="$value"/>
</xsl:element>
</xsl:if>
<xsl:if test="$colnum &lt; $col-count">
<xsl:call-template name="altova:html-table-table-output-cells">
<xsl:with-param name="colnum" select="$colnum + 1"/>
<xsl:with-param name="rownum" select="$rownum"/>
<xsl:with-param name="row" select="$row"/>
<xsl:with-param name="col-count" select="$col-count"/>
<xsl:with-param name="row-count" select="$row-count"/>
<xsl:with-param name="table-matrix" select="$table-matrix"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="table">
<xsl:call-template name="altova:html-table-table-output-table">
<xsl:with-param name="table" select="."/>
</xsl:call-template>
</xsl:template>
<xsl:function name="altova:GetChartYValuesForSingleSeries">
<xsl:param name="seqCategoryLeafPos" as="node()*"/>
<xsl:param name="nodeSeriesLeafPos" as="node()"/>
<xsl:param name="bValuesInCategory" as="xs:boolean"/>
<xsl:for-each select="$seqCategoryLeafPos">
<xsl:element name="altova:Value">
<xsl:value-of select="altova:GetChartYValueForSingleSeriesPos($nodeSeriesLeafPos, ., $bValuesInCategory)"/>
</xsl:element>
</xsl:for-each>
</xsl:function>
<xsl:function name="altova:GetChartYValueForSingleSeriesPos">
<xsl:param name="nodeSeriesLeafPos" as="node()"/>
<xsl:param name="nodeCategoryLeafPos" as="node()"/>
<xsl:param name="bValuesInCategory" as="xs:boolean"/>
<xsl:variable name="altova:seqCategoryContextIds" select="$nodeCategoryLeafPos/altova:Context/@altova:ContextId" as="xs:string*"/>
<xsl:variable name="altova:seqSeriesContextIds" select="$nodeSeriesLeafPos/altova:Context/@altova:ContextId" as="xs:string*"/>
<xsl:variable name="altova:sCommonContextId" select="for $i in $altova:seqCategoryContextIds return if (some $j in $altova:seqSeriesContextIds satisfies $i eq $j) then $i else ()" as="xs:string*"/>
<xsl:choose>
<xsl:when test="count($altova:sCommonContextId) gt 1">
<xsl:message select="concat('Found several values instead of a single one (contexts: ', string-join($altova:sCommonContextId, ', '), ').')" terminate="yes"/>
</xsl:when>
<xsl:when test="count($altova:sCommonContextId) lt 1">
<xsl:message select="concat('XBRL Chart: Info: No value found for position labeled &quot;', $nodeCategoryLeafPos/@altova:sLabel, '&quot;')" terminate="no"/>
<xsl:sequence select="'altova:no-value'"/>
</xsl:when>
<xsl:when test="$bValuesInCategory">
<xsl:sequence select="xs:string($nodeCategoryLeafPos/altova:Context[@altova:ContextId eq $altova:sCommonContextId]/@altova:Value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="xs:string($nodeSeriesLeafPos/altova:Context[@altova:ContextId eq $altova:sCommonContextId]/@altova:Value)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="altova:GetChartLabelForPos" as="xs:string">
<xsl:param name="nodeParam" as="node()"/>
<xsl:value-of select="string-join($nodeParam/ancestor-or-self::altova:Pos/@altova:sLabel, ' ')"/>
</xsl:function>
<xsl:function name="altova:convert-length-to-pixel" as="xs:decimal">
<xsl:param name="altova:length"/>
<xsl:variable name="normLength" select="normalize-space($altova:length)"/>
<xsl:choose>
<xsl:when test="ends-with($normLength, 'px')">
<xsl:value-of select="substring-before($normLength, 'px')"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'in')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'in')) * $altova:nPxPerIn"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'cm')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'cm')) * $altova:nPxPerIn div 2.54"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'mm')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'mm')) * $altova:nPxPerIn div 25.4"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'pt')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'pt')) * $altova:nPxPerIn div 72.0"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'pc')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'pc')) * $altova:nPxPerIn div 6.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$normLength"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="altova:convert-length-to-mm" as="xs:decimal">
<xsl:param name="altova:length"/>
<xsl:variable name="normLength" select="normalize-space($altova:length)"/>
<xsl:choose>
<xsl:when test="ends-with($normLength, 'px')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'px')) div $altova:nPxPerIn * 25.4"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'in')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'in')) * 25.4"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'cm')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'cm')) * 10"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'mm')">
<xsl:value-of select="substring-before($normLength, 'mm') "/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'pt')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'pt')) * 25.4 div 72.0"/>
</xsl:when>
<xsl:when test="ends-with($normLength, 'pc')">
<xsl:value-of select="xs:decimal(substring-before($normLength, 'pc')) * 25.4 div 6.0"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number($normLength) div $altova:nPxPerIn * 25.4"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
</xsl:stylesheet>
(3-3/4)