Project

Profile

Help

Bug #4478 ยป problematicXSLTFile.txt

Pranay Deshpande, 2020-03-11 08:33

 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--Designed and generated by Altova StyleVision Enterprise Edition 2020 sp1 - see http://www.altova.com/stylevision for more information.-->
3
<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">
4
	<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"/>
5
	<xsl:character-map name="spaces">
6
		<xsl:output-character character="&#160;" string="&amp;#160;"/>
7
	</xsl:character-map>
8
	<xsl:param name="altova:bGeneratingFromPxf" select="false()"/>
9
	<xsl:param name="altova:bGeneratingMime" as="xs:boolean" select="false()"/>
10
	<xsl:param name="altova:execution-guid" as="xs:string">
11
		<xsl:sequence select="altovaext:generate-guid()" use-when="function-available('altovaext:generate-guid', 0)"/>
12
		<xsl:sequence select="'00000000-0000-0000-0000-NON0UNIQUE00'" use-when="not(function-available('altovaext:generate-guid', 0))"/>
13
	</xsl:param>
14
	<xsl:param name="SV_OutputFormat" select="'HTML'"/>
15
	<xsl:param name="SV_BaseOutputFileName" as="xs:string?">
16
		<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;)"/>
17
	</xsl:param>
18
	<xsl:param name="SV_GeneratedFileNamePrefix" select="if ( $SV_BaseOutputFileName ) then $SV_BaseOutputFileName else &apos;usps_850_v4&apos;" as="xs:string?"/>
19
	<xsl:variable name="XML" select="/"/>
20
	<xsl:variable name="altova:nPxPerIn" select="96"/>
21
	<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'"/>
22
	<xsl:variable name="altova:CssImages" select="()"/>
23
	<xsl:template match="/">
24
		<xsl:call-template name="altova:Root"/>
25
	</xsl:template>
26
	<xsl:template name="altova:Root">
27
		<html>
28
			<head>
29
				<title/>
30
				<meta name="generator" content="Altova StyleVision Enterprise Edition 2020 sp1 (http://www.altova.com)"/>
31
				<meta http-equiv="X-UA-Compatible" content="IE=9"/>
32
				<style type="text/css">
33
					<xsl:comment>.header { color:#1e2125;
34
 }</xsl:comment>
35
				</style>
36
				<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>
37
				<xsl:comment>[if !IE]&gt;&lt;!</xsl:comment>
38
				<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>
39
				<xsl:comment>&lt;![endif]</xsl:comment>
40
				<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>
41
			</head>
42
			<body style="font-family:Arial; white-space:nowrap; " alink="#f26a21" link="#f26a21" vlink="#3c3c3c">
43
				<br/>
44
				<xsl:for-each select="$XML">
45
					<xsl:variable name="orderdate" select="substring-before(OrderRequestHeader/@orderDate, &apos;T&apos;)"/>
46
					<xsl:variable name="env" select="Message/MessageTenant"/>
47
					<xsl:for-each select="Message">
48
						<br/>
49
						<xsl:variable name="altova:table">
50
							<table style="border-collapse:collapse; empty-cells:hide; " align="center" cellpadding="5" cellspacing="1" width="50%">
51
								<xsl:variable name="altova:CurrContextGrid_0" select="."/>
52
								<xsl:variable name="altova:ColumnData"/>
53
								<tbody>
54
									<tr>
55
										<td>
56
											<xsl:variable name="altova:table">
57
												<table align="center" width="100%" altova:hide-rows="empty" altova:hide-cols="empty">
58
													<xsl:variable name="altova:CurrContextGrid_1" select="."/>
59
													<xsl:variable name="altova:ColumnData"/>
60
													<tbody valign="bottom">
61
														<tr>
62
															<td style="color:#323263; text-align:left; width:50%; " valign="bottom">
63
																<xsl:for-each select="cXML">
64
																	<xsl:for-each select="format-dateTime(@timestamp, &apos;[M01].[D01].[Y0001]&apos;)">
65
																		<span style="font-family:Consolas; font-size:8pt; font-style:italic; ">
66
																			<xsl:choose>
67
																				<xsl:when test=". instance of element() or . instance of document-node()">
68
																					<xsl:apply-templates/>
69
																				</xsl:when>
70
																				<xsl:otherwise>
71
																					<xsl:value-of select="."/>
72
																				</xsl:otherwise>
73
																			</xsl:choose>
74
																		</span>
75
																	</xsl:for-each>
76
																</xsl:for-each>
77
															</td>
78
															<td style="color:#323263; text-align:right; width:50%; " valign="bottom">
79
																<xsl:for-each select="cXML">
80
																	<xsl:for-each select="format-dateTime(@timestamp, &apos;[H01]:[m01]:[s01] [P]&apos;)">
81
																		<span style="font-family:Consolas; font-size:8pt; font-style:italic; ">
82
																			<xsl:choose>
83
																				<xsl:when test=". instance of element() or . instance of document-node()">
84
																					<xsl:apply-templates/>
85
																				</xsl:when>
86
																				<xsl:otherwise>
87
																					<xsl:value-of select="."/>
88
																				</xsl:otherwise>
89
																			</xsl:choose>
90
																		</span>
91
																	</xsl:for-each>
92
																</xsl:for-each>
93
															</td>
94
														</tr>
95
													</tbody>
96
												</table>
97
											</xsl:variable>
98
											<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=""/>
99
											<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
100
											<xsl:variable name="altova:generate-cols" as="xs:boolean*" xpath-default-namespace="">
101
												<xsl:choose>
102
													<xsl:when test="$altova:table/table/@altova:hide-cols = 'empty'">
103
														<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 ) )"/>
104
													</xsl:when>
105
													<xsl:otherwise>
106
														<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 ) ) )"/>
107
													</xsl:otherwise>
108
												</xsl:choose>
109
											</xsl:variable>
110
											<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
111
												<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
112
													<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
113
													<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
114
												</xsl:apply-templates>
115
											</xsl:variable>
116
											<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
117
										</td>
118
									</tr>
119
									<tr>
120
										<td>
121
											<xsl:variable name="altova:table">
122
												<table style="border-collapse:collapse; empty-cells:hide; " align="center" bgcolor="#323263" cellpadding="5" cellspacing="1" width="100%">
123
													<xsl:variable name="altova:CurrContextGrid_2" select="."/>
124
													<xsl:variable name="altova:ColumnData"/>
125
													<tbody>
126
														<tr style="background-color:#323263; color:#ffffff; white-space:nowrap; " valign="middle">
127
															<td style="color:#ffffff; text-align:center; width:15%; " valign="bottom">
128
																<xsl:for-each select="MessagePartnerName">
129
																	<span style="font-family:Arial Black; font-size:36pt; ">
130
																		<xsl:apply-templates/>
131
																	</span>
132
																</xsl:for-each>
133
															</td>
134
															<td style="text-align:center; width:30%; "/>
135
															<td style="text-align:center; "/>
136
															<td style="width:15%; "/>
137
															<td style="text-align:right; width:30%; " valign="middle">
138
																<xsl:for-each select="cXML">
139
																	<xsl:for-each select="Request">
140
																		<xsl:for-each select="OrderRequest">
141
																			<xsl:for-each select="OrderRequestHeader">
142
																				<xsl:for-each select="Total">
143
																					<xsl:for-each select="Money">
144
																						<span style="font-family:Arial Black; font-size:24pt; ">
145
																							<xsl:text>$</xsl:text>
146
																						</span>
147
																						<span style="font-family:Arial Black; font-size:24pt; ">
148
																							<xsl:variable name="altova:seqContentStrings_3">
149
																								<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
150
																							</xsl:variable>
151
																							<xsl:variable name="altova:sContent_3" select="string($altova:seqContentStrings_3)"/>
152
																							<xsl:value-of select="$altova:sContent_3"/>
153
																						</span>
154
																					</xsl:for-each>
155
																				</xsl:for-each>
156
																			</xsl:for-each>
157
																		</xsl:for-each>
158
																	</xsl:for-each>
159
																</xsl:for-each>
160
															</td>
161
															<td/>
162
														</tr>
163
														<tr style="background-color:#fcfafa; color:#3c3c3c; white-space:nowrap; " valign="middle">
164
															<td style="text-align:left; text-indent:25px; width:15%; ">
165
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
166
																	<xsl:text>PO Number</xsl:text>
167
																</span>
168
															</td>
169
															<td style="text-align:left; width:30%; ">
170
																<xsl:for-each select="cXML">
171
																	<xsl:for-each select="Request">
172
																		<xsl:for-each select="OrderRequest">
173
																			<xsl:for-each select="OrderRequestHeader">
174
																				<xsl:for-each select="@orderID">
175
																					<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
176
																						<xsl:value-of select="string(.)"/>
177
																					</span>
178
																				</xsl:for-each>
179
																			</xsl:for-each>
180
																		</xsl:for-each>
181
																	</xsl:for-each>
182
																</xsl:for-each>
183
															</td>
184
															<td style="text-align:right; "/>
185
															<td style="text-align:left; width:15%; ">
186
																<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
187
																	<xsl:text>Contact</xsl:text>
188
																</span>
189
															</td>
190
															<td style="text-align:left; width:30%; ">
191
																<xsl:for-each select="cXML">
192
																	<xsl:for-each select="Request">
193
																		<xsl:for-each select="OrderRequest">
194
																			<xsl:for-each select="OrderRequestHeader">
195
																				<xsl:for-each select="Contact">
196
																					<xsl:for-each select="Name">
197
																						<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
198
																							<xsl:apply-templates/>
199
																						</span>
200
																					</xsl:for-each>
201
																				</xsl:for-each>
202
																			</xsl:for-each>
203
																		</xsl:for-each>
204
																	</xsl:for-each>
205
																</xsl:for-each>
206
															</td>
207
															<td style="text-align:right; "/>
208
														</tr>
209
														<tr style="background-color:#EBEBEB; color:#3c3c3c; white-space:nowrap; " valign="middle">
210
															<td style="text-align:left; text-indent:25px; width:15%; ">
211
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
212
																	<xsl:text>PO Date</xsl:text>
213
																</span>
214
															</td>
215
															<td style="text-align:left; width:30%; ">
216
																<xsl:for-each select="cXML">
217
																	<xsl:for-each select="Request">
218
																		<xsl:for-each select="OrderRequest">
219
																			<xsl:for-each select="OrderRequestHeader">
220
																				<xsl:for-each select="@orderDate">
221
																					<xsl:for-each select="format-dateTime(., &apos;[M01]/[D01]/[Y0001]&apos;)">
222
																						<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
223
																							<xsl:choose>
224
																								<xsl:when test=". instance of element() or . instance of document-node()">
225
																									<xsl:apply-templates/>
226
																								</xsl:when>
227
																								<xsl:otherwise>
228
																									<xsl:value-of select="."/>
229
																								</xsl:otherwise>
230
																							</xsl:choose>
231
																						</span>
232
																					</xsl:for-each>
233
																				</xsl:for-each>
234
																			</xsl:for-each>
235
																		</xsl:for-each>
236
																	</xsl:for-each>
237
																</xsl:for-each>
238
															</td>
239
															<td style="text-align:right; "/>
240
															<td style="text-align:left; width:15%; ">
241
																<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
242
																	<xsl:text>Email</xsl:text>
243
																</span>
244
															</td>
245
															<td style="text-align:left; width:30%; ">
246
																<xsl:for-each select="cXML">
247
																	<xsl:for-each select="Request">
248
																		<xsl:for-each select="OrderRequest">
249
																			<xsl:for-each select="OrderRequestHeader">
250
																				<xsl:for-each select="Contact">
251
																					<xsl:for-each select="Email">
252
																						<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
253
																							<xsl:apply-templates/>
254
																						</span>
255
																					</xsl:for-each>
256
																				</xsl:for-each>
257
																			</xsl:for-each>
258
																		</xsl:for-each>
259
																	</xsl:for-each>
260
																</xsl:for-each>
261
															</td>
262
															<td style="text-align:right; "/>
263
														</tr>
264
														<tr style="background-color:#fcfafa; color:#3c3c3c; white-space:nowrap; " valign="middle">
265
															<td style="text-align:left; text-indent:25px; width:15%; ">
266
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
267
																	<xsl:text>PO Type</xsl:text>
268
																</span>
269
															</td>
270
															<td style="text-align:left; width:30%; ">
271
																<xsl:for-each select="cXML">
272
																	<xsl:for-each select="Request">
273
																		<xsl:for-each select="OrderRequest">
274
																			<xsl:for-each select="OrderRequestHeader">
275
																				<xsl:for-each select="@type">
276
																					<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
277
																						<xsl:value-of select="string(.)"/>
278
																					</span>
279
																				</xsl:for-each>
280
																			</xsl:for-each>
281
																		</xsl:for-each>
282
																	</xsl:for-each>
283
																</xsl:for-each>
284
															</td>
285
															<td style="text-align:left; "/>
286
															<td style="text-align:left; width:15%; ">
287
																<span style="font-family:Consolas; font-size:12pt; font-style:italic; ">
288
																	<xsl:text>Phone</xsl:text>
289
																</span>
290
															</td>
291
															<td style="text-align:left; width:30%; ">
292
																<xsl:for-each select="cXML">
293
																	<xsl:for-each select="Request">
294
																		<xsl:for-each select="OrderRequest">
295
																			<xsl:for-each select="OrderRequestHeader">
296
																				<xsl:for-each select="Contact">
297
																					<xsl:for-each select="Phone">
298
																						<xsl:for-each select="TelephoneNumber">
299
																							<span style="font-family:Consolas; font-size:14pt; font-weight:bold; ">
300
																								<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)))"/>
301
																							</span>
302
																						</xsl:for-each>
303
																					</xsl:for-each>
304
																				</xsl:for-each>
305
																			</xsl:for-each>
306
																		</xsl:for-each>
307
																	</xsl:for-each>
308
																</xsl:for-each>
309
															</td>
310
															<td style="text-align:left; "/>
311
														</tr>
312
													</tbody>
313
												</table>
314
											</xsl:variable>
315
											<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=""/>
316
											<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
317
											<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
318
											<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
319
												<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
320
													<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
321
													<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
322
												</xsl:apply-templates>
323
											</xsl:variable>
324
											<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
325
										</td>
326
									</tr>
327
									<tr>
328
										<td>
329
											<xsl:variable name="altova:table">
330
												<table style="border-collapse:collapse; empty-cells:hide; " align="center" bgcolor="#3c3c3c" cellpadding="5" cellspacing="1" width="100%" altova:hide-rows="empty">
331
													<xsl:variable name="altova:CurrContextGrid_4" select="."/>
332
													<xsl:variable name="altova:ColumnData"/>
333
													<tbody valign="bottom">
334
														<tr style="color:#EBEBEB; ">
335
															<td style="color:#FFFFFF; text-indent:10px; width:15%; " valign="bottom">
336
																<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
337
																	<xsl:text>Bill To</xsl:text>
338
																</span>
339
															</td>
340
															<td style="color:#FFFFFF; text-align:left; width:45%; " valign="bottom">
341
																<xsl:for-each select="cXML">
342
																	<xsl:for-each select="Request">
343
																		<xsl:for-each select="OrderRequest">
344
																			<xsl:for-each select="OrderRequestHeader">
345
																				<xsl:for-each select="BillTo">
346
																					<xsl:for-each select="Address">
347
																						<xsl:for-each select="Name">
348
																							<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
349
																								<xsl:apply-templates/>
350
																							</span>
351
																						</xsl:for-each>
352
																					</xsl:for-each>
353
																				</xsl:for-each>
354
																			</xsl:for-each>
355
																		</xsl:for-each>
356
																	</xsl:for-each>
357
																</xsl:for-each>
358
															</td>
359
															<td style="color:#FFFFFF; width:5%; "/>
360
															<td style="color:#FFFFFF; width:15%; " valign="bottom">
361
																<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
362
																	<xsl:text>Id</xsl:text>
363
																</span>
364
															</td>
365
															<td style="color:#FFFFFF; text-align:left; width:40%; " valign="bottom">
366
																<xsl:for-each select="cXML">
367
																	<xsl:for-each select="Request">
368
																		<xsl:for-each select="OrderRequest">
369
																			<xsl:for-each select="OrderRequestHeader">
370
																				<xsl:for-each select="BillTo">
371
																					<xsl:for-each select="Address">
372
																						<xsl:for-each select="@addressID">
373
																							<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
374
																								<xsl:value-of select="string(.)"/>
375
																							</span>
376
																						</xsl:for-each>
377
																					</xsl:for-each>
378
																				</xsl:for-each>
379
																			</xsl:for-each>
380
																		</xsl:for-each>
381
																	</xsl:for-each>
382
																</xsl:for-each>
383
															</td>
384
															<td style="color:#FFFFFF; width:5%; "/>
385
														</tr>
386
													</tbody>
387
												</table>
388
											</xsl:variable>
389
											<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=""/>
390
											<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
391
											<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
392
											<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
393
												<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
394
													<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
395
													<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
396
												</xsl:apply-templates>
397
											</xsl:variable>
398
											<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
399
										</td>
400
									</tr>
401
									<tr>
402
										<td>
403
											<xsl:variable name="altova:table">
404
												<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">
405
													<xsl:variable name="altova:CurrContextGrid_5" select="."/>
406
													<xsl:variable name="altova:ColumnData"/>
407
													<tbody>
408
														<tr style="border-collapse:collapse; color:#EBEBEB; " valign="bottom">
409
															<td style="border-collapse:collapse; color:#FFFFFF; text-indent:10px; width:15%; " valign="bottom">
410
																<span style="font-family:Arial; font-size:10pt; font-style:italic; ">
411
																	<xsl:text>Ship To</xsl:text>
412
																</span>
413
															</td>
414
															<td style="border-collapse:collapse; color:#FFFFFF; text-align:left; width:30%; " valign="bottom">
415
																<xsl:for-each select="cXML">
416
																	<xsl:for-each select="Request">
417
																		<xsl:for-each select="OrderRequest">
418
																			<xsl:for-each select="OrderRequestHeader">
419
																				<xsl:for-each select="ShipTo">
420
																					<xsl:for-each select="Address">
421
																						<xsl:for-each select="PostalAddress">
422
																							<xsl:for-each select="DeliverTo">
423
																								<span style="font-family:Arial; font-size:16pt; font-weight:bold; ">
424
																									<xsl:apply-templates/>
425
																								</span>
426
																							</xsl:for-each>
427
																						</xsl:for-each>
428
																					</xsl:for-each>
429
																				</xsl:for-each>
430
																			</xsl:for-each>
431
																		</xsl:for-each>
432
																	</xsl:for-each>
433
																</xsl:for-each>
434
															</td>
435
															<td style="border-collapse:collapse; color:#FFFFFF; width:5%; "/>
436
															<td style="border-collapse:collapse; color:#FFFFFF; width:15%; "/>
437
															<td style="border-collapse:collapse; color:#FFFFFF; width:30%; "/>
438
															<td style="border-collapse:collapse; color:#FFFFFF; width:5%; "/>
439
														</tr>
440
														<tr style="background-color:#EBEBEB; border-collapse:collapse; color:#3c3c3c; " valign="middle">
441
															<td style="text-indent:25px; width:15%; ">
442
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
443
																	<xsl:text>Street</xsl:text>
444
																</span>
445
															</td>
446
															<td style="width:30%; ">
447
																<xsl:choose>
448
																	<xsl:when test="string-length(/Message/cXML/Request/OrderRequest/OrderRequestHeader/BillTo/Address/PostalAddress/Street[2]) &gt; 0">
449
																		<xsl:for-each select="cXML">
450
																			<xsl:for-each select="Request">
451
																				<xsl:for-each select="OrderRequest">
452
																					<xsl:for-each select="OrderRequestHeader">
453
																						<xsl:for-each select="ShipTo">
454
																							<xsl:for-each select="Address">
455
																								<xsl:for-each select="PostalAddress">
456
																									<xsl:for-each select="concat(Street[1],
457
codepoints-to-string(10),
458
Street[2])">
459
																										<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
460
																											<xsl:choose>
461
																												<xsl:when test=". instance of element() or . instance of document-node()">
462
																													<xsl:apply-templates/>
463
																												</xsl:when>
464
																												<xsl:otherwise>
465
																													<xsl:value-of select="."/>
466
																												</xsl:otherwise>
467
																											</xsl:choose>
468
																										</span>
469
																									</xsl:for-each>
470
																								</xsl:for-each>
471
																							</xsl:for-each>
472
																						</xsl:for-each>
473
																					</xsl:for-each>
474
																				</xsl:for-each>
475
																			</xsl:for-each>
476
																		</xsl:for-each>
477
																	</xsl:when>
478
																	<xsl:otherwise>
479
																		<xsl:for-each select="cXML">
480
																			<xsl:for-each select="Request">
481
																				<xsl:for-each select="OrderRequest">
482
																					<xsl:for-each select="OrderRequestHeader">
483
																						<xsl:for-each select="ShipTo">
484
																							<xsl:for-each select="Address">
485
																								<xsl:for-each select="PostalAddress">
486
																									<xsl:for-each select="Street[1]">
487
																										<span style="font-family:Consolas; font-weight:bold; ">
488
																											<xsl:apply-templates/>
489
																										</span>
490
																									</xsl:for-each>
491
																								</xsl:for-each>
492
																							</xsl:for-each>
493
																						</xsl:for-each>
494
																					</xsl:for-each>
495
																				</xsl:for-each>
496
																			</xsl:for-each>
497
																		</xsl:for-each>
498
																	</xsl:otherwise>
499
																</xsl:choose>
500
															</td>
501
															<td style="width:5%; "/>
502
															<td style="width:15%; "/>
503
															<td style="width:30%; "/>
504
															<td style="width:5%; "/>
505
														</tr>
506
														<tr style="background-color:#fcfafa; color:#3c3c3c; " valign="middle">
507
															<td style="text-indent:25px; width:15%; ">
508
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
509
																	<xsl:text>City</xsl:text>
510
																</span>
511
															</td>
512
															<td style="width:30%; ">
513
																<xsl:for-each select="cXML">
514
																	<xsl:for-each select="Request">
515
																		<xsl:for-each select="OrderRequest">
516
																			<xsl:for-each select="OrderRequestHeader">
517
																				<xsl:for-each select="ShipTo">
518
																					<xsl:for-each select="Address">
519
																						<xsl:for-each select="PostalAddress">
520
																							<xsl:for-each select="City">
521
																								<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
522
																									<xsl:apply-templates/>
523
																								</span>
524
																							</xsl:for-each>
525
																						</xsl:for-each>
526
																					</xsl:for-each>
527
																				</xsl:for-each>
528
																			</xsl:for-each>
529
																		</xsl:for-each>
530
																	</xsl:for-each>
531
																</xsl:for-each>
532
															</td>
533
															<td style="width:5%; "/>
534
															<td style="width:15%; ">
535
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
536
																	<xsl:text>State</xsl:text>
537
																</span>
538
															</td>
539
															<td style="text-align:left; width:30%; ">
540
																<xsl:for-each select="cXML">
541
																	<xsl:for-each select="Request">
542
																		<xsl:for-each select="OrderRequest">
543
																			<xsl:for-each select="OrderRequestHeader">
544
																				<xsl:for-each select="ShipTo">
545
																					<xsl:for-each select="Address">
546
																						<xsl:for-each select="PostalAddress">
547
																							<xsl:for-each select="State">
548
																								<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
549
																									<xsl:apply-templates/>
550
																								</span>
551
																							</xsl:for-each>
552
																						</xsl:for-each>
553
																					</xsl:for-each>
554
																				</xsl:for-each>
555
																			</xsl:for-each>
556
																		</xsl:for-each>
557
																	</xsl:for-each>
558
																</xsl:for-each>
559
															</td>
560
															<td style="width:5%; "/>
561
														</tr>
562
														<tr style="background-color:#EBEBEB; color:#3c3c3c; " valign="middle">
563
															<td style="text-indent:25px; width:15%; ">
564
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
565
																	<xsl:text>Postal</xsl:text>
566
																</span>
567
															</td>
568
															<td style="width:30%; ">
569
																<xsl:for-each select="cXML">
570
																	<xsl:for-each select="Request">
571
																		<xsl:for-each select="OrderRequest">
572
																			<xsl:for-each select="OrderRequestHeader">
573
																				<xsl:for-each select="ShipTo">
574
																					<xsl:for-each select="Address">
575
																						<xsl:for-each select="PostalAddress">
576
																							<xsl:for-each select="PostalCode">
577
																								<span style="font-family:Consolas; font-size:11pt; font-weight:bold; ">
578
																									<xsl:apply-templates/>
579
																								</span>
580
																							</xsl:for-each>
581
																						</xsl:for-each>
582
																					</xsl:for-each>
583
																				</xsl:for-each>
584
																			</xsl:for-each>
585
																		</xsl:for-each>
586
																	</xsl:for-each>
587
																</xsl:for-each>
588
															</td>
589
															<td style="width:5%; "/>
590
															<td style="width:15%; ">
591
																<span style="font-family:Consolas; font-size:11pt; font-style:italic; ">
592
																	<xsl:text>Country</xsl:text>
593
																</span>
594
															</td>
595
															<td style="width:30%; ">
596
																<xsl:for-each select="cXML">
597
																	<xsl:for-each select="Request">
598
																		<xsl:for-each select="OrderRequest">
599
																			<xsl:for-each select="OrderRequestHeader">
600
																				<xsl:for-each select="ShipTo">
601
																					<xsl:for-each select="Address">
602
																						<xsl:for-each select="PostalAddress">
603
																							<xsl:for-each select="Country">
604
																								<span style="font-family:Consolas; font-size:12pt; font-weight:bold; ">
605
																									<xsl:apply-templates/>
606
																								</span>
607
																							</xsl:for-each>
608
																						</xsl:for-each>
609
																					</xsl:for-each>
610
																				</xsl:for-each>
611
																			</xsl:for-each>
612
																		</xsl:for-each>
613
																	</xsl:for-each>
614
																</xsl:for-each>
615
															</td>
616
															<td style="width:5%; "/>
617
														</tr>
618
													</tbody>
619
												</table>
620
											</xsl:variable>
621
											<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=""/>
622
											<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
623
											<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
624
											<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
625
												<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
626
													<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
627
													<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
628
												</xsl:apply-templates>
629
											</xsl:variable>
630
											<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
631
										</td>
632
									</tr>
633
									<tr>
634
										<td>
635
											<xsl:variable name="altova:table">
636
												<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">
637
													<xsl:variable name="altova:CurrContextGrid_6" select="."/>
638
													<xsl:variable name="altova:ColumnData"/>
639
													<thead style="border-collapse:collapse; height:auto; " valign="bottom">
640
														<tr style="background-color:#E71921; background-size:auto; color:#ebebeb; font-family:Arial Narrow; font-size:12px; height:20px; white-space:nowrap; ">
641
															<th>
642
																<span style="font-family:Arial Narrow; font-size:12pt; ">
643
																	<xsl:text>Line </xsl:text>
644
																</span>
645
															</th>
646
															<th style="white-space:nowrap; width:auto; ">
647
																<span style="font-family:Arial Narrow; font-size:12pt; ">
648
																	<xsl:text>Qty</xsl:text>
649
																</span>
650
															</th>
651
															<th style="text-align:center; white-space:nowrap; width:auto; ">
652
																<span style="font-family:Arial Narrow; font-size:12pt; ">
653
																	<xsl:text>Unit</xsl:text>
654
																</span>
655
															</th>
656
															<th style="white-space:nowrap; width:auto; ">
657
																<span style="font-family:Arial Narrow; font-size:12pt; ">
658
																	<xsl:text>Unit Price</xsl:text>
659
																</span>
660
															</th>
661
															<th style="white-space:nowrap; width:auto; ">
662
																<span style="font-family:Arial Narrow; font-size:12pt; ">
663
																	<xsl:text>Supplier Part ID</xsl:text>
664
																</span>
665
															</th>
666
															<th style="white-space:nowrap; width:auto; ">
667
																<span style="background-color:transparent; color:#ebebeb; font-family:Arial Narrow; font-size:12pt; ">
668
																	<xsl:text>Line Total</xsl:text>
669
																</span>
670
															</th>
671
														</tr>
672
													</thead>
673
													<tbody style="border-bottom-color:gray; border-bottom-style:dashed; border-bottom-width:thin; border-top-color:gray; border-top-width:thin; ">
674
														<xsl:for-each select="cXML">
675
															<xsl:for-each select="Request">
676
																<xsl:for-each select="OrderRequest">
677
																	<xsl:for-each select="ItemOut">
678
																		<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; }">
679
																			<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
680
																				<xsl:for-each select="@lineNumber">
681
																					<span style="border-spacing:0; font-family:Consolas; ">
682
																						<xsl:value-of select="string(.)"/>
683
																					</span>
684
																				</xsl:for-each>
685
																			</td>
686
																			<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
687
																				<xsl:for-each select="@quantity">
688
																					<span>
689
																						<xsl:value-of select="string(.)"/>
690
																					</span>
691
																				</xsl:for-each>
692
																			</td>
693
																			<td style="text-align:center; white-space:nowrap; width:auto; " valign="middle">
694
																				<xsl:for-each select="ItemDetail">
695
																					<xsl:for-each select="UnitOfMeasure">
696
																						<xsl:apply-templates/>
697
																					</xsl:for-each>
698
																				</xsl:for-each>
699
																			</td>
700
																			<td style="text-align:center; white-space:nowrap; width:auto; ">
701
																				<xsl:for-each select="ItemDetail">
702
																					<xsl:for-each select="UnitPrice">
703
																						<xsl:for-each select="Money">
704
																							<span>
705
																								<xsl:variable name="altova:seqContentStrings_7">
706
																									<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
707
																								</xsl:variable>
708
																								<xsl:variable name="altova:sContent_7" select="string($altova:seqContentStrings_7)"/>
709
																								<xsl:value-of select="$altova:sContent_7"/>
710
																							</span>
711
																						</xsl:for-each>
712
																					</xsl:for-each>
713
																				</xsl:for-each>
714
																			</td>
715
																			<td style="text-align:center; white-space:nowrap; width:auto; ">
716
																				<xsl:for-each select="ItemID">
717
																					<xsl:for-each select="SupplierPartID">
718
																						<xsl:apply-templates/>
719
																					</xsl:for-each>
720
																				</xsl:for-each>
721
																			</td>
722
																			<td style="text-align:right; white-space:nowrap; width:auto; ">
723
																				<xsl:for-each select="Distribution">
724
																					<xsl:for-each select="Charge">
725
																						<xsl:for-each select="Money">
726
																							<span>
727
																								<xsl:variable name="altova:seqContentStrings_8">
728
																									<xsl:value-of select="format-number(number(string(.)), '###,##0.00')"/>
729
																								</xsl:variable>
730
																								<xsl:variable name="altova:sContent_8" select="string($altova:seqContentStrings_8)"/>
731
																								<xsl:value-of select="$altova:sContent_8"/>
732
																							</span>
733
																						</xsl:for-each>
734
																					</xsl:for-each>
735
																				</xsl:for-each>
736
																			</td>
737
																		</tr>
738
																	</xsl:for-each>
739
																</xsl:for-each>
740
															</xsl:for-each>
741
														</xsl:for-each>
742
													</tbody>
743
												</table>
744
											</xsl:variable>
745
											<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=""/>
746
											<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
747
											<xsl:variable name="altova:generate-cols" as="xs:boolean*" xpath-default-namespace="">
748
												<xsl:choose>
749
													<xsl:when test="$altova:table/table/@altova:hide-cols = 'empty'">
750
														<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 ) )"/>
751
													</xsl:when>
752
													<xsl:otherwise>
753
														<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 ) ) )"/>
754
													</xsl:otherwise>
755
												</xsl:choose>
756
											</xsl:variable>
757
											<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
758
												<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
759
													<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
760
													<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
761
												</xsl:apply-templates>
762
											</xsl:variable>
763
											<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
764
										</td>
765
									</tr>
766
								</tbody>
767
							</table>
768
						</xsl:variable>
769
						<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=""/>
770
						<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
771
						<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
772
						<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
773
							<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
774
								<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
775
								<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
776
							</xsl:apply-templates>
777
						</xsl:variable>
778
						<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
779
						<br/>
780
						<br/>
781
						<br/>
782
					</xsl:for-each>
783
					<br/>
784
					<br/>
785
					<xsl:variable name="altova:table">
786
						<table style="color:#1e2125; font-size:11px; font-style:italic; " align="center" cellpadding="2" width="50%">
787
							<xsl:variable name="altova:CurrContextGrid_9" select="."/>
788
							<xsl:variable name="altova:ColumnData"/>
789
							<tbody style="font-size:11px; ">
790
								<tr>
791
									<td style="text-align:center; ">
792
										<span style="font-family:Arial; font-size:16px; font-style:italic; font-weight:bold; white-space:nowrap; ">
793
											<xsl:text>ProcessData</xsl:text>
794
										</span>
795
									</td>
796
								</tr>
797
								<tr>
798
									<td>
799
										<xsl:variable name="altova:table">
800
											<table style="color:#1e2125; font-family:Consolas; font-size:11px; font-style:italic; " align="center" bgcolor="white" cellpadding="5" cellspacing="2" width="50%">
801
												<xsl:variable name="altova:CurrContextGrid_10" select="."/>
802
												<xsl:variable name="altova:ColumnData"/>
803
												<tbody style="background-color:#f9f9f9; font-size:11px; ">
804
													<tr style="height:0.30in; white-space:nowrap; ">
805
														<td style="font-size:12px; white-space:nowrap; ">
806
															<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
807
																<xsl:text>Partner</xsl:text>
808
															</span>
809
														</td>
810
														<td style="font-size:12px; ">
811
															<xsl:for-each select="Message">
812
																<xsl:for-each select="MessagePartnerName">
813
																	<xsl:apply-templates/>
814
																</xsl:for-each>
815
															</xsl:for-each>
816
														</td>
817
													</tr>
818
													<tr style="white-space:nowrap; ">
819
														<td style="font-size:12px; white-space:nowrap; ">
820
															<span style="font-weight:bold; ">
821
																<xsl:text>iFlow</xsl:text>
822
															</span>
823
														</td>
824
														<td style="font-size:12px; ">
825
															<xsl:for-each select="Message">
826
																<xsl:for-each select="MessageiFlow">
827
																	<xsl:apply-templates/>
828
																</xsl:for-each>
829
															</xsl:for-each>
830
														</td>
831
													</tr>
832
													<xsl:choose>
833
														<xsl:when test="string-length(Message/MessageEndpoint) &gt; 1">
834
															<tr style="white-space:nowrap; ">
835
																<td style="font-size:12px; white-space:nowrap; ">
836
																	<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
837
																		<xsl:text>Endpoint</xsl:text>
838
																	</span>
839
																</td>
840
																<td style="font-size:12px; ">
841
																	<xsl:for-each select="Message">
842
																		<xsl:for-each select="MessageEndpoint">
843
																			<xsl:apply-templates/>
844
																		</xsl:for-each>
845
																	</xsl:for-each>
846
																</td>
847
															</tr>
848
														</xsl:when>
849
														<xsl:otherwise/>
850
													</xsl:choose>
851
													<tr style="white-space:nowrap; ">
852
														<td style="font-size:12px; white-space:nowrap; ">
853
															<span style="font-weight:bold; ">
854
																<xsl:text>Tenant Name</xsl:text>
855
															</span>
856
														</td>
857
														<td style="font-size:12px; ">
858
															<xsl:for-each select="Message">
859
																<xsl:for-each select="MessageTenant">
860
																	<xsl:apply-templates/>
861
																</xsl:for-each>
862
															</xsl:for-each>
863
														</td>
864
													</tr>
865
													<xsl:choose>
866
														<xsl:when test="string-length(Message/MessageFileName) &gt; 1">
867
															<tr style="white-space:nowrap; ">
868
																<td style="font-size:12px; white-space:nowrap; ">
869
																	<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
870
																		<xsl:text>Source File Name</xsl:text>
871
																	</span>
872
																</td>
873
																<td style="font-size:12px; ">
874
																	<xsl:for-each select="Message">
875
																		<xsl:for-each select="MessageFileName">
876
																			<xsl:apply-templates/>
877
																		</xsl:for-each>
878
																	</xsl:for-each>
879
																</td>
880
															</tr>
881
														</xsl:when>
882
														<xsl:otherwise/>
883
													</xsl:choose>
884
													<xsl:choose>
885
														<xsl:when test="string-length(Message/MessageId) &gt; 1">
886
															<tr style="white-space:nowrap; ">
887
																<td style="font-size:12px; white-space:nowrap; ">
888
																	<span style="font-weight:bold; ">
889
																		<xsl:text>PayloadID</xsl:text>
890
																	</span>
891
																</td>
892
																<td style="font-size:12px; ">
893
																	<xsl:for-each select="Message">
894
																		<xsl:for-each select="MessageName">
895
																			<xsl:apply-templates/>
896
																		</xsl:for-each>
897
																	</xsl:for-each>
898
																</td>
899
															</tr>
900
														</xsl:when>
901
														<xsl:otherwise/>
902
													</xsl:choose>
903
													<tr style="white-space:nowrap; ">
904
														<td>
905
															<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
906
																<xsl:text>Date Time</xsl:text>
907
															</span>
908
														</td>
909
														<td>
910
															<xsl:for-each select="Message">
911
																<xsl:for-each select="MessageTime">
912
																	<xsl:apply-templates/>
913
																</xsl:for-each>
914
															</xsl:for-each>
915
														</td>
916
													</tr>
917
													<tr style="white-space:nowrap; ">
918
														<td style="font-size:12px; white-space:nowrap; ">
919
															<span style="font-size:11px; font-style:italic; font-weight:bold; white-space:nowrap; ">
920
																<xsl:text>Message ID</xsl:text>
921
															</span>
922
														</td>
923
														<td style="font-size:12px; ">
924
															<a>
925
																<xsl:choose>
926
																	<xsl:when test="not(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)))">
927
																		<xsl:attribute name="href">
928
																			<xsl:text>#</xsl:text>
929
																		</xsl:attribute>
930
																	</xsl:when>
931
																	<xsl:when test="substring(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), 1, 1) = '#'">
932
																		<xsl:attribute name="href">
933
																			<xsl:value-of select="concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)"/>
934
																		</xsl:attribute>
935
																	</xsl:when>
936
																	<xsl:otherwise>
937
																		<xsl:attribute name="href">
938
																			<xsl:if test="substring(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), 2, 1) = ':'">
939
																				<xsl:text>file:///</xsl:text>
940
																			</xsl:if>
941
																			<xsl:value-of select="translate(string(concat(&apos;https://messagestoreviewer-hf3d1fb3c.dispatcher.us3.hana.ondemand.com/index.html#/entries/&apos;,Message/MessageId)), '&#x5c;', '/')"/>
942
																		</xsl:attribute>
943
																	</xsl:otherwise>
944
																</xsl:choose>
945
																<xsl:for-each select="Message">
946
																	<xsl:for-each select="MessageId">
947
																		<xsl:apply-templates/>
948
																	</xsl:for-each>
949
																</xsl:for-each>
950
															</a>
951
														</td>
952
													</tr>
953
													<tr style="white-space:nowrap; ">
954
														<td>
955
															<span style="font-weight:bold; ">
956
																<xsl:text>Archive</xsl:text>
957
															</span>
958
														</td>
959
														<td>
960
															<xsl:choose>
961
																<xsl:when test="Message/MessageTenant = &quot;l250804&quot;">
962
																	<a>
963
																		<xsl:choose>
964
																			<xsl:when test="not(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;))">
965
																				<xsl:attribute name="href">
966
																					<xsl:text>#</xsl:text>
967
																				</xsl:attribute>
968
																			</xsl:when>
969
																			<xsl:when test="substring(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), 1, 1) = '#'">
970
																				<xsl:attribute name="href">
971
																					<xsl:value-of select="&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;"/>
972
																				</xsl:attribute>
973
																			</xsl:when>
974
																			<xsl:otherwise>
975
																				<xsl:attribute name="href">
976
																					<xsl:if test="substring(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), 2, 1) = ':'">
977
																						<xsl:text>file:///</xsl:text>
978
																					</xsl:if>
979
																					<xsl:value-of select="translate(string(&apos;file://\\idcpsi01\ARCHIVE\CPI&apos;), '&#x5c;', '/')"/>
980
																				</xsl:attribute>
981
																			</xsl:otherwise>
982
																		</xsl:choose>
983
																		<span>
984
																			<xsl:text>\\idcpsi01\ARCHIVE\CPI</xsl:text>
985
																		</span>
986
																	</a>
987
																</xsl:when>
988
																<xsl:when test="$env = &quot;l250805&quot;">
989
																	<a>
990
																		<xsl:choose>
991
																			<xsl:when test="not(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;))">
992
																				<xsl:attribute name="href">
993
																					<xsl:text>#</xsl:text>
994
																				</xsl:attribute>
995
																			</xsl:when>
996
																			<xsl:when test="substring(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), 1, 1) = '#'">
997
																				<xsl:attribute name="href">
998
																					<xsl:value-of select="&apos;\\idcpsi01\ARCHIVE\CPI&apos;"/>
999
																				</xsl:attribute>
1000
																			</xsl:when>
1001
																			<xsl:otherwise>
1002
																				<xsl:attribute name="href">
1003
																					<xsl:if test="substring(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), 2, 1) = ':'">
1004
																						<xsl:text>file:///</xsl:text>
1005
																					</xsl:if>
1006
																					<xsl:value-of select="translate(string(&apos;\\idcpsi01\ARCHIVE\CPI&apos;), '&#x5c;', '/')"/>
1007
																				</xsl:attribute>
1008
																			</xsl:otherwise>
1009
																		</xsl:choose>
1010
																		<span>
1011
																			<xsl:text>\\idcpsi01\ARCHIVE\CPI</xsl:text>
1012
																		</span>
1013
																	</a>
1014
																</xsl:when>
1015
															</xsl:choose>
1016
														</td>
1017
													</tr>
1018
												</tbody>
1019
											</table>
1020
										</xsl:variable>
1021
										<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=""/>
1022
										<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
1023
										<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
1024
										<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
1025
											<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
1026
												<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1027
												<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1028
											</xsl:apply-templates>
1029
										</xsl:variable>
1030
										<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
1031
									</td>
1032
								</tr>
1033
							</tbody>
1034
						</table>
1035
					</xsl:variable>
1036
					<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=""/>
1037
					<xsl:variable name="altova:TableIndexInfo" select="altova:BuildTableIndexInfo($altova:table)"/>
1038
					<xsl:variable name="altova:generate-cols" as="xs:boolean*" select="for $altova:pos in 1 to $altova:col-count return true()"/>
1039
					<xsl:variable name="altova:nodeTableWithoutUnwantedParts">
1040
						<xsl:apply-templates select="$altova:table" mode="altova:generate-table">
1041
							<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1042
							<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1043
						</xsl:apply-templates>
1044
					</xsl:variable>
1045
					<xsl:sequence select="$altova:nodeTableWithoutUnwantedParts"/>
1046
					<br/>
1047
				</xsl:for-each>
1048
				<br/>
1049
				<br/>
1050
				<br/>
1051
			</body>
1052
		</html>
1053
	</xsl:template>
1054
	<xsl:template name="Template1">
1055
		<img>
1056
			<xsl:attribute name="src">
1057
				<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;', '/') )"/>
1058
				<xsl:if test="substring( $altova:img_src, 2, 1) = ':'">
1059
					<xsl:text>file:///</xsl:text>
1060
				</xsl:if>
1061
				<xsl:value-of select="$altova:img_src"/>
1062
			</xsl:attribute>
1063
			<xsl:attribute name="alt"/>
1064
		</img>
1065
	</xsl:template>
1066
	<xsl:function name="altova:is-cell-empty" as="xs:boolean">
1067
		<xsl:param name="altova:cell" as="element()"/>
1068
		<xsl:sequence select="altova:is-node-empty( $altova:cell )"/>
1069
	</xsl:function>
1070
	<xsl:function name="altova:is-node-empty" as="xs:boolean" xpath-default-namespace="">
1071
		<xsl:param name="altova:node" as="element()"/>
1072
		<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 ) ) )"/>
1073
	</xsl:function>
1074
	<xsl:function name="altova:col-position" as="xs:integer" xpath-default-namespace="">
1075
		<xsl:param name="altova:Cell" as="element()"/>
1076
		<xsl:param name="altova:TableIndexInfo" as="element()"/>
1077
		<xsl:variable name="altova:nRow" select="altova:GetGridRowNumForCell($altova:Cell)"/>
1078
		<xsl:variable name="altova:nCell" select="count($altova:Cell/preceding-sibling::th) + count($altova:Cell/preceding-sibling::td) + 1" as="xs:integer"/>
1079
		<xsl:sequence select="$altova:TableIndexInfo/altova:Row[$altova:nRow]/altova:ColumnIndex[$altova:nCell]"/>
1080
	</xsl:function>
1081
	<xsl:template match="@*" mode="altova:copy-table-cell-properties">
1082
		<xsl:copy-of select="."/>
1083
	</xsl:template>
1084
	<xsl:template match="@colspan" mode="altova:copy-table-cell-properties"/>
1085
	<xsl:function name="altova:col-span" as="xs:integer">
1086
		<xsl:param name="altova:cell" as="element()"/>
1087
		<xsl:sequence select="if ( exists( $altova:cell/@colspan ) ) then xs:integer( $altova:cell/@colspan ) else 1"/>
1088
	</xsl:function>
1089
	<xsl:template match="@* | node()" mode="altova:generate-table">
1090
		<xsl:param name="altova:generate-cols"/>
1091
		<xsl:param name="altova:TableIndexInfo"/>
1092
		<xsl:copy>
1093
			<xsl:apply-templates select="@* | node()" mode="#current">
1094
				<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1095
				<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1096
			</xsl:apply-templates>
1097
		</xsl:copy>
1098
	</xsl:template>
1099
	<xsl:template match="tbody" mode="altova:generate-table" xpath-default-namespace="">
1100
		<xsl:param name="altova:generate-cols"/>
1101
		<xsl:param name="altova:TableIndexInfo"/>
1102
		<xsl:choose>
1103
			<xsl:when test="empty(tr)">
1104
				<xsl:copy>
1105
					<tr>
1106
						<td/>
1107
					</tr>
1108
				</xsl:copy>
1109
			</xsl:when>
1110
			<xsl:otherwise>
1111
				<xsl:copy>
1112
					<xsl:apply-templates select="@* | node()" mode="#current">
1113
						<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1114
						<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1115
					</xsl:apply-templates>
1116
				</xsl:copy>
1117
			</xsl:otherwise>
1118
		</xsl:choose>
1119
	</xsl:template>
1120
	<xsl:template match="tr" mode="altova:generate-table" xpath-default-namespace="">
1121
		<xsl:param name="altova:generate-cols"/>
1122
		<xsl:param name="altova:TableIndexInfo"/>
1123
		<xsl:choose>
1124
			<xsl:when test="ancestor::table[1]/@altova:hide-rows = 'empty'">
1125
				<xsl:if test="some $altova:cell in (th | td) satisfies not(altova:is-cell-empty($altova:cell))">
1126
					<xsl:copy>
1127
						<xsl:apply-templates select="@* | node()" mode="#current">
1128
							<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1129
							<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1130
						</xsl:apply-templates>
1131
					</xsl:copy>
1132
				</xsl:if>
1133
			</xsl:when>
1134
			<xsl:when test="ancestor::table[1]/@altova:hide-rows = 'body-empty'">
1135
				<xsl:if test="not(exists(parent::tbody)) or (some $altova:cell in td satisfies not(altova:is-cell-empty($altova:cell)))">
1136
					<xsl:copy>
1137
						<xsl:apply-templates select="@* | node()" mode="#current">
1138
							<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1139
							<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1140
						</xsl:apply-templates>
1141
					</xsl:copy>
1142
				</xsl:if>
1143
			</xsl:when>
1144
			<xsl:otherwise>
1145
				<xsl:copy>
1146
					<xsl:apply-templates select="@* | node()" mode="#current">
1147
						<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1148
						<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1149
					</xsl:apply-templates>
1150
				</xsl:copy>
1151
			</xsl:otherwise>
1152
		</xsl:choose>
1153
	</xsl:template>
1154
	<xsl:template match="th | td" mode="altova:generate-table" xpath-default-namespace="">
1155
		<xsl:param name="altova:generate-cols"/>
1156
		<xsl:param name="altova:TableIndexInfo"/>
1157
		<xsl:variable name="altova:this-cell" select="."/>
1158
		<xsl:variable name="altova:col-index" select="altova:col-position($altova:this-cell, $altova:TableIndexInfo)"/>
1159
		<xsl:choose>
1160
			<xsl:when test="$altova:generate-cols[$altova:col-index]">
1161
				<xsl:copy>
1162
					<xsl:apply-templates select="@*" mode="#current">
1163
						<xsl:with-param name="altova:generate-cols" select="$altova:generate-cols"/>
1164
						<xsl:with-param name="altova:TableIndexInfo" select="$altova:TableIndexInfo"/>
1165
					</xsl:apply-templates>
1166
					<xsl:choose>
1167
						<xsl:when test="altova:is-cell-empty($altova:this-cell)">
1168
							<xsl:text>&#160;</xsl:text>
1169
						</xsl:when>
1170
						<xsl:otherwise>
1171
							<xsl:copy-of select="node()"/>
1172
						</xsl:otherwise>
1173
					</xsl:choose>
1174
				</xsl:copy>
1175
			</xsl:when>
1176
			<xsl:when test="altova:col-span($altova:this-cell) > 1">
1177
				<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 ()">
1178
					<xsl:for-each select="$altova:this-cell">
1179
						<xsl:copy>
1180
							<xsl:apply-templates select="@*" mode="altova:copy-table-cell-properties"/>
1181
							<xsl:text>&#160;</xsl:text>
1182
						</xsl:copy>
1183
					</xsl:for-each>
1184
				</xsl:for-each>
1185
			</xsl:when>
1186
		</xsl:choose>
1187
	</xsl:template>
1188
	<xsl:template match="@colspan" mode="altova:generate-table" xpath-default-namespace="">
1189
		<xsl:param name="altova:generate-cols"/>
1190
		<xsl:param name="altova:TableIndexInfo"/>
1191
		<xsl:choose>
1192
			<xsl:when test="exists( ancestor::table[ 1 ]/@altova:hide-cols )">
1193
				<xsl:variable name="altova:col-index" select="altova:col-position(.., $altova:TableIndexInfo)"/>
1194
				<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 )"/>
1195
			</xsl:when>
1196
			<xsl:otherwise>
1197
				<xsl:attribute name="colspan" select="."/>
1198
			</xsl:otherwise>
1199
		</xsl:choose>
1200
	</xsl:template>
1201
	<xsl:template match="@altova:hide-rows | @altova:hide-cols" mode="altova:generate-table"/>
1202
	<xsl:function name="altova:CountLeadingTrueValues">
1203
		<xsl:param name="seqBools"/>
1204
		<xsl:sequence select="if (not($seqBools[1] = true())) then 0 else 1 + altova:CountLeadingTrueValues($seqBools[position() gt 1])"/>
1205
	</xsl:function>
1206
	<xsl:function name="altova:GetCellFromRow" as="node()?" xpath-default-namespace="">
1207
		<xsl:param name="nodeTableRow" as="node()"/>
1208
		<xsl:param name="nCell" as="xs:integer"/>
1209
		<xsl:sequence select="$nodeTableRow/(th | td)[$nCell]"/>
1210
	</xsl:function>
1211
	<xsl:function name="altova:GetCellsFromRow" as="node()*" xpath-default-namespace="">
1212
		<xsl:param name="nodeTableRow" as="node()"/>
1213
		<xsl:sequence select="$nodeTableRow/(th | td)"/>
1214
	</xsl:function>
1215
	<xsl:function name="altova:GetRowsFromTable" as="node()*" xpath-default-namespace="">
1216
		<xsl:param name="nodeTable" as="node()"/>
1217
		<xsl:sequence select="$nodeTable/(thead | tbody | tfoot)/tr"/>
1218
	</xsl:function>
1219
	<xsl:function name="altova:GetRowspanFromCell" as="xs:integer" xpath-default-namespace="">
1220
		<xsl:param name="altova:nodeCell" as="node()"/>
1221
		<xsl:variable name="altova:sRowSpan" select="$altova:nodeCell/@rowspan" as="xs:string?"/>
1222
		<xsl:variable name="altova:nRowSpan" select="if ($altova:sRowSpan) then xs:integer($altova:sRowSpan) else 1" as="xs:integer"/>
1223
		<xsl:sequence select="$altova:nRowSpan"/>
1224
	</xsl:function>
1225
	<!-- 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 -->
1226
	<xsl:function name="altova:GetGridRowNumForCell" xpath-default-namespace="">
1227
		<xsl:param name="altova:nodeTableCell" as="node()"/>
1228
		<xsl:variable name="altova:nodeTableRow" select="$altova:nodeTableCell/.." as="node()"/>
1229
		<xsl:variable name="altova:nodeTableSection" select="$altova:nodeTableRow/.." as="node()"/>
1230
		<xsl:variable name="altova:sTableSection" select="fn:local-name($altova:nodeTableSection)" as="xs:string"/>
1231
		<xsl:variable name="altova:nodeTable" select="$altova:nodeTableSection/.." as="node()"/>
1232
		<xsl:variable name="altova:nRowNumInSection" select="count($altova:nodeTableRow/preceding-sibling::tr) + 1" as="xs:integer"/>
1233
		<xsl:choose>
1234
			<xsl:when test="$altova:sTableSection eq 'tbody'">
1235
				<xsl:sequence select="count($altova:nodeTable/thead/tr) + $altova:nRowNumInSection"/>
1236
			</xsl:when>
1237
			<xsl:when test="$altova:sTableSection eq 'thead'">
1238
				<xsl:sequence select="$altova:nRowNumInSection"/>
1239
			</xsl:when>
1240
			<xsl:when test="$altova:sTableSection eq 'tfoot'">
1241
				<xsl:sequence select="count($altova:nodeTable/thead/tr) + count($altova:nodeTable/tbody/tr) + $altova:nRowNumInSection"/>
1242
			</xsl:when>
1243
			<xsl:otherwise>
1244
				<xsl:message select="'Internal Error'" terminate="yes"/>
1245
			</xsl:otherwise>
1246
		</xsl:choose>
1247
	</xsl:function>
1248
	<xsl:function name="altova:BuildTableIndexInfo" as="node()" xpath-default-namespace="">
1249
		<xsl:param name="altova:nodeTable" as="node()"/>
1250
		<altova:ColumnIndices>
1251
			<xsl:variable name="altova:nodeAllRows" select="altova:GetRowsFromTable($altova:nodeTable/table)" as="node()*"/>
1252
			<xsl:if test="$altova:nodeAllRows">
1253
				<xsl:variable name="altova:seqCellsInFirstRow" select="altova:GetCellsFromRow($altova:nodeAllRows[1])" as="node()*"/>
1254
				<xsl:variable name="altova:nColumnsInTable" select="sum(for $nodeCell in $altova:seqCellsInFirstRow return altova:col-span($nodeCell))" as="xs:integer"/>
1255
				<xsl:variable name="altova:seqActiveRowSpans" select="for $Cell in 1 to $altova:nColumnsInTable return 0" as="xs:integer*"/>
1256
				<!--xsl:sequence select="altova:BuildTableIndexInfo_Recursive($altova:nodeAllRows, 1, $altova:seqActiveRowSpans)"/-->
1257
				<xsl:call-template name="altova:BuildTableIndexInfo_Recursive">
1258
					<xsl:with-param name="altova:nodeTableRows" select="$altova:nodeAllRows"/>
1259
					<xsl:with-param name="altova:nRow" select="1"/>
1260
					<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
1261
				</xsl:call-template>
1262
			</xsl:if>
1263
		</altova:ColumnIndices>
1264
	</xsl:function>
1265
	<!--xsl:template name="altova:BuildTableIndexInfo_Recursive" as="node()*" xpath-default-namespace=""-->
1266
	<xsl:template name="altova:BuildTableIndexInfo_Recursive" xpath-default-namespace="">
1267
		<xsl:param name="altova:nodeTableRows" as="node()*"/>
1268
		<xsl:param name="altova:nRow" as="xs:integer"/>
1269
		<xsl:param name="altova:seqActiveRowSpans" as="xs:integer*"/>
1270
		<xsl:variable name="altova:nodeRow" select="$altova:nodeTableRows[$altova:nRow]" as="node()?"/>
1271
		<xsl:choose>
1272
			<xsl:when test="empty($altova:nodeRow)">
1273
				<xsl:sequence select="()"/>
1274
			</xsl:when>
1275
			<xsl:when test="empty(altova:GetCellFromRow($altova:nodeRow, 1))">
1276
				<xsl:sequence select="()"/>
1277
			</xsl:when>
1278
			<xsl:otherwise>
1279
				<xsl:variable name="altova:nodeCell1" select="altova:GetCellFromRow($altova:nodeRow, 1)" as="node()?"/>
1280
				<xsl:variable name="altova:nColSpan" select="altova:col-span($altova:nodeCell1)" as="xs:integer"/>
1281
				<altova:Row>
1282
					<!--xsl:variable name="altova:seqColumnIndicesOfCurrentRow" select="altova:BuildTableIndexInfo_SingleRow_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, 1, 1, $altova:nColSpan, true(), 0, 0)" as="node()*"/>
1283
						<xsl:sequence select="$altova:seqColumnIndicesOfCurrentRow"/-->
1284
					<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
1285
						<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
1286
						<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
1287
						<xsl:with-param name="altova:nColumn" select="1"/>
1288
						<xsl:with-param name="altova:nCellInCurrentRow" select="1"/>
1289
						<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpan"/>
1290
						<xsl:with-param name="altova:bColSpanBegins" select="true()"/>
1291
						<xsl:with-param name="altova:nCurrentSum" select="0"/>
1292
						<xsl:with-param name="altova:nRowSpansToAdd" select="0"/>
1293
					</xsl:call-template>
1294
				</altova:Row>
1295
				<xsl:variable name="altova:seqActiveRowSpans_New" select="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive($altova:seqActiveRowSpans, $altova:nodeRow, 1, 1, $altova:nColSpan)" as="xs:integer*"/>
1296
				<!--xsl:sequence select="altova:BuildTableIndexInfo_Recursive($altova:nodeTableRows, $altova:nRow + 1, $altova:seqActiveRowSpans_New)"/-->
1297
				<xsl:call-template name="altova:BuildTableIndexInfo_Recursive">
1298
					<xsl:with-param name="altova:nodeTableRows" select="$altova:nodeTableRows"/>
1299
					<xsl:with-param name="altova:nRow" select="$altova:nRow + 1"/>
1300
					<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans_New"/>
1301
				</xsl:call-template>
1302
			</xsl:otherwise>
1303
		</xsl:choose>
1304
	</xsl:template>
1305
	<!--xsl:template name="altova:BuildTableIndexInfo_SingleRow_Recursive" as="node()*" xpath-default-namespace=""-->
1306
	<xsl:template name="altova:BuildTableIndexInfo_SingleRow_Recursive" xpath-default-namespace="">
1307
		<xsl:param name="altova:seqActiveRowSpans" as="xs:integer*"/>
1308
		<xsl:param name="altova:nodeRow" as="node()"/>
1309
		<xsl:param name="altova:nColumn" as="xs:integer"/>
1310
		<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
1311
		<xsl:param name="altova:nColSpanInCellRemaining" as="xs:integer"/>
1312
		<xsl:param name="altova:bColSpanBegins" as="xs:boolean"/>
1313
		<!-- Also true if it's just a single cell -->
1314
		<xsl:param name="altova:nCurrentSum" as="xs:integer"/>
1315
		<xsl:param name="altova:nRowSpansToAdd" as="xs:integer"/>
1316
		<xsl:choose>
1317
			<xsl:when test="$altova:nColumn gt count($altova:seqActiveRowSpans)">
1318
				<xsl:sequence select="()"/>
1319
			</xsl:when>
1320
			<!-- If the cell is not under a rowspan -->
1321
			<xsl:when test="$altova:seqActiveRowSpans[$altova:nColumn] eq 0">
1322
				<!-- If the cell is not under a colspan -->
1323
				<xsl:if test="$altova:bColSpanBegins eq true()">
1324
					<!-- A non-spanned cell starts in this column -->
1325
					<altova:ColumnIndex>
1326
						<xsl:sequence select="$altova:nCurrentSum + 1"/>
1327
					</altova:ColumnIndex>
1328
				</xsl:if>
1329
				<xsl:variable name="altova:nCellInCurrentRow_New" select="if ($altova:nColSpanInCellRemaining gt 1) then $altova:nCellInCurrentRow else $altova:nCellInCurrentRow + 1" as="xs:integer"/>
1330
				<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"/>
1331
				<xsl:variable name="altova:bColSpanBegins_New" select="$altova:nCellInCurrentRow ne $altova:nCellInCurrentRow_New" as="xs:boolean"/>
1332
				<!--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)"/-->
1333
				<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
1334
					<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
1335
					<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
1336
					<xsl:with-param name="altova:nColumn" select="$altova:nColumn + 1"/>
1337
					<xsl:with-param name="altova:nCellInCurrentRow" select="$altova:nCellInCurrentRow_New"/>
1338
					<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpanInCell_New"/>
1339
					<xsl:with-param name="altova:bColSpanBegins" select="$altova:bColSpanBegins_New"/>
1340
					<xsl:with-param name="altova:nCurrentSum" select="$altova:nCurrentSum + 1"/>
1341
					<xsl:with-param name="altova:nRowSpansToAdd" select="$altova:nRowSpansToAdd"/>
1342
				</xsl:call-template>
1343
			</xsl:when>
1344
			<!-- The cell is under a rowspan -->
1345
			<xsl:otherwise>
1346
				<!--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)"/-->
1347
				<xsl:call-template name="altova:BuildTableIndexInfo_SingleRow_Recursive">
1348
					<xsl:with-param name="altova:seqActiveRowSpans" select="$altova:seqActiveRowSpans"/>
1349
					<xsl:with-param name="altova:nodeRow" select="$altova:nodeRow"/>
1350
					<xsl:with-param name="altova:nColumn" select="$altova:nColumn + 1"/>
1351
					<xsl:with-param name="altova:nCellInCurrentRow" select="$altova:nCellInCurrentRow"/>
1352
					<xsl:with-param name="altova:nColSpanInCellRemaining" select="$altova:nColSpanInCellRemaining"/>
1353
					<xsl:with-param name="altova:bColSpanBegins" select="$altova:bColSpanBegins"/>
1354
					<xsl:with-param name="altova:nCurrentSum" select="$altova:nCurrentSum + 1"/>
1355
					<xsl:with-param name="altova:nRowSpansToAdd" select="$altova:nRowSpansToAdd + 1"/>
1356
				</xsl:call-template>
1357
			</xsl:otherwise>
1358
		</xsl:choose>
1359
	</xsl:template>
1360
	<xsl:function name="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive" as="xs:integer*" xpath-default-namespace="">
1361
		<xsl:param name="altova:seqRowSpans" as="xs:integer*"/>
1362
		<xsl:param name="altova:nodeCurrentRow" as="node()"/>
1363
		<xsl:param name="altova:nColumn" as="xs:integer"/>
1364
		<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
1365
		<xsl:param name="altova:nColSpanInCellRemaining" as="xs:integer"/>
1366
		<xsl:choose>
1367
			<xsl:when test="$altova:nColumn gt count($altova:seqRowSpans)">
1368
				<xsl:sequence select="()"/>
1369
			</xsl:when>
1370
			<xsl:otherwise>
1371
				<xsl:variable name="altova:nRowSpanForCurrentColumn" select="altova:BuildTableIndexInfo_ActiveRowSpans_SingleColumn($altova:seqRowSpans, $altova:nodeCurrentRow, $altova:nColumn, $altova:nCellInCurrentRow)" as="xs:integer?"/>
1372
				<xsl:sequence select="$altova:nRowSpanForCurrentColumn"/>
1373
				<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"/>
1374
				<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"/>
1375
				<xsl:sequence select="altova:BuildTableIndexInfo_ActiveRowSpans_Recursive($altova:seqRowSpans, $altova:nodeCurrentRow, $altova:nColumn + 1, $altova:nCellInCurrentRow_New, $altova:nColSpanInCell_New)"/>
1376
			</xsl:otherwise>
1377
		</xsl:choose>
1378
	</xsl:function>
1379
	<xsl:function name="altova:BuildTableIndexInfo_ActiveRowSpans_SingleColumn" as="xs:integer?" xpath-default-namespace="">
1380
		<xsl:param name="altova:seqRowSpans" as="xs:integer*"/>
1381
		<xsl:param name="altova:nodeCurrentRow" as="node()"/>
1382
		<xsl:param name="altova:nColumn" as="xs:integer"/>
1383
		<xsl:param name="altova:nCellInCurrentRow" as="xs:integer"/>
1384
		<xsl:choose>
1385
			<xsl:when test="$altova:seqRowSpans[$altova:nColumn] gt 0">
1386
				<xsl:sequence select="$altova:seqRowSpans[$altova:nColumn] - 1"/>
1387
			</xsl:when>
1388
			<xsl:otherwise>
1389
				<xsl:variable name="altova:nodeCell" select="altova:GetCellFromRow($altova:nodeCurrentRow, $altova:nCellInCurrentRow)" as="node()"/>
1390
				<xsl:sequence select="altova:GetRowspanFromCell($altova:nodeCell) - 1"/>
1391
			</xsl:otherwise>
1392
		</xsl:choose>
1393
	</xsl:function>
1394
	<xsl:function name="altova:reluri-to-content-id" as="xs:string">
1395
		<xsl:param name="input"/>
1396
		<xsl:choose>
1397
			<xsl:when test="$altova:bGeneratingMime and not(contains($input, '://') or starts-with($input, '/') or contains($input, ':/') or contains($input, ':\'))">
1398
				<xsl:sequence select="string-join(('cid:', encode-for-uri($input), '@', $altova:execution-guid, '.Altova.StyleVision'), '')"/>
1399
			</xsl:when>
1400
			<xsl:otherwise>
1401
				<xsl:sequence select="$input"/>
1402
			</xsl:otherwise>
1403
		</xsl:choose>
1404
	</xsl:function>
1405
	<xsl:template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
1406
		<xsl:param name="pos"/>
1407
		<xsl:param name="endpos"/>
1408
		<xsl:param name="rowinfo"/>
1409
		<xsl:variable name="rowspan">
1410
			<xsl:call-template name="altova:vector-get-value">
1411
				<xsl:with-param name="index" select="($pos - 1) * 2 + 2"/>
1412
				<xsl:with-param name="vector" select="$rowinfo"/>
1413
				<xsl:with-param name="separator" select="';'"/>
1414
			</xsl:call-template>
1415
		</xsl:variable>
1416
		<xsl:choose>
1417
			<xsl:when test="number($rowspan) > 0">
1418
				<xsl:if test="$endpos = -1 or $pos &lt; $endpos">
1419
					<xsl:variable name="colspan">
1420
						<xsl:call-template name="altova:vector-get-value">
1421
							<xsl:with-param name="index" select="($pos - 1) * 2 + 1"/>
1422
							<xsl:with-param name="vector" select="$rowinfo"/>
1423
							<xsl:with-param name="separator" select="';'"/>
1424
						</xsl:call-template>
1425
					</xsl:variable>
1426
					<xsl:value-of select="concat($colspan,';',number($rowspan) - 1,';')"/>
1427
					<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
1428
						<xsl:with-param name="pos" select="$pos + 1"/>
1429
						<xsl:with-param name="endpos" select="$endpos"/>
1430
						<xsl:with-param name="rowinfo" select="$rowinfo"/>
1431
					</xsl:call-template>
1432
				</xsl:if>
1433
			</xsl:when>
1434
			<xsl:otherwise>
1435
				<xsl:if test="$endpos != -1 and $pos &lt; $endpos">
1436
					<xsl:value-of select="'0;0;'"/>
1437
					<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
1438
						<xsl:with-param name="pos" select="$pos + 1"/>
1439
						<xsl:with-param name="endpos" select="$endpos"/>
1440
						<xsl:with-param name="rowinfo" select="$rowinfo"/>
1441
					</xsl:call-template>
1442
				</xsl:if>
1443
			</xsl:otherwise>
1444
		</xsl:choose>
1445
	</xsl:template>
1446
	<xsl:template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
1447
		<xsl:param name="pos"/>
1448
		<xsl:param name="endpos"/>
1449
		<xsl:param name="rowinfo"/>
1450
		<xsl:variable name="rowspan">
1451
			<xsl:call-template name="altova:vector-get-value">
1452
				<xsl:with-param name="index" select="($pos - 1) * 2 + 2"/>
1453
				<xsl:with-param name="vector" select="$rowinfo"/>
1454
				<xsl:with-param name="separator" select="';'"/>
1455
			</xsl:call-template>
1456
		</xsl:variable>
1457
		<xsl:choose>
1458
			<xsl:when test="number($rowspan) > 0">
1459
				<xsl:if test="$endpos = -1 or $pos &lt; $endpos">
1460
					<xsl:variable name="colspan">
1461
						<xsl:call-template name="altova:vector-get-value">
1462
							<xsl:with-param name="index" select="($pos - 1) * 2 + 1"/>
1463
							<xsl:with-param name="vector" select="$rowinfo"/>
1464
							<xsl:with-param name="separator" select="';'"/>
1465
						</xsl:call-template>
1466
					</xsl:variable>
1467
					<xsl:choose>
1468
						<xsl:when test="number($colspan) > 0">5</xsl:when>
1469
						<xsl:otherwise>3</xsl:otherwise>
1470
					</xsl:choose>
1471
					<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
1472
						<xsl:with-param name="pos" select="$pos + 1"/>
1473
						<xsl:with-param name="endpos" select="$endpos"/>
1474
						<xsl:with-param name="rowinfo" select="$rowinfo"/>
1475
					</xsl:call-template>
1476
				</xsl:if>
1477
			</xsl:when>
1478
			<xsl:otherwise>
1479
				<xsl:if test="$endpos != -1 and $pos &lt; $endpos">
1480
					<xsl:value-of select="'2'"/>
1481
					<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
1482
						<xsl:with-param name="pos" select="$pos + 1"/>
1483
						<xsl:with-param name="endpos" select="$endpos"/>
1484
						<xsl:with-param name="rowinfo" select="$rowinfo"/>
1485
					</xsl:call-template>
1486
				</xsl:if>
1487
			</xsl:otherwise>
1488
		</xsl:choose>
1489
	</xsl:template>
1490
	<xsl:template name="altova:xml-table-table-matrix-get-master-cell-colnum">
1491
		<xsl:param name="colnum"/>
1492
		<xsl:param name="rownum"/>
1493
		<xsl:param name="col-count"/>
1494
		<xsl:param name="table-matrix"/>
1495
		<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
1496
		<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
1497
		<xsl:choose>
1498
			<xsl:when test="$entry-type='4' or $entry-type='5'">
1499
				<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
1500
					<xsl:with-param name="colnum" select="$colnum - 1"/>
1501
					<xsl:with-param name="rownum" select="$rownum"/>
1502
					<xsl:with-param name="col-count" select="$col-count"/>
1503
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
1504
				</xsl:call-template>
1505
			</xsl:when>
1506
			<xsl:otherwise>
1507
				<xsl:value-of select="$colnum"/>
1508
			</xsl:otherwise>
1509
		</xsl:choose>
1510
	</xsl:template>
1511
	<xsl:template name="altova:xml-table-table-matrix-get-master-cell-rownum">
1512
		<xsl:param name="colnum"/>
1513
		<xsl:param name="rownum"/>
1514
		<xsl:param name="col-count"/>
1515
		<xsl:param name="table-matrix"/>
1516
		<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
1517
		<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
1518
		<xsl:choose>
1519
			<xsl:when test="$entry-type='3'">
1520
				<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
1521
					<xsl:with-param name="colnum" select="$colnum"/>
1522
					<xsl:with-param name="rownum" select="$rownum - 1"/>
1523
					<xsl:with-param name="col-count" select="$col-count"/>
1524
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
1525
				</xsl:call-template>
1526
			</xsl:when>
1527
			<xsl:otherwise>
1528
				<xsl:value-of select="$rownum"/>
1529
			</xsl:otherwise>
1530
		</xsl:choose>
1531
	</xsl:template>
1532
	<xsl:template name="altova:xml-table-table-matrix-calc-spanned-cols">
1533
		<xsl:param name="colnum"/>
1534
		<xsl:param name="rownum"/>
1535
		<xsl:param name="col-count"/>
1536
		<xsl:param name="table-matrix"/>
1537
		<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
1538
			<xsl:with-param name="spanned-cols" select="0"/>
1539
			<xsl:with-param name="colnum" select="$colnum + 1"/>
1540
			<xsl:with-param name="rownum" select="$rownum"/>
1541
			<xsl:with-param name="col-count" select="$col-count"/>
1542
			<xsl:with-param name="table-matrix" select="$table-matrix"/>
1543
		</xsl:call-template>
1544
	</xsl:template>
1545
	<xsl:template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
1546
		<xsl:param name="spanned-cols"/>
1547
		<xsl:param name="colnum"/>
1548
		<xsl:param name="rownum"/>
1549
		<xsl:param name="col-count"/>
1550
		<xsl:param name="table-matrix"/>
1551
		<xsl:choose>
1552
			<xsl:when test="$colnum &lt;= $col-count">
1553
				<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
1554
				<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
1555
				<xsl:choose>
1556
					<xsl:when test="$entry-type='4' or $entry-type='5'">
1557
						<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols-helper">
1558
							<xsl:with-param name="spanned-cols" select="$spanned-cols + 1"/>
1559
							<xsl:with-param name="colnum" select="$colnum + 1"/>
1560
							<xsl:with-param name="rownum" select="$rownum"/>
1561
							<xsl:with-param name="col-count" select="$col-count"/>
1562
							<xsl:with-param name="table-matrix" select="$table-matrix"/>
1563
						</xsl:call-template>
1564
					</xsl:when>
1565
					<xsl:otherwise>
1566
						<xsl:value-of select="$spanned-cols"/>
1567
					</xsl:otherwise>
1568
				</xsl:choose>
1569
			</xsl:when>
1570
			<xsl:otherwise>
1571
				<xsl:value-of select="$spanned-cols"/>
1572
			</xsl:otherwise>
1573
		</xsl:choose>
1574
	</xsl:template>
1575
	<xsl:template name="altova:xml-table-table-matrix-calc-spanned-rows">
1576
		<xsl:param name="colnum"/>
1577
		<xsl:param name="rownum"/>
1578
		<xsl:param name="col-count"/>
1579
		<xsl:param name="row-count"/>
1580
		<xsl:param name="table-matrix"/>
1581
		<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
1582
			<xsl:with-param name="spanned-rows" select="0"/>
1583
			<xsl:with-param name="colnum" select="$colnum"/>
1584
			<xsl:with-param name="rownum" select="$rownum + 1"/>
1585
			<xsl:with-param name="col-count" select="$col-count"/>
1586
			<xsl:with-param name="row-count" select="$row-count"/>
1587
			<xsl:with-param name="table-matrix" select="$table-matrix"/>
1588
		</xsl:call-template>
1589
	</xsl:template>
1590
	<xsl:template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
1591
		<xsl:param name="spanned-rows"/>
1592
		<xsl:param name="colnum"/>
1593
		<xsl:param name="rownum"/>
1594
		<xsl:param name="col-count"/>
1595
		<xsl:param name="row-count"/>
1596
		<xsl:param name="table-matrix"/>
1597
		<xsl:choose>
1598
			<xsl:when test="$rownum &lt;= $row-count">
1599
				<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
1600
				<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
1601
				<xsl:choose>
1602
					<xsl:when test="$entry-type='3' or $entry-type='5'">
1603
						<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows-helper">
1604
							<xsl:with-param name="spanned-rows" select="$spanned-rows + 1"/>
1605
							<xsl:with-param name="colnum" select="$colnum"/>
1606
							<xsl:with-param name="rownum" select="$rownum + 1"/>
1607
							<xsl:with-param name="col-count" select="$col-count"/>
1608
							<xsl:with-param name="row-count" select="$row-count"/>
1609
							<xsl:with-param name="table-matrix" select="$table-matrix"/>
1610
						</xsl:call-template>
1611
					</xsl:when>
1612
					<xsl:otherwise>
1613
						<xsl:value-of select="$spanned-rows"/>
1614
					</xsl:otherwise>
1615
				</xsl:choose>
1616
			</xsl:when>
1617
			<xsl:otherwise>
1618
				<xsl:value-of select="$spanned-rows"/>
1619
			</xsl:otherwise>
1620
		</xsl:choose>
1621
	</xsl:template>
1622
	<xsl:template name="altova:vector-count">
1623
		<xsl:param name="vector"/>
1624
		<xsl:param name="separator"/>
1625
		<xsl:call-template name="altova:vector-count-helper">
1626
			<xsl:with-param name="vector" select="$vector"/>
1627
			<xsl:with-param name="separator" select="$separator"/>
1628
			<xsl:with-param name="count" select="0"/>
1629
		</xsl:call-template>
1630
	</xsl:template>
1631
	<xsl:template name="altova:vector-count-helper">
1632
		<xsl:param name="vector"/>
1633
		<xsl:param name="separator"/>
1634
		<xsl:param name="count"/>
1635
		<xsl:choose>
1636
			<xsl:when test="not($vector)">
1637
				<xsl:value-of select="$count"/>
1638
			</xsl:when>
1639
			<xsl:otherwise>
1640
				<xsl:call-template name="altova:vector-count-helper">
1641
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1642
					<xsl:with-param name="separator" select="$separator"/>
1643
					<xsl:with-param name="count" select="$count + 1"/>
1644
				</xsl:call-template>
1645
			</xsl:otherwise>
1646
		</xsl:choose>
1647
	</xsl:template>
1648
	<xsl:template name="altova:vector-count-value">
1649
		<xsl:param name="value"/>
1650
		<xsl:param name="vector"/>
1651
		<xsl:param name="separator"/>
1652
		<xsl:call-template name="altova:vector-count-value-helper">
1653
			<xsl:with-param name="value" select="$value"/>
1654
			<xsl:with-param name="vector" select="$vector"/>
1655
			<xsl:with-param name="separator" select="$separator"/>
1656
			<xsl:with-param name="count" select="0"/>
1657
		</xsl:call-template>
1658
	</xsl:template>
1659
	<xsl:template name="altova:vector-count-value-helper">
1660
		<xsl:param name="value"/>
1661
		<xsl:param name="vector"/>
1662
		<xsl:param name="separator"/>
1663
		<xsl:param name="count"/>
1664
		<xsl:choose>
1665
			<xsl:when test="string($vector)">
1666
				<xsl:variable name="current-value">
1667
					<xsl:choose>
1668
						<xsl:when test="contains($vector,$separator)">
1669
							<xsl:value-of select="substring-before($vector,$separator)"/>
1670
						</xsl:when>
1671
						<xsl:otherwise>
1672
							<xsl:value-of select="$vector"/>
1673
						</xsl:otherwise>
1674
					</xsl:choose>
1675
				</xsl:variable>
1676
				<xsl:variable name="new-count">
1677
					<xsl:choose>
1678
						<xsl:when test="$value=string($current-value)">
1679
							<xsl:value-of select="$count + 1"/>
1680
						</xsl:when>
1681
						<xsl:otherwise>
1682
							<xsl:value-of select="$count"/>
1683
						</xsl:otherwise>
1684
					</xsl:choose>
1685
				</xsl:variable>
1686
				<xsl:call-template name="altova:vector-count-value-helper">
1687
					<xsl:with-param name="value" select="$value"/>
1688
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1689
					<xsl:with-param name="separator" select="$separator"/>
1690
					<xsl:with-param name="count" select="number($new-count)"/>
1691
				</xsl:call-template>
1692
			</xsl:when>
1693
			<xsl:otherwise>
1694
				<xsl:value-of select="$count"/>
1695
			</xsl:otherwise>
1696
		</xsl:choose>
1697
	</xsl:template>
1698
	<xsl:template name="altova:vector-multiply-values">
1699
		<xsl:param name="multiplier"/>
1700
		<xsl:param name="vector"/>
1701
		<xsl:param name="separator"/>
1702
		<xsl:if test="string($vector)">
1703
			<xsl:variable name="current-value">
1704
				<xsl:choose>
1705
					<xsl:when test="contains($vector,$separator)">
1706
						<xsl:value-of select="substring-before($vector,$separator)"/>
1707
					</xsl:when>
1708
					<xsl:otherwise>
1709
						<xsl:value-of select="$vector"/>
1710
					</xsl:otherwise>
1711
				</xsl:choose>
1712
			</xsl:variable>
1713
			<xsl:if test="string($current-value)">
1714
				<xsl:value-of select="number($current-value) * $multiplier"/>
1715
				<xsl:value-of select="$separator"/>
1716
			</xsl:if>
1717
			<xsl:call-template name="altova:vector-multiply-values">
1718
				<xsl:with-param name="multiplier" select="$multiplier"/>
1719
				<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1720
				<xsl:with-param name="separator" select="$separator"/>
1721
			</xsl:call-template>
1722
		</xsl:if>
1723
	</xsl:template>
1724
	<xsl:template name="altova:vector-replace-value">
1725
		<xsl:param name="old-value"/>
1726
		<xsl:param name="new-value"/>
1727
		<xsl:param name="vector"/>
1728
		<xsl:param name="separator"/>
1729
		<xsl:if test="string($vector)">
1730
			<xsl:variable name="current-value">
1731
				<xsl:choose>
1732
					<xsl:when test="contains($vector,$separator)">
1733
						<xsl:value-of select="substring-before($vector,$separator)"/>
1734
					</xsl:when>
1735
					<xsl:otherwise>
1736
						<xsl:value-of select="$vector"/>
1737
					</xsl:otherwise>
1738
				</xsl:choose>
1739
			</xsl:variable>
1740
			<xsl:choose>
1741
				<xsl:when test="$current-value = $old-value">
1742
					<xsl:value-of select="$new-value"/>
1743
				</xsl:when>
1744
				<xsl:otherwise>
1745
					<xsl:value-of select="$current-value"/>
1746
				</xsl:otherwise>
1747
			</xsl:choose>
1748
			<xsl:value-of select="$separator"/>
1749
			<xsl:call-template name="altova:vector-replace-value">
1750
				<xsl:with-param name="old-value" select="$old-value"/>
1751
				<xsl:with-param name="new-value" select="$new-value"/>
1752
				<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1753
				<xsl:with-param name="separator" select="$separator"/>
1754
			</xsl:call-template>
1755
		</xsl:if>
1756
	</xsl:template>
1757
	<xsl:template name="altova:vector-reverse">
1758
		<xsl:param name="vector"/>
1759
		<xsl:param name="separator"/>
1760
		<xsl:if test="$vector">
1761
			<xsl:call-template name="altova:vector-reverse">
1762
				<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1763
				<xsl:with-param name="separator" select="$separator"/>
1764
			</xsl:call-template>
1765
			<xsl:choose>
1766
				<xsl:when test="contains($vector,$separator)">
1767
					<xsl:value-of select="concat(substring-before($vector,$separator),$separator)"/>
1768
				</xsl:when>
1769
				<xsl:otherwise>
1770
					<xsl:value-of select="concat($vector,$separator)"/>
1771
				</xsl:otherwise>
1772
			</xsl:choose>
1773
		</xsl:if>
1774
	</xsl:template>
1775
	<xsl:template name="altova:vector-get-value">
1776
		<xsl:param name="index"/>
1777
		<xsl:param name="vector"/>
1778
		<xsl:param name="separator"/>
1779
		<xsl:choose>
1780
			<xsl:when test="$index = 1">
1781
				<xsl:choose>
1782
					<xsl:when test="contains($vector,$separator)">
1783
						<xsl:value-of select="substring-before($vector,$separator)"/>
1784
					</xsl:when>
1785
					<xsl:otherwise>
1786
						<xsl:value-of select="$vector"/>
1787
					</xsl:otherwise>
1788
				</xsl:choose>
1789
			</xsl:when>
1790
			<xsl:otherwise>
1791
				<xsl:call-template name="altova:vector-get-value">
1792
					<xsl:with-param name="index" select="$index - 1"/>
1793
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1794
					<xsl:with-param name="separator" select="$separator"/>
1795
				</xsl:call-template>
1796
			</xsl:otherwise>
1797
		</xsl:choose>
1798
	</xsl:template>
1799
	<xsl:template name="altova:vector-append">
1800
		<xsl:param name="count"/>
1801
		<xsl:param name="value"/>
1802
		<xsl:param name="separator"/>
1803
		<xsl:if test="$count > 0">
1804
			<xsl:value-of select="concat($value,$separator)"/>
1805
			<xsl:call-template name="altova:vector-append">
1806
				<xsl:with-param name="count" select="$count - 1"/>
1807
				<xsl:with-param name="value" select="$value"/>
1808
				<xsl:with-param name="separator" select="$separator"/>
1809
			</xsl:call-template>
1810
		</xsl:if>
1811
	</xsl:template>
1812
	<xsl:template name="altova:vector-calc-sum">
1813
		<xsl:param name="start-sum"/>
1814
		<xsl:param name="vector"/>
1815
		<xsl:param name="separator"/>
1816
		<xsl:choose>
1817
			<xsl:when test="string($vector)">
1818
				<xsl:variable name="value">
1819
					<xsl:choose>
1820
						<xsl:when test="contains($vector,$separator)">
1821
							<xsl:value-of select="substring-before($vector,$separator)"/>
1822
						</xsl:when>
1823
						<xsl:otherwise>
1824
							<xsl:value-of select="$vector"/>
1825
						</xsl:otherwise>
1826
					</xsl:choose>
1827
				</xsl:variable>
1828
				<xsl:call-template name="altova:vector-calc-sum">
1829
					<xsl:with-param name="start-sum" select="$start-sum + number($value)"/>
1830
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1831
					<xsl:with-param name="separator" select="$separator"/>
1832
				</xsl:call-template>
1833
			</xsl:when>
1834
			<xsl:otherwise>
1835
				<xsl:value-of select="$start-sum"/>
1836
			</xsl:otherwise>
1837
		</xsl:choose>
1838
	</xsl:template>
1839
	<xsl:template name="altova:vector-calc-sum-range">
1840
		<xsl:param name="start-sum"/>
1841
		<xsl:param name="from"/>
1842
		<xsl:param name="to"/>
1843
		<xsl:param name="vector"/>
1844
		<xsl:param name="separator"/>
1845
		<xsl:call-template name="altova:vector-calc-sum-range-helper">
1846
			<xsl:with-param name="start-sum" select="$start-sum"/>
1847
			<xsl:with-param name="pos" select="1"/>
1848
			<xsl:with-param name="from" select="$from"/>
1849
			<xsl:with-param name="to" select="$to"/>
1850
			<xsl:with-param name="vector" select="$vector"/>
1851
			<xsl:with-param name="separator" select="$separator"/>
1852
		</xsl:call-template>
1853
	</xsl:template>
1854
	<xsl:template name="altova:vector-calc-sum-range-helper">
1855
		<xsl:param name="start-sum"/>
1856
		<xsl:param name="pos"/>
1857
		<xsl:param name="from"/>
1858
		<xsl:param name="to"/>
1859
		<xsl:param name="vector"/>
1860
		<xsl:param name="separator"/>
1861
		<xsl:choose>
1862
			<xsl:when test="$pos &lt; $from">
1863
				<xsl:call-template name="altova:vector-calc-sum-range-helper">
1864
					<xsl:with-param name="start-sum" select="$start-sum"/>
1865
					<xsl:with-param name="pos" select="$pos + 1"/>
1866
					<xsl:with-param name="from" select="$from"/>
1867
					<xsl:with-param name="to" select="$to"/>
1868
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1869
					<xsl:with-param name="separator" select="$separator"/>
1870
				</xsl:call-template>
1871
			</xsl:when>
1872
			<xsl:when test="$pos &gt; $to">
1873
				<xsl:value-of select="$start-sum"/>
1874
			</xsl:when>
1875
			<xsl:otherwise>
1876
				<xsl:variable name="value">
1877
					<xsl:choose>
1878
						<xsl:when test="contains($vector,$separator)">
1879
							<xsl:value-of select="substring-before($vector,$separator)"/>
1880
						</xsl:when>
1881
						<xsl:otherwise>
1882
							<xsl:value-of select="$vector"/>
1883
						</xsl:otherwise>
1884
					</xsl:choose>
1885
				</xsl:variable>
1886
				<xsl:call-template name="altova:vector-calc-sum-range-helper">
1887
					<xsl:with-param name="start-sum" select="$start-sum + number($value)"/>
1888
					<xsl:with-param name="pos" select="$pos + 1"/>
1889
					<xsl:with-param name="from" select="$from"/>
1890
					<xsl:with-param name="to" select="$to"/>
1891
					<xsl:with-param name="vector" select="substring-after($vector,$separator)"/>
1892
					<xsl:with-param name="separator" select="$separator"/>
1893
				</xsl:call-template>
1894
			</xsl:otherwise>
1895
		</xsl:choose>
1896
	</xsl:template>
1897
	<xsl:template name="altova:vector-merge-vectors-using-max-value">
1898
		<xsl:param name="vector1"/>
1899
		<xsl:param name="vector2"/>
1900
		<xsl:param name="separator"/>
1901
		<xsl:choose>
1902
			<xsl:when test="string($vector1) and string($vector2)">
1903
				<xsl:variable name="value1">
1904
					<xsl:choose>
1905
						<xsl:when test="contains($vector1,$separator)">
1906
							<xsl:value-of select="substring-before($vector1,$separator)"/>
1907
						</xsl:when>
1908
						<xsl:otherwise>
1909
							<xsl:value-of select="$vector1"/>
1910
						</xsl:otherwise>
1911
					</xsl:choose>
1912
				</xsl:variable>
1913
				<xsl:variable name="value2">
1914
					<xsl:choose>
1915
						<xsl:when test="contains($vector2,$separator)">
1916
							<xsl:value-of select="substring-before($vector2,$separator)"/>
1917
						</xsl:when>
1918
						<xsl:otherwise>
1919
							<xsl:value-of select="$vector2"/>
1920
						</xsl:otherwise>
1921
					</xsl:choose>
1922
				</xsl:variable>
1923
				<xsl:choose>
1924
					<xsl:when test="number($value1) > number($value2)">
1925
						<xsl:value-of select="$value1"/>
1926
					</xsl:when>
1927
					<xsl:otherwise>
1928
						<xsl:value-of select="$value2"/>
1929
					</xsl:otherwise>
1930
				</xsl:choose>
1931
				<xsl:value-of select="$separator"/>
1932
				<xsl:call-template name="altova:vector-merge-vectors-using-max-value">
1933
					<xsl:with-param name="vector1" select="substring-after($vector1,$separator)"/>
1934
					<xsl:with-param name="vector2" select="substring-after($vector2,$separator)"/>
1935
					<xsl:with-param name="separator" select="$separator"/>
1936
				</xsl:call-template>
1937
			</xsl:when>
1938
			<xsl:when test="string($vector1)">
1939
				<xsl:value-of select="$vector1"/>
1940
			</xsl:when>
1941
			<xsl:when test="string($vector2)">
1942
				<xsl:value-of select="$vector2"/>
1943
			</xsl:when>
1944
		</xsl:choose>
1945
	</xsl:template>
1946
	<xsl:template name="altova:char-vector-append">
1947
		<xsl:param name="count"/>
1948
		<xsl:param name="char"/>
1949
		<xsl:if test="$count > 0">
1950
			<xsl:value-of select="$char"/>
1951
			<xsl:call-template name="altova:char-vector-append">
1952
				<xsl:with-param name="count" select="$count - 1"/>
1953
				<xsl:with-param name="char" select="$char"/>
1954
			</xsl:call-template>
1955
		</xsl:if>
1956
	</xsl:template>
1957
	<xsl:template name="altova:char-vector-calc-index-of-nth-char">
1958
		<xsl:param name="n"/>
1959
		<xsl:param name="char"/>
1960
		<xsl:param name="char-vector"/>
1961
		<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
1962
			<xsl:with-param name="pos" select="1"/>
1963
			<xsl:with-param name="count" select="0"/>
1964
			<xsl:with-param name="n" select="$n"/>
1965
			<xsl:with-param name="char" select="$char"/>
1966
			<xsl:with-param name="char-vector" select="$char-vector"/>
1967
		</xsl:call-template>
1968
	</xsl:template>
1969
	<xsl:template name="altova:char-vector-calc-index-of-nth-char-helper">
1970
		<xsl:param name="pos"/>
1971
		<xsl:param name="count"/>
1972
		<xsl:param name="n"/>
1973
		<xsl:param name="char"/>
1974
		<xsl:param name="char-vector"/>
1975
		<xsl:choose>
1976
			<xsl:when test="substring($char-vector,$pos,1)=$char">
1977
				<xsl:choose>
1978
					<xsl:when test="$n = $count+1">
1979
						<xsl:value-of select="$pos"/>
1980
					</xsl:when>
1981
					<xsl:otherwise>
1982
						<xsl:if test="$pos &lt; string-length($char-vector)">
1983
							<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
1984
								<xsl:with-param name="pos" select="$pos + 1"/>
1985
								<xsl:with-param name="count" select="$count + 1"/>
1986
								<xsl:with-param name="n" select="$n"/>
1987
								<xsl:with-param name="char" select="$char"/>
1988
								<xsl:with-param name="char-vector" select="$char-vector"/>
1989
							</xsl:call-template>
1990
						</xsl:if>
1991
					</xsl:otherwise>
1992
				</xsl:choose>
1993
			</xsl:when>
1994
			<xsl:otherwise>
1995
				<xsl:if test="$pos &lt; string-length($char-vector)">
1996
					<xsl:call-template name="altova:char-vector-calc-index-of-nth-char-helper">
1997
						<xsl:with-param name="pos" select="$pos + 1"/>
1998
						<xsl:with-param name="count" select="$count"/>
1999
						<xsl:with-param name="n" select="$n"/>
2000
						<xsl:with-param name="char" select="$char"/>
2001
						<xsl:with-param name="char-vector" select="$char-vector"/>
2002
					</xsl:call-template>
2003
				</xsl:if>
2004
			</xsl:otherwise>
2005
		</xsl:choose>
2006
	</xsl:template>
2007
	<xsl:template name="altova:css-styles-get-property">
2008
		<xsl:param name="property"/>
2009
		<xsl:param name="css-styles"/>
2010
		<xsl:choose>
2011
			<xsl:when test="not($css-styles)"/>
2012
			<xsl:when test="normalize-space(substring-before($css-styles,':'))=$property">
2013
				<xsl:choose>
2014
					<xsl:when test="contains($css-styles,';')">
2015
						<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
2016
					</xsl:when>
2017
					<xsl:otherwise>
2018
						<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
2019
					</xsl:otherwise>
2020
				</xsl:choose>
2021
			</xsl:when>
2022
			<xsl:otherwise>
2023
				<xsl:call-template name="altova:css-styles-get-property">
2024
					<xsl:with-param name="property" select="$property"/>
2025
					<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
2026
				</xsl:call-template>
2027
			</xsl:otherwise>
2028
		</xsl:choose>
2029
	</xsl:template>
2030
	<xsl:template name="altova:css-styles-remove-property">
2031
		<xsl:param name="property"/>
2032
		<xsl:param name="css-styles"/>
2033
		<xsl:if test="string($css-styles)">
2034
			<xsl:variable name="actual-property" select="normalize-space(substring-before($css-styles,':'))"/>
2035
			<xsl:if test="not(contains($actual-property,';'))">
2036
				<xsl:if test="$actual-property!=$property">
2037
					<xsl:variable name="value">
2038
						<xsl:choose>
2039
							<xsl:when test="contains($css-styles,';')">
2040
								<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
2041
							</xsl:when>
2042
							<xsl:otherwise>
2043
								<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
2044
							</xsl:otherwise>
2045
						</xsl:choose>
2046
					</xsl:variable>
2047
					<xsl:value-of select="concat($actual-property,':',$value,';')"/>
2048
				</xsl:if>
2049
			</xsl:if>
2050
			<xsl:call-template name="altova:css-styles-remove-property">
2051
				<xsl:with-param name="property" select="$property"/>
2052
				<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
2053
			</xsl:call-template>
2054
		</xsl:if>
2055
	</xsl:template>
2056
	<xsl:template name="altova:css-styles-get-inherited-styles-for-table-cell">
2057
		<xsl:param name="css-styles"/>
2058
		<xsl:if test="string($css-styles)">
2059
			<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
2060
			<xsl:variable name="value">
2061
				<xsl:choose>
2062
					<xsl:when test="contains($css-styles,';')">
2063
						<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
2064
					</xsl:when>
2065
					<xsl:otherwise>
2066
						<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
2067
					</xsl:otherwise>
2068
				</xsl:choose>
2069
			</xsl:variable>
2070
			<xsl:choose>
2071
				<xsl:when test="$property='background'">
2072
					<xsl:value-of select="concat($property,':',$value,';')"/>
2073
				</xsl:when>
2074
				<xsl:when test="$property='background-color'">
2075
					<xsl:value-of select="concat($property,':',$value,';')"/>
2076
				</xsl:when>
2077
				<xsl:when test="$property='color'">
2078
					<xsl:value-of select="concat($property,':',$value,';')"/>
2079
				</xsl:when>
2080
				<xsl:when test="$property='font'">
2081
					<xsl:value-of select="concat($property,':',$value,';')"/>
2082
				</xsl:when>
2083
				<xsl:when test="$property='font-family'">
2084
					<xsl:value-of select="concat($property,':',$value,';')"/>
2085
				</xsl:when>
2086
				<xsl:when test="$property='font-size'">
2087
					<xsl:value-of select="concat($property,':',$value,';')"/>
2088
				</xsl:when>
2089
				<xsl:when test="$property='font-style'">
2090
					<xsl:value-of select="concat($property,':',$value,';')"/>
2091
				</xsl:when>
2092
				<xsl:when test="$property='font-variant'">
2093
					<xsl:value-of select="concat($property,':',$value,';')"/>
2094
				</xsl:when>
2095
				<xsl:when test="$property='font-weight'">
2096
					<xsl:value-of select="concat($property,':',$value,';')"/>
2097
				</xsl:when>
2098
				<xsl:when test="$property='letter-spacing'">
2099
					<xsl:value-of select="concat($property,':',$value,';')"/>
2100
				</xsl:when>
2101
				<xsl:when test="$property='text-align'">
2102
					<xsl:value-of select="concat($property,':',$value,';')"/>
2103
				</xsl:when>
2104
				<xsl:when test="$property='text-decoration'">
2105
					<xsl:value-of select="concat($property,':',$value,';')"/>
2106
				</xsl:when>
2107
				<xsl:when test="$property='text-indent'">
2108
					<xsl:value-of select="concat($property,':',$value,';')"/>
2109
				</xsl:when>
2110
				<xsl:when test="$property='text-transform'">
2111
					<xsl:value-of select="concat($property,':',$value,';')"/>
2112
				</xsl:when>
2113
				<xsl:when test="$property='vertical-align'">
2114
					<xsl:value-of select="concat($property,':',$value,';')"/>
2115
				</xsl:when>
2116
			</xsl:choose>
2117
			<xsl:call-template name="altova:css-styles-get-inherited-styles-for-table-cell">
2118
				<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
2119
			</xsl:call-template>
2120
		</xsl:if>
2121
	</xsl:template>
2122
	<xsl:template name="altova:css-styles-split-shorthand-styles">
2123
		<xsl:param name="css-styles"/>
2124
		<xsl:if test="string($css-styles)">
2125
			<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
2126
			<xsl:if test="string($property) and not(contains($property,';'))">
2127
				<xsl:variable name="value">
2128
					<xsl:choose>
2129
						<xsl:when test="contains($css-styles,';')">
2130
							<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
2131
						</xsl:when>
2132
						<xsl:otherwise>
2133
							<xsl:value-of select="normalize-space(substring-after($css-styles,':'))"/>
2134
						</xsl:otherwise>
2135
					</xsl:choose>
2136
				</xsl:variable>
2137
				<xsl:choose>
2138
					<xsl:when test="$property='background'">
2139
						<xsl:call-template name="altova:css-styles-split-background">
2140
							<xsl:with-param name="value" select="string($value)"/>
2141
						</xsl:call-template>
2142
					</xsl:when>
2143
					<xsl:when test="$property='border'">
2144
						<xsl:call-template name="altova:css-styles-split-border">
2145
							<xsl:with-param name="value" select="string($value)"/>
2146
						</xsl:call-template>
2147
					</xsl:when>
2148
					<xsl:when test="$property='border-top'">
2149
						<xsl:call-template name="altova:css-styles-split-border-top">
2150
							<xsl:with-param name="value" select="string($value)"/>
2151
						</xsl:call-template>
2152
					</xsl:when>
2153
					<xsl:when test="$property='border-right'">
2154
						<xsl:call-template name="altova:css-styles-split-border-right">
2155
							<xsl:with-param name="value" select="string($value)"/>
2156
						</xsl:call-template>
2157
					</xsl:when>
2158
					<xsl:when test="$property='border-bottom'">
2159
						<xsl:call-template name="altova:css-styles-split-border-bottom">
2160
							<xsl:with-param name="value" select="string($value)"/>
2161
						</xsl:call-template>
2162
					</xsl:when>
2163
					<xsl:when test="$property='border-left'">
2164
						<xsl:call-template name="altova:css-styles-split-border-left">
2165
							<xsl:with-param name="value" select="string($value)"/>
2166
						</xsl:call-template>
2167
					</xsl:when>
2168
					<xsl:when test="$property='border-color'">
2169
						<xsl:call-template name="altova:css-styles-split-border-color">
2170
							<xsl:with-param name="value" select="string($value)"/>
2171
						</xsl:call-template>
2172
					</xsl:when>
2173
					<xsl:when test="$property='border-style'">
2174
						<xsl:call-template name="altova:css-styles-split-border-style">
2175
							<xsl:with-param name="value" select="string($value)"/>
2176
						</xsl:call-template>
2177
					</xsl:when>
2178
					<xsl:when test="$property='border-width'">
2179
						<xsl:call-template name="altova:css-styles-split-border-width">
2180
							<xsl:with-param name="value" select="string($value)"/>
2181
						</xsl:call-template>
2182
					</xsl:when>
2183
					<xsl:when test="$property='font'">
2184
						<xsl:call-template name="altova:css-styles-split-font-style">
2185
							<xsl:with-param name="value" select="string($value)"/>
2186
							<xsl:with-param name="font-style" select="'normal'"/>
2187
							<xsl:with-param name="font-variant" select="'normal'"/>
2188
							<xsl:with-param name="font-weight" select="'normal'"/>
2189
						</xsl:call-template>
2190
					</xsl:when>
2191
					<xsl:when test="$property='margin'">
2192
						<xsl:call-template name="altova:css-styles-split-margin-style">
2193
							<xsl:with-param name="value" select="string($value)"/>
2194
						</xsl:call-template>
2195
					</xsl:when>
2196
					<xsl:when test="$property='padding'">
2197
						<xsl:call-template name="altova:css-styles-split-padding-style">
2198
							<xsl:with-param name="value" select="string($value)"/>
2199
						</xsl:call-template>
2200
					</xsl:when>
2201
					<xsl:otherwise>
2202
						<xsl:value-of select="concat($property,':',$value,';')"/>
2203
					</xsl:otherwise>
2204
				</xsl:choose>
2205
			</xsl:if>
2206
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
2207
				<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
2208
			</xsl:call-template>
2209
		</xsl:if>
2210
	</xsl:template>
2211
	<xsl:template name="altova:css-styles-is-value-length">
2212
		<xsl:param name="value"/>
2213
		<xsl:variable name="unit" select="translate($value,'0123456789+-.','')"/>
2214
		<xsl:choose>
2215
			<xsl:when test="$unit='em'">1</xsl:when>
2216
			<xsl:when test="$unit='ex'">1</xsl:when>
2217
			<xsl:when test="$unit='px'">1</xsl:when>
2218
			<xsl:when test="$unit='in'">1</xsl:when>
2219
			<xsl:when test="$unit='cm'">1</xsl:when>
2220
			<xsl:when test="$unit='mm'">1</xsl:when>
2221
			<xsl:when test="$unit='pt'">1</xsl:when>
2222
			<xsl:when test="$unit='pc'">1</xsl:when>
2223
			<xsl:when test="$unit=''">
2224
				<xsl:variable name="number" select="translate($value,'ceimnptx','')"/>
2225
				<xsl:choose>
2226
					<xsl:when test="number($number)=0">1</xsl:when>
2227
					<xsl:otherwise>0</xsl:otherwise>
2228
				</xsl:choose>
2229
			</xsl:when>
2230
			<xsl:otherwise>0</xsl:otherwise>
2231
		</xsl:choose>
2232
	</xsl:template>
2233
	<xsl:template name="altova:css-styles-is-value-background-color">
2234
		<xsl:param name="value"/>
2235
		<xsl:choose>
2236
			<xsl:when test="$value='transparent'">1</xsl:when>
2237
			<xsl:otherwise>
2238
				<xsl:variable name="is-color">
2239
					<xsl:call-template name="altova:css-styles-is-value-color">
2240
						<xsl:with-param name="value" select="$value"/>
2241
					</xsl:call-template>
2242
				</xsl:variable>
2243
				<xsl:choose>
2244
					<xsl:when test="$is-color='1'">1</xsl:when>
2245
					<xsl:otherwise>0</xsl:otherwise>
2246
				</xsl:choose>
2247
			</xsl:otherwise>
2248
		</xsl:choose>
2249
	</xsl:template>
2250
	<xsl:template name="altova:css-styles-is-value-background-image">
2251
		<xsl:param name="value"/>
2252
		<xsl:choose>
2253
			<xsl:when test="$value='none'">1</xsl:when>
2254
			<xsl:otherwise>
2255
				<xsl:variable name="is-uri">
2256
					<xsl:call-template name="altova:css-styles-is-value-uri">
2257
						<xsl:with-param name="value" select="$value"/>
2258
					</xsl:call-template>
2259
				</xsl:variable>
2260
				<xsl:choose>
2261
					<xsl:when test="$is-uri='1'">1</xsl:when>
2262
					<xsl:otherwise>0</xsl:otherwise>
2263
				</xsl:choose>
2264
			</xsl:otherwise>
2265
		</xsl:choose>
2266
	</xsl:template>
2267
	<xsl:template name="altova:css-styles-is-value-background-repeat">
2268
		<xsl:param name="value"/>
2269
		<xsl:choose>
2270
			<xsl:when test="$value='repeat'">1</xsl:when>
2271
			<xsl:when test="$value='repeat-x'">1</xsl:when>
2272
			<xsl:when test="$value='repeat-y'">1</xsl:when>
2273
			<xsl:when test="$value='no-repeat'">1</xsl:when>
2274
			<xsl:otherwise>0</xsl:otherwise>
2275
		</xsl:choose>
2276
	</xsl:template>
2277
	<xsl:template name="altova:css-styles-is-value-background-attachment">
2278
		<xsl:param name="value"/>
2279
		<xsl:choose>
2280
			<xsl:when test="$value='scroll'">1</xsl:when>
2281
			<xsl:when test="$value='fixed'">1</xsl:when>
2282
			<xsl:otherwise>0</xsl:otherwise>
2283
		</xsl:choose>
2284
	</xsl:template>
2285
	<xsl:template name="altova:css-styles-is-value-color">
2286
		<xsl:param name="value"/>
2287
		<xsl:choose>
2288
			<xsl:when test="$value='aqua'">1</xsl:when>
2289
			<xsl:when test="$value='black'">1</xsl:when>
2290
			<xsl:when test="$value='blue'">1</xsl:when>
2291
			<xsl:when test="$value='fuchsia'">1</xsl:when>
2292
			<xsl:when test="$value='gray'">1</xsl:when>
2293
			<xsl:when test="$value='green'">1</xsl:when>
2294
			<xsl:when test="$value='lime'">1</xsl:when>
2295
			<xsl:when test="$value='maroon'">1</xsl:when>
2296
			<xsl:when test="$value='navy'">1</xsl:when>
2297
			<xsl:when test="$value='olive'">1</xsl:when>
2298
			<xsl:when test="$value='orange'">1</xsl:when>
2299
			<xsl:when test="$value='purple'">1</xsl:when>
2300
			<xsl:when test="$value='red'">1</xsl:when>
2301
			<xsl:when test="$value='silver'">1</xsl:when>
2302
			<xsl:when test="$value='teal'">1</xsl:when>
2303
			<xsl:when test="$value='white'">1</xsl:when>
2304
			<xsl:when test="$value='yellow'">1</xsl:when>
2305
			<xsl:when test="starts-with($value,'#')">1</xsl:when>
2306
			<xsl:when test="starts-with($value,'rgb(')">1</xsl:when>
2307
			<xsl:otherwise>0</xsl:otherwise>
2308
		</xsl:choose>
2309
	</xsl:template>
2310
	<xsl:template name="altova:css-styles-is-value-border-width">
2311
		<xsl:param name="value"/>
2312
		<xsl:choose>
2313
			<xsl:when test="$value='thin'">1</xsl:when>
2314
			<xsl:when test="$value='medium'">1</xsl:when>
2315
			<xsl:when test="$value='thick'">1</xsl:when>
2316
			<xsl:otherwise>
2317
				<xsl:variable name="is-length">
2318
					<xsl:call-template name="altova:css-styles-is-value-length">
2319
						<xsl:with-param name="value" select="$value"/>
2320
					</xsl:call-template>
2321
				</xsl:variable>
2322
				<xsl:choose>
2323
					<xsl:when test="$is-length='1'">1</xsl:when>
2324
					<xsl:otherwise>0</xsl:otherwise>
2325
				</xsl:choose>
2326
			</xsl:otherwise>
2327
		</xsl:choose>
2328
	</xsl:template>
2329
	<xsl:template name="altova:css-styles-is-value-border-style">
2330
		<xsl:param name="value"/>
2331
		<xsl:choose>
2332
			<xsl:when test="$value='none'">1</xsl:when>
2333
			<xsl:when test="$value='hidden'">1</xsl:when>
2334
			<xsl:when test="$value='dotted'">1</xsl:when>
2335
			<xsl:when test="$value='dashed'">1</xsl:when>
2336
			<xsl:when test="$value='solid'">1</xsl:when>
2337
			<xsl:when test="$value='double'">1</xsl:when>
2338
			<xsl:when test="$value='groove'">1</xsl:when>
2339
			<xsl:when test="$value='ridge'">1</xsl:when>
2340
			<xsl:when test="$value='inset'">1</xsl:when>
2341
			<xsl:when test="$value='outset'">1</xsl:when>
2342
			<xsl:otherwise>0</xsl:otherwise>
2343
		</xsl:choose>
2344
	</xsl:template>
2345
	<xsl:template name="altova:css-styles-is-value-border-color">
2346
		<xsl:param name="value"/>
2347
		<xsl:choose>
2348
			<xsl:when test="$value='transparent'">1</xsl:when>
2349
			<xsl:otherwise>
2350
				<xsl:variable name="is-color">
2351
					<xsl:call-template name="altova:css-styles-is-value-color">
2352
						<xsl:with-param name="value" select="$value"/>
2353
					</xsl:call-template>
2354
				</xsl:variable>
2355
				<xsl:choose>
2356
					<xsl:when test="$is-color='1'">1</xsl:when>
2357
					<xsl:otherwise>0</xsl:otherwise>
2358
				</xsl:choose>
2359
			</xsl:otherwise>
2360
		</xsl:choose>
2361
	</xsl:template>
2362
	<xsl:template name="altova:css-styles-is-value-font-style">
2363
		<xsl:param name="value"/>
2364
		<xsl:choose>
2365
			<xsl:when test="$value='normal'">1</xsl:when>
2366
			<xsl:when test="$value='italic'">1</xsl:when>
2367
			<xsl:when test="$value='oblique'">1</xsl:when>
2368
			<xsl:otherwise>0</xsl:otherwise>
2369
		</xsl:choose>
2370
	</xsl:template>
2371
	<xsl:template name="altova:css-styles-is-value-font-variant">
2372
		<xsl:param name="value"/>
2373
		<xsl:choose>
2374
			<xsl:when test="$value='normal'">1</xsl:when>
2375
			<xsl:when test="$value='small-caps'">1</xsl:when>
2376
			<xsl:otherwise>0</xsl:otherwise>
2377
		</xsl:choose>
2378
	</xsl:template>
2379
	<xsl:template name="altova:css-styles-is-value-font-weight">
2380
		<xsl:param name="value"/>
2381
		<xsl:choose>
2382
			<xsl:when test="$value='normal'">1</xsl:when>
2383
			<xsl:when test="$value='bold'">1</xsl:when>
2384
			<xsl:when test="$value='bolder'">1</xsl:when>
2385
			<xsl:when test="$value='lighter'">1</xsl:when>
2386
			<xsl:when test="$value='100'">1</xsl:when>
2387
			<xsl:when test="$value='200'">1</xsl:when>
2388
			<xsl:when test="$value='300'">1</xsl:when>
2389
			<xsl:when test="$value='400'">1</xsl:when>
2390
			<xsl:when test="$value='500'">1</xsl:when>
2391
			<xsl:when test="$value='600'">1</xsl:when>
2392
			<xsl:when test="$value='700'">1</xsl:when>
2393
			<xsl:when test="$value='800'">1</xsl:when>
2394
			<xsl:when test="$value='900'">1</xsl:when>
2395
			<xsl:otherwise>0</xsl:otherwise>
2396
		</xsl:choose>
2397
	</xsl:template>
2398
	<xsl:template name="altova:css-styles-is-value-uri">
2399
		<xsl:param name="value"/>
2400
		<xsl:choose>
2401
			<xsl:when test="starts-with($value,'url(')">1</xsl:when>
2402
			<xsl:otherwise>0</xsl:otherwise>
2403
		</xsl:choose>
2404
	</xsl:template>
2405
	<xsl:template name="altova:css-styles-split-background">
2406
		<xsl:param name="value"/>
2407
		<xsl:if test="$value">
2408
			<xsl:variable name="first-value">
2409
				<xsl:choose>
2410
					<xsl:when test="contains($value,' ')">
2411
						<xsl:value-of select="substring-before($value,' ')"/>
2412
					</xsl:when>
2413
					<xsl:otherwise>
2414
						<xsl:value-of select="$value"/>
2415
					</xsl:otherwise>
2416
				</xsl:choose>
2417
			</xsl:variable>
2418
			<xsl:variable name="is-background-color">
2419
				<xsl:call-template name="altova:css-styles-is-value-background-color">
2420
					<xsl:with-param name="value" select="$first-value"/>
2421
				</xsl:call-template>
2422
			</xsl:variable>
2423
			<xsl:variable name="is-background-image">
2424
				<xsl:call-template name="altova:css-styles-is-value-background-image">
2425
					<xsl:with-param name="value" select="$first-value"/>
2426
				</xsl:call-template>
2427
			</xsl:variable>
2428
			<xsl:variable name="is-background-repeat">
2429
				<xsl:call-template name="altova:css-styles-is-value-background-repeat">
2430
					<xsl:with-param name="value" select="$first-value"/>
2431
				</xsl:call-template>
2432
			</xsl:variable>
2433
			<xsl:variable name="is-background-attachment">
2434
				<xsl:call-template name="altova:css-styles-is-value-background-attachment">
2435
					<xsl:with-param name="value" select="$first-value"/>
2436
				</xsl:call-template>
2437
			</xsl:variable>
2438
			<xsl:choose>
2439
				<xsl:when test="$is-background-color='1'">
2440
					<xsl:value-of select="concat('background-color:',$first-value,';')"/>
2441
				</xsl:when>
2442
				<xsl:when test="$is-background-image='1'">
2443
					<xsl:value-of select="concat('background-image:',$first-value,';')"/>
2444
				</xsl:when>
2445
				<xsl:when test="$is-background-repeat='1'">
2446
					<xsl:value-of select="concat('background-repeat:',$first-value,';')"/>
2447
				</xsl:when>
2448
				<xsl:when test="$is-background-attachment='1'">
2449
					<xsl:value-of select="concat('background-attachment:',$first-value,';')"/>
2450
				</xsl:when>
2451
				<xsl:otherwise>
2452
					<xsl:value-of select="concat('background-position:',$first-value,';')"/>
2453
				</xsl:otherwise>
2454
			</xsl:choose>
2455
			<xsl:call-template name="altova:css-styles-split-background">
2456
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2457
			</xsl:call-template>
2458
		</xsl:if>
2459
	</xsl:template>
2460
	<xsl:template name="altova:css-styles-split-border">
2461
		<xsl:param name="value"/>
2462
		<xsl:if test="$value">
2463
			<xsl:variable name="first-value">
2464
				<xsl:choose>
2465
					<xsl:when test="contains($value,' ')">
2466
						<xsl:value-of select="substring-before($value,' ')"/>
2467
					</xsl:when>
2468
					<xsl:otherwise>
2469
						<xsl:value-of select="$value"/>
2470
					</xsl:otherwise>
2471
				</xsl:choose>
2472
			</xsl:variable>
2473
			<xsl:variable name="is-border-width">
2474
				<xsl:call-template name="altova:css-styles-is-value-border-width">
2475
					<xsl:with-param name="value" select="$first-value"/>
2476
				</xsl:call-template>
2477
			</xsl:variable>
2478
			<xsl:variable name="is-border-style">
2479
				<xsl:call-template name="altova:css-styles-is-value-border-style">
2480
					<xsl:with-param name="value" select="$first-value"/>
2481
				</xsl:call-template>
2482
			</xsl:variable>
2483
			<xsl:variable name="is-border-color">
2484
				<xsl:call-template name="altova:css-styles-is-value-border-color">
2485
					<xsl:with-param name="value" select="$first-value"/>
2486
				</xsl:call-template>
2487
			</xsl:variable>
2488
			<xsl:choose>
2489
				<xsl:when test="$is-border-width='1'">
2490
					<xsl:value-of select="concat('border-top-width:',$first-value,';')"/>
2491
					<xsl:value-of select="concat('border-right-width:',$first-value,';')"/>
2492
					<xsl:value-of select="concat('border-bottom-width:',$first-value,';')"/>
2493
					<xsl:value-of select="concat('border-left-width:',$first-value,';')"/>
2494
				</xsl:when>
2495
				<xsl:when test="$is-border-style='1'">
2496
					<xsl:value-of select="concat('border-top-style:',$first-value,';')"/>
2497
					<xsl:value-of select="concat('border-right-style:',$first-value,';')"/>
2498
					<xsl:value-of select="concat('border-bottom-style:',$first-value,';')"/>
2499
					<xsl:value-of select="concat('border-left-style:',$first-value,';')"/>
2500
				</xsl:when>
2501
				<xsl:when test="$is-border-color='1'">
2502
					<xsl:value-of select="concat('border-top-color:',$first-value,';')"/>
2503
					<xsl:value-of select="concat('border-right-color:',$first-value,';')"/>
2504
					<xsl:value-of select="concat('border-bottom-color:',$first-value,';')"/>
2505
					<xsl:value-of select="concat('border-left-color:',$first-value,';')"/>
2506
				</xsl:when>
2507
			</xsl:choose>
2508
			<xsl:call-template name="altova:css-styles-split-border">
2509
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2510
			</xsl:call-template>
2511
		</xsl:if>
2512
	</xsl:template>
2513
	<xsl:template name="altova:css-styles-split-border-top">
2514
		<xsl:param name="value"/>
2515
		<xsl:if test="$value">
2516
			<xsl:variable name="first-value">
2517
				<xsl:choose>
2518
					<xsl:when test="contains($value,' ')">
2519
						<xsl:value-of select="substring-before($value,' ')"/>
2520
					</xsl:when>
2521
					<xsl:otherwise>
2522
						<xsl:value-of select="$value"/>
2523
					</xsl:otherwise>
2524
				</xsl:choose>
2525
			</xsl:variable>
2526
			<xsl:variable name="is-border-width">
2527
				<xsl:call-template name="altova:css-styles-is-value-border-width">
2528
					<xsl:with-param name="value" select="$first-value"/>
2529
				</xsl:call-template>
2530
			</xsl:variable>
2531
			<xsl:variable name="is-border-style">
2532
				<xsl:call-template name="altova:css-styles-is-value-border-style">
2533
					<xsl:with-param name="value" select="$first-value"/>
2534
				</xsl:call-template>
2535
			</xsl:variable>
2536
			<xsl:variable name="is-border-color">
2537
				<xsl:call-template name="altova:css-styles-is-value-border-color">
2538
					<xsl:with-param name="value" select="$first-value"/>
2539
				</xsl:call-template>
2540
			</xsl:variable>
2541
			<xsl:choose>
2542
				<xsl:when test="$is-border-width='1'">
2543
					<xsl:value-of select="concat('border-top-width:',$first-value,';')"/>
2544
				</xsl:when>
2545
				<xsl:when test="$is-border-style='1'">
2546
					<xsl:value-of select="concat('border-top-style:',$first-value,';')"/>
2547
				</xsl:when>
2548
				<xsl:when test="$is-border-color='1'">
2549
					<xsl:value-of select="concat('border-top-color:',$first-value,';')"/>
2550
				</xsl:when>
2551
			</xsl:choose>
2552
			<xsl:call-template name="altova:css-styles-split-border-top">
2553
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2554
			</xsl:call-template>
2555
		</xsl:if>
2556
	</xsl:template>
2557
	<xsl:template name="altova:css-styles-split-border-right">
2558
		<xsl:param name="value"/>
2559
		<xsl:if test="$value">
2560
			<xsl:variable name="first-value">
2561
				<xsl:choose>
2562
					<xsl:when test="contains($value,' ')">
2563
						<xsl:value-of select="substring-before($value,' ')"/>
2564
					</xsl:when>
2565
					<xsl:otherwise>
2566
						<xsl:value-of select="$value"/>
2567
					</xsl:otherwise>
2568
				</xsl:choose>
2569
			</xsl:variable>
2570
			<xsl:variable name="is-border-width">
2571
				<xsl:call-template name="altova:css-styles-is-value-border-width">
2572
					<xsl:with-param name="value" select="$first-value"/>
2573
				</xsl:call-template>
2574
			</xsl:variable>
2575
			<xsl:variable name="is-border-style">
2576
				<xsl:call-template name="altova:css-styles-is-value-border-style">
2577
					<xsl:with-param name="value" select="$first-value"/>
2578
				</xsl:call-template>
2579
			</xsl:variable>
2580
			<xsl:variable name="is-border-color">
2581
				<xsl:call-template name="altova:css-styles-is-value-border-color">
2582
					<xsl:with-param name="value" select="$first-value"/>
2583
				</xsl:call-template>
2584
			</xsl:variable>
2585
			<xsl:choose>
2586
				<xsl:when test="$is-border-width='1'">
2587
					<xsl:value-of select="concat('border-right-width:',$first-value,';')"/>
2588
				</xsl:when>
2589
				<xsl:when test="$is-border-style='1'">
2590
					<xsl:value-of select="concat('border-right-style:',$first-value,';')"/>
2591
				</xsl:when>
2592
				<xsl:when test="$is-border-color='1'">
2593
					<xsl:value-of select="concat('border-right-color:',$first-value,';')"/>
2594
				</xsl:when>
2595
			</xsl:choose>
2596
			<xsl:call-template name="altova:css-styles-split-border-right">
2597
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2598
			</xsl:call-template>
2599
		</xsl:if>
2600
	</xsl:template>
2601
	<xsl:template name="altova:css-styles-split-border-bottom">
2602
		<xsl:param name="value"/>
2603
		<xsl:if test="$value">
2604
			<xsl:variable name="first-value">
2605
				<xsl:choose>
2606
					<xsl:when test="contains($value,' ')">
2607
						<xsl:value-of select="substring-before($value,' ')"/>
2608
					</xsl:when>
2609
					<xsl:otherwise>
2610
						<xsl:value-of select="$value"/>
2611
					</xsl:otherwise>
2612
				</xsl:choose>
2613
			</xsl:variable>
2614
			<xsl:variable name="is-border-width">
2615
				<xsl:call-template name="altova:css-styles-is-value-border-width">
2616
					<xsl:with-param name="value" select="$first-value"/>
2617
				</xsl:call-template>
2618
			</xsl:variable>
2619
			<xsl:variable name="is-border-style">
2620
				<xsl:call-template name="altova:css-styles-is-value-border-style">
2621
					<xsl:with-param name="value" select="$first-value"/>
2622
				</xsl:call-template>
2623
			</xsl:variable>
2624
			<xsl:variable name="is-border-color">
2625
				<xsl:call-template name="altova:css-styles-is-value-border-color">
2626
					<xsl:with-param name="value" select="$first-value"/>
2627
				</xsl:call-template>
2628
			</xsl:variable>
2629
			<xsl:choose>
2630
				<xsl:when test="$is-border-width='1'">
2631
					<xsl:value-of select="concat('border-bottom-width:',$first-value,';')"/>
2632
				</xsl:when>
2633
				<xsl:when test="$is-border-style='1'">
2634
					<xsl:value-of select="concat('border-bottom-style:',$first-value,';')"/>
2635
				</xsl:when>
2636
				<xsl:when test="$is-border-color='1'">
2637
					<xsl:value-of select="concat('border-bottom-color:',$first-value,';')"/>
2638
				</xsl:when>
2639
			</xsl:choose>
2640
			<xsl:call-template name="altova:css-styles-split-border-bottom">
2641
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2642
			</xsl:call-template>
2643
		</xsl:if>
2644
	</xsl:template>
2645
	<xsl:template name="altova:css-styles-split-border-left">
2646
		<xsl:param name="value"/>
2647
		<xsl:if test="$value">
2648
			<xsl:variable name="first-value">
2649
				<xsl:choose>
2650
					<xsl:when test="contains($value,' ')">
2651
						<xsl:value-of select="substring-before($value,' ')"/>
2652
					</xsl:when>
2653
					<xsl:otherwise>
2654
						<xsl:value-of select="$value"/>
2655
					</xsl:otherwise>
2656
				</xsl:choose>
2657
			</xsl:variable>
2658
			<xsl:variable name="is-border-width">
2659
				<xsl:call-template name="altova:css-styles-is-value-border-width">
2660
					<xsl:with-param name="value" select="$first-value"/>
2661
				</xsl:call-template>
2662
			</xsl:variable>
2663
			<xsl:variable name="is-border-style">
2664
				<xsl:call-template name="altova:css-styles-is-value-border-style">
2665
					<xsl:with-param name="value" select="$first-value"/>
2666
				</xsl:call-template>
2667
			</xsl:variable>
2668
			<xsl:variable name="is-border-color">
2669
				<xsl:call-template name="altova:css-styles-is-value-border-color">
2670
					<xsl:with-param name="value" select="$first-value"/>
2671
				</xsl:call-template>
2672
			</xsl:variable>
2673
			<xsl:choose>
2674
				<xsl:when test="$is-border-width='1'">
2675
					<xsl:value-of select="concat('border-left-width:',$first-value,';')"/>
2676
				</xsl:when>
2677
				<xsl:when test="$is-border-style='1'">
2678
					<xsl:value-of select="concat('border-left-style:',$first-value,';')"/>
2679
				</xsl:when>
2680
				<xsl:when test="$is-border-color='1'">
2681
					<xsl:value-of select="concat('border-left-color:',$first-value,';')"/>
2682
				</xsl:when>
2683
			</xsl:choose>
2684
			<xsl:call-template name="altova:css-styles-split-border-left">
2685
				<xsl:with-param name="value" select="substring-after($value,' ')"/>
2686
			</xsl:call-template>
2687
		</xsl:if>
2688
	</xsl:template>
2689
	<xsl:template name="altova:css-styles-split-border-color">
2690
		<xsl:param name="value"/>
2691
		<xsl:variable name="count">
2692
			<xsl:call-template name="altova:vector-count">
2693
				<xsl:with-param name="vector" select="$value"/>
2694
				<xsl:with-param name="separator" select="' '"/>
2695
			</xsl:call-template>
2696
		</xsl:variable>
2697
		<xsl:choose>
2698
			<xsl:when test="number($count)=1">
2699
				<xsl:variable name="value1">
2700
					<xsl:call-template name="altova:vector-get-value">
2701
						<xsl:with-param name="index" select="1"/>
2702
						<xsl:with-param name="vector" select="$value"/>
2703
						<xsl:with-param name="separator" select="' '"/>
2704
					</xsl:call-template>
2705
				</xsl:variable>
2706
				<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
2707
				<xsl:value-of select="concat('border-right-color:',$value1,';')"/>
2708
				<xsl:value-of select="concat('border-bottom-color:',$value1,';')"/>
2709
				<xsl:value-of select="concat('border-left-color:',$value1,';')"/>
2710
			</xsl:when>
2711
			<xsl:when test="number($count)=2">
2712
				<xsl:variable name="value1">
2713
					<xsl:call-template name="altova:vector-get-value">
2714
						<xsl:with-param name="index" select="1"/>
2715
						<xsl:with-param name="vector" select="$value"/>
2716
						<xsl:with-param name="separator" select="' '"/>
2717
					</xsl:call-template>
2718
				</xsl:variable>
2719
				<xsl:variable name="value2">
2720
					<xsl:call-template name="altova:vector-get-value">
2721
						<xsl:with-param name="index" select="2"/>
2722
						<xsl:with-param name="vector" select="$value"/>
2723
						<xsl:with-param name="separator" select="' '"/>
2724
					</xsl:call-template>
2725
				</xsl:variable>
2726
				<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
2727
				<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
2728
				<xsl:value-of select="concat('border-bottom-color:',$value1,';')"/>
2729
				<xsl:value-of select="concat('border-left-color:',$value2,';')"/>
2730
			</xsl:when>
2731
			<xsl:when test="number($count)=3">
2732
				<xsl:variable name="value1">
2733
					<xsl:call-template name="altova:vector-get-value">
2734
						<xsl:with-param name="index" select="1"/>
2735
						<xsl:with-param name="vector" select="$value"/>
2736
						<xsl:with-param name="separator" select="' '"/>
2737
					</xsl:call-template>
2738
				</xsl:variable>
2739
				<xsl:variable name="value2">
2740
					<xsl:call-template name="altova:vector-get-value">
2741
						<xsl:with-param name="index" select="2"/>
2742
						<xsl:with-param name="vector" select="$value"/>
2743
						<xsl:with-param name="separator" select="' '"/>
2744
					</xsl:call-template>
2745
				</xsl:variable>
2746
				<xsl:variable name="value3">
2747
					<xsl:call-template name="altova:vector-get-value">
2748
						<xsl:with-param name="index" select="3"/>
2749
						<xsl:with-param name="vector" select="$value"/>
2750
						<xsl:with-param name="separator" select="' '"/>
2751
					</xsl:call-template>
2752
				</xsl:variable>
2753
				<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
2754
				<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
2755
				<xsl:value-of select="concat('border-bottom-color:',$value3,';')"/>
2756
				<xsl:value-of select="concat('border-left-color:',$value2,';')"/>
2757
			</xsl:when>
2758
			<xsl:when test="number($count)=4">
2759
				<xsl:variable name="value1">
2760
					<xsl:call-template name="altova:vector-get-value">
2761
						<xsl:with-param name="index" select="1"/>
2762
						<xsl:with-param name="vector" select="$value"/>
2763
						<xsl:with-param name="separator" select="' '"/>
2764
					</xsl:call-template>
2765
				</xsl:variable>
2766
				<xsl:variable name="value2">
2767
					<xsl:call-template name="altova:vector-get-value">
2768
						<xsl:with-param name="index" select="2"/>
2769
						<xsl:with-param name="vector" select="$value"/>
2770
						<xsl:with-param name="separator" select="' '"/>
2771
					</xsl:call-template>
2772
				</xsl:variable>
2773
				<xsl:variable name="value3">
2774
					<xsl:call-template name="altova:vector-get-value">
2775
						<xsl:with-param name="index" select="3"/>
2776
						<xsl:with-param name="vector" select="$value"/>
2777
						<xsl:with-param name="separator" select="' '"/>
2778
					</xsl:call-template>
2779
				</xsl:variable>
2780
				<xsl:variable name="value4">
2781
					<xsl:call-template name="altova:vector-get-value">
2782
						<xsl:with-param name="index" select="4"/>
2783
						<xsl:with-param name="vector" select="$value"/>
2784
						<xsl:with-param name="separator" select="' '"/>
2785
					</xsl:call-template>
2786
				</xsl:variable>
2787
				<xsl:value-of select="concat('border-top-color:',$value1,';')"/>
2788
				<xsl:value-of select="concat('border-right-color:',$value2,';')"/>
2789
				<xsl:value-of select="concat('border-bottom-color:',$value3,';')"/>
2790
				<xsl:value-of select="concat('border-left-color:',$value4,';')"/>
2791
			</xsl:when>
2792
		</xsl:choose>
2793
	</xsl:template>
2794
	<xsl:template name="altova:css-styles-split-border-style">
2795
		<xsl:param name="value"/>
2796
		<xsl:variable name="count">
2797
			<xsl:call-template name="altova:vector-count">
2798
				<xsl:with-param name="vector" select="$value"/>
2799
				<xsl:with-param name="separator" select="' '"/>
2800
			</xsl:call-template>
2801
		</xsl:variable>
2802
		<xsl:choose>
2803
			<xsl:when test="number($count)=1">
2804
				<xsl:variable name="value1">
2805
					<xsl:call-template name="altova:vector-get-value">
2806
						<xsl:with-param name="index" select="1"/>
2807
						<xsl:with-param name="vector" select="$value"/>
2808
						<xsl:with-param name="separator" select="' '"/>
2809
					</xsl:call-template>
2810
				</xsl:variable>
2811
				<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
2812
				<xsl:value-of select="concat('border-right-style:',$value1,';')"/>
2813
				<xsl:value-of select="concat('border-bottom-style:',$value1,';')"/>
2814
				<xsl:value-of select="concat('border-left-style:',$value1,';')"/>
2815
			</xsl:when>
2816
			<xsl:when test="number($count)=2">
2817
				<xsl:variable name="value1">
2818
					<xsl:call-template name="altova:vector-get-value">
2819
						<xsl:with-param name="index" select="1"/>
2820
						<xsl:with-param name="vector" select="$value"/>
2821
						<xsl:with-param name="separator" select="' '"/>
2822
					</xsl:call-template>
2823
				</xsl:variable>
2824
				<xsl:variable name="value2">
2825
					<xsl:call-template name="altova:vector-get-value">
2826
						<xsl:with-param name="index" select="2"/>
2827
						<xsl:with-param name="vector" select="$value"/>
2828
						<xsl:with-param name="separator" select="' '"/>
2829
					</xsl:call-template>
2830
				</xsl:variable>
2831
				<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
2832
				<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
2833
				<xsl:value-of select="concat('border-bottom-style:',$value1,';')"/>
2834
				<xsl:value-of select="concat('border-left-style:',$value2,';')"/>
2835
			</xsl:when>
2836
			<xsl:when test="number($count)=3">
2837
				<xsl:variable name="value1">
2838
					<xsl:call-template name="altova:vector-get-value">
2839
						<xsl:with-param name="index" select="1"/>
2840
						<xsl:with-param name="vector" select="$value"/>
2841
						<xsl:with-param name="separator" select="' '"/>
2842
					</xsl:call-template>
2843
				</xsl:variable>
2844
				<xsl:variable name="value2">
2845
					<xsl:call-template name="altova:vector-get-value">
2846
						<xsl:with-param name="index" select="2"/>
2847
						<xsl:with-param name="vector" select="$value"/>
2848
						<xsl:with-param name="separator" select="' '"/>
2849
					</xsl:call-template>
2850
				</xsl:variable>
2851
				<xsl:variable name="value3">
2852
					<xsl:call-template name="altova:vector-get-value">
2853
						<xsl:with-param name="index" select="3"/>
2854
						<xsl:with-param name="vector" select="$value"/>
2855
						<xsl:with-param name="separator" select="' '"/>
2856
					</xsl:call-template>
2857
				</xsl:variable>
2858
				<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
2859
				<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
2860
				<xsl:value-of select="concat('border-bottom-style:',$value3,';')"/>
2861
				<xsl:value-of select="concat('border-left-style:',$value2,';')"/>
2862
			</xsl:when>
2863
			<xsl:when test="number($count)=4">
2864
				<xsl:variable name="value1">
2865
					<xsl:call-template name="altova:vector-get-value">
2866
						<xsl:with-param name="index" select="1"/>
2867
						<xsl:with-param name="vector" select="$value"/>
2868
						<xsl:with-param name="separator" select="' '"/>
2869
					</xsl:call-template>
2870
				</xsl:variable>
2871
				<xsl:variable name="value2">
2872
					<xsl:call-template name="altova:vector-get-value">
2873
						<xsl:with-param name="index" select="2"/>
2874
						<xsl:with-param name="vector" select="$value"/>
2875
						<xsl:with-param name="separator" select="' '"/>
2876
					</xsl:call-template>
2877
				</xsl:variable>
2878
				<xsl:variable name="value3">
2879
					<xsl:call-template name="altova:vector-get-value">
2880
						<xsl:with-param name="index" select="3"/>
2881
						<xsl:with-param name="vector" select="$value"/>
2882
						<xsl:with-param name="separator" select="' '"/>
2883
					</xsl:call-template>
2884
				</xsl:variable>
2885
				<xsl:variable name="value4">
2886
					<xsl:call-template name="altova:vector-get-value">
2887
						<xsl:with-param name="index" select="4"/>
2888
						<xsl:with-param name="vector" select="$value"/>
2889
						<xsl:with-param name="separator" select="' '"/>
2890
					</xsl:call-template>
2891
				</xsl:variable>
2892
				<xsl:value-of select="concat('border-top-style:',$value1,';')"/>
2893
				<xsl:value-of select="concat('border-right-style:',$value2,';')"/>
2894
				<xsl:value-of select="concat('border-bottom-style:',$value3,';')"/>
2895
				<xsl:value-of select="concat('border-left-style:',$value4,';')"/>
2896
			</xsl:when>
2897
		</xsl:choose>
2898
	</xsl:template>
2899
	<xsl:template name="altova:css-styles-split-border-width">
2900
		<xsl:param name="value"/>
2901
		<xsl:variable name="count">
2902
			<xsl:call-template name="altova:vector-count">
2903
				<xsl:with-param name="vector" select="$value"/>
2904
				<xsl:with-param name="separator" select="' '"/>
2905
			</xsl:call-template>
2906
		</xsl:variable>
2907
		<xsl:choose>
2908
			<xsl:when test="number($count)=1">
2909
				<xsl:variable name="value1">
2910
					<xsl:call-template name="altova:vector-get-value">
2911
						<xsl:with-param name="index" select="1"/>
2912
						<xsl:with-param name="vector" select="$value"/>
2913
						<xsl:with-param name="separator" select="' '"/>
2914
					</xsl:call-template>
2915
				</xsl:variable>
2916
				<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
2917
				<xsl:value-of select="concat('border-right-width:',$value1,';')"/>
2918
				<xsl:value-of select="concat('border-bottom-width:',$value1,';')"/>
2919
				<xsl:value-of select="concat('border-left-width:',$value1,';')"/>
2920
			</xsl:when>
2921
			<xsl:when test="number($count)=2">
2922
				<xsl:variable name="value1">
2923
					<xsl:call-template name="altova:vector-get-value">
2924
						<xsl:with-param name="index" select="1"/>
2925
						<xsl:with-param name="vector" select="$value"/>
2926
						<xsl:with-param name="separator" select="' '"/>
2927
					</xsl:call-template>
2928
				</xsl:variable>
2929
				<xsl:variable name="value2">
2930
					<xsl:call-template name="altova:vector-get-value">
2931
						<xsl:with-param name="index" select="2"/>
2932
						<xsl:with-param name="vector" select="$value"/>
2933
						<xsl:with-param name="separator" select="' '"/>
2934
					</xsl:call-template>
2935
				</xsl:variable>
2936
				<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
2937
				<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
2938
				<xsl:value-of select="concat('border-bottom-width:',$value1,';')"/>
2939
				<xsl:value-of select="concat('border-left-width:',$value2,';')"/>
2940
			</xsl:when>
2941
			<xsl:when test="number($count)=3">
2942
				<xsl:variable name="value1">
2943
					<xsl:call-template name="altova:vector-get-value">
2944
						<xsl:with-param name="index" select="1"/>
2945
						<xsl:with-param name="vector" select="$value"/>
2946
						<xsl:with-param name="separator" select="' '"/>
2947
					</xsl:call-template>
2948
				</xsl:variable>
2949
				<xsl:variable name="value2">
2950
					<xsl:call-template name="altova:vector-get-value">
2951
						<xsl:with-param name="index" select="2"/>
2952
						<xsl:with-param name="vector" select="$value"/>
2953
						<xsl:with-param name="separator" select="' '"/>
2954
					</xsl:call-template>
2955
				</xsl:variable>
2956
				<xsl:variable name="value3">
2957
					<xsl:call-template name="altova:vector-get-value">
2958
						<xsl:with-param name="index" select="3"/>
2959
						<xsl:with-param name="vector" select="$value"/>
2960
						<xsl:with-param name="separator" select="' '"/>
2961
					</xsl:call-template>
2962
				</xsl:variable>
2963
				<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
2964
				<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
2965
				<xsl:value-of select="concat('border-bottom-width:',$value3,';')"/>
2966
				<xsl:value-of select="concat('border-left-width:',$value2,';')"/>
2967
			</xsl:when>
2968
			<xsl:when test="number($count)=4">
2969
				<xsl:variable name="value1">
2970
					<xsl:call-template name="altova:vector-get-value">
2971
						<xsl:with-param name="index" select="1"/>
2972
						<xsl:with-param name="vector" select="$value"/>
2973
						<xsl:with-param name="separator" select="' '"/>
2974
					</xsl:call-template>
2975
				</xsl:variable>
2976
				<xsl:variable name="value2">
2977
					<xsl:call-template name="altova:vector-get-value">
2978
						<xsl:with-param name="index" select="2"/>
2979
						<xsl:with-param name="vector" select="$value"/>
2980
						<xsl:with-param name="separator" select="' '"/>
2981
					</xsl:call-template>
2982
				</xsl:variable>
2983
				<xsl:variable name="value3">
2984
					<xsl:call-template name="altova:vector-get-value">
2985
						<xsl:with-param name="index" select="3"/>
2986
						<xsl:with-param name="vector" select="$value"/>
2987
						<xsl:with-param name="separator" select="' '"/>
2988
					</xsl:call-template>
2989
				</xsl:variable>
2990
				<xsl:variable name="value4">
2991
					<xsl:call-template name="altova:vector-get-value">
2992
						<xsl:with-param name="index" select="4"/>
2993
						<xsl:with-param name="vector" select="$value"/>
2994
						<xsl:with-param name="separator" select="' '"/>
2995
					</xsl:call-template>
2996
				</xsl:variable>
2997
				<xsl:value-of select="concat('border-top-width:',$value1,';')"/>
2998
				<xsl:value-of select="concat('border-right-width:',$value2,';')"/>
2999
				<xsl:value-of select="concat('border-bottom-width:',$value3,';')"/>
3000
				<xsl:value-of select="concat('border-left-width:',$value4,';')"/>
3001
			</xsl:when>
3002
		</xsl:choose>
3003
	</xsl:template>
3004
	<xsl:template name="altova:css-styles-split-font-style">
3005
		<xsl:param name="value"/>
3006
		<xsl:param name="font-style"/>
3007
		<xsl:param name="font-variant"/>
3008
		<xsl:param name="font-weight"/>
3009
		<xsl:if test="$value">
3010
			<xsl:variable name="first-value">
3011
				<xsl:choose>
3012
					<xsl:when test="contains($value,' ')">
3013
						<xsl:value-of select="substring-before($value,' ')"/>
3014
					</xsl:when>
3015
					<xsl:otherwise>
3016
						<xsl:value-of select="$value"/>
3017
					</xsl:otherwise>
3018
				</xsl:choose>
3019
			</xsl:variable>
3020
			<xsl:variable name="is-font-style">
3021
				<xsl:call-template name="altova:css-styles-is-value-font-style">
3022
					<xsl:with-param name="value" select="$first-value"/>
3023
				</xsl:call-template>
3024
			</xsl:variable>
3025
			<xsl:variable name="is-font-variant">
3026
				<xsl:call-template name="altova:css-styles-is-value-font-variant">
3027
					<xsl:with-param name="value" select="$first-value"/>
3028
				</xsl:call-template>
3029
			</xsl:variable>
3030
			<xsl:variable name="is-font-weight">
3031
				<xsl:call-template name="altova:css-styles-is-value-font-weight">
3032
					<xsl:with-param name="value" select="$first-value"/>
3033
				</xsl:call-template>
3034
			</xsl:variable>
3035
			<xsl:choose>
3036
				<xsl:when test="$is-font-style='1' and $is-font-variant='1' and $is-font-weight='1'">
3037
					<xsl:call-template name="altova:css-styles-split-font-style">
3038
						<xsl:with-param name="value" select="substring-after($value,' ')"/>
3039
						<xsl:with-param name="font-style" select="$font-style"/>
3040
						<xsl:with-param name="font-variant" select="$font-variant"/>
3041
						<xsl:with-param name="font-weight" select="$font-weight"/>
3042
					</xsl:call-template>
3043
				</xsl:when>
3044
				<xsl:when test="$is-font-style='1'">
3045
					<xsl:call-template name="altova:css-styles-split-font-style">
3046
						<xsl:with-param name="value" select="substring-after($value,' ')"/>
3047
						<xsl:with-param name="font-style" select="$first-value"/>
3048
						<xsl:with-param name="font-variant" select="$font-variant"/>
3049
						<xsl:with-param name="font-weight" select="$font-weight"/>
3050
					</xsl:call-template>
3051
				</xsl:when>
3052
				<xsl:when test="$is-font-variant='1'">
3053
					<xsl:call-template name="altova:css-styles-split-font-style">
3054
						<xsl:with-param name="value" select="substring-after($value,' ')"/>
3055
						<xsl:with-param name="font-style" select="$font-style"/>
3056
						<xsl:with-param name="font-variant" select="$first-value"/>
3057
						<xsl:with-param name="font-weight" select="$font-weight"/>
3058
					</xsl:call-template>
3059
				</xsl:when>
3060
				<xsl:when test="$is-font-weight='1'">
3061
					<xsl:call-template name="altova:css-styles-split-font-style">
3062
						<xsl:with-param name="value" select="substring-after($value,' ')"/>
3063
						<xsl:with-param name="font-style" select="$font-style"/>
3064
						<xsl:with-param name="font-variant" select="$font-variant"/>
3065
						<xsl:with-param name="font-weight" select="$first-value"/>
3066
					</xsl:call-template>
3067
				</xsl:when>
3068
				<xsl:otherwise>
3069
					<xsl:value-of select="concat('font-style:',$font-style,';')"/>
3070
					<xsl:value-of select="concat('font-variant:',$font-variant,';')"/>
3071
					<xsl:value-of select="concat('font-weight:',$font-weight,';')"/>
3072
					<xsl:choose>
3073
						<xsl:when test="contains($first-value,'/')">
3074
							<xsl:value-of select="concat('font-size:',substring-before($first-value,'/'),';')"/>
3075
							<xsl:value-of select="concat('line-height:',substring-after($first-value,'/'),';')"/>
3076
						</xsl:when>
3077
						<xsl:otherwise>
3078
							<xsl:value-of select="concat('font-size:',$first-value,';')"/>
3079
						</xsl:otherwise>
3080
					</xsl:choose>
3081
					<xsl:value-of select="concat('font-family:',substring-after($value,' '),';')"/>
3082
				</xsl:otherwise>
3083
			</xsl:choose>
3084
		</xsl:if>
3085
	</xsl:template>
3086
	<xsl:template name="altova:css-styles-split-margin-style">
3087
		<xsl:param name="value"/>
3088
		<xsl:variable name="count">
3089
			<xsl:call-template name="altova:vector-count">
3090
				<xsl:with-param name="vector" select="$value"/>
3091
				<xsl:with-param name="separator" select="' '"/>
3092
			</xsl:call-template>
3093
		</xsl:variable>
3094
		<xsl:choose>
3095
			<xsl:when test="number($count)=1">
3096
				<xsl:variable name="value1">
3097
					<xsl:call-template name="altova:vector-get-value">
3098
						<xsl:with-param name="index" select="1"/>
3099
						<xsl:with-param name="vector" select="$value"/>
3100
						<xsl:with-param name="separator" select="' '"/>
3101
					</xsl:call-template>
3102
				</xsl:variable>
3103
				<xsl:value-of select="concat('margin-top:',$value1,';')"/>
3104
				<xsl:value-of select="concat('margin-right:',$value1,';')"/>
3105
				<xsl:value-of select="concat('margin-bottom:',$value1,';')"/>
3106
				<xsl:value-of select="concat('margin-left:',$value1,';')"/>
3107
			</xsl:when>
3108
			<xsl:when test="number($count)=2">
3109
				<xsl:variable name="value1">
3110
					<xsl:call-template name="altova:vector-get-value">
3111
						<xsl:with-param name="index" select="1"/>
3112
						<xsl:with-param name="vector" select="$value"/>
3113
						<xsl:with-param name="separator" select="' '"/>
3114
					</xsl:call-template>
3115
				</xsl:variable>
3116
				<xsl:variable name="value2">
3117
					<xsl:call-template name="altova:vector-get-value">
3118
						<xsl:with-param name="index" select="2"/>
3119
						<xsl:with-param name="vector" select="$value"/>
3120
						<xsl:with-param name="separator" select="' '"/>
3121
					</xsl:call-template>
3122
				</xsl:variable>
3123
				<xsl:value-of select="concat('margin-top:',$value1,';')"/>
3124
				<xsl:value-of select="concat('margin-right:',$value2,';')"/>
3125
				<xsl:value-of select="concat('margin-bottom:',$value1,';')"/>
3126
				<xsl:value-of select="concat('margin-left:',$value2,';')"/>
3127
			</xsl:when>
3128
			<xsl:when test="number($count)=3">
3129
				<xsl:variable name="value1">
3130
					<xsl:call-template name="altova:vector-get-value">
3131
						<xsl:with-param name="index" select="1"/>
3132
						<xsl:with-param name="vector" select="$value"/>
3133
						<xsl:with-param name="separator" select="' '"/>
3134
					</xsl:call-template>
3135
				</xsl:variable>
3136
				<xsl:variable name="value2">
3137
					<xsl:call-template name="altova:vector-get-value">
3138
						<xsl:with-param name="index" select="2"/>
3139
						<xsl:with-param name="vector" select="$value"/>
3140
						<xsl:with-param name="separator" select="' '"/>
3141
					</xsl:call-template>
3142
				</xsl:variable>
3143
				<xsl:variable name="value3">
3144
					<xsl:call-template name="altova:vector-get-value">
3145
						<xsl:with-param name="index" select="3"/>
3146
						<xsl:with-param name="vector" select="$value"/>
3147
						<xsl:with-param name="separator" select="' '"/>
3148
					</xsl:call-template>
3149
				</xsl:variable>
3150
				<xsl:value-of select="concat('margin-top:',$value1,';')"/>
3151
				<xsl:value-of select="concat('margin-right:',$value2,';')"/>
3152
				<xsl:value-of select="concat('margin-bottom:',$value3,';')"/>
3153
				<xsl:value-of select="concat('margin-left:',$value2,';')"/>
3154
			</xsl:when>
3155
			<xsl:when test="number($count)=4">
3156
				<xsl:variable name="value1">
3157
					<xsl:call-template name="altova:vector-get-value">
3158
						<xsl:with-param name="index" select="1"/>
3159
						<xsl:with-param name="vector" select="$value"/>
3160
						<xsl:with-param name="separator" select="' '"/>
3161
					</xsl:call-template>
3162
				</xsl:variable>
3163
				<xsl:variable name="value2">
3164
					<xsl:call-template name="altova:vector-get-value">
3165
						<xsl:with-param name="index" select="2"/>
3166
						<xsl:with-param name="vector" select="$value"/>
3167
						<xsl:with-param name="separator" select="' '"/>
3168
					</xsl:call-template>
3169
				</xsl:variable>
3170
				<xsl:variable name="value3">
3171
					<xsl:call-template name="altova:vector-get-value">
3172
						<xsl:with-param name="index" select="3"/>
3173
						<xsl:with-param name="vector" select="$value"/>
3174
						<xsl:with-param name="separator" select="' '"/>
3175
					</xsl:call-template>
3176
				</xsl:variable>
3177
				<xsl:variable name="value4">
3178
					<xsl:call-template name="altova:vector-get-value">
3179
						<xsl:with-param name="index" select="4"/>
3180
						<xsl:with-param name="vector" select="$value"/>
3181
						<xsl:with-param name="separator" select="' '"/>
3182
					</xsl:call-template>
3183
				</xsl:variable>
3184
				<xsl:value-of select="concat('margin-top:',$value1,';')"/>
3185
				<xsl:value-of select="concat('margin-right:',$value2,';')"/>
3186
				<xsl:value-of select="concat('margin-bottom:',$value3,';')"/>
3187
				<xsl:value-of select="concat('margin-left:',$value4,';')"/>
3188
			</xsl:when>
3189
		</xsl:choose>
3190
	</xsl:template>
3191
	<xsl:template name="altova:css-styles-split-padding-style">
3192
		<xsl:param name="value"/>
3193
		<xsl:variable name="count">
3194
			<xsl:call-template name="altova:vector-count">
3195
				<xsl:with-param name="vector" select="$value"/>
3196
				<xsl:with-param name="separator" select="' '"/>
3197
			</xsl:call-template>
3198
		</xsl:variable>
3199
		<xsl:choose>
3200
			<xsl:when test="number($count)=1">
3201
				<xsl:variable name="value1">
3202
					<xsl:call-template name="altova:vector-get-value">
3203
						<xsl:with-param name="index" select="1"/>
3204
						<xsl:with-param name="vector" select="$value"/>
3205
						<xsl:with-param name="separator" select="' '"/>
3206
					</xsl:call-template>
3207
				</xsl:variable>
3208
				<xsl:value-of select="concat('padding-top:',$value1,';')"/>
3209
				<xsl:value-of select="concat('padding-right:',$value1,';')"/>
3210
				<xsl:value-of select="concat('padding-bottom:',$value1,';')"/>
3211
				<xsl:value-of select="concat('padding-left:',$value1,';')"/>
3212
			</xsl:when>
3213
			<xsl:when test="number($count)=2">
3214
				<xsl:variable name="value1">
3215
					<xsl:call-template name="altova:vector-get-value">
3216
						<xsl:with-param name="index" select="1"/>
3217
						<xsl:with-param name="vector" select="$value"/>
3218
						<xsl:with-param name="separator" select="' '"/>
3219
					</xsl:call-template>
3220
				</xsl:variable>
3221
				<xsl:variable name="value2">
3222
					<xsl:call-template name="altova:vector-get-value">
3223
						<xsl:with-param name="index" select="2"/>
3224
						<xsl:with-param name="vector" select="$value"/>
3225
						<xsl:with-param name="separator" select="' '"/>
3226
					</xsl:call-template>
3227
				</xsl:variable>
3228
				<xsl:value-of select="concat('padding-top:',$value1,';')"/>
3229
				<xsl:value-of select="concat('padding-right:',$value2,';')"/>
3230
				<xsl:value-of select="concat('padding-bottom:',$value1,';')"/>
3231
				<xsl:value-of select="concat('padding-left:',$value2,';')"/>
3232
			</xsl:when>
3233
			<xsl:when test="number($count)=3">
3234
				<xsl:variable name="value1">
3235
					<xsl:call-template name="altova:vector-get-value">
3236
						<xsl:with-param name="index" select="1"/>
3237
						<xsl:with-param name="vector" select="$value"/>
3238
						<xsl:with-param name="separator" select="' '"/>
3239
					</xsl:call-template>
3240
				</xsl:variable>
3241
				<xsl:variable name="value2">
3242
					<xsl:call-template name="altova:vector-get-value">
3243
						<xsl:with-param name="index" select="2"/>
3244
						<xsl:with-param name="vector" select="$value"/>
3245
						<xsl:with-param name="separator" select="' '"/>
3246
					</xsl:call-template>
3247
				</xsl:variable>
3248
				<xsl:variable name="value3">
3249
					<xsl:call-template name="altova:vector-get-value">
3250
						<xsl:with-param name="index" select="3"/>
3251
						<xsl:with-param name="vector" select="$value"/>
3252
						<xsl:with-param name="separator" select="' '"/>
3253
					</xsl:call-template>
3254
				</xsl:variable>
3255
				<xsl:value-of select="concat('padding-top:',$value1,';')"/>
3256
				<xsl:value-of select="concat('padding-right:',$value2,';')"/>
3257
				<xsl:value-of select="concat('padding-bottom:',$value3,';')"/>
3258
				<xsl:value-of select="concat('padding-left:',$value2,';')"/>
3259
			</xsl:when>
3260
			<xsl:when test="number($count)=4">
3261
				<xsl:variable name="value1">
3262
					<xsl:call-template name="altova:vector-get-value">
3263
						<xsl:with-param name="index" select="1"/>
3264
						<xsl:with-param name="vector" select="$value"/>
3265
						<xsl:with-param name="separator" select="' '"/>
3266
					</xsl:call-template>
3267
				</xsl:variable>
3268
				<xsl:variable name="value2">
3269
					<xsl:call-template name="altova:vector-get-value">
3270
						<xsl:with-param name="index" select="2"/>
3271
						<xsl:with-param name="vector" select="$value"/>
3272
						<xsl:with-param name="separator" select="' '"/>
3273
					</xsl:call-template>
3274
				</xsl:variable>
3275
				<xsl:variable name="value3">
3276
					<xsl:call-template name="altova:vector-get-value">
3277
						<xsl:with-param name="index" select="3"/>
3278
						<xsl:with-param name="vector" select="$value"/>
3279
						<xsl:with-param name="separator" select="' '"/>
3280
					</xsl:call-template>
3281
				</xsl:variable>
3282
				<xsl:variable name="value4">
3283
					<xsl:call-template name="altova:vector-get-value">
3284
						<xsl:with-param name="index" select="4"/>
3285
						<xsl:with-param name="vector" select="$value"/>
3286
						<xsl:with-param name="separator" select="' '"/>
3287
					</xsl:call-template>
3288
				</xsl:variable>
3289
				<xsl:value-of select="concat('padding-top:',$value1,';')"/>
3290
				<xsl:value-of select="concat('padding-right:',$value2,';')"/>
3291
				<xsl:value-of select="concat('padding-bottom:',$value3,';')"/>
3292
				<xsl:value-of select="concat('padding-left:',$value4,';')"/>
3293
			</xsl:when>
3294
		</xsl:choose>
3295
	</xsl:template>
3296
	<xsl:template name="altova:css-styles-output-fo-attributes">
3297
		<xsl:param name="css-styles"/>
3298
		<xsl:variable name="splitted-styles">
3299
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3300
				<xsl:with-param name="css-styles" select="string($css-styles)"/>
3301
			</xsl:call-template>
3302
		</xsl:variable>
3303
		<xsl:call-template name="altova:css-styles-output-fo-attributes-helper">
3304
			<xsl:with-param name="css-styles" select="$splitted-styles"/>
3305
		</xsl:call-template>
3306
	</xsl:template>
3307
	<xsl:template name="altova:css-styles-output-fo-attributes-helper">
3308
		<xsl:param name="css-styles"/>
3309
		<xsl:variable name="property" select="normalize-space(substring-before($css-styles,':'))"/>
3310
		<xsl:if test="string($property) and not(contains($property,';'))">
3311
			<xsl:choose>
3312
				<xsl:when test="$property='html-table-align'"/>
3313
				<xsl:when test="$property='vertical-align'">
3314
					<xsl:attribute name="display-align">
3315
						<xsl:variable name="value" select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
3316
						<xsl:choose>
3317
							<xsl:when test="$value='top'">before</xsl:when>
3318
							<xsl:when test="$value='middle'">center</xsl:when>
3319
							<xsl:when test="$value='bottom'">after</xsl:when>
3320
							<xsl:otherwise>auto</xsl:otherwise>
3321
						</xsl:choose>
3322
					</xsl:attribute>
3323
				</xsl:when>
3324
				<xsl:otherwise>
3325
					<xsl:attribute name="{$property}">
3326
						<xsl:value-of select="normalize-space(substring-after(substring-before($css-styles,';'),':'))"/>
3327
					</xsl:attribute>
3328
				</xsl:otherwise>
3329
			</xsl:choose>
3330
			<xsl:call-template name="altova:css-styles-output-fo-attributes-helper">
3331
				<xsl:with-param name="css-styles" select="substring-after($css-styles,';')"/>
3332
			</xsl:call-template>
3333
		</xsl:if>
3334
	</xsl:template>
3335
	<xsl:template name="altova:css-styles-convert-length-to-twips">
3336
		<xsl:param name="css-length"/>
3337
		<xsl:param name="dpi" select="96"/>
3338
		<xsl:param name="em-height-pt" select="12"/>
3339
		<xsl:param name="parent-length-twips" select="0"/>
3340
		<xsl:choose>
3341
			<xsl:when test="contains($css-length,'cm')">
3342
				<xsl:value-of select="(number(substring-before($css-length,'cm')) * 1440) div 2.54"/>
3343
			</xsl:when>
3344
			<xsl:when test="contains($css-length,'mm')">
3345
				<xsl:value-of select="(number(substring-before($css-length,'mm')) * 1440) div 25.4"/>
3346
			</xsl:when>
3347
			<xsl:when test="contains($css-length,'in')">
3348
				<xsl:value-of select="number(substring-before($css-length,'in')) * 1440"/>
3349
			</xsl:when>
3350
			<xsl:when test="contains($css-length,'pc')">
3351
				<xsl:value-of select="number(substring-before($css-length,'pc')) * 240"/>
3352
			</xsl:when>
3353
			<xsl:when test="contains($css-length,'pt')">
3354
				<xsl:value-of select="number(substring-before($css-length,'pt')) * 20"/>
3355
			</xsl:when>
3356
			<xsl:when test="contains($css-length,'px')">
3357
				<xsl:value-of select="(number(substring-before($css-length,'px')) * 1440) div $dpi"/>
3358
			</xsl:when>
3359
			<xsl:when test="contains($css-length,'em')">
3360
				<xsl:value-of select="number(substring-before($css-length,'em')) * 20 * $em-height-pt"/>
3361
			</xsl:when>
3362
			<xsl:when test="contains($css-length,'ex')">
3363
				<xsl:value-of select="number(substring-before($css-length,'ex')) * 10 * $em-height-pt"/>
3364
			</xsl:when>
3365
			<xsl:when test="contains($css-length,'%')">
3366
				<xsl:value-of select="(number(substring-before($css-length,'%')) * $parent-length-twips) div 100"/>
3367
			</xsl:when>
3368
			<xsl:otherwise>0</xsl:otherwise>
3369
		</xsl:choose>
3370
	</xsl:template>
3371
	<xsl:template name="altova:html-table-calc-entry-spanned-cols">
3372
		<xsl:param name="entry"/>
3373
		<xsl:choose>
3374
			<xsl:when test="$entry">
3375
				<xsl:choose>
3376
					<xsl:when test="$entry/@colspan">
3377
						<xsl:value-of select="number($entry/@colspan) - 1"/>
3378
					</xsl:when>
3379
					<xsl:otherwise>0</xsl:otherwise>
3380
				</xsl:choose>
3381
			</xsl:when>
3382
			<xsl:otherwise>0</xsl:otherwise>
3383
		</xsl:choose>
3384
	</xsl:template>
3385
	<xsl:template name="altova:html-table-calc-entry-spanned-rows">
3386
		<xsl:param name="entry"/>
3387
		<xsl:choose>
3388
			<xsl:when test="$entry">
3389
				<xsl:choose>
3390
					<xsl:when test="$entry/@rowspan">
3391
						<xsl:value-of select="number($entry/@rowspan) - 1"/>
3392
					</xsl:when>
3393
					<xsl:otherwise>0</xsl:otherwise>
3394
				</xsl:choose>
3395
			</xsl:when>
3396
			<xsl:otherwise>0</xsl:otherwise>
3397
		</xsl:choose>
3398
	</xsl:template>
3399
	<xsl:template name="altova:html-table-table-get-table-user-styles"/>
3400
	<xsl:template name="altova:html-table-table-get-caption-user-styles"/>
3401
	<xsl:template name="altova:html-table-table-get-thead-user-styles">
3402
		<xsl:text>background-color:#d2d2d2;</xsl:text>
3403
	</xsl:template>
3404
	<xsl:template name="altova:html-table-table-get-tfoot-user-styles"/>
3405
	<xsl:template name="altova:html-table-table-get-tbody-user-styles"/>
3406
	<xsl:template name="altova:html-table-table-get-tr-user-styles">
3407
		<xsl:param name="rownum"/>
3408
	</xsl:template>
3409
	<xsl:template name="altova:html-table-table-get-td-user-styles">
3410
		<xsl:param name="colnum"/>
3411
		<xsl:param name="rownum"/>
3412
	</xsl:template>
3413
	<xsl:template name="altova:html-table-table-get-th-user-styles">
3414
		<xsl:param name="colnum"/>
3415
		<xsl:param name="rownum"/>
3416
		<xsl:text>font-family:Arial;</xsl:text>
3417
	</xsl:template>
3418
	<xsl:template name="altova:html-table-table-calc-table-effective-styles">
3419
		<xsl:param name="table"/>
3420
		<xsl:text>border-collapse:separate;</xsl:text>
3421
		<xsl:text>border-spacing:2px;</xsl:text>
3422
		<xsl:variable name="align" select="normalize-space(string($table/@align))"/>
3423
		<xsl:if test="string-length($align) > 0">
3424
			<xsl:value-of select="concat('html-table-align:',$align,';')"/>
3425
		</xsl:if>
3426
		<xsl:variable name="bgcolor" select="normalize-space(string($table/@bgcolor))"/>
3427
		<xsl:if test="string-length($bgcolor) > 0">
3428
			<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
3429
		</xsl:if>
3430
		<xsl:variable name="effective-border">
3431
			<xsl:variable name="border" select="normalize-space(string($table/@border))"/>
3432
			<xsl:choose>
3433
				<xsl:when test="string-length($border) > 0">
3434
					<xsl:value-of select="$border"/>
3435
				</xsl:when>
3436
				<xsl:otherwise>0</xsl:otherwise>
3437
			</xsl:choose>
3438
		</xsl:variable>
3439
		<xsl:variable name="effective-frame">
3440
			<xsl:variable name="frame" select="normalize-space(string($table/@frame))"/>
3441
			<xsl:choose>
3442
				<xsl:when test="string-length($frame) > 0">
3443
					<xsl:value-of select="$frame"/>
3444
				</xsl:when>
3445
				<xsl:otherwise>
3446
					<xsl:choose>
3447
						<xsl:when test="$effective-border='0'">void</xsl:when>
3448
						<xsl:otherwise>border</xsl:otherwise>
3449
					</xsl:choose>
3450
				</xsl:otherwise>
3451
			</xsl:choose>
3452
		</xsl:variable>
3453
		<xsl:choose>
3454
			<xsl:when test="$effective-frame='above' or $effective-frame='hsides' or $effective-frame='box' or $effective-frame='border'">
3455
				<xsl:text>border-top-style:solid;</xsl:text>
3456
				<xsl:value-of select="concat('border-top-width:',$effective-border,'px;')"/>
3457
			</xsl:when>
3458
			<xsl:otherwise>
3459
				<xsl:text>border-top-style:none;</xsl:text>
3460
			</xsl:otherwise>
3461
		</xsl:choose>
3462
		<xsl:choose>
3463
			<xsl:when test="$effective-frame='rhs' or $effective-frame='vsides' or $effective-frame='box' or $effective-frame='border'">
3464
				<xsl:text>border-right-style:solid;</xsl:text>
3465
				<xsl:value-of select="concat('border-right-width:',$effective-border,'px;')"/>
3466
			</xsl:when>
3467
			<xsl:otherwise>
3468
				<xsl:text>border-right-style:none;</xsl:text>
3469
			</xsl:otherwise>
3470
		</xsl:choose>
3471
		<xsl:choose>
3472
			<xsl:when test="$effective-frame='below' or $effective-frame='hsides' or $effective-frame='box' or $effective-frame='border'">
3473
				<xsl:text>border-bottom-style:solid;</xsl:text>
3474
				<xsl:value-of select="concat('border-bottom-width:',$effective-border,'px;')"/>
3475
			</xsl:when>
3476
			<xsl:otherwise>
3477
				<xsl:text>border-bottom-style:none;</xsl:text>
3478
			</xsl:otherwise>
3479
		</xsl:choose>
3480
		<xsl:choose>
3481
			<xsl:when test="$effective-frame='lhs' or $effective-frame='vsides' or $effective-frame='box' or $effective-frame='border'">
3482
				<xsl:text>border-left-style:solid;</xsl:text>
3483
				<xsl:value-of select="concat('border-left-width:',$effective-border,'px;')"/>
3484
			</xsl:when>
3485
			<xsl:otherwise>
3486
				<xsl:text>border-left-style:none;</xsl:text>
3487
			</xsl:otherwise>
3488
		</xsl:choose>
3489
		<xsl:variable name="cellspacing" select="normalize-space(string($table/@cellspacing))"/>
3490
		<xsl:if test="string-length($cellspacing) > 0">
3491
			<xsl:value-of select="concat('border-spacing:',$cellspacing,'px;')"/>
3492
		</xsl:if>
3493
		<xsl:variable name="height" select="normalize-space(string($table/@height))"/>
3494
		<xsl:if test="string-length($height) > 0">
3495
			<xsl:choose>
3496
				<xsl:when test="contains($height,'%')">
3497
					<xsl:value-of select="concat('height:',$height,';')"/>
3498
				</xsl:when>
3499
				<xsl:otherwise>
3500
					<xsl:value-of select="concat('height:',$height,'px;')"/>
3501
				</xsl:otherwise>
3502
			</xsl:choose>
3503
		</xsl:if>
3504
		<xsl:variable name="width" select="normalize-space(string($table/@width))"/>
3505
		<xsl:if test="string-length($width) > 0">
3506
			<xsl:choose>
3507
				<xsl:when test="contains($width,'%')">
3508
					<xsl:value-of select="concat('width:',$width,';')"/>
3509
				</xsl:when>
3510
				<xsl:otherwise>
3511
					<xsl:value-of select="concat('width:',$width,'px;')"/>
3512
				</xsl:otherwise>
3513
			</xsl:choose>
3514
		</xsl:if>
3515
		<xsl:variable name="user-styles">
3516
			<xsl:for-each select="$table">
3517
				<xsl:call-template name="altova:html-table-table-get-table-user-styles"/>
3518
			</xsl:for-each>
3519
		</xsl:variable>
3520
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3521
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3522
		</xsl:call-template>
3523
		<xsl:variable name="style" select="normalize-space(string($table/@style))"/>
3524
		<xsl:if test="string-length($style) > 0">
3525
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3526
				<xsl:with-param name="css-styles" select="string($style)"/>
3527
			</xsl:call-template>
3528
		</xsl:if>
3529
	</xsl:template>
3530
	<xsl:template name="altova:html-table-table-calc-table-align">
3531
		<xsl:param name="effective-styles"/>
3532
		<xsl:variable name="html-table-align">
3533
			<xsl:call-template name="altova:css-styles-get-property">
3534
				<xsl:with-param name="property" select="'html-table-align'"/>
3535
				<xsl:with-param name="css-styles" select="string($effective-styles)"/>
3536
			</xsl:call-template>
3537
		</xsl:variable>
3538
		<xsl:variable name="margin-left">
3539
			<xsl:call-template name="altova:css-styles-get-property">
3540
				<xsl:with-param name="property" select="'margin-left'"/>
3541
				<xsl:with-param name="css-styles" select="string($effective-styles)"/>
3542
			</xsl:call-template>
3543
		</xsl:variable>
3544
		<xsl:variable name="margin-right">
3545
			<xsl:call-template name="altova:css-styles-get-property">
3546
				<xsl:with-param name="property" select="'margin-right'"/>
3547
				<xsl:with-param name="css-styles" select="string($effective-styles)"/>
3548
			</xsl:call-template>
3549
		</xsl:variable>
3550
		<xsl:choose>
3551
			<xsl:when test="$margin-left='auto' and $margin-right='auto'">center</xsl:when>
3552
			<xsl:when test="$margin-left='auto'">right</xsl:when>
3553
			<xsl:when test="$margin-right='auto'">left</xsl:when>
3554
			<xsl:otherwise>
3555
				<xsl:value-of select="$html-table-align"/>
3556
			</xsl:otherwise>
3557
		</xsl:choose>
3558
	</xsl:template>
3559
	<xsl:template name="altova:html-table-table-calc-caption-effective-styles">
3560
		<xsl:param name="caption"/>
3561
		<xsl:text>text-align:center;</xsl:text>
3562
		<xsl:variable name="align" select="normalize-space(string($caption/@align))"/>
3563
		<xsl:choose>
3564
			<xsl:when test="$align='top'">caption-side:top;</xsl:when>
3565
			<xsl:when test="$align='bottom'">caption-side:bottom;</xsl:when>
3566
			<xsl:otherwise>caption-side:top;</xsl:otherwise>
3567
		</xsl:choose>
3568
		<xsl:variable name="user-styles">
3569
			<xsl:for-each select="$caption">
3570
				<xsl:call-template name="altova:html-table-table-get-caption-user-styles"/>
3571
			</xsl:for-each>
3572
		</xsl:variable>
3573
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3574
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3575
		</xsl:call-template>
3576
		<xsl:variable name="style" select="normalize-space(string($caption/@style))"/>
3577
		<xsl:if test="string-length($style) > 0">
3578
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3579
				<xsl:with-param name="css-styles" select="string($style)"/>
3580
			</xsl:call-template>
3581
		</xsl:if>
3582
	</xsl:template>
3583
	<xsl:template name="altova:html-table-table-calc-thead-effective-styles">
3584
		<xsl:param name="thead"/>
3585
		<xsl:variable name="align" select="normalize-space(string($thead/@align))"/>
3586
		<xsl:if test="string-length($align) > 0">
3587
			<xsl:value-of select="concat('text-align:',$align,';')"/>
3588
		</xsl:if>
3589
		<xsl:variable name="valign" select="normalize-space(string($thead/@valign))"/>
3590
		<xsl:if test="string-length($valign) > 0">
3591
			<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
3592
		</xsl:if>
3593
		<xsl:variable name="user-styles">
3594
			<xsl:for-each select="$thead">
3595
				<xsl:call-template name="altova:html-table-table-get-thead-user-styles"/>
3596
			</xsl:for-each>
3597
		</xsl:variable>
3598
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3599
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3600
		</xsl:call-template>
3601
		<xsl:variable name="style" select="normalize-space(string($thead/@style))"/>
3602
		<xsl:if test="string-length($style) > 0">
3603
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3604
				<xsl:with-param name="css-styles" select="string($style)"/>
3605
			</xsl:call-template>
3606
		</xsl:if>
3607
	</xsl:template>
3608
	<xsl:template name="altova:html-table-table-calc-tfoot-effective-styles">
3609
		<xsl:param name="tfoot"/>
3610
		<xsl:variable name="align" select="normalize-space(string($tfoot/@align))"/>
3611
		<xsl:if test="string-length($align) > 0">
3612
			<xsl:value-of select="concat('text-align:',$align,';')"/>
3613
		</xsl:if>
3614
		<xsl:variable name="valign" select="normalize-space(string($tfoot/@valign))"/>
3615
		<xsl:if test="string-length($valign) > 0">
3616
			<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
3617
		</xsl:if>
3618
		<xsl:variable name="user-styles">
3619
			<xsl:for-each select="$tfoot">
3620
				<xsl:call-template name="altova:html-table-table-get-tfoot-user-styles"/>
3621
			</xsl:for-each>
3622
		</xsl:variable>
3623
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3624
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3625
		</xsl:call-template>
3626
		<xsl:variable name="style" select="normalize-space(string($tfoot/@style))"/>
3627
		<xsl:if test="string-length($style) > 0">
3628
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3629
				<xsl:with-param name="css-styles" select="string($style)"/>
3630
			</xsl:call-template>
3631
		</xsl:if>
3632
	</xsl:template>
3633
	<xsl:template name="altova:html-table-table-calc-tbody-effective-styles">
3634
		<xsl:param name="tbody"/>
3635
		<xsl:variable name="align" select="normalize-space(string($tbody/@align))"/>
3636
		<xsl:if test="string-length($align) > 0">
3637
			<xsl:value-of select="concat('text-align:',$align,';')"/>
3638
		</xsl:if>
3639
		<xsl:variable name="valign" select="normalize-space(string($tbody/@valign))"/>
3640
		<xsl:if test="string-length($valign) > 0">
3641
			<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
3642
		</xsl:if>
3643
		<xsl:variable name="user-styles">
3644
			<xsl:for-each select="$tbody">
3645
				<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
3646
			</xsl:for-each>
3647
		</xsl:variable>
3648
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3649
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3650
		</xsl:call-template>
3651
		<xsl:variable name="style" select="normalize-space(string($tbody/@style))"/>
3652
		<xsl:if test="string-length($style) > 0">
3653
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3654
				<xsl:with-param name="css-styles" select="string($style)"/>
3655
			</xsl:call-template>
3656
		</xsl:if>
3657
	</xsl:template>
3658
	<xsl:template name="altova:html-table-table-calc-row-effective-styles">
3659
		<xsl:param name="rownum"/>
3660
		<xsl:param name="row"/>
3661
		<xsl:variable name="align" select="normalize-space(string($row/@align))"/>
3662
		<xsl:if test="string-length($align) > 0">
3663
			<xsl:value-of select="concat('text-align:',$align,';')"/>
3664
		</xsl:if>
3665
		<xsl:variable name="bgcolor" select="normalize-space(string($row/@bgcolor))"/>
3666
		<xsl:if test="string-length($bgcolor) > 0">
3667
			<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
3668
		</xsl:if>
3669
		<xsl:variable name="valign" select="normalize-space(string($row/@valign))"/>
3670
		<xsl:if test="string-length($valign) > 0">
3671
			<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
3672
		</xsl:if>
3673
		<xsl:variable name="height" select="normalize-space(string($row/@height))"/>
3674
		<xsl:if test="string($height)">
3675
			<xsl:choose>
3676
				<xsl:when test="contains($height,'%')">
3677
					<xsl:value-of select="concat('height:',$height,';')"/>
3678
				</xsl:when>
3679
				<xsl:otherwise>
3680
					<xsl:value-of select="concat('height:',$height,'px;')"/>
3681
				</xsl:otherwise>
3682
			</xsl:choose>
3683
		</xsl:if>
3684
		<xsl:variable name="user-styles">
3685
			<xsl:for-each select="$row">
3686
				<xsl:call-template name="altova:html-table-table-get-tr-user-styles">
3687
					<xsl:with-param name="rownum" select="$rownum"/>
3688
				</xsl:call-template>
3689
			</xsl:for-each>
3690
		</xsl:variable>
3691
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3692
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3693
		</xsl:call-template>
3694
		<xsl:variable name="style" select="normalize-space(string($row/@style))"/>
3695
		<xsl:if test="string-length($style) > 0">
3696
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3697
				<xsl:with-param name="css-styles" select="string($style)"/>
3698
			</xsl:call-template>
3699
		</xsl:if>
3700
	</xsl:template>
3701
	<xsl:template name="altova:html-table-table-calc-cell-effective-styles">
3702
		<xsl:param name="colnum"/>
3703
		<xsl:param name="rownum"/>
3704
		<xsl:param name="col-count"/>
3705
		<xsl:param name="row-count"/>
3706
		<xsl:param name="is-first-table-row"/>
3707
		<xsl:param name="is-last-table-row"/>
3708
		<xsl:param name="row"/>
3709
		<xsl:param name="entry"/>
3710
		<xsl:param name="parent-user-styles"/>
3711
		<xsl:choose>
3712
			<xsl:when test="$entry/self::th">
3713
				<xsl:text>text-align:center;</xsl:text>
3714
			</xsl:when>
3715
			<xsl:otherwise>
3716
				<xsl:text>text-align:left;</xsl:text>
3717
			</xsl:otherwise>
3718
		</xsl:choose>
3719
		<xsl:call-template name="altova:css-styles-get-inherited-styles-for-table-cell">
3720
			<xsl:with-param name="css-styles" select="$parent-user-styles"/>
3721
		</xsl:call-template>
3722
		<xsl:text>padding-top:1px;</xsl:text>
3723
		<xsl:text>padding-right:1px;</xsl:text>
3724
		<xsl:text>padding-bottom:1px;</xsl:text>
3725
		<xsl:text>padding-left:1px;</xsl:text>
3726
		<xsl:text>vertical-align:middle;</xsl:text>
3727
		<xsl:if test="$entry/self::th">
3728
			<xsl:text>font-weight:bold;</xsl:text>
3729
		</xsl:if>
3730
		<xsl:variable name="cellpadding" select="normalize-space(string($row/ancestor::table[1]/@cellpadding))"/>
3731
		<xsl:if test="string($cellpadding)">
3732
			<xsl:value-of select="concat('padding-top:',$cellpadding,'px;')"/>
3733
			<xsl:value-of select="concat('padding-right:',$cellpadding,'px;')"/>
3734
			<xsl:value-of select="concat('padding-bottom:',$cellpadding,'px;')"/>
3735
			<xsl:value-of select="concat('padding-left:',$cellpadding,'px;')"/>
3736
		</xsl:if>
3737
		<xsl:variable name="effective-border">
3738
			<xsl:variable name="border" select="normalize-space(string($row/ancestor::table[1]/@border))"/>
3739
			<xsl:choose>
3740
				<xsl:when test="string-length($border) > 0">
3741
					<xsl:value-of select="$border"/>
3742
				</xsl:when>
3743
				<xsl:otherwise>0</xsl:otherwise>
3744
			</xsl:choose>
3745
		</xsl:variable>
3746
		<xsl:variable name="effective-frame">
3747
			<xsl:variable name="frame" select="normalize-space(string($row/ancestor::table[1]/@frame))"/>
3748
			<xsl:choose>
3749
				<xsl:when test="string-length($frame) > 0">
3750
					<xsl:value-of select="$frame"/>
3751
				</xsl:when>
3752
				<xsl:otherwise>
3753
					<xsl:choose>
3754
						<xsl:when test="$effective-border='0'">void</xsl:when>
3755
						<xsl:otherwise>border</xsl:otherwise>
3756
					</xsl:choose>
3757
				</xsl:otherwise>
3758
			</xsl:choose>
3759
		</xsl:variable>
3760
		<xsl:variable name="effective-rules">
3761
			<xsl:variable name="rules" select="normalize-space(string($row/ancestor::table[1]/@rules))"/>
3762
			<xsl:choose>
3763
				<xsl:when test="string-length($rules) > 0">
3764
					<xsl:value-of select="$rules"/>
3765
				</xsl:when>
3766
				<xsl:otherwise>
3767
					<xsl:choose>
3768
						<xsl:when test="$effective-border='0'">none</xsl:when>
3769
						<xsl:otherwise>all</xsl:otherwise>
3770
					</xsl:choose>
3771
				</xsl:otherwise>
3772
			</xsl:choose>
3773
		</xsl:variable>
3774
		<xsl:variable name="show-border-top">
3775
			<xsl:choose>
3776
				<xsl:when test="$is-first-table-row">
3777
					<xsl:choose>
3778
						<xsl:when test="$effective-frame='above'">1</xsl:when>
3779
						<xsl:when test="$effective-frame='hsides'">1</xsl:when>
3780
						<xsl:when test="$effective-frame='box'">1</xsl:when>
3781
						<xsl:when test="$effective-frame='border'">1</xsl:when>
3782
						<xsl:otherwise>0</xsl:otherwise>
3783
					</xsl:choose>
3784
				</xsl:when>
3785
				<xsl:when test="$effective-rules='all'">1</xsl:when>
3786
				<xsl:when test="$effective-rules='rows'">1</xsl:when>
3787
				<xsl:when test="$effective-rules='groups'">
3788
					<xsl:choose>
3789
						<xsl:when test="$rownum=1">1</xsl:when>
3790
						<xsl:otherwise>0</xsl:otherwise>
3791
					</xsl:choose>
3792
				</xsl:when>
3793
				<xsl:otherwise>0</xsl:otherwise>
3794
			</xsl:choose>
3795
		</xsl:variable>
3796
		<xsl:choose>
3797
			<xsl:when test="$show-border-top='1'">
3798
				<xsl:text>border-top-style:solid;</xsl:text>
3799
			</xsl:when>
3800
			<xsl:otherwise>
3801
				<xsl:text>border-top-style:none;</xsl:text>
3802
			</xsl:otherwise>
3803
		</xsl:choose>
3804
		<xsl:variable name="show-border-right">
3805
			<xsl:choose>
3806
				<xsl:when test="$colnum=$col-count">
3807
					<xsl:choose>
3808
						<xsl:when test="$effective-frame='rhs'">1</xsl:when>
3809
						<xsl:when test="$effective-frame='vsides'">1</xsl:when>
3810
						<xsl:when test="$effective-frame='box'">1</xsl:when>
3811
						<xsl:when test="$effective-frame='border'">1</xsl:when>
3812
						<xsl:otherwise>0</xsl:otherwise>
3813
					</xsl:choose>
3814
				</xsl:when>
3815
				<xsl:when test="$effective-rules='all'">1</xsl:when>
3816
				<xsl:when test="$effective-rules='cols'">1</xsl:when>
3817
				<xsl:otherwise>0</xsl:otherwise>
3818
			</xsl:choose>
3819
		</xsl:variable>
3820
		<xsl:choose>
3821
			<xsl:when test="$show-border-right='1'">
3822
				<xsl:text>border-right-style:solid;</xsl:text>
3823
			</xsl:when>
3824
			<xsl:otherwise>
3825
				<xsl:text>border-right-style:none;</xsl:text>
3826
			</xsl:otherwise>
3827
		</xsl:choose>
3828
		<xsl:variable name="show-border-bottom">
3829
			<xsl:choose>
3830
				<xsl:when test="$is-last-table-row">
3831
					<xsl:choose>
3832
						<xsl:when test="$effective-frame='below'">1</xsl:when>
3833
						<xsl:when test="$effective-frame='hsides'">1</xsl:when>
3834
						<xsl:when test="$effective-frame='box'">1</xsl:when>
3835
						<xsl:when test="$effective-frame='border'">1</xsl:when>
3836
						<xsl:otherwise>0</xsl:otherwise>
3837
					</xsl:choose>
3838
				</xsl:when>
3839
				<xsl:when test="$effective-rules='all'">1</xsl:when>
3840
				<xsl:when test="$effective-rules='rows'">1</xsl:when>
3841
				<xsl:when test="$effective-rules='groups'">
3842
					<xsl:choose>
3843
						<xsl:when test="$rownum=$row-count">1</xsl:when>
3844
						<xsl:otherwise>0</xsl:otherwise>
3845
					</xsl:choose>
3846
				</xsl:when>
3847
				<xsl:otherwise>0</xsl:otherwise>
3848
			</xsl:choose>
3849
		</xsl:variable>
3850
		<xsl:choose>
3851
			<xsl:when test="$show-border-bottom='1'">
3852
				<xsl:text>border-bottom-style:solid;</xsl:text>
3853
			</xsl:when>
3854
			<xsl:otherwise>
3855
				<xsl:text>border-bottom-style:none;</xsl:text>
3856
			</xsl:otherwise>
3857
		</xsl:choose>
3858
		<xsl:variable name="show-border-left">
3859
			<xsl:choose>
3860
				<xsl:when test="$colnum=1">
3861
					<xsl:choose>
3862
						<xsl:when test="$effective-frame='lhs'">1</xsl:when>
3863
						<xsl:when test="$effective-frame='vsides'">1</xsl:when>
3864
						<xsl:when test="$effective-frame='box'">1</xsl:when>
3865
						<xsl:when test="$effective-frame='border'">1</xsl:when>
3866
						<xsl:otherwise>0</xsl:otherwise>
3867
					</xsl:choose>
3868
				</xsl:when>
3869
				<xsl:when test="$effective-rules='all'">1</xsl:when>
3870
				<xsl:when test="$effective-rules='cols'">1</xsl:when>
3871
				<xsl:otherwise>0</xsl:otherwise>
3872
			</xsl:choose>
3873
		</xsl:variable>
3874
		<xsl:choose>
3875
			<xsl:when test="$show-border-left='1'">
3876
				<xsl:text>border-left-style:solid;</xsl:text>
3877
			</xsl:when>
3878
			<xsl:otherwise>
3879
				<xsl:text>border-left-style:none;</xsl:text>
3880
			</xsl:otherwise>
3881
		</xsl:choose>
3882
		<xsl:variable name="align" select="normalize-space(string($entry/@align))"/>
3883
		<xsl:if test="string-length($align) > 0">
3884
			<xsl:value-of select="concat('text-align:',$align,';')"/>
3885
		</xsl:if>
3886
		<xsl:variable name="bgcolor" select="normalize-space(string($entry/@bgcolor))"/>
3887
		<xsl:if test="string-length($bgcolor) > 0">
3888
			<xsl:value-of select="concat('background-color:',$bgcolor,';')"/>
3889
		</xsl:if>
3890
		<xsl:variable name="valign" select="normalize-space(string($entry/@valign))"/>
3891
		<xsl:if test="string-length($valign) > 0">
3892
			<xsl:value-of select="concat('vertical-align:',$valign,';')"/>
3893
		</xsl:if>
3894
		<xsl:variable name="height" select="normalize-space(string($entry/@height))"/>
3895
		<xsl:if test="string($height)">
3896
			<xsl:choose>
3897
				<xsl:when test="contains($height,'%')">
3898
					<xsl:value-of select="concat('height:',$height,';')"/>
3899
				</xsl:when>
3900
				<xsl:otherwise>
3901
					<xsl:value-of select="concat('height:',$height,'px;')"/>
3902
				</xsl:otherwise>
3903
			</xsl:choose>
3904
		</xsl:if>
3905
		<xsl:variable name="width" select="normalize-space(string($entry/@width))"/>
3906
		<xsl:if test="string($width)">
3907
			<xsl:choose>
3908
				<xsl:when test="contains($width,'%')">
3909
					<xsl:value-of select="concat('width:',$width,';')"/>
3910
				</xsl:when>
3911
				<xsl:otherwise>
3912
					<xsl:value-of select="concat('width:',$width,'px;')"/>
3913
				</xsl:otherwise>
3914
			</xsl:choose>
3915
		</xsl:if>
3916
		<xsl:variable name="user-styles">
3917
			<xsl:choose>
3918
				<xsl:when test="$entry/self::th">
3919
					<xsl:for-each select="$entry">
3920
						<xsl:call-template name="altova:html-table-table-get-th-user-styles">
3921
							<xsl:with-param name="colnum" select="$colnum"/>
3922
							<xsl:with-param name="rownum" select="$rownum"/>
3923
						</xsl:call-template>
3924
					</xsl:for-each>
3925
				</xsl:when>
3926
				<xsl:when test="$entry/self::td">
3927
					<xsl:for-each select="$entry">
3928
						<xsl:call-template name="altova:html-table-table-get-td-user-styles">
3929
							<xsl:with-param name="colnum" select="$colnum"/>
3930
							<xsl:with-param name="rownum" select="$rownum"/>
3931
						</xsl:call-template>
3932
					</xsl:for-each>
3933
				</xsl:when>
3934
				<xsl:otherwise>
3935
					<xsl:call-template name="altova:html-table-table-get-td-user-styles">
3936
						<xsl:with-param name="colnum" select="$colnum"/>
3937
						<xsl:with-param name="rownum" select="$rownum"/>
3938
					</xsl:call-template>
3939
				</xsl:otherwise>
3940
			</xsl:choose>
3941
		</xsl:variable>
3942
		<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3943
			<xsl:with-param name="css-styles" select="string($user-styles)"/>
3944
		</xsl:call-template>
3945
		<xsl:variable name="style" select="normalize-space(string($entry/@style))"/>
3946
		<xsl:if test="string-length($style) > 0">
3947
			<xsl:call-template name="altova:css-styles-split-shorthand-styles">
3948
				<xsl:with-param name="css-styles" select="string($style)"/>
3949
			</xsl:call-template>
3950
		</xsl:if>
3951
	</xsl:template>
3952
	<xsl:template name="altova:html-table-table-is-first-table-row">
3953
		<xsl:param name="row"/>
3954
		<xsl:choose>
3955
			<xsl:when test="$row/parent::thead">
3956
				<xsl:choose>
3957
					<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
3958
					<xsl:otherwise>1</xsl:otherwise>
3959
				</xsl:choose>
3960
			</xsl:when>
3961
			<xsl:when test="$row/parent::tfoot">0</xsl:when>
3962
			<xsl:when test="$row/parent::tbody">
3963
				<xsl:choose>
3964
					<xsl:when test="$row/../preceding-sibling::thead">0</xsl:when>
3965
					<xsl:when test="$row/../preceding-sibling::tbody">0</xsl:when>
3966
					<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
3967
					<xsl:otherwise>1</xsl:otherwise>
3968
				</xsl:choose>
3969
			</xsl:when>
3970
			<xsl:when test="$row/parent::table">
3971
				<xsl:choose>
3972
					<xsl:when test="$row/preceding-sibling::tr">0</xsl:when>
3973
					<xsl:otherwise>1</xsl:otherwise>
3974
				</xsl:choose>
3975
			</xsl:when>
3976
		</xsl:choose>
3977
	</xsl:template>
3978
	<xsl:template name="altova:html-table-table-is-last-table-row">
3979
		<xsl:param name="row"/>
3980
		<xsl:choose>
3981
			<xsl:when test="$row/parent::thead">0</xsl:when>
3982
			<xsl:when test="$row/parent::tfoot">
3983
				<xsl:choose>
3984
					<xsl:when test="$row/following-sibling::tr">0</xsl:when>
3985
					<xsl:otherwise>1</xsl:otherwise>
3986
				</xsl:choose>
3987
			</xsl:when>
3988
			<xsl:when test="$row/parent::tbody">
3989
				<xsl:choose>
3990
					<xsl:when test="$row/../preceding-sibling::tfoot">0</xsl:when>
3991
					<xsl:when test="$row/../following-sibling::tbody">0</xsl:when>
3992
					<xsl:when test="$row/following-sibling::tr">0</xsl:when>
3993
					<xsl:otherwise>1</xsl:otherwise>
3994
				</xsl:choose>
3995
			</xsl:when>
3996
			<xsl:when test="$row/parent::table">
3997
				<xsl:choose>
3998
					<xsl:when test="$row/following-sibling::tr">0</xsl:when>
3999
					<xsl:otherwise>1</xsl:otherwise>
4000
				</xsl:choose>
4001
			</xsl:when>
4002
		</xsl:choose>
4003
	</xsl:template>
4004
	<xsl:template name="altova:html-table-table-calc-col-count">
4005
		<xsl:param name="table"/>
4006
		<xsl:variable name="col-count">
4007
			<xsl:choose>
4008
				<xsl:when test="$table/tr[1]">
4009
					<xsl:call-template name="altova:html-table-table-calc-col-count-row">
4010
						<xsl:with-param name="row" select="$table/tr[1]"/>
4011
						<xsl:with-param name="rowinfo" select="''"/>
4012
					</xsl:call-template>
4013
				</xsl:when>
4014
				<xsl:otherwise>0</xsl:otherwise>
4015
			</xsl:choose>
4016
		</xsl:variable>
4017
		<xsl:choose>
4018
			<xsl:when test="($table/thead|$table/tfoot|$table/tbody)[1]">
4019
				<xsl:call-template name="altova:html-table-table-calc-col-count-tbody">
4020
					<xsl:with-param name="tbody" select="($table/thead|$table/tfoot|$table/tbody)[1]"/>
4021
					<xsl:with-param name="col-count-max" select="number($col-count)"/>
4022
				</xsl:call-template>
4023
			</xsl:when>
4024
			<xsl:otherwise>
4025
				<xsl:value-of select="$col-count"/>
4026
			</xsl:otherwise>
4027
		</xsl:choose>
4028
	</xsl:template>
4029
	<xsl:template name="altova:html-table-table-calc-col-count-tbody">
4030
		<xsl:param name="tbody"/>
4031
		<xsl:param name="col-count-max"/>
4032
		<xsl:variable name="col-count">
4033
			<xsl:call-template name="altova:html-table-table-calc-col-count-row">
4034
				<xsl:with-param name="row" select="$tbody/tr[1]"/>
4035
				<xsl:with-param name="rowinfo" select="''"/>
4036
			</xsl:call-template>
4037
		</xsl:variable>
4038
		<xsl:variable name="new-col-count-max">
4039
			<xsl:choose>
4040
				<xsl:when test="$col-count-max >= number($col-count)">
4041
					<xsl:value-of select="$col-count-max"/>
4042
				</xsl:when>
4043
				<xsl:otherwise>
4044
					<xsl:value-of select="$col-count"/>
4045
				</xsl:otherwise>
4046
			</xsl:choose>
4047
		</xsl:variable>
4048
		<xsl:variable name="next-tbody" select="($tbody/following-sibling::thead|$tbody/following-sibling::tfoot|$tbody/following-sibling::tbody)[1]"/>
4049
		<xsl:choose>
4050
			<xsl:when test="$next-tbody">
4051
				<xsl:call-template name="altova:html-table-table-calc-col-count-tbody">
4052
					<xsl:with-param name="tbody" select="$next-tbody"/>
4053
					<xsl:with-param name="col-count-max" select="number($new-col-count-max)"/>
4054
				</xsl:call-template>
4055
			</xsl:when>
4056
			<xsl:otherwise>
4057
				<xsl:value-of select="$new-col-count-max"/>
4058
			</xsl:otherwise>
4059
		</xsl:choose>
4060
	</xsl:template>
4061
	<xsl:template name="altova:html-table-table-calc-col-count-row">
4062
		<xsl:param name="row"/>
4063
		<xsl:param name="rowinfo"/>
4064
		<xsl:variable name="rowinfo-count">
4065
			<xsl:call-template name="altova:vector-count">
4066
				<xsl:with-param name="vector" select="$rowinfo"/>
4067
				<xsl:with-param name="separator" select="';'"/>
4068
			</xsl:call-template>
4069
		</xsl:variable>
4070
		<xsl:variable name="first-entry" select="($row/td|$row/th)[1]"/>
4071
		<xsl:variable name="nextrowinfo">
4072
			<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
4073
				<xsl:with-param name="entry" select="$first-entry"/>
4074
				<xsl:with-param name="pos" select="1"/>
4075
				<xsl:with-param name="rowinfo" select="$rowinfo"/>
4076
				<xsl:with-param name="col-count" select="number($rowinfo-count) div 2"/>
4077
			</xsl:call-template>
4078
		</xsl:variable>
4079
		<xsl:choose>
4080
			<xsl:when test="$row/following-sibling::tr[1]">
4081
				<xsl:call-template name="altova:html-table-table-calc-col-count-row">
4082
					<xsl:with-param name="row" select="$row/following-sibling::tr[1]"/>
4083
					<xsl:with-param name="rowinfo" select="$nextrowinfo"/>
4084
				</xsl:call-template>
4085
			</xsl:when>
4086
			<xsl:otherwise>
4087
				<xsl:variable name="nextrowinfo-count">
4088
					<xsl:call-template name="altova:vector-count">
4089
						<xsl:with-param name="vector" select="$nextrowinfo"/>
4090
						<xsl:with-param name="separator" select="';'"/>
4091
					</xsl:call-template>
4092
				</xsl:variable>
4093
				<xsl:value-of select="number($nextrowinfo-count) div 2"/>
4094
			</xsl:otherwise>
4095
		</xsl:choose>
4096
	</xsl:template>
4097
	<xsl:template name="altova:html-table-table-generate-table-matrix">
4098
		<xsl:param name="tbody"/>
4099
		<xsl:param name="col-count"/>
4100
		<xsl:variable name="rowinfo">
4101
			<xsl:call-template name="altova:vector-append">
4102
				<xsl:with-param name="count" select="$col-count * 2"/>
4103
				<xsl:with-param name="value" select="'0'"/>
4104
				<xsl:with-param name="separator" select="';'"/>
4105
			</xsl:call-template>
4106
		</xsl:variable>
4107
		<xsl:call-template name="altova:html-table-table-generate-table-matrix-row">
4108
			<xsl:with-param name="row" select="$tbody/tr[1]"/>
4109
			<xsl:with-param name="rowinfo" select="$rowinfo"/>
4110
			<xsl:with-param name="col-count" select="$col-count"/>
4111
		</xsl:call-template>
4112
	</xsl:template>
4113
	<xsl:template name="altova:html-table-table-generate-table-matrix-row">
4114
		<xsl:param name="row"/>
4115
		<xsl:param name="rowinfo"/>
4116
		<xsl:param name="col-count"/>
4117
		<xsl:variable name="first-entry" select="($row/td|$row/th)[1]"/>
4118
		<xsl:call-template name="altova:html-table-table-generate-table-matrix-entry">
4119
			<xsl:with-param name="entry" select="$first-entry"/>
4120
			<xsl:with-param name="pos" select="1"/>
4121
			<xsl:with-param name="rowinfo" select="$rowinfo"/>
4122
			<xsl:with-param name="col-count" select="$col-count"/>
4123
		</xsl:call-template>
4124
		<xsl:variable name="nextrowinfo">
4125
			<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
4126
				<xsl:with-param name="entry" select="$first-entry"/>
4127
				<xsl:with-param name="pos" select="1"/>
4128
				<xsl:with-param name="rowinfo" select="$rowinfo"/>
4129
				<xsl:with-param name="col-count" select="$col-count"/>
4130
			</xsl:call-template>
4131
		</xsl:variable>
4132
		<xsl:for-each select="$row/following-sibling::tr[1]">
4133
			<xsl:call-template name="altova:html-table-table-generate-table-matrix-row">
4134
				<xsl:with-param name="row" select="."/>
4135
				<xsl:with-param name="rowinfo" select="$nextrowinfo"/>
4136
				<xsl:with-param name="col-count" select="$col-count"/>
4137
			</xsl:call-template>
4138
		</xsl:for-each>
4139
	</xsl:template>
4140
	<xsl:template name="altova:html-table-table-generate-table-matrix-entry">
4141
		<xsl:param name="entry"/>
4142
		<xsl:param name="pos"/>
4143
		<xsl:param name="rowinfo"/>
4144
		<xsl:param name="col-count"/>
4145
		<xsl:variable name="dummy-cells">
4146
			<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
4147
				<xsl:with-param name="pos" select="$pos"/>
4148
				<xsl:with-param name="endpos" select="-1"/>
4149
				<xsl:with-param name="rowinfo" select="$rowinfo"/>
4150
			</xsl:call-template>
4151
		</xsl:variable>
4152
		<xsl:value-of select="$dummy-cells"/>
4153
		<xsl:value-of select="'1'"/>
4154
		<xsl:variable name="colspan">
4155
			<xsl:call-template name="altova:html-table-calc-entry-spanned-cols">
4156
				<xsl:with-param name="entry" select="$entry"/>
4157
			</xsl:call-template>
4158
		</xsl:variable>
4159
		<xsl:call-template name="altova:char-vector-append">
4160
			<xsl:with-param name="count" select="number($colspan)"/>
4161
			<xsl:with-param name="char" select="'4'"/>
4162
		</xsl:call-template>
4163
		<xsl:variable name="nextpos" select="$pos + string-length($dummy-cells) + 1 + number($colspan)"/>
4164
		<xsl:choose>
4165
			<xsl:when test="($entry/following-sibling::td|$entry/following-sibling::th)[1]">
4166
				<xsl:call-template name="altova:html-table-table-generate-table-matrix-entry">
4167
					<xsl:with-param name="entry" select="($entry/following-sibling::td|$entry/following-sibling::th)[1]"/>
4168
					<xsl:with-param name="pos" select="$nextpos"/>
4169
					<xsl:with-param name="rowinfo" select="$rowinfo"/>
4170
					<xsl:with-param name="col-count" select="$col-count"/>
4171
				</xsl:call-template>
4172
			</xsl:when>
4173
			<xsl:otherwise>
4174
				<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
4175
					<xsl:with-param name="pos" select="$nextpos"/>
4176
					<xsl:with-param name="endpos" select="$col-count + 1"/>
4177
					<xsl:with-param name="rowinfo" select="$rowinfo"/>
4178
				</xsl:call-template>
4179
			</xsl:otherwise>
4180
		</xsl:choose>
4181
	</xsl:template>
4182
	<xsl:template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
4183
		<xsl:param name="entry"/>
4184
		<xsl:param name="pos"/>
4185
		<xsl:param name="rowinfo"/>
4186
		<xsl:param name="col-count"/>
4187
		<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
4188
			<xsl:with-param name="pos" select="$pos"/>
4189
			<xsl:with-param name="endpos" select="-1"/>
4190
			<xsl:with-param name="rowinfo" select="$rowinfo"/>
4191
		</xsl:call-template>
4192
		<xsl:variable name="dummy-cells">
4193
			<xsl:call-template name="altova:xml-table-fill-table-matrix-with-dummy-cells">
4194
				<xsl:with-param name="pos" select="$pos"/>
4195
				<xsl:with-param name="endpos" select="-1"/>
4196
				<xsl:with-param name="rowinfo" select="$rowinfo"/>
4197
			</xsl:call-template>
4198
		</xsl:variable>
4199
		<xsl:variable name="colspan">
4200
			<xsl:call-template name="altova:html-table-calc-entry-spanned-cols">
4201
				<xsl:with-param name="entry" select="$entry"/>
4202
			</xsl:call-template>
4203
		</xsl:variable>
4204
		<xsl:variable name="rowspan">
4205
			<xsl:call-template name="altova:html-table-calc-entry-spanned-rows">
4206
				<xsl:with-param name="entry" select="$entry"/>
4207
			</xsl:call-template>
4208
		</xsl:variable>
4209
		<xsl:call-template name="altova:vector-append">
4210
			<xsl:with-param name="count" select="1"/>
4211
			<xsl:with-param name="value" select="concat('0;',$rowspan)"/>
4212
			<xsl:with-param name="separator" select="';'"/>
4213
		</xsl:call-template>
4214
		<xsl:call-template name="altova:vector-append">
4215
			<xsl:with-param name="count" select="number($colspan)"/>
4216
			<xsl:with-param name="value" select="concat('1;',$rowspan)"/>
4217
			<xsl:with-param name="separator" select="';'"/>
4218
		</xsl:call-template>
4219
		<xsl:variable name="nextpos" select="$pos + string-length($dummy-cells) + 1 + number($colspan)"/>
4220
		<xsl:choose>
4221
			<xsl:when test="($entry/following-sibling::td|$entry/following-sibling::th)[1]">
4222
				<xsl:call-template name="altova:html-table-table-generate-table-matrix-nextrowinfo">
4223
					<xsl:with-param name="entry" select="($entry/following-sibling::td|$entry/following-sibling::th)[1]"/>
4224
					<xsl:with-param name="pos" select="$nextpos"/>
4225
					<xsl:with-param name="rowinfo" select="$rowinfo"/>
4226
					<xsl:with-param name="col-count" select="$col-count"/>
4227
				</xsl:call-template>
4228
			</xsl:when>
4229
			<xsl:otherwise>
4230
				<xsl:call-template name="altova:xml-table-generate-table-matrix-nextrow-rowspan">
4231
					<xsl:with-param name="pos" select="$nextpos"/>
4232
					<xsl:with-param name="endpos" select="$col-count + 1"/>
4233
					<xsl:with-param name="rowinfo" select="$rowinfo"/>
4234
				</xsl:call-template>
4235
			</xsl:otherwise>
4236
		</xsl:choose>
4237
	</xsl:template>
4238
	<xsl:template name="altova:html-table-table-calc-col-width-vector">
4239
		<xsl:param name="unit"/>
4240
		<xsl:param name="col-count"/>
4241
		<xsl:param name="table"/>
4242
		<xsl:param name="table-width-twips"/>
4243
		<xsl:variable name="col-width-vector">
4244
			<xsl:choose>
4245
				<xsl:when test="$table/tr">
4246
					<xsl:variable name="table-matrix">
4247
						<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4248
							<xsl:with-param name="tbody" select="$table"/>
4249
							<xsl:with-param name="col-count" select="$col-count"/>
4250
						</xsl:call-template>
4251
					</xsl:variable>
4252
					<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
4253
						<xsl:with-param name="unit" select="$unit"/>
4254
						<xsl:with-param name="colnum" select="1"/>
4255
						<xsl:with-param name="col-count" select="$col-count"/>
4256
						<xsl:with-param name="row-count" select="count($table/tr)"/>
4257
						<xsl:with-param name="tbody" select="$table"/>
4258
						<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4259
						<xsl:with-param name="table-matrix" select="$table-matrix"/>
4260
					</xsl:call-template>
4261
				</xsl:when>
4262
				<xsl:otherwise>
4263
					<xsl:call-template name="altova:vector-append">
4264
						<xsl:with-param name="count" select="$col-count"/>
4265
						<xsl:with-param name="value" select="0"/>
4266
						<xsl:with-param name="separator" select="';'"/>
4267
					</xsl:call-template>
4268
				</xsl:otherwise>
4269
			</xsl:choose>
4270
		</xsl:variable>
4271
		<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper">
4272
			<xsl:with-param name="unit" select="$unit"/>
4273
			<xsl:with-param name="col-width-vector" select="$col-width-vector"/>
4274
			<xsl:with-param name="col-count" select="$col-count"/>
4275
			<xsl:with-param name="tbody" select="($table/thead|$table/tfoot|$table/tbody)[1]"/>
4276
			<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4277
		</xsl:call-template>
4278
	</xsl:template>
4279
	<xsl:template name="altova:html-table-table-calc-col-width-vector-helper">
4280
		<xsl:param name="unit"/>
4281
		<xsl:param name="col-width-vector"/>
4282
		<xsl:param name="col-count"/>
4283
		<xsl:param name="tbody"/>
4284
		<xsl:param name="table-width-twips"/>
4285
		<xsl:choose>
4286
			<xsl:when test="$tbody">
4287
				<xsl:variable name="table-matrix">
4288
					<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4289
						<xsl:with-param name="tbody" select="$tbody"/>
4290
						<xsl:with-param name="col-count" select="$col-count"/>
4291
					</xsl:call-template>
4292
				</xsl:variable>
4293
				<xsl:variable name="new-col-width-vector">
4294
					<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
4295
						<xsl:with-param name="unit" select="$unit"/>
4296
						<xsl:with-param name="colnum" select="1"/>
4297
						<xsl:with-param name="col-count" select="$col-count"/>
4298
						<xsl:with-param name="row-count" select="count($tbody/tr)"/>
4299
						<xsl:with-param name="tbody" select="$tbody"/>
4300
						<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4301
						<xsl:with-param name="table-matrix" select="$table-matrix"/>
4302
					</xsl:call-template>
4303
				</xsl:variable>
4304
				<xsl:variable name="max-col-width-vector">
4305
					<xsl:call-template name="altova:vector-merge-vectors-using-max-value">
4306
						<xsl:with-param name="vector1" select="$col-width-vector"/>
4307
						<xsl:with-param name="vector2" select="$new-col-width-vector"/>
4308
						<xsl:with-param name="separator" select="';'"/>
4309
					</xsl:call-template>
4310
				</xsl:variable>
4311
				<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper">
4312
					<xsl:with-param name="unit" select="$unit"/>
4313
					<xsl:with-param name="col-width-vector" select="$max-col-width-vector"/>
4314
					<xsl:with-param name="col-count" select="$col-count"/>
4315
					<xsl:with-param name="tbody" select="($tbody/following-sibling::thead|$tbody/following-sibling::tfoot|$tbody/following-sibling::tbody)[1]"/>
4316
					<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4317
				</xsl:call-template>
4318
			</xsl:when>
4319
			<xsl:otherwise>
4320
				<xsl:value-of select="$col-width-vector"/>
4321
			</xsl:otherwise>
4322
		</xsl:choose>
4323
	</xsl:template>
4324
	<xsl:template name="altova:html-table-table-calc-col-width-vector-helper2">
4325
		<xsl:param name="unit"/>
4326
		<xsl:param name="colnum"/>
4327
		<xsl:param name="col-count"/>
4328
		<xsl:param name="row-count"/>
4329
		<xsl:param name="tbody"/>
4330
		<xsl:param name="table-width-twips"/>
4331
		<xsl:param name="table-matrix"/>
4332
		<xsl:call-template name="altova:html-table-table-calc-effective-col-width">
4333
			<xsl:with-param name="unit" select="$unit"/>
4334
			<xsl:with-param name="colnum" select="$colnum"/>
4335
			<xsl:with-param name="col-count" select="$col-count"/>
4336
			<xsl:with-param name="row-count" select="$row-count"/>
4337
			<xsl:with-param name="tbody" select="$tbody"/>
4338
			<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4339
			<xsl:with-param name="table-matrix" select="$table-matrix"/>
4340
		</xsl:call-template>
4341
		<xsl:text>;</xsl:text>
4342
		<xsl:if test="$colnum &lt; $col-count">
4343
			<xsl:call-template name="altova:html-table-table-calc-col-width-vector-helper2">
4344
				<xsl:with-param name="unit" select="$unit"/>
4345
				<xsl:with-param name="colnum" select="$colnum + 1"/>
4346
				<xsl:with-param name="col-count" select="$col-count"/>
4347
				<xsl:with-param name="row-count" select="$row-count"/>
4348
				<xsl:with-param name="tbody" select="$tbody"/>
4349
				<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4350
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4351
			</xsl:call-template>
4352
		</xsl:if>
4353
	</xsl:template>
4354
	<xsl:template name="altova:html-table-table-calc-effective-col-width">
4355
		<xsl:param name="unit"/>
4356
		<xsl:param name="colnum"/>
4357
		<xsl:param name="col-count"/>
4358
		<xsl:param name="row-count"/>
4359
		<xsl:param name="tbody"/>
4360
		<xsl:param name="table-width-twips"/>
4361
		<xsl:param name="table-matrix"/>
4362
		<xsl:call-template name="altova:html-table-table-calc-effective-col-width-helper">
4363
			<xsl:with-param name="unit" select="$unit"/>
4364
			<xsl:with-param name="max-col-width" select="0"/>
4365
			<xsl:with-param name="colnum" select="$colnum"/>
4366
			<xsl:with-param name="rownum" select="1"/>
4367
			<xsl:with-param name="col-count" select="$col-count"/>
4368
			<xsl:with-param name="row-count" select="$row-count"/>
4369
			<xsl:with-param name="tbody" select="$tbody"/>
4370
			<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4371
			<xsl:with-param name="table-matrix" select="$table-matrix"/>
4372
		</xsl:call-template>
4373
	</xsl:template>
4374
	<xsl:template name="altova:html-table-table-calc-effective-col-width-helper">
4375
		<xsl:param name="max-col-width"/>
4376
		<xsl:param name="unit"/>
4377
		<xsl:param name="colnum"/>
4378
		<xsl:param name="rownum"/>
4379
		<xsl:param name="col-count"/>
4380
		<xsl:param name="row-count"/>
4381
		<xsl:param name="tbody"/>
4382
		<xsl:param name="table-width-twips"/>
4383
		<xsl:param name="table-matrix"/>
4384
		<xsl:variable name="master-colnum">
4385
			<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
4386
				<xsl:with-param name="colnum" select="$colnum"/>
4387
				<xsl:with-param name="rownum" select="$rownum"/>
4388
				<xsl:with-param name="col-count" select="$col-count"/>
4389
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4390
			</xsl:call-template>
4391
		</xsl:variable>
4392
		<xsl:variable name="master-rownum">
4393
			<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
4394
				<xsl:with-param name="colnum" select="$master-colnum"/>
4395
				<xsl:with-param name="rownum" select="$rownum"/>
4396
				<xsl:with-param name="col-count" select="$col-count"/>
4397
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4398
			</xsl:call-template>
4399
		</xsl:variable>
4400
		<xsl:variable name="master-entry-type" select="substring($table-matrix,$col-count * ($master-rownum - 1) + $master-colnum,1)"/>
4401
		<xsl:variable name="master-row" select="$tbody/tr[position()=number($master-rownum)]"/>
4402
		<xsl:variable name="master-pos-in-xml">
4403
			<xsl:choose>
4404
				<xsl:when test="$master-entry-type='1'">
4405
					<xsl:value-of select="string-length(translate(substring($table-matrix,$col-count * ($master-rownum - 1) + 1,$colnum),'102345','1'))"/>
4406
				</xsl:when>
4407
				<xsl:otherwise>0</xsl:otherwise>
4408
			</xsl:choose>
4409
		</xsl:variable>
4410
		<xsl:variable name="master-entry" select="($master-row/td|$master-row/th)[position()=number($master-pos-in-xml)]"/>
4411
		<xsl:variable name="spanned-cols">
4412
			<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-cols">
4413
				<xsl:with-param name="colnum" select="$master-colnum"/>
4414
				<xsl:with-param name="rownum" select="$master-rownum"/>
4415
				<xsl:with-param name="col-count" select="$col-count"/>
4416
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4417
			</xsl:call-template>
4418
		</xsl:variable>
4419
		<xsl:variable name="effective-styles">
4420
			<xsl:call-template name="altova:html-table-table-calc-cell-effective-styles">
4421
				<xsl:with-param name="colnum" select="$master-colnum"/>
4422
				<xsl:with-param name="rownum" select="$master-rownum"/>
4423
				<xsl:with-param name="col-count" select="$col-count"/>
4424
				<xsl:with-param name="row-count" select="$row-count"/>
4425
				<xsl:with-param name="is-first-table-row" select="false()"/>
4426
				<xsl:with-param name="is-last-table-row" select="false()"/>
4427
				<xsl:with-param name="row" select="$master-row"/>
4428
				<xsl:with-param name="entry" select="$master-entry"/>
4429
				<xsl:with-param name="parent-user-styles" select="''"/>
4430
			</xsl:call-template>
4431
		</xsl:variable>
4432
		<xsl:variable name="reversed-styles">
4433
			<xsl:call-template name="altova:vector-reverse">
4434
				<xsl:with-param name="vector" select="$effective-styles"/>
4435
				<xsl:with-param name="separator" select="';'"/>
4436
			</xsl:call-template>
4437
		</xsl:variable>
4438
		<xsl:variable name="width">
4439
			<xsl:call-template name="altova:css-styles-get-property">
4440
				<xsl:with-param name="property" select="'width'"/>
4441
				<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
4442
			</xsl:call-template>
4443
		</xsl:variable>
4444
		<xsl:variable name="cell-width">
4445
			<xsl:choose>
4446
				<xsl:when test="$unit='twips'">
4447
					<xsl:call-template name="altova:css-styles-convert-length-to-twips">
4448
						<xsl:with-param name="css-length" select="$width"/>
4449
						<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
4450
						<xsl:with-param name="em-height-pt" select="12"/>
4451
						<xsl:with-param name="parent-length-twips" select="$table-width-twips"/>
4452
					</xsl:call-template>
4453
				</xsl:when>
4454
				<xsl:when test="$unit='percent'">
4455
					<xsl:choose>
4456
						<xsl:when test="contains($width,'%')">
4457
							<xsl:value-of select="substring-before($width,'%')"/>
4458
						</xsl:when>
4459
						<xsl:otherwise>0</xsl:otherwise>
4460
					</xsl:choose>
4461
				</xsl:when>
4462
				<xsl:otherwise>0</xsl:otherwise>
4463
			</xsl:choose>
4464
		</xsl:variable>
4465
		<xsl:variable name="col-width" select="number($cell-width) div (number($spanned-cols) + 1)"/>
4466
		<xsl:variable name="new-max-col-width">
4467
			<xsl:choose>
4468
				<xsl:when test="number($col-width) > number($max-col-width)">
4469
					<xsl:value-of select="$col-width"/>
4470
				</xsl:when>
4471
				<xsl:otherwise>
4472
					<xsl:value-of select="$max-col-width"/>
4473
				</xsl:otherwise>
4474
			</xsl:choose>
4475
		</xsl:variable>
4476
		<xsl:choose>
4477
			<xsl:when test="$rownum &lt; $row-count">
4478
				<xsl:call-template name="altova:html-table-table-calc-effective-col-width-helper">
4479
					<xsl:with-param name="max-col-width" select="number($new-max-col-width)"/>
4480
					<xsl:with-param name="unit" select="$unit"/>
4481
					<xsl:with-param name="colnum" select="$colnum"/>
4482
					<xsl:with-param name="rownum" select="$rownum + 1"/>
4483
					<xsl:with-param name="col-count" select="$col-count"/>
4484
					<xsl:with-param name="row-count" select="$row-count"/>
4485
					<xsl:with-param name="tbody" select="$tbody"/>
4486
					<xsl:with-param name="table-width-twips" select="$table-width-twips"/>
4487
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4488
				</xsl:call-template>
4489
			</xsl:when>
4490
			<xsl:otherwise>
4491
				<xsl:value-of select="round($new-max-col-width)"/>
4492
			</xsl:otherwise>
4493
		</xsl:choose>
4494
	</xsl:template>
4495
	<xsl:template name="altova:html-table-table-calc-effective-row-height-twips">
4496
		<xsl:param name="rownum"/>
4497
		<xsl:param name="col-count"/>
4498
		<xsl:param name="row-count"/>
4499
		<xsl:param name="row"/>
4500
		<xsl:param name="row-styles"/>
4501
		<xsl:param name="table-matrix"/>
4502
		<xsl:variable name="reversed-styles">
4503
			<xsl:call-template name="altova:vector-reverse">
4504
				<xsl:with-param name="vector" select="$row-styles"/>
4505
				<xsl:with-param name="separator" select="';'"/>
4506
			</xsl:call-template>
4507
		</xsl:variable>
4508
		<xsl:variable name="height">
4509
			<xsl:call-template name="altova:css-styles-get-property">
4510
				<xsl:with-param name="property" select="'height'"/>
4511
				<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
4512
			</xsl:call-template>
4513
		</xsl:variable>
4514
		<xsl:variable name="row-height-twips">
4515
			<xsl:call-template name="altova:css-styles-convert-length-to-twips">
4516
				<xsl:with-param name="css-length" select="$height"/>
4517
				<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
4518
				<xsl:with-param name="em-height-pt" select="12"/>
4519
				<xsl:with-param name="parent-length-twips" select="0"/>
4520
			</xsl:call-template>
4521
		</xsl:variable>
4522
		<xsl:call-template name="altova:html-table-table-calc-effective-row-height-twips-helper">
4523
			<xsl:with-param name="max-row-height-twips" select="$row-height-twips"/>
4524
			<xsl:with-param name="colnum" select="1"/>
4525
			<xsl:with-param name="rownum" select="$rownum"/>
4526
			<xsl:with-param name="col-count" select="$col-count"/>
4527
			<xsl:with-param name="row-count" select="$row-count"/>
4528
			<xsl:with-param name="row" select="$row"/>
4529
			<xsl:with-param name="table-matrix" select="$table-matrix"/>
4530
		</xsl:call-template>
4531
	</xsl:template>
4532
	<xsl:template name="altova:html-table-table-calc-effective-row-height-twips-helper">
4533
		<xsl:param name="max-row-height-twips"/>
4534
		<xsl:param name="colnum"/>
4535
		<xsl:param name="rownum"/>
4536
		<xsl:param name="col-count"/>
4537
		<xsl:param name="row-count"/>
4538
		<xsl:param name="row"/>
4539
		<xsl:param name="table-matrix"/>
4540
		<xsl:variable name="master-colnum">
4541
			<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-colnum">
4542
				<xsl:with-param name="colnum" select="$colnum"/>
4543
				<xsl:with-param name="rownum" select="$rownum"/>
4544
				<xsl:with-param name="col-count" select="$col-count"/>
4545
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4546
			</xsl:call-template>
4547
		</xsl:variable>
4548
		<xsl:variable name="master-rownum">
4549
			<xsl:call-template name="altova:xml-table-table-matrix-get-master-cell-rownum">
4550
				<xsl:with-param name="colnum" select="$master-colnum"/>
4551
				<xsl:with-param name="rownum" select="$rownum"/>
4552
				<xsl:with-param name="col-count" select="$col-count"/>
4553
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4554
			</xsl:call-template>
4555
		</xsl:variable>
4556
		<xsl:variable name="master-entry-type" select="substring($table-matrix,$col-count * ($master-rownum - 1) + $master-colnum,1)"/>
4557
		<xsl:variable name="master-row" select="$row/../tr[position()=number($master-rownum)]"/>
4558
		<xsl:variable name="master-pos-in-xml">
4559
			<xsl:choose>
4560
				<xsl:when test="$master-entry-type='1'">
4561
					<xsl:value-of select="string-length(translate(substring($table-matrix,$col-count * ($master-rownum - 1) + 1,$colnum),'102345','1'))"/>
4562
				</xsl:when>
4563
				<xsl:otherwise>0</xsl:otherwise>
4564
			</xsl:choose>
4565
		</xsl:variable>
4566
		<xsl:variable name="master-entry" select="($master-row/td|$master-row/th)[position()=number($master-pos-in-xml)]"/>
4567
		<xsl:variable name="spanned-rows">
4568
			<xsl:call-template name="altova:xml-table-table-matrix-calc-spanned-rows">
4569
				<xsl:with-param name="colnum" select="$master-colnum"/>
4570
				<xsl:with-param name="rownum" select="$master-rownum"/>
4571
				<xsl:with-param name="col-count" select="$col-count"/>
4572
				<xsl:with-param name="row-count" select="$row-count"/>
4573
				<xsl:with-param name="table-matrix" select="$table-matrix"/>
4574
			</xsl:call-template>
4575
		</xsl:variable>
4576
		<xsl:variable name="effective-styles">
4577
			<xsl:call-template name="altova:html-table-table-calc-cell-effective-styles">
4578
				<xsl:with-param name="colnum" select="$master-colnum"/>
4579
				<xsl:with-param name="rownum" select="$master-rownum"/>
4580
				<xsl:with-param name="col-count" select="$col-count"/>
4581
				<xsl:with-param name="row-count" select="$row-count"/>
4582
				<xsl:with-param name="is-first-table-row" select="false()"/>
4583
				<xsl:with-param name="is-last-table-row" select="false()"/>
4584
				<xsl:with-param name="row" select="$master-row"/>
4585
				<xsl:with-param name="entry" select="$master-entry"/>
4586
				<xsl:with-param name="parent-user-styles" select="''"/>
4587
			</xsl:call-template>
4588
		</xsl:variable>
4589
		<xsl:variable name="reversed-styles">
4590
			<xsl:call-template name="altova:vector-reverse">
4591
				<xsl:with-param name="vector" select="$effective-styles"/>
4592
				<xsl:with-param name="separator" select="';'"/>
4593
			</xsl:call-template>
4594
		</xsl:variable>
4595
		<xsl:variable name="height">
4596
			<xsl:call-template name="altova:css-styles-get-property">
4597
				<xsl:with-param name="property" select="'height'"/>
4598
				<xsl:with-param name="css-styles" select="string($reversed-styles)"/>
4599
			</xsl:call-template>
4600
		</xsl:variable>
4601
		<xsl:variable name="cell-height-twips">
4602
			<xsl:call-template name="altova:css-styles-convert-length-to-twips">
4603
				<xsl:with-param name="css-length" select="$height"/>
4604
				<xsl:with-param name="dpi" select="$altova:nPxPerIn"/>
4605
				<xsl:with-param name="em-height-pt" select="12"/>
4606
				<xsl:with-param name="parent-length-twips" select="0"/>
4607
			</xsl:call-template>
4608
		</xsl:variable>
4609
		<xsl:variable name="row-height-twips" select="number($cell-height-twips) div (number($spanned-rows) + 1)"/>
4610
		<xsl:variable name="new-max-row-height-twips">
4611
			<xsl:choose>
4612
				<xsl:when test="number($row-height-twips) > number($max-row-height-twips)">
4613
					<xsl:value-of select="$row-height-twips"/>
4614
				</xsl:when>
4615
				<xsl:otherwise>
4616
					<xsl:value-of select="$max-row-height-twips"/>
4617
				</xsl:otherwise>
4618
			</xsl:choose>
4619
		</xsl:variable>
4620
		<xsl:choose>
4621
			<xsl:when test="$colnum &lt; $col-count">
4622
				<xsl:call-template name="altova:html-table-table-calc-effective-row-height-twips-helper">
4623
					<xsl:with-param name="max-row-height-twips" select="number($new-max-row-height-twips)"/>
4624
					<xsl:with-param name="colnum" select="$colnum + 1"/>
4625
					<xsl:with-param name="rownum" select="$rownum"/>
4626
					<xsl:with-param name="col-count" select="$col-count"/>
4627
					<xsl:with-param name="row-count" select="$row-count"/>
4628
					<xsl:with-param name="row" select="$row"/>
4629
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4630
				</xsl:call-template>
4631
			</xsl:when>
4632
			<xsl:otherwise>
4633
				<xsl:value-of select="round($new-max-row-height-twips)"/>
4634
			</xsl:otherwise>
4635
		</xsl:choose>
4636
	</xsl:template>
4637
	<xsl:template name="altova:html-table-table-output-table">
4638
		<xsl:param name="table"/>
4639
		<table>
4640
			<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"/>
4641
			<xsl:variable name="user-styles">
4642
				<xsl:for-each select="$table">
4643
					<xsl:call-template name="altova:html-table-table-get-table-user-styles"/>
4644
				</xsl:for-each>
4645
			</xsl:variable>
4646
			<xsl:if test="string($user-styles) or $table/@style">
4647
				<xsl:attribute name="style">
4648
					<xsl:value-of select="concat($user-styles,string($table/@style))"/>
4649
				</xsl:attribute>
4650
			</xsl:if>
4651
			<xsl:variable name="col-count">
4652
				<xsl:call-template name="altova:html-table-table-calc-col-count">
4653
					<xsl:with-param name="table" select="$table"/>
4654
				</xsl:call-template>
4655
			</xsl:variable>
4656
			<xsl:call-template name="altova:html-table-table-output-caption">
4657
				<xsl:with-param name="table" select="$table"/>
4658
			</xsl:call-template>
4659
			<xsl:call-template name="altova:html-table-table-output-thead">
4660
				<xsl:with-param name="table" select="$table"/>
4661
				<xsl:with-param name="col-count" select="number($col-count)"/>
4662
			</xsl:call-template>
4663
			<xsl:call-template name="altova:html-table-table-output-tfoot">
4664
				<xsl:with-param name="table" select="$table"/>
4665
				<xsl:with-param name="col-count" select="number($col-count)"/>
4666
			</xsl:call-template>
4667
			<xsl:call-template name="altova:html-table-table-output-tbody">
4668
				<xsl:with-param name="table" select="$table"/>
4669
				<xsl:with-param name="col-count" select="number($col-count)"/>
4670
			</xsl:call-template>
4671
		</table>
4672
	</xsl:template>
4673
	<xsl:template name="altova:html-table-table-output-caption">
4674
		<xsl:param name="table"/>
4675
		<xsl:for-each select="$table/caption">
4676
			<caption>
4677
				<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align"/>
4678
				<xsl:variable name="user-styles">
4679
					<xsl:call-template name="altova:html-table-table-get-caption-user-styles"/>
4680
				</xsl:variable>
4681
				<xsl:if test="string($user-styles) or @style">
4682
					<xsl:attribute name="style">
4683
						<xsl:value-of select="concat($user-styles,@style)"/>
4684
					</xsl:attribute>
4685
				</xsl:if>
4686
				<xsl:apply-templates select="."/>
4687
			</caption>
4688
		</xsl:for-each>
4689
	</xsl:template>
4690
	<xsl:template name="altova:html-table-table-output-thead">
4691
		<xsl:param name="table"/>
4692
		<xsl:param name="col-count"/>
4693
		<xsl:for-each select="$table/thead">
4694
			<thead>
4695
				<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
4696
				<xsl:variable name="user-styles">
4697
					<xsl:call-template name="altova:html-table-table-get-thead-user-styles"/>
4698
				</xsl:variable>
4699
				<xsl:if test="string($user-styles) or @style">
4700
					<xsl:attribute name="style">
4701
						<xsl:value-of select="concat($user-styles,@style)"/>
4702
					</xsl:attribute>
4703
				</xsl:if>
4704
				<xsl:variable name="table-matrix">
4705
					<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4706
						<xsl:with-param name="tbody" select="."/>
4707
						<xsl:with-param name="col-count" select="$col-count"/>
4708
					</xsl:call-template>
4709
				</xsl:variable>
4710
				<xsl:call-template name="altova:html-table-table-output-rows">
4711
					<xsl:with-param name="tbody" select="."/>
4712
					<xsl:with-param name="col-count" select="$col-count"/>
4713
					<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
4714
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4715
				</xsl:call-template>
4716
			</thead>
4717
		</xsl:for-each>
4718
	</xsl:template>
4719
	<xsl:template name="altova:html-table-table-output-tfoot">
4720
		<xsl:param name="table"/>
4721
		<xsl:param name="col-count"/>
4722
		<xsl:for-each select="$table/tfoot">
4723
			<tfoot>
4724
				<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
4725
				<xsl:variable name="user-styles">
4726
					<xsl:call-template name="altova:html-table-table-get-tfoot-user-styles"/>
4727
				</xsl:variable>
4728
				<xsl:if test="string($user-styles) or @style">
4729
					<xsl:attribute name="style">
4730
						<xsl:value-of select="concat($user-styles,@style)"/>
4731
					</xsl:attribute>
4732
				</xsl:if>
4733
				<xsl:variable name="table-matrix">
4734
					<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4735
						<xsl:with-param name="tbody" select="."/>
4736
						<xsl:with-param name="col-count" select="$col-count"/>
4737
					</xsl:call-template>
4738
				</xsl:variable>
4739
				<xsl:call-template name="altova:html-table-table-output-rows">
4740
					<xsl:with-param name="tbody" select="."/>
4741
					<xsl:with-param name="col-count" select="$col-count"/>
4742
					<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
4743
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4744
				</xsl:call-template>
4745
			</tfoot>
4746
		</xsl:for-each>
4747
	</xsl:template>
4748
	<xsl:template name="altova:html-table-table-output-tbody">
4749
		<xsl:param name="table"/>
4750
		<xsl:param name="col-count"/>
4751
		<xsl:for-each select="$table/tbody">
4752
			<tbody>
4753
				<xsl:copy-of select="@id|@class|@lang|@dir|@title|@onclick|@ondblclick|@onmousedown|@onmouseup|@onmouseover|@onmousemove|@onmouseout|@onkeypress|@onkeydown|@onkeyup|@align|@char|@charoff|@valign"/>
4754
				<xsl:variable name="user-styles">
4755
					<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
4756
				</xsl:variable>
4757
				<xsl:if test="string($user-styles) or @style">
4758
					<xsl:attribute name="style">
4759
						<xsl:value-of select="concat($user-styles,@style)"/>
4760
					</xsl:attribute>
4761
				</xsl:if>
4762
				<xsl:variable name="table-matrix">
4763
					<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4764
						<xsl:with-param name="tbody" select="."/>
4765
						<xsl:with-param name="col-count" select="$col-count"/>
4766
					</xsl:call-template>
4767
				</xsl:variable>
4768
				<xsl:call-template name="altova:html-table-table-output-rows">
4769
					<xsl:with-param name="tbody" select="."/>
4770
					<xsl:with-param name="col-count" select="$col-count"/>
4771
					<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
4772
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4773
				</xsl:call-template>
4774
			</tbody>
4775
		</xsl:for-each>
4776
		<xsl:if test="$table/tr">
4777
			<tbody>
4778
				<xsl:variable name="user-styles">
4779
					<xsl:call-template name="altova:html-table-table-get-tbody-user-styles"/>
4780
				</xsl:variable>
4781
				<xsl:if test="string($user-styles)">
4782
					<xsl:attribute name="style">
4783
						<xsl:value-of select="$user-styles"/>
4784
					</xsl:attribute>
4785
				</xsl:if>
4786
				<xsl:variable name="table-matrix">
4787
					<xsl:call-template name="altova:html-table-table-generate-table-matrix">
4788
						<xsl:with-param name="tbody" select="$table"/>
4789
						<xsl:with-param name="col-count" select="$col-count"/>
4790
					</xsl:call-template>
4791
				</xsl:variable>
4792
				<xsl:call-template name="altova:html-table-table-output-rows">
4793
					<xsl:with-param name="tbody" select="$table"/>
4794
					<xsl:with-param name="col-count" select="$col-count"/>
4795
					<xsl:with-param name="row-count" select="string-length($table-matrix) div $col-count"/>
4796
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4797
				</xsl:call-template>
4798
			</tbody>
4799
		</xsl:if>
4800
	</xsl:template>
4801
	<xsl:template name="altova:html-table-table-output-rows">
4802
		<xsl:param name="tbody"/>
4803
		<xsl:param name="col-count"/>
4804
		<xsl:param name="row-count"/>
4805
		<xsl:param name="table-matrix"/>
4806
		<xsl:for-each select="$tbody/tr">
4807
			<tr>
4808
				<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"/>
4809
				<xsl:variable name="user-styles">
4810
					<xsl:call-template name="altova:html-table-table-get-tr-user-styles">
4811
						<xsl:with-param name="rownum" select="position()"/>
4812
					</xsl:call-template>
4813
				</xsl:variable>
4814
				<xsl:if test="string($user-styles) or @style">
4815
					<xsl:attribute name="style">
4816
						<xsl:value-of select="concat($user-styles,@style)"/>
4817
					</xsl:attribute>
4818
				</xsl:if>
4819
				<xsl:call-template name="altova:html-table-table-output-cells">
4820
					<xsl:with-param name="colnum" select="1"/>
4821
					<xsl:with-param name="rownum" select="position()"/>
4822
					<xsl:with-param name="row" select="."/>
4823
					<xsl:with-param name="col-count" select="$col-count"/>
4824
					<xsl:with-param name="row-count" select="$row-count"/>
4825
					<xsl:with-param name="table-matrix" select="$table-matrix"/>
4826
				</xsl:call-template>
4827
			</tr>
4828
		</xsl:for-each>
4829
	</xsl:template>
4830
	<xsl:template name="altova:html-table-table-output-cells">
4831
		<xsl:param name="colnum"/>
4832
		<xsl:param name="rownum"/>
4833
		<xsl:param name="row"/>
4834
		<xsl:param name="col-count"/>
4835
		<xsl:param name="row-count"/>
4836
		<xsl:param name="table-matrix"/>
4837
		<xsl:variable name="rowstart" select="$col-count * ($rownum - 1)"/>
4838
		<xsl:variable name="entry-type" select="substring($table-matrix,$rowstart + $colnum,1)"/>
4839
		<xsl:variable name="pos-in-xml">
4840
			<xsl:choose>
4841
				<xsl:when test="$entry-type='1'">
4842
					<xsl:value-of select="string-length(translate(substring($table-matrix,$rowstart+1,$colnum),'102345','1'))"/>
4843
				</xsl:when>
4844
				<xsl:otherwise>0</xsl:otherwise>
4845
			</xsl:choose>
4846
		</xsl:variable>
4847
		<xsl:variable name="entry" selec