Attachment 'content.xsl'
Download 1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:html="http://www.w3.org/1999/xhtml"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
6 xmlns:wwmode="urn:WebWorks-Engine-Mode"
7 xmlns:wwlinks="urn:WebWorks-Engine-Links-Schema"
8 xmlns:wwalinks="urn:WebWorks-ALinks-Schema"
9 xmlns:wwfiles="urn:WebWorks-Engine-Files-Schema"
10 xmlns:wwdoc="urn:WebWorks-Document-Schema"
11 xmlns:wwsplits="urn:WebWorks-Engine-Splits-Schema"
12 xmlns:wwtoc="urn:WebWorks-Engine-TOC-Schema"
13 xmlns:wwbehaviors="urn:WebWorks-Behaviors-Schema"
14 xmlns:wwnotes="urn:WebWorks-Footnote-Schema"
15 xmlns:wwproject="urn:WebWorks-Publish-Project"
16 xmlns:wwpage="urn:WebWorks-Page-Template-Schema"
17 xmlns:wwlocale="urn:WebWorks-Locale-Schema"
18 xmlns:wwprogress="urn:WebWorks-XSLT-Extension-Progress"
19 xmlns:wwlog="urn:WebWorks-XSLT-Extension-Log"
20 xmlns:wwfilesystem="urn:WebWorks-XSLT-Extension-FileSystem"
21 xmlns:wwuri="urn:WebWorks-XSLT-Extension-URI"
22 xmlns:wwstring="urn:WebWorks-XSLT-Extension-StringUtilities"
23 xmlns:wwunits="urn:WebWorks-XSLT-Extension-Units"
24 xmlns:wwfilesext="urn:WebWorks-XSLT-Extension-Files"
25 xmlns:wwprojext="urn:WebWorks-XSLT-Extension-Project"
26 xmlns:wwimaging="urn:WebWorks-XSLT-Extension-Imaging"
27 xmlns:wwexsldoc="urn:WebWorks-XSLT-Extension-Document"
28 exclude-result-prefixes="xsl msxsl wwmode wwlinks wwalinks wwfiles wwdoc wwsplits wwtoc wwbehaviors wwnotes wwproject wwpage wwlocale wwprogress wwlog wwfilesystem wwuri wwstring wwunits wwfilesext wwprojext wwimaging wwexsldoc"
29 >
30 <xsl:key name="wwsplits-files-by-groupid-type" match="wwsplits:File" use="concat(@groupID, ':', @type)" />
31 <xsl:key name="wwsplits-files-by-source-lowercase" match="wwsplits:File" use="@source-lowercase" />
32 <xsl:key name="wwsplits-frames-by-id" match="wwsplits:Frame" use="@id" />
33 <xsl:key name="wwsplits-popups-by-id" match="wwsplits:Popup" use="@id" />
34 <xsl:key name="wwtoc-entry-by-id" match="wwtoc:Entry" use="@id" />
35 <xsl:key name="wwbehaviors-paragraphs-by-id" match="wwbehaviors:Paragraph" use="@id" />
36 <xsl:key name="wwbehaviors-paragraphs-by-relatedtopic" match="wwbehaviors:Paragraph" use="@relatedtopic" />
37 <xsl:key name="wwbehaviors-tables-by-id" match="wwbehaviors:Table" use="@id" />
38 <xsl:key name="wwdoc-paragraphs-by-id" match="wwdoc:Paragraph" use="@id" />
39 <xsl:key name="wwdoc-text-by-value" match="wwdoc:Text" use="@value" />
40 <xsl:key name="wwnotes-notes-by-id" match="wwnotes:Note" use="@id" />
41 <xsl:key name="wwfiles-files-by-path" match="wwfiles:File" use="@path" />
42 <xsl:key name="wwproject-property-by-name" match="wwproject:Property" use="@Name"/>
43
44
45 <xsl:template name="Breadcrumbs">
46 <xsl:param name="ParamPageRule" />
47 <xsl:param name="ParamSplit" />
48 <xsl:param name="ParamBreadcrumbTOCEntry" />
49
50 <xsl:for-each select="$ParamBreadcrumbTOCEntry/../ancestor-or-self::wwtoc:Entry">
51 <xsl:variable name="VarTOCEntry" select="." />
52
53 <!-- Emit entry -->
54 <!-- -->
55 <xsl:choose>
56 <xsl:when test="string-length($VarTOCEntry/@path) > 0">
57 <!-- Entry with link -->
58 <!-- -->
59 <xsl:variable name="VarRelativePath" select="wwuri:GetRelativeTo($VarTOCEntry/@path, $ParamSplit/@path)" />
60
61 <html:a class="WebWorks_Breadcrumb_Link" href="{$VarRelativePath}#{$ParamBreadcrumbTOCEntry/@linkid}">
62 <xsl:call-template name="BreadcrumbEntry">
63 <xsl:with-param name="ParamTOCEntry" select="$VarTOCEntry" />
64 </xsl:call-template>
65 </html:a>
66 </xsl:when>
67
68 <xsl:otherwise>
69 <!-- Entry without link -->
70 <!-- -->
71 <xsl:call-template name="BreadcrumbEntry">
72 <xsl:with-param name="ParamTOCEntry" select="$VarTOCEntry" />
73 </xsl:call-template>
74 </xsl:otherwise>
75 </xsl:choose>
76
77 <!-- Emit separator -->
78 <!-- -->
79 <xsl:variable name="VarBreadcrumbsSeparator" select="$ParamPageRule/wwproject:Properties/wwproject:Property[@Name = 'breadcrumbs-separator']/@Value" />
80 <xsl:choose>
81 <xsl:when test="string-length($VarBreadcrumbsSeparator) > 0">
82 <xsl:value-of select="$VarBreadcrumbsSeparator" />
83 </xsl:when>
84
85 <xsl:otherwise>
86 <xsl:text> : </xsl:text>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:for-each>
90
91 <!-- Emit entry -->
92 <!-- -->
93 <xsl:call-template name="BreadcrumbEntry">
94 <xsl:with-param name="ParamTOCEntry" select="$ParamBreadcrumbTOCEntry" />
95 </xsl:call-template>
96 </xsl:template>
97
98
99 <xsl:template name="BreadcrumbEntry">
100 <xsl:param name="ParamTOCEntry" />
101
102 <xsl:for-each select="$ParamTOCEntry/wwdoc:Paragraph/wwdoc:Number/wwdoc:Text | $ParamTOCEntry/wwdoc:Paragraph/wwdoc:TextRun/wwdoc:Text">
103 <xsl:variable name="VarText" select="." />
104
105 <xsl:value-of select="$VarText/@value" />
106 </xsl:for-each>
107 </xsl:template>
108
109
110 <xsl:template name="Content-Content">
111 <xsl:param name="ParamContent" />
112 <xsl:param name="ParamSplits" />
113 <xsl:param name="ParamCargo" />
114 <xsl:param name="ParamLinks" />
115 <xsl:param name="ParamTOCData" />
116 <xsl:param name="ParamSplit" />
117
118 <!-- Content -->
119 <!-- -->
120 <xsl:apply-templates select="$ParamContent" mode="wwmode:content">
121 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
122 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
123 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
124 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
125 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
126 </xsl:apply-templates>
127
128 <!-- Related Topics -->
129 <!-- -->
130 <xsl:call-template name="RelatedTopics">
131 <xsl:with-param name="ParamContent" select="$ParamContent" />
132 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
133 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
134 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
135 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
136 </xsl:call-template>
137 </xsl:template>
138
139
140 <xsl:template name="RelatedTopics">
141 <xsl:param name="ParamContent" />
142 <xsl:param name="ParamSplits" />
143 <xsl:param name="ParamCargo" />
144 <xsl:param name="ParamLinks" />
145 <xsl:param name="ParamSplit" />
146
147 <xsl:variable name="VarRelatedTopicParagraphsAsXML">
148 <xsl:call-template name="RelatedTopicParagraphs">
149 <xsl:with-param name="ParamContent" select="$ParamContent" />
150 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
151 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
152 </xsl:call-template>
153 </xsl:variable>
154 <xsl:variable name="VarRelatedTopicParagraphs" select="msxsl:node-set($VarRelatedTopicParagraphsAsXML)/wwdoc:Paragraph" />
155
156 <html:script type="text/javascript" language="JavaScript1.2">
157 <xsl:comment>
158 <xsl:text>
159 </xsl:text>
160 <xsl:text> // Clear related topics
161 </xsl:text>
162 <xsl:text> //
163 </xsl:text>
164 <xsl:text> WWHClearRelatedTopics();
165 </xsl:text>
166
167 <xsl:if test="count($VarRelatedTopicParagraphs) > 0">
168 <xsl:text>
169 </xsl:text>
170 <xsl:text> // Add related topics
171 </xsl:text>
172 <xsl:text> //
173 </xsl:text>
174 <xsl:for-each select="$VarRelatedTopicParagraphs">
175 <xsl:variable name="VarRelatedTopicParagraph" select="." />
176
177 <!-- Resolve link -->
178 <!-- -->
179 <xsl:variable name="VarResolvedLinkInfoAsXML">
180 <xsl:call-template name="Links-Resolve">
181 <xsl:with-param name="ParamAllowBaggage" select="$ParameterAllowBaggage" />
182 <xsl:with-param name="ParamAllowGroupToGroup" select="$ParameterAllowGroupToGroup" />
183 <xsl:with-param name="ParamAllowURL" select="$ParameterAllowURL" />
184 <xsl:with-param name="ParamBaggageSplitFileType" select="$ParameterBaggageSplitFileType" />
185 <xsl:with-param name="ParamProject" select="$GlobalProject" />
186 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
187 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
188 <xsl:with-param name="ParamSplitGroupID" select="$ParamSplit/@groupID" />
189 <xsl:with-param name="ParamSplitDocumentID" select="$ParamSplit/@documentID" />
190 <xsl:with-param name="ParamDocumentLink" select="$VarRelatedTopicParagraph/wwdoc:Link" />
191 </xsl:call-template>
192 </xsl:variable>
193 <xsl:variable name="VarResolvedLinkInfo" select="msxsl:node-set($VarResolvedLinkInfoAsXML)/wwlinks:ResolvedLink" />
194
195 <xsl:choose>
196 <!-- Document -->
197 <!-- -->
198 <xsl:when test="($VarResolvedLinkInfo/@type = 'document') or ($VarResolvedLinkInfo/@type = 'group') or ($VarResolvedLinkInfo/@type = 'project')">
199 <!-- Project link -->
200 <!-- -->
201 <xsl:variable name="VarGroupName" select="wwprojext:GetGroupName($VarResolvedLinkInfo/@groupID)" />
202 <xsl:variable name="VarOutputDirectoryPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), $VarGroupName)" />
203 <xsl:variable name="VarRelativePath" select="wwuri:GetRelativeTo($VarResolvedLinkInfo/@path, wwfilesystem:Combine($VarOutputDirectoryPath, 'dummy.component'))" />
204
205 <!-- Add entry -->
206 <!-- -->
207 <xsl:text> </xsl:text>
208 <xsl:text>WWHAddRelatedTopic("</xsl:text>
209
210 <!-- Paragraph text -->
211 <!-- -->
212 <xsl:for-each select="$VarRelatedTopicParagraph/wwdoc:TextRun/wwdoc:Text">
213 <xsl:value-of select="wwstring:JavaScriptEncoding(@value)" />
214 </xsl:for-each>
215 <xsl:text>", "</xsl:text>
216
217 <!-- Context -->
218 <!-- -->
219 <xsl:call-template name="WWHelpContext">
220 <xsl:with-param name="ParamProject" select="$GlobalProject" />
221 <xsl:with-param name="ParamGroupID" select="$VarResolvedLinkInfo/@groupID" />
222 </xsl:call-template>
223 <xsl:text>", "</xsl:text>
224
225 <!-- Link -->
226 <!-- -->
227 <xsl:value-of select="wwstring:JavaScriptEncoding($VarRelativePath)" />
228 <xsl:if test="(string-length($VarRelatedTopicParagraph/wwdoc:Link/@anchor) > 0) and (string-length($VarResolvedLinkInfo/@linkid) > 0)">
229 <xsl:text>#</xsl:text>
230 <xsl:value-of select="wwstring:JavaScriptEncoding($VarResolvedLinkInfo/@linkid)" />
231 </xsl:if>
232 <xsl:text>"</xsl:text>
233 <xsl:text>);
234 </xsl:text>
235 </xsl:when>
236 </xsl:choose>
237 </xsl:for-each>
238 </xsl:if>
239
240 <xsl:text>
241 </xsl:text>
242 <xsl:text> document.writeln(WWHRelatedTopicsInlineHTML());
243 </xsl:text>
244 <xsl:text> // </xsl:text>
245 </xsl:comment>
246 </html:script>
247 </xsl:template>
248
249
250 <xsl:template name="RelatedTopicParagraphs">
251 <xsl:param name="ParamContent" />
252 <xsl:param name="ParamCargo" />
253 <xsl:param name="ParamSplit" />
254
255 <xsl:for-each select="$ParamCargo/wwbehaviors:Behaviors[1]">
256 <xsl:variable name="VarRelatedTopicBehaviorParagraphs" select="key('wwbehaviors-paragraphs-by-relatedtopic', 'define') | key('wwbehaviors-paragraphs-by-relatedtopic', 'define-no-output')" />
257
258 <xsl:for-each select="$VarRelatedTopicBehaviorParagraphs[(@documentposition >= $ParamSplit/@documentstartposition) and (@documentposition <= $ParamSplit/@documentendposition)]">
259 <xsl:variable name="VarBehaviorParagraph" select="." />
260
261 <xsl:for-each select="$ParamContent[1]">
262 <xsl:for-each select="key('wwdoc-paragraphs-by-id', $VarBehaviorParagraph/@id)[1]">
263 <xsl:variable name="VarParagraph" select="." />
264
265 <!-- Paragraph has link? -->
266 <!-- -->
267 <xsl:variable name="VarChildLinks" select="$VarParagraph//wwdoc:Link[count($VarParagraph | ancestor::wwdoc:Paragraph[1]) = 1]" />
268 <xsl:variable name="VarChildLinksCount" select="count($VarChildLinks)" />
269 <xsl:if test="$VarChildLinksCount > 0">
270 <!-- Emit paragraph -->
271 <!-- -->
272 <wwdoc:Paragraph>
273 <xsl:copy-of select="$VarParagraph/@*" />
274
275 <!-- Insure link is defined -->
276 <!-- -->
277 <xsl:if test="count($VarParagraph/wwdoc:Link) = 0">
278 <xsl:copy-of select="$VarChildLinks[1]" />
279 </xsl:if>
280
281 <xsl:copy-of select="$VarParagraph/*" />
282 </wwdoc:Paragraph>
283 </xsl:if>
284 </xsl:for-each>
285 </xsl:for-each>
286 </xsl:for-each>
287 </xsl:for-each>
288 </xsl:template>
289
290
291 <xsl:template name="Content-Notes">
292 <xsl:param name="ParamNotes" />
293 <xsl:param name="ParamSplits" />
294 <xsl:param name="ParamCargo" />
295 <xsl:param name="ParamLinks" />
296 <xsl:param name="ParamTOCData" />
297 <xsl:param name="ParamSplit" />
298
299 <xsl:if test="count($ParamNotes[1]) = 1">
300 <html:hr />
301 <xsl:for-each select="$ParamNotes">
302 <xsl:variable name="VarNote" select="." />
303
304 <xsl:variable name="VarNoteNumber" select="$ParamCargo/wwnotes:NoteNumbering/wwnotes:Note[@id = $VarNote/@id]/@number" />
305
306 <xsl:if test="string-length($VarNoteNumber) > 0">
307 <html:div style="font-size: smaller; float: left; padding-right: 10px;">
308 <html:a name="{$VarNote/@id}">
309 <xsl:attribute name="href">
310 <xsl:text>#wwfootnote_inline_</xsl:text>
311 <xsl:value-of select="$VarNote/@id" />
312 </xsl:attribute>
313
314 <xsl:value-of select="$VarNoteNumber"/>
315 </html:a>
316 </html:div>
317
318 <xsl:apply-templates select="$VarNote/*" mode="wwmode:content">
319 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
320 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
321 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
322 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
323 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
324 </xsl:apply-templates>
325 <html:br style="clear: all;" />
326 </xsl:if>
327 </xsl:for-each>
328 </xsl:if>
329 </xsl:template>
330
331
332 <xsl:template name="Content-Bullet">
333 <xsl:param name="ParamSplits" />
334 <xsl:param name="ParamSplit" />
335 <xsl:param name="ParamParagraph" />
336 <xsl:param name="ParamCharacter" />
337 <xsl:param name="ParamImage" />
338 <xsl:param name="ParamSeparator" />
339 <xsl:param name="ParamStyle" />
340
341 <xsl:choose>
342 <xsl:when test="string-length($ParamStyle) > 0">
343
344 <!-- Get rule -->
345 <!-- -->
346 <xsl:variable name="VarRule" select="wwprojext:GetRule('Character', $ParamStyle)" />
347
348 <!-- Resolve project properties -->
349 <!-- -->
350 <xsl:variable name="VarResolvedContextPropertiesAsXML">
351 <xsl:call-template name="Properties-ResolveContextRule">
352 <xsl:with-param name="ParamDocumentContext" select="$ParamParagraph" />
353 <xsl:with-param name="ParamProperties" select="$VarRule/wwproject:Properties/wwproject:Property" />
354 <xsl:with-param name="ParamStyleName" select="$ParamStyle" />
355 <xsl:with-param name="ParamStyleType" select="'Character'" />
356 <xsl:with-param name="ParamContextStyle" select="$ParamParagraph/wwdoc:Number[1]/wwdoc:Style" />
357 </xsl:call-template>
358 </xsl:variable>
359 <xsl:variable name="VarResolvedContextProperties" select="msxsl:node-set($VarResolvedContextPropertiesAsXML)/wwproject:Property" />
360
361 <!-- CSS properties -->
362 <!-- -->
363 <xsl:variable name="VarCSSPropertiesAsXML">
364 <xsl:call-template name="CSS-TranslateProjectProperties">
365 <xsl:with-param name="ParamProperties" select="$VarResolvedContextProperties" />
366 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
367 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
368 </xsl:call-template>
369 </xsl:variable>
370 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
371
372 <!-- Style attribute -->
373 <!-- -->
374 <xsl:variable name="VarStyleAttribute">
375 <xsl:call-template name="CSS-InlineProperties">
376 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
377 </xsl:call-template>
378 </xsl:variable>
379
380 <xsl:variable name="VarTagProperty" select="$VarRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
381 <xsl:variable name="VarTag">
382 <xsl:choose>
383 <xsl:when test="string-length($VarTagProperty) > 0">
384 <xsl:value-of select="$VarTagProperty" />
385 </xsl:when>
386
387 <xsl:otherwise>
388 <xsl:value-of select="'span'" />
389 </xsl:otherwise>
390 </xsl:choose>
391 </xsl:variable>
392
393 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
394 <!-- Style attribute -->
395 <!-- -->
396 <xsl:if test="string-length($VarStyleAttribute) > 0">
397 <xsl:attribute name="style">
398 <xsl:value-of select="$VarStyleAttribute" />
399 </xsl:attribute>
400 </xsl:if>
401
402 <xsl:if test="string-length($ParamImage) > 0">
403 <!-- Get absolute path for imaging info -->
404 <!-- -->
405 <xsl:variable name="VarImageFileSystemPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), wwprojext:GetGroupName($ParamSplit/@groupID), $ParamImage)" />
406 <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarImageFileSystemPath)" />
407
408 <xsl:variable name="VarImagePath">
409 <xsl:call-template name="URI-ResolveProjectFileURI">
410 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
411 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
412 <xsl:with-param name="ParamURI" select="$ParamImage" />
413 </xsl:call-template>
414 </xsl:variable>
415
416 <!-- Image -->
417 <!-- -->
418 <html:img src="{$VarImagePath}" alt="*" id="{concat('bullet', $ParamParagraph/@id)}" border="0" width="{$VarImageInfo/@width}" height="{$VarImageInfo/@height}" />
419 </xsl:if>
420
421 <!-- Characters -->
422 <!-- -->
423 <xsl:value-of select="$ParamCharacter" />
424
425 <!-- Separator -->
426 <!-- -->
427 <xsl:value-of select="$ParamSeparator" />
428 </xsl:element>
429 </xsl:when>
430
431 <xsl:otherwise>
432 <xsl:if test="string-length($ParamImage) > 0">
433 <!-- Get absolute path for imaging info -->
434 <!-- -->
435 <xsl:variable name="VarImageFileSystemPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), wwprojext:GetGroupName($ParamSplit/@groupID), $ParamImage)" />
436 <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarImageFileSystemPath)" />
437
438 <xsl:variable name="VarImagePath">
439 <xsl:call-template name="URI-ResolveProjectFileURI">
440 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
441 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
442 <xsl:with-param name="ParamURI" select="$ParamImage" />
443 </xsl:call-template>
444 </xsl:variable>
445
446 <!-- Image -->
447 <!-- -->
448 <html:img src="{$VarImagePath}" alt="*" id="{concat('bullet', $ParamParagraph/@id)}" border="0" width="{$VarImageInfo/@width}" height="{$VarImageInfo/@height}" />
449 </xsl:if>
450
451 <!-- Characters -->
452 <!-- -->
453 <xsl:value-of select="$ParamCharacter" />
454
455 <!-- Separator -->
456 <!-- -->
457 <xsl:value-of select="$ParamSeparator" />
458 </xsl:otherwise>
459 </xsl:choose>
460 </xsl:template>
461
462
463 <xsl:template name="Notes-Number">
464 <xsl:param name="ParamNotes" />
465
466 <wwnotes:NoteNumbering version="1.0">
467 <xsl:for-each select="$ParamNotes">
468 <xsl:variable name="VarNote" select="." />
469
470 <wwnotes:Note id="{$VarNote/@id}" number="{position()}" />
471 </xsl:for-each>
472 </wwnotes:NoteNumbering>
473 </xsl:template>
474
475
476 <xsl:template match="wwdoc:Paragraph" mode="wwmode:content">
477 <xsl:param name="ParamSplits" />
478 <xsl:param name="ParamCargo" />
479 <xsl:param name="ParamLinks" />
480 <xsl:param name="ParamTOCData" />
481 <xsl:param name="ParamSplit" />
482
483 <xsl:variable name="VarParagraph" select="." />
484
485 <!-- Aborted? -->
486 <!-- -->
487 <xsl:if test="not(wwprogress:Abort())">
488 <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Paragraph', $VarParagraph/@stylename, $ParamSplit/@documentID, $VarParagraph/@id)" />
489 <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
490 <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
491 <xsl:if test="$VarGenerateOutput">
492 <!-- Related Topic Only or Popup Only? -->
493 <!-- -->
494 <xsl:for-each select="$ParamCargo/wwbehaviors:Behaviors[1]">
495 <xsl:variable name="VarParagraphBehavior" select="key('wwbehaviors-paragraphs-by-id', $VarParagraph/@id)[1]" />
496 <xsl:variable name="VarInPopupPage" select="count($ParamCargo/wwbehaviors:PopupPage) > 0" />
497 <xsl:variable name="VarPopupOnly" select="($VarParagraphBehavior/@popup = 'define-no-output') or ($VarParagraphBehavior/@popup = 'append-no-output')" />
498 <xsl:variable name="VarRelatedTopicOnly" select="$VarParagraphBehavior/@relatedtopic = 'define-no-output'" />
499
500 <xsl:if test="$VarInPopupPage or (not($VarPopupOnly) and not($VarRelatedTopicOnly))">
501 <!-- Paragraph -->
502 <!-- -->
503 <xsl:call-template name="Paragraph">
504 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
505 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
506 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
507 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
508 <xsl:with-param name="ParamParagraph" select="$VarParagraph" />
509 <xsl:with-param name="ParamStyleName" select="$VarParagraph/@stylename" />
510 <xsl:with-param name="ParamOverrideRule" select="$VarOverrideRule" />
511 <xsl:with-param name="ParamParagraphBehavior" select="$VarParagraphBehavior" />
512 </xsl:call-template>
513
514 <!-- MiniTOC -->
515 <!-- -->
516 <xsl:if test="not($VarInPopupPage)">
517 <xsl:variable name="VarMiniTOCSubLevels" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'minitoc-sublevels']/@Value" />
518 <xsl:variable name="VarMiniTOCSubLevelsNumericPrefix" select="wwunits:NumericPrefix($VarMiniTOCSubLevels)" />
519 <xsl:variable name="VarMiniTOCSubLevelsGreaterThanZero" select="(string-length($VarMiniTOCSubLevelsNumericPrefix) > 0) and (number($VarMiniTOCSubLevelsNumericPrefix) > 0)" />
520 <xsl:if test="($VarMiniTOCSubLevelsGreaterThanZero) or ($VarMiniTOCSubLevels = 'all')">
521 <xsl:for-each select="$ParamTOCData[1]">
522 <xsl:variable name="VarTOCEntry" select="key('wwtoc-entry-by-id', $VarParagraph/@id)[@documentID = $ParamSplit/@documentID]" />
523 <xsl:for-each select="$VarTOCEntry[1]">
524 <xsl:call-template name="MiniTOC">
525 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
526 <xsl:with-param name="ParamTOCEntry" select="$VarTOCEntry[1]" />
527 <xsl:with-param name="ParamEmitTOCEntry" select="false()" />
528 <xsl:with-param name="ParamMiniTOCSubLevels" select="$VarMiniTOCSubLevels" />
529 </xsl:call-template>
530 </xsl:for-each>
531 </xsl:for-each>
532 </xsl:if>
533 </xsl:if>
534 </xsl:if>
535 </xsl:for-each>
536 </xsl:if>
537 </xsl:if>
538 </xsl:template>
539
540
541 <xsl:template name="MiniTOC">
542 <xsl:param name="ParamSplit" />
543 <xsl:param name="ParamTOCEntry" />
544 <xsl:param name="ParamEmitTOCEntry" />
545 <xsl:param name="ParamMiniTOCSubLevels" />
546
547 <xsl:if test="($ParamEmitTOCEntry = true()) or (count($ParamTOCEntry/wwtoc:Entry[1]) = 1)">
548 <html:span class="zNotehead" style="margin-left: 18pt;"><b>Subtopics:</b></html:span>
549 <html:div class="WebWorks_MiniTOC">
550 <!-- Emit top-level entry? -->
551 <!-- -->
552 <xsl:choose>
553 <xsl:when test="$ParamEmitTOCEntry = true()">
554 <html:div class="WebWorks_MiniTOC_Level1">
555 <!-- Paragraph -->
556 <!-- -->
557 <xsl:call-template name="MiniTOCParagraph">
558 <xsl:with-param name="ParamParagraph" select="$ParamTOCEntry/wwdoc:Paragraph" />
559 </xsl:call-template>
560 </html:div>
561
562 <!-- Children -->
563 <!-- -->
564 <xsl:call-template name="MiniTOCEntries">
565 <xsl:with-param name="ParamReferencePath" select="$ParamSplit/@path" />
566 <xsl:with-param name="ParamParent" select="$ParamTOCEntry" />
567 <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
568 <xsl:with-param name="ParamLevel" select="2" />
569 </xsl:call-template>
570 </xsl:when>
571
572 <xsl:otherwise>
573 <!-- Children -->
574 <!-- -->
575 <xsl:call-template name="MiniTOCEntries">
576 <xsl:with-param name="ParamReferencePath" select="$ParamSplit/@path" />
577 <xsl:with-param name="ParamParent" select="$ParamTOCEntry" />
578 <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
579 <xsl:with-param name="ParamLevel" select="1" />
580 </xsl:call-template>
581 </xsl:otherwise>
582 </xsl:choose>
583 </html:div>
584 </xsl:if>
585 </xsl:template>
586
587
588 <xsl:template name="MiniTOCEntries">
589 <xsl:param name="ParamReferencePath" />
590 <xsl:param name="ParamParent" />
591 <xsl:param name="ParamMiniTOCSubLevels" />
592 <xsl:param name="ParamLevel" />
593
594 <xsl:variable name="VarSubEntries" select="$ParamParent/wwtoc:Entry" />
595
596 <xsl:for-each select="$VarSubEntries[1]">
597 <xsl:for-each select="$VarSubEntries">
598 <xsl:variable name="VarEntry" select="." />
599
600 <html:div>
601 <xsl:attribute name="class">
602 <xsl:text>WebWorks_MiniTOC_Level</xsl:text>
603 <xsl:value-of select="$ParamLevel" />
604 </xsl:attribute>
605
606 <xsl:choose>
607 <xsl:when test="string-length($VarEntry/@path) > 0">
608 <!-- Get link -->
609 <!-- -->
610 <xsl:variable name="VarRelativeLinkPath" select="wwuri:GetRelativeTo($VarEntry/@path, $ParamReferencePath)" />
611
612 <html:a class="WebWorks_MiniTOC_Link" href="{$VarRelativeLinkPath}#{$VarEntry/@linkid}">
613 <xsl:call-template name="MiniTOCParagraph">
614 <xsl:with-param name="ParamParagraph" select="$VarEntry/wwdoc:Paragraph" />
615 </xsl:call-template>
616 </html:a>
617 </xsl:when>
618
619 <xsl:otherwise>
620 <xsl:call-template name="MiniTOCParagraph">
621 <xsl:with-param name="ParamParagraph" select="$VarEntry/wwdoc:Paragraph" />
622 </xsl:call-template>
623 </xsl:otherwise>
624 </xsl:choose>
625 </html:div>
626
627 <!-- Recurse -->
628 <!-- -->
629 <xsl:choose>
630 <xsl:when test="$ParamMiniTOCSubLevels = 'all'">
631 <xsl:call-template name="MiniTOCEntries">
632 <xsl:with-param name="ParamReferencePath" select="$ParamReferencePath" />
633 <xsl:with-param name="ParamParent" select="$VarEntry" />
634 <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
635 <xsl:with-param name="ParamLevel" select="$ParamLevel + 1" />
636 </xsl:call-template>
637 </xsl:when>
638
639 <xsl:when test="($ParamMiniTOCSubLevels - 1) > 0">
640 <xsl:call-template name="MiniTOCEntries">
641 <xsl:with-param name="ParamReferencePath" select="$ParamReferencePath" />
642 <xsl:with-param name="ParamParent" select="$VarEntry" />
643 <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels - 1" />
644 <xsl:with-param name="ParamLevel" select="$ParamLevel + 1" />
645 </xsl:call-template>
646 </xsl:when>
647 </xsl:choose>
648 </xsl:for-each>
649 </xsl:for-each>
650 </xsl:template>
651
652
653 <xsl:template name="MiniTOCParagraph">
654 <xsl:param name="ParamParagraph" />
655 <html:span><b>º </b></html:span>
656
657 <xsl:for-each select="$ParamParagraph/wwdoc:Number/wwdoc:Text | $ParamParagraph/wwdoc:TextRun/wwdoc:Text">
658 <xsl:value-of select="@value" />
659 </xsl:for-each>
660 </xsl:template>
661
662
663 <xsl:template name="Paragraph">
664 <xsl:param name="ParamSplits" />
665 <xsl:param name="ParamCargo" />
666 <xsl:param name="ParamLinks" />
667 <xsl:param name="ParamSplit" />
668 <xsl:param name="ParamParagraph" />
669 <xsl:param name="ParamStyleName" />
670 <xsl:param name="ParamOverrideRule" />
671 <xsl:param name="ParamParagraphBehavior" />
672
673 <!-- Preserve empty? -->
674 <!-- -->
675 <xsl:variable name="VarPreserveEmptyOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'preserve-empty']/@Value" />
676 <xsl:variable name="VarPreserveEmpty" select="(string-length($VarPreserveEmptyOption) = 0) or ($VarPreserveEmptyOption = 'true')" />
677
678 <!-- Non-empty text runs -->
679 <!-- -->
680 <xsl:variable name="VarTextRuns" select="$ParamParagraph/wwdoc:TextRun[count(child::wwdoc:Text[1] | child::wwdoc:Frame[1] | child::wwdoc:Note[1] | child::wwdoc:LineBreak[1]) > 0]" />
681
682 <!-- Process this paragraph at all? -->
683 <!-- -->
684 <xsl:if test="($VarPreserveEmpty) or (count($VarTextRuns[1]) = 1)">
685 <!-- Pass-through? -->
686 <!-- -->
687 <xsl:variable name="VarPassThrough">
688 <xsl:call-template name="Conditions-PassThrough">
689 <xsl:with-param name="ParamConditions" select="$ParamParagraph/wwdoc:Conditions" />
690 </xsl:call-template>
691 </xsl:variable>
692
693 <!-- A-Link? -->
694 <!-- -->
695 <xsl:variable name="VarALinkOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'alink']/@Value" />
696 <xsl:variable name="VarALink" select="$VarALinkOption = 'true'" />
697
698 <xsl:choose>
699 <!-- Pass-through -->
700 <!-- -->
701 <xsl:when test="$VarPassThrough = 'true'">
702 <xsl:call-template name="Paragraph-PassThrough">
703 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
704 </xsl:call-template>
705 </xsl:when>
706
707 <!-- A-Link around whole paragraph -->
708 <!-- -->
709 <xsl:when test="$VarALink">
710 <!-- Update cargo -->
711 <!-- -->
712 <xsl:variable name="VarCargoALinkAsXML">
713 <xsl:variable name="VarALinkEntries">
714 <xsl:call-template name="ALinkEntries">
715 <xsl:with-param name="ParamMarkers" select="$ParamParagraph/wwdoc:TextRun/wwdoc:Marker" />
716 </xsl:call-template>
717 </xsl:variable>
718
719 <wwalinks:ALink>
720 <xsl:attribute name="href">
721 <xsl:value-of select="'javascript:WWHDoNothingHREF();'" />
722 </xsl:attribute>
723 <xsl:attribute name="onClick">
724 <xsl:value-of select="concat('WWHShowALinksPopup(new Array(', $VarALinkEntries, '), (document.all||document.getElementById||document.layers)?event:null);')" />
725 </xsl:attribute>
726 </wwalinks:ALink>
727 </xsl:variable>
728 <xsl:variable name="VarCargoALink" select="msxsl:node-set($VarCargoALinkAsXML)" />
729 <xsl:variable name="VarCargo" select="$ParamCargo/*/.. | $VarCargoALink" />
730
731 <xsl:for-each select="$ParamSplits[1]">
732 <!-- Determine image paths -->
733 <!-- -->
734 <xsl:variable name="Var_seertup" select="wwuri:GetRelativeTo(key('wwsplits-files-by-source-lowercase', wwstring:ToLower('wwformat:Files/images/seertup.gif'))[1]/@path, $ParamSplit/@path)" />
735 <xsl:variable name="Var_seeright" select="wwuri:GetRelativeTo(key('wwsplits-files-by-source-lowercase', wwstring:ToLower('wwformat:Files/images/seeright.gif'))[1]/@path, $ParamSplit/@path)" />
736 <xsl:variable name="Var_seelflow" select="wwuri:GetRelativeTo(key('wwsplits-files-by-source-lowercase', wwstring:ToLower('wwformat:Files/images/seelflow.gif'))[1]/@path, $ParamSplit/@path)" />
737 <xsl:variable name="Var_seebttm" select="wwuri:GetRelativeTo(key('wwsplits-files-by-source-lowercase', wwstring:ToLower('wwformat:Files/images/seebttm.gif'))[1]/@path, $ParamSplit/@path)" />
738 <xsl:variable name="Var_seertlow" select="wwuri:GetRelativeTo(key('wwsplits-files-by-source-lowercase', wwstring:ToLower('wwformat:Files/images/seertlow.gif'))[1]/@path, $ParamSplit/@path)" />
739
740 <html:table id="{concat('SummaryNotRequired_al', $ParamParagraph/@id)}" border="0" cellspacing="0" cellpadding="0" onClick="{$VarCargo/wwalinks:ALink[1]/@onClick}">
741 <html:tr>
742 <html:td height="2" colspan="4" bgcolor="#FFFFFF"></html:td>
743 <html:td width="2" height="2" background="{$Var_seertup}"></html:td>
744 </html:tr>
745 <html:tr>
746 <html:td width="2" height="2" bgcolor="#FFFFFF"></html:td>
747 <html:td height="2" colspan="3" bgcolor="#EEEEEE"></html:td>
748 <html:td width="2" height="2" background="{$Var_seeright}"></html:td>
749 </html:tr>
750 <html:tr>
751 <html:td width="2" bgcolor="#FFFFFF"></html:td>
752 <html:td width="2" bgcolor="#EEEEEE"></html:td>
753 <html:td bgcolor="#EEEEEE">
754
755 <xsl:call-template name="Paragraph-Normal">
756 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
757 <xsl:with-param name="ParamCargo" select="$VarCargo" />
758 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
759 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
760 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
761 <xsl:with-param name="ParamStyleName" select="$ParamStyleName" />
762 <xsl:with-param name="ParamOverrideRule" select="$ParamOverrideRule" />
763 <xsl:with-param name="ParamParagraphBehavior" select="$ParamParagraphBehavior" />
764 </xsl:call-template>
765
766 </html:td>
767 <html:td width="2" bgcolor="#EEEEEE"></html:td>
768 <html:td width="2" background="{$Var_seeright}"></html:td>
769 </html:tr>
770 <html:tr>
771 <html:td width="2" height="2" bgcolor="#FFFFFF"></html:td>
772 <html:td height="2" colspan="3" bgcolor="#EEEEEE"></html:td>
773 <html:td width="2" height="2" background="{$Var_seeright}"></html:td>
774 </html:tr>
775 <html:tr>
776 <html:td width="2" height="2" background="{$Var_seelflow}"></html:td>
777 <html:td height="2" colspan="3" background="{$Var_seebttm}"></html:td>
778 <html:td width="2" height="2" background="{$Var_seertlow}"></html:td>
779 </html:tr>
780 </html:table>
781 </xsl:for-each>
782 </xsl:when>
783
784 <xsl:otherwise>
785 <xsl:call-template name="Paragraph-Normal">
786 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
787 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
788 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
789 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
790 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
791 <xsl:with-param name="ParamStyleName" select="$ParamStyleName" />
792 <xsl:with-param name="ParamOverrideRule" select="$ParamOverrideRule" />
793 <xsl:with-param name="ParamParagraphBehavior" select="$ParamParagraphBehavior" />
794 </xsl:call-template>
795 </xsl:otherwise>
796 </xsl:choose>
797 </xsl:if>
798 </xsl:template>
799
800
801 <xsl:template name="Paragraph-PassThrough">
802 <xsl:param name="ParamParagraph" />
803
804 <wwexsldoc:Text disable-output-escaping="yes">
805 <xsl:for-each select="$ParamParagraph/wwdoc:TextRun/wwdoc:Text">
806 <xsl:variable name="VarText" select="." />
807
808 <xsl:value-of select="$VarText/@value" />
809 </xsl:for-each>
810 </wwexsldoc:Text>
811 </xsl:template>
812
813
814 <xsl:template name="Paragraph-Normal">
815 <xsl:param name="ParamSplits" />
816 <xsl:param name="ParamCargo" />
817 <xsl:param name="ParamLinks" />
818 <xsl:param name="ParamSplit" />
819 <xsl:param name="ParamParagraph" />
820 <xsl:param name="ParamStyleName" />
821 <xsl:param name="ParamOverrideRule" />
822 <xsl:param name="ParamParagraphBehavior" />
823
824 <!-- Resolve project properties -->
825 <!-- -->
826 <xsl:variable name="VarResolvedPropertiesAsXML">
827 <xsl:call-template name="Properties-ResolveOverrideRule">
828 <xsl:with-param name="ParamProperties" select="$ParamOverrideRule/wwproject:Properties/wwproject:Property" />
829 <xsl:with-param name="ParamContextStyle" select="$ParamParagraph/wwdoc:Style" />
830 </xsl:call-template>
831 </xsl:variable>
832 <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
833
834 <!-- CSS properties -->
835 <!-- -->
836 <xsl:variable name="VarCSSPropertiesAsXML">
837 <xsl:call-template name="CSS-TranslateProjectProperties">
838 <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
839 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
840 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
841 </xsl:call-template>
842 </xsl:variable>
843 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
844
845 <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Paragraph', $ParamParagraph/@stylename, $ParamSplit/@documentID, $ParamParagraph/@id)" />
846
847 <!-- Resolve project properties -->
848 <!-- -->
849 <xsl:variable name="VarResolvedContextPropertiesAsXML">
850 <xsl:call-template name="Properties-ResolveContextRule">
851 <xsl:with-param name="ParamDocumentContext" select="$ParamParagraph" />
852 <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
853 <xsl:with-param name="ParamStyleName" select="$ParamParagraph/@stylename" />
854 <xsl:with-param name="ParamStyleType" select="'Paragraph'" />
855 <xsl:with-param name="ParamContextStyle" select="$ParamParagraph/wwdoc:Style" />
856 </xsl:call-template>
857 </xsl:variable>
858 <xsl:variable name="VarResolvedContextProperties" select="msxsl:node-set($VarResolvedContextPropertiesAsXML)/wwproject:Property" />
859
860 <!-- CSS properties -->
861 <!-- -->
862 <xsl:variable name="VarCSSContextPropertiesAsXML">
863 <xsl:call-template name="CSS-TranslateProjectProperties">
864 <xsl:with-param name="ParamProperties" select="$VarResolvedContextProperties" />
865 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
866 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
867 </xsl:call-template>
868 </xsl:variable>
869 <xsl:variable name="VarCSSContextProperties" select="msxsl:node-set($VarCSSContextPropertiesAsXML)/wwproject:Property" />
870
871 <!-- Use numbering? -->
872 <!-- -->
873 <xsl:variable name="VarUseNumberingOption" select="$VarContextRule/wwproject:Options/wwproject:Option[@Name = 'use-numbering']/@Value" />
874 <xsl:variable name="VarUseNumbering" select="(string-length($VarUseNumberingOption) = 0) or ($VarUseNumberingOption = 'true')" />
875
876 <!-- Text Indent -->
877 <!-- -->
878 <xsl:variable name="VarTextIndent">
879 <xsl:if test="$VarUseNumbering">
880 <xsl:variable name="VarOverrideTextIndent" select="$VarCSSProperties[@Name = 'text-indent']/@Value" />
881 <xsl:choose>
882 <xsl:when test="string-length($VarOverrideTextIndent) > 0">
883 <xsl:value-of select="$VarOverrideTextIndent" />
884 </xsl:when>
885
886 <xsl:otherwise>
887 <!-- Text indent defined? -->
888 <!-- -->
889 <xsl:variable name="VarContextTextIndent" select="$VarCSSContextProperties[@Name = 'text-indent']/@Value" />
890 <xsl:if test="string-length($VarContextTextIndent) > 0">
891 <xsl:value-of select="$VarContextTextIndent" />
892 </xsl:if>
893 </xsl:otherwise>
894 </xsl:choose>
895 </xsl:if>
896 </xsl:variable>
897
898 <xsl:variable name="VarTextIndentNumericPrefix" select="wwunits:NumericPrefix($VarTextIndent)" />
899 <xsl:variable name="VarTextIndentLessThanZero" select="(string-length($VarTextIndentNumericPrefix) > 0) and (number($VarTextIndentNumericPrefix) < 0)" />
900
901 <!-- Use bullet from UI? -->
902 <!-- -->
903 <xsl:variable name="VarBulletCharacter" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-character']/@Value" />
904 <xsl:variable name="VarBulletImage" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-image']/@Value" />
905 <xsl:variable name="VarBulletSeparator" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-separator']/@Value" />
906 <xsl:variable name="VarBulletStyle" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-style']/@Value" />
907 <xsl:variable name="VarIgnoreDocumentNumber" select="(string-length($VarBulletCharacter) > 0) or (string-length($VarBulletImage) > 0) or (string-length($VarBulletSeparator) > 0)" />
908
909 <!-- Is numbered paragraph -->
910 <!-- -->
911 <xsl:variable name="VarIsNumberedParagraph" select="($VarTextIndentLessThanZero = true()) and ((count($ParamParagraph/wwdoc:Number[1]) = 1) or (string-length($VarBulletCharacter) > 0) or (string-length($VarBulletImage) > 0) or (string-length($VarBulletSeparator) > 0) or (string-length($VarBulletStyle) > 0))" />
912
913 <!-- Citation -->
914 <!-- -->
915 <xsl:variable name="VarCitation">
916 <xsl:call-template name="Behaviors-Options-OptionMarker">
917 <xsl:with-param name="ParamContainer" select="$ParamParagraph" />
918 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
919 <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
920 <xsl:with-param name="ParamRule" select="$VarContextRule" />
921 <xsl:with-param name="ParamOption" select="'citation'" />
922 </xsl:call-template>
923 </xsl:variable>
924
925 <!-- Tag -->
926 <!-- -->
927 <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
928 <xsl:variable name="VarTag">
929 <xsl:choose>
930 <xsl:when test="string-length($VarTagProperty) > 0">
931 <xsl:value-of select="$VarTagProperty" />
932 </xsl:when>
933
934 <xsl:otherwise>
935 <xsl:value-of select="'div'" />
936 </xsl:otherwise>
937 </xsl:choose>
938 </xsl:variable>
939
940 <!-- Use character styles? -->
941 <!-- -->
942 <xsl:variable name="VarUseCharacterStylesOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'use-character-styles']/@Value" />
943 <xsl:variable name="VarUseCharacterStyles" select="(string-length($VarUseCharacterStylesOption) = 0) or ($VarUseCharacterStylesOption = 'true')" />
944
945 <!-- Preserve empty? -->
946 <!-- -->
947 <xsl:variable name="VarPreserveEmptyOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'preserve-empty']/@Value" />
948 <xsl:variable name="VarPreserveEmpty" select="(string-length($VarPreserveEmptyOption) = 0) or ($VarPreserveEmptyOption = 'true')" />
949
950 <!-- Begin paragraph emit -->
951 <!-- -->
952 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
953 <!-- Class attribute -->
954 <!-- -->
955 <xsl:attribute name="class">
956 <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
957 <xsl:if test="$VarIsNumberedParagraph = true()">
958 <xsl:value-of select="'_outer'" />
959 </xsl:if>
960 </xsl:attribute>
961
962 <!-- Style attribute -->
963 <!-- -->
964 <xsl:choose>
965 <xsl:when test="$VarIsNumberedParagraph = true()">
966 <xsl:variable name="VarStyleAttributeOuter">
967 <xsl:call-template name="CSS-InlinePropertiesOuter">
968 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
969 <xsl:with-param name="ParamContextProperties" select="$VarCSSContextProperties" />
970 </xsl:call-template>
971 </xsl:variable>
972
973 <xsl:if test="string-length($VarStyleAttributeOuter) > 0">
974 <xsl:attribute name="style">
975 <xsl:value-of select="$VarStyleAttributeOuter" />
976 </xsl:attribute>
977 </xsl:if>
978 </xsl:when>
979
980 <xsl:otherwise>
981 <xsl:variable name="VarStyleAttribute">
982 <xsl:call-template name="CSS-InlineProperties">
983 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
984 </xsl:call-template>
985 </xsl:variable>
986
987 <xsl:if test="string-length($VarStyleAttribute) > 0">
988 <xsl:attribute name="style">
989 <xsl:value-of select="$VarStyleAttribute" />
990 </xsl:attribute>
991 </xsl:if>
992 </xsl:otherwise>
993 </xsl:choose>
994
995 <!-- Cite attribute -->
996 <!-- -->
997 <xsl:if test="string-length($VarCitation) > 0">
998 <xsl:attribute name="cite">
999 <xsl:value-of select="$VarCitation" />
1000 </xsl:attribute>
1001 </xsl:if>
1002
1003 <!-- Dropdown -->
1004 <!-- -->
1005 <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1006 <xsl:attribute name="onclick">
1007 <xsl:value-of select="concat('WebWorks_ToggleDIV(WebWorksRootPath, "wwdd', $ParamParagraph/@id, '");')" />
1008 </xsl:attribute>
1009 </xsl:if>
1010
1011 <!-- Use numbering? -->
1012 <!-- -->
1013 <xsl:choose>
1014 <!-- Use Number -->
1015 <!-- -->
1016 <xsl:when test="$VarUseNumbering">
1017 <xsl:choose>
1018 <xsl:when test="(count($ParamParagraph/wwdoc:Number[1]) > 0) or (string-length($VarBulletCharacter) > 0) or (string-length($VarBulletImage) > 0) or (string-length($VarBulletSeparator) > 0)">
1019 <xsl:choose>
1020 <xsl:when test="$VarTextIndentLessThanZero">
1021
1022 <html:table border="0" cellspacing="0" cellpadding="0" id="{concat('SummaryNotRequired_np', $ParamParagraph/@id)}">
1023 <html:tr style="vertical-align: baseline;">
1024 <html:td>
1025 <!-- Emit number with inner class and specific number style attribute -->
1026 <!-- -->
1027 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1028 <xsl:attribute name="class">
1029 <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
1030 <xsl:text>_inner</xsl:text>
1031 </xsl:attribute>
1032
1033 <xsl:variable name="VarTextIndentNumberAsUnits" select="wwunits:NumericPrefix($VarTextIndent)" />
1034 <xsl:variable name="VarTextIndentUnits" select="wwunits:UnitsSuffix($VarTextIndent)" />
1035
1036 <xsl:attribute name="style">
1037 <xsl:value-of select="concat('width: ', 0 - $VarTextIndentNumberAsUnits, $VarTextIndentUnits, '; white-space: nowrap;')" />
1038 <xsl:call-template name="CSS-InlinePropertiesInnerNumber">
1039 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1040 </xsl:call-template>
1041 </xsl:attribute>
1042
1043 <xsl:call-template name="Number">
1044 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1045 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1046 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1047 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1048 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1049 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1050 <xsl:with-param name="ParamIgnoreDocumentNumber" select="$VarIgnoreDocumentNumber" />
1051 <xsl:with-param name="ParamCharacter" select="$VarBulletCharacter" />
1052 <xsl:with-param name="ParamImage" select="$VarBulletImage" />
1053 <xsl:with-param name="ParamSeparator" select="$VarBulletSeparator" />
1054 <xsl:with-param name="ParamStyle" select="$VarBulletStyle" />
1055 </xsl:call-template>
1056 </xsl:element>
1057 </html:td>
1058
1059 <!-- Force second cell to honor first cell width -->
1060 <!-- -->
1061 <html:td width="100%">
1062 <xsl:variable name="VarStyleAttributeInnerContent">
1063 <xsl:call-template name="CSS-InlinePropertiesInnerContent">
1064 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1065 </xsl:call-template>
1066 </xsl:variable>
1067
1068 <!-- Emit content -->
1069 <!-- -->
1070 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1071 <xsl:attribute name="class">
1072 <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
1073 <xsl:text>_inner</xsl:text>
1074 </xsl:attribute>
1075 <xsl:if test="string-length($VarStyleAttributeInnerContent) > 0">
1076 <xsl:attribute name="style">
1077 <xsl:value-of select="$VarStyleAttributeInnerContent" />
1078 </xsl:attribute>
1079 </xsl:if>
1080
1081 <!-- Text Runs -->
1082 <!-- -->
1083 <xsl:call-template name="ParagraphTextRuns">
1084 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1085 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1086 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1087 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1088 <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1089 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1090 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1091 </xsl:call-template>
1092 </xsl:element>
1093 </html:td>
1094 </html:tr>
1095 </html:table>
1096 </xsl:when>
1097
1098 <xsl:otherwise>
1099 <xsl:call-template name="Number">
1100 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1101 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1102 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1103 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1104 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1105 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1106 <xsl:with-param name="ParamIgnoreDocumentNumber" select="$VarIgnoreDocumentNumber" />
1107 <xsl:with-param name="ParamCharacter" select="$VarBulletCharacter" />
1108 <xsl:with-param name="ParamImage" select="$VarBulletImage" />
1109 <xsl:with-param name="ParamSeparator" select="$VarBulletSeparator" />
1110 <xsl:with-param name="ParamStyle" select="$VarBulletStyle" />
1111 </xsl:call-template>
1112
1113 <!-- Text Runs -->
1114 <!-- -->
1115 <xsl:call-template name="ParagraphTextRuns">
1116 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1117 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1118 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1119 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1120 <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1121 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1122 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1123 </xsl:call-template>
1124 </xsl:otherwise>
1125 </xsl:choose>
1126 </xsl:when>
1127
1128 <xsl:otherwise>
1129 <!-- Text Runs -->
1130 <!-- -->
1131 <xsl:call-template name="ParagraphTextRuns">
1132 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1133 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1134 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1135 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1136 <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1137 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1138 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1139 </xsl:call-template>
1140 </xsl:otherwise>
1141 </xsl:choose>
1142 </xsl:when>
1143
1144 <!-- Skip Number -->
1145 <!-- -->
1146 <xsl:otherwise>
1147 <!-- Text Runs -->
1148 <!-- -->
1149 <xsl:call-template name="ParagraphTextRuns">
1150 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1151 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1152 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1153 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1154 <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1155 <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1156 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1157 </xsl:call-template>
1158 </xsl:otherwise>
1159 </xsl:choose>
1160
1161 <!-- Dropdown Arrow -->
1162 <!-- -->
1163 <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1164 <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteArrow(WebWorksRootPath, "<xsl:value-of select="concat('wwdd', $ParamParagraph/@id)" />", <xsl:value-of select="$ParamParagraphBehavior/@dropdown = 'start-open'" />);</html:script>
1165 </xsl:if>
1166
1167 <!-- End paragraph emit -->
1168 <!-- -->
1169 </xsl:element>
1170
1171 <!-- Dropdown Start -->
1172 <!-- -->
1173 <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1174 <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVOpen("<xsl:value-of select="concat('wwdd', $ParamParagraph/@id)" />", <xsl:value-of select="$ParamParagraphBehavior/@dropdown = 'start-open'" />);</html:script>
1175 </xsl:if>
1176
1177 <!-- Dropdown End -->
1178 <!-- -->
1179 <xsl:if test="$ParamParagraphBehavior/@dropdown = 'end'">
1180 <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVClose();</html:script>
1181 </xsl:if>
1182 </xsl:template>
1183
1184
1185 <xsl:template name="Number">
1186 <xsl:param name="ParamSplits" />
1187 <xsl:param name="ParamCargo" />
1188 <xsl:param name="ParamLinks" />
1189 <xsl:param name="ParamSplit" />
1190 <xsl:param name="ParamParagraph" />
1191 <xsl:param name="ParamUseCharacterStyles" />
1192 <xsl:param name="ParamIgnoreDocumentNumber" />
1193 <xsl:param name="ParamCharacter" />
1194 <xsl:param name="ParamImage" />
1195 <xsl:param name="ParamSeparator" />
1196 <xsl:param name="ParamStyle" />
1197
1198 <xsl:choose>
1199 <xsl:when test="$ParamIgnoreDocumentNumber">
1200 <xsl:call-template name="Content-Bullet">
1201 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1202 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1203 <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1204 <xsl:with-param name="ParamCharacter" select="$ParamCharacter" />
1205 <xsl:with-param name="ParamImage" select="$ParamImage" />
1206 <xsl:with-param name="ParamSeparator" select="$ParamSeparator" />
1207 <xsl:with-param name="ParamStyle" select="$ParamStyle" />
1208 </xsl:call-template>
1209 </xsl:when>
1210
1211 <xsl:otherwise>
1212 <xsl:variable name="VarBulletPropertiesAsXML">
1213 <wwproject:BulletProperties>
1214 <wwproject:Property Name="bullet-style" Value="{$ParamStyle}" />
1215 </wwproject:BulletProperties>
1216 </xsl:variable>
1217 <xsl:variable name="VarBulletProperties" select="msxsl:node-set($VarBulletPropertiesAsXML)" />
1218
1219 <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'BulletProperties']/.. | $VarBulletProperties" />
1220
1221 <xsl:call-template name="TextRun">
1222 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1223 <xsl:with-param name="ParamCargo" select="$VarCargo" />
1224 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1225 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1226 <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
1227 <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1228 <xsl:with-param name="ParamTextRun" select="$ParamParagraph/wwdoc:Number[1]" />
1229 <xsl:with-param name="ParamPosition" select="0" />
1230 </xsl:call-template>
1231 </xsl:otherwise>
1232 </xsl:choose>
1233 </xsl:template>
1234
1235
1236 <xsl:template name="ParagraphTextRuns">
1237 <xsl:param name="ParamSplits" />
1238 <xsl:param name="ParamCargo" />
1239 <xsl:param name="ParamLinks" />
1240 <xsl:param name="ParamSplit" />
1241 <xsl:param name="ParamPreserveEmpty" />
1242 <xsl:param name="ParamUseCharacterStyles" />
1243 <xsl:param name="ParamParagraph" />
1244
1245 <!-- Prevent whitespace issues with preformatted text blocks -->
1246 <!-- -->
1247 <wwexsldoc:NoBreak />
1248
1249 <!-- Non-empty text runs -->
1250 <!-- -->
1251 <xsl:variable name="VarTextRuns" select="$ParamParagraph/wwdoc:TextRun[count(child::wwdoc:Text[1] | child::wwdoc:Frame[1] | child::wwdoc:Note[1] | child::wwdoc:LineBreak[1]) > 0]" />
1252
1253 <!-- Check for empty paragraphs -->
1254 <!-- -->
1255 <xsl:choose>
1256 <xsl:when test="count($VarTextRuns[1]) = 1">
1257 <!-- Paragraph has content -->
1258 <!-- -->
1259 <xsl:for-each select="$VarTextRuns">
1260 <xsl:variable name="VarTextRun" select="." />
1261
1262 <xsl:call-template name="TextRun">
1263 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1264 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1265 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1266 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1267 <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
1268 <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1269 <xsl:with-param name="ParamTextRun" select="$VarTextRun" />
1270 <xsl:with-param name="ParamPosition" select="position()" />
1271 </xsl:call-template>
1272 </xsl:for-each>
1273 </xsl:when>
1274
1275 <xsl:otherwise>
1276 <!-- Empty paragraph! -->
1277 <!-- -->
1278 <xsl:if test="$ParamPreserveEmpty">
1279 <html:a name="{$ParamParagraph/@id}"> </html:a>
1280 </xsl:if>
1281 </xsl:otherwise>
1282 </xsl:choose>
1283 </xsl:template>
1284
1285
1286 <xsl:template name="SplitOnSemicolon">
1287 <xsl:param name="ParamString" />
1288
1289 <xsl:choose>
1290 <xsl:when test="contains($ParamString, ';')">
1291 <xsl:variable name="VarPrefix" select="substring-before($ParamString, ';')" />
1292 <xsl:variable name="VarSuffix" select="substring-after($ParamString, ';')" />
1293
1294 <xsl:call-template name="SplitOnSemicolon">
1295 <xsl:with-param name="ParamString" select="$VarPrefix" />
1296 </xsl:call-template>
1297 <xsl:call-template name="SplitOnSemicolon">
1298 <xsl:with-param name="ParamString" select="$VarSuffix" />
1299 </xsl:call-template>
1300 </xsl:when>
1301
1302 <xsl:otherwise>
1303 <xsl:variable name="VarNormalizedString" select="normalize-space($ParamString)" />
1304
1305 <xsl:if test="string-length($VarNormalizedString) > 0">
1306 <wwdoc:Text value="{$VarNormalizedString}" />
1307 </xsl:if>
1308 </xsl:otherwise>
1309 </xsl:choose>
1310 </xsl:template>
1311
1312
1313 <xsl:template name="ALinkEntries">
1314 <xsl:param name="ParamMarkers" />
1315
1316 <xsl:variable name="VarALinkKeywordsAsXML">
1317 <xsl:for-each select="$ParamMarkers">
1318 <xsl:variable name="VarMarker" select="." />
1319
1320 <xsl:variable name="VarMarkerRule" select="wwprojext:GetRule('Marker', $VarMarker/@name)" />
1321 <xsl:variable name="VarMarkerType" select="$VarMarkerRule/wwproject:Options/wwproject:Option[@Name = 'marker-type']/@Value" />
1322
1323 <xsl:if test="$VarMarkerType = 'alink-link-keywords'">
1324 <xsl:variable name="VarMarkerText">
1325 <xsl:for-each select="$VarMarker/wwdoc:TextRun/wwdoc:Text">
1326 <xsl:value-of select="@value" />
1327 </xsl:for-each>
1328 </xsl:variable>
1329
1330 <xsl:call-template name="SplitOnSemicolon">
1331 <xsl:with-param name="ParamString" select="$VarMarkerText" />
1332 </xsl:call-template>
1333 </xsl:if>
1334 </xsl:for-each>
1335 </xsl:variable>
1336 <xsl:variable name="VarALinkKeywords" select="msxsl:node-set($VarALinkKeywordsAsXML)/*" />
1337
1338 <xsl:variable name="VarALinkUniqueKeywordsAsXML">
1339 <xsl:for-each select="$VarALinkKeywords">
1340 <xsl:variable name="VarText" select="." />
1341
1342 <xsl:if test="count($VarText | key('wwdoc-text-by-value', $VarText/@value)[1]) = 1">
1343 <xsl:copy-of select="$VarText" />
1344 </xsl:if>
1345 </xsl:for-each>
1346 </xsl:variable>
1347 <xsl:variable name="VarALinkUniqueKeywords" select="msxsl:node-set($VarALinkUniqueKeywordsAsXML)/*" />
1348
1349 <xsl:for-each select="$VarALinkUniqueKeywords">
1350 <xsl:variable name="VarText" select="." />
1351
1352 <xsl:value-of select="concat('"', $VarText/@value, '"')" />
1353 <xsl:if test="position() != last()">
1354 <xsl:value-of select="', '" />
1355 </xsl:if>
1356 </xsl:for-each>
1357 </xsl:template>
1358
1359
1360 <xsl:template name="LinkInfo">
1361 <xsl:param name="ParamSplits" />
1362 <xsl:param name="ParamLinks" />
1363 <xsl:param name="ParamSplit" />
1364 <xsl:param name="ParamDocumentLink" />
1365
1366 <xsl:element name="LinkInfo" namespace="urn:WebWorks-Engine-Links-Schema">
1367 <xsl:if test="count($ParamDocumentLink) > 0">
1368 <!-- Resolve link -->
1369 <!-- -->
1370 <xsl:variable name="VarResolvedLinkInfoAsXML">
1371 <xsl:call-template name="Links-Resolve">
1372 <xsl:with-param name="ParamAllowBaggage" select="$ParameterAllowBaggage" />
1373 <xsl:with-param name="ParamAllowGroupToGroup" select="$ParameterAllowGroupToGroup" />
1374 <xsl:with-param name="ParamAllowURL" select="$ParameterAllowURL" />
1375 <xsl:with-param name="ParamBaggageSplitFileType" select="$ParameterBaggageSplitFileType" />
1376 <xsl:with-param name="ParamProject" select="$GlobalProject" />
1377 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1378 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1379 <xsl:with-param name="ParamSplitGroupID" select="$ParamSplit/@groupID" />
1380 <xsl:with-param name="ParamSplitDocumentID" select="$ParamSplit/@documentID" />
1381 <xsl:with-param name="ParamDocumentLink" select="$ParamDocumentLink" />
1382 </xsl:call-template>
1383 </xsl:variable>
1384 <xsl:variable name="VarResolvedLinkInfo" select="msxsl:node-set($VarResolvedLinkInfoAsXML)/wwlinks:ResolvedLink" />
1385
1386 <xsl:choose>
1387 <!-- Baggage -->
1388 <!-- -->
1389 <xsl:when test="$VarResolvedLinkInfo/@type = 'baggage'">
1390 <xsl:variable name="VarRelativePath" select="wwuri:GetRelativeTo($VarResolvedLinkInfo/@path, $ParamSplit/@path)" />
1391
1392 <xsl:attribute name="href">
1393 <xsl:value-of select="$VarRelativePath" />
1394 </xsl:attribute>
1395
1396 <xsl:variable name="VarTarget" select="wwprojext:GetFormatSetting('baggage-file-target', '_window')" />
1397
1398 <xsl:if test="(string-length($VarTarget) > 0) and ($VarTarget != 'none')">
1399 <xsl:attribute name="target">
1400 <xsl:value-of select="$VarTarget" />
1401 </xsl:attribute>
1402 </xsl:if>
1403 </xsl:when>
1404
1405 <!-- Document -->
1406 <!-- -->
1407 <xsl:when test="($VarResolvedLinkInfo/@type = 'document') or ($VarResolvedLinkInfo/@type = 'group') or ($VarResolvedLinkInfo/@type = 'project')">
1408 <!-- Valid link -->
1409 <!-- -->
1410 <xsl:variable name="VarGroupName" select="wwprojext:GetGroupName($VarResolvedLinkInfo/@groupID)" />
1411 <xsl:variable name="VarOutputDirectoryPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), $VarGroupName)" />
1412 <xsl:variable name="VarLinkPath" select="wwuri:GetRelativeTo($VarResolvedLinkInfo/@path, wwfilesystem:Combine($VarOutputDirectoryPath, 'dummy.component'))" />
1413 <xsl:variable name="VarPopupPath">
1414 <xsl:for-each select="$GlobalProjectSplits[1]">
1415 <xsl:variable name="VarSplitsPopups" select="key('wwsplits-popups-by-id', $VarResolvedLinkInfo/@linkid)[@documentID = $VarResolvedLinkInfo/@documentID]" />
1416 <xsl:for-each select="$VarSplitsPopups[1]">
1417 <xsl:variable name="VarSplitsPopup" select="." />
1418
1419 <xsl:value-of select="wwuri:GetRelativeTo($VarSplitsPopup/@path, wwfilesystem:Combine($VarOutputDirectoryPath, 'dummy.component'))" />
1420 </xsl:for-each>
1421 </xsl:for-each>
1422 </xsl:variable>
1423
1424 <!-- Popup only? -->
1425 <!-- -->
1426 <xsl:attribute name="href">
1427 <!-- JavaScript Link -->
1428 <!-- -->
1429 <xsl:text>javascript:WWHClickedPopup('</xsl:text>
1430
1431 <!-- Context -->
1432 <!-- -->
1433 <xsl:call-template name="WWHelpContext">
1434 <xsl:with-param name="ParamProject" select="$GlobalProject" />
1435 <xsl:with-param name="ParamGroupID" select="$VarResolvedLinkInfo/@groupID" />
1436 </xsl:call-template>
1437 <xsl:text>', '</xsl:text>
1438
1439 <!-- Link -->
1440 <!-- -->
1441 <xsl:if test="(string-length($VarResolvedLinkInfo/@popup-only) = 0) or ($VarResolvedLinkInfo/@popup-only != 'true')">
1442 <xsl:value-of select="wwstring:JavaScriptEncoding($VarLinkPath)" />
1443 <xsl:if test="(string-length($ParamDocumentLink/@anchor) > 0) and (string-length($VarResolvedLinkInfo/@linkid) > 0)">
1444 <xsl:text>#</xsl:text>
1445 <xsl:value-of select="wwstring:JavaScriptEncoding($VarResolvedLinkInfo/@linkid)" />
1446 </xsl:if>
1447 </xsl:if>
1448 <xsl:text>', '</xsl:text>
1449
1450 <!-- Popup Link -->
1451 <!-- -->
1452 <xsl:value-of select="wwstring:JavaScriptEncoding($VarPopupPath)" />
1453 <xsl:text>');</xsl:text>
1454 </xsl:attribute>
1455
1456 <!-- Popup -->
1457 <!-- -->
1458 <xsl:if test="$VarResolvedLinkInfo/@popup = 'true'">
1459 <xsl:attribute name="onMouseOver">
1460 <!-- JavaScript Link -->
1461 <!-- -->
1462 <xsl:text>javascript:WWHShowPopup('</xsl:text>
1463
1464 <!-- Context -->
1465 <!-- -->
1466 <xsl:call-template name="WWHelpContext">
1467 <xsl:with-param name="ParamProject" select="$GlobalProject" />
1468 <xsl:with-param name="ParamGroupID" select="$VarResolvedLinkInfo/@groupID" />
1469 </xsl:call-template>
1470 <xsl:text>', '</xsl:text>
1471
1472 <!-- Popup Link -->
1473 <!-- -->
1474 <xsl:value-of select="wwstring:JavaScriptEncoding($VarPopupPath)" />
1475 <xsl:text>', (document.all||document.getElementById||document.layers)?event:null);</xsl:text>
1476 </xsl:attribute>
1477
1478 <xsl:attribute name="onMouseOut">
1479 <xsl:text>WWHHidePopup();</xsl:text>
1480 </xsl:attribute>
1481 </xsl:if>
1482 </xsl:when>
1483
1484 <!-- URL -->
1485 <!-- -->
1486 <xsl:when test="$VarResolvedLinkInfo/@type = 'url'">
1487 <xsl:attribute name="href">
1488 <xsl:value-of select="$VarResolvedLinkInfo/@url" />
1489 </xsl:attribute>
1490
1491 <!-- External URL Target -->
1492 <!-- -->
1493 <xsl:if test="not(wwuri:IsFile($VarResolvedLinkInfo/@url))">
1494 <xsl:variable name="VarTarget" select="wwprojext:GetFormatSetting('external-url-target', '_window')" />
1495
1496 <xsl:if test="(string-length($VarTarget) > 0) and ($VarTarget != 'none')">
1497 <xsl:attribute name="target">
1498 <xsl:value-of select="$VarTarget" />
1499 </xsl:attribute>
1500 </xsl:if>
1501 </xsl:if>
1502 </xsl:when>
1503 </xsl:choose>
1504 </xsl:if>
1505 </xsl:element>
1506 </xsl:template>
1507
1508
1509 <xsl:template name="TextRun">
1510 <xsl:param name="ParamSplits" />
1511 <xsl:param name="ParamCargo" />
1512 <xsl:param name="ParamLinks" />
1513 <xsl:param name="ParamSplit" />
1514 <xsl:param name="ParamParagraphID" />
1515 <xsl:param name="ParamUseCharacterStyles" />
1516 <xsl:param name="ParamTextRun" />
1517 <xsl:param name="ParamPosition" />
1518
1519 <!-- Get rule -->
1520 <!-- -->
1521 <xsl:variable name="VarRule" select="wwprojext:GetRule('Character', $ParamTextRun/@stylename)" />
1522
1523 <!-- Generate output? -->
1524 <!--- -->
1525 <xsl:variable name="VarGenerateOutputOption" select="$VarRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
1526 <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
1527 <xsl:if test="$VarGenerateOutput">
1528 <!-- Pass-through? -->
1529 <!-- -->
1530 <xsl:variable name="VarPassThrough">
1531 <xsl:call-template name="Conditions-PassThrough">
1532 <xsl:with-param name="ParamConditions" select="$ParamTextRun/wwdoc:Conditions" />
1533 </xsl:call-template>
1534 </xsl:variable>
1535
1536 <xsl:choose>
1537 <xsl:when test="$VarPassThrough = 'true'">
1538 <xsl:call-template name="TextRun-PassThrough">
1539 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1540 </xsl:call-template>
1541 </xsl:when>
1542
1543 <xsl:otherwise>
1544 <!-- A-Link? -->
1545 <!-- -->
1546 <xsl:variable name="VarALinkOption" select="$VarRule/wwproject:Options/wwproject:Option[@Name = 'alink']/@Value" />
1547 <xsl:variable name="VarALink" select="$VarALinkOption = 'true'" />
1548
1549 <xsl:choose>
1550 <!-- Handle A-Links -->
1551 <!-- -->
1552 <xsl:when test="(count($ParamCargo/wwalinks:ALink[1]) = 0) and ($VarALink)">
1553 <!-- Update cargo -->
1554 <!-- -->
1555 <xsl:variable name="VarCargoALinkAsXML">
1556 <xsl:variable name="VarALinkEntries">
1557 <xsl:call-template name="ALinkEntries">
1558 <xsl:with-param name="ParamMarkers" select="$ParamTextRun/wwdoc:Marker" />
1559 </xsl:call-template>
1560 </xsl:variable>
1561
1562 <wwalinks:ALink>
1563 <xsl:attribute name="href">
1564 <xsl:value-of select="'javascript:WWHDoNothingHREF();'" />
1565 </xsl:attribute>
1566 <xsl:attribute name="onClick">
1567 <xsl:value-of select="concat('WWHShowALinksPopup(new Array(', $VarALinkEntries, '), (document.all||document.getElementById||document.layers)?event:null);')" />
1568 </xsl:attribute>
1569 </wwalinks:ALink>
1570 </xsl:variable>
1571 <xsl:variable name="VarCargoALink" select="msxsl:node-set($VarCargoALinkAsXML)" />
1572 <xsl:variable name="VarCargo" select="$ParamCargo/*/.. | $VarCargoALink" />
1573
1574 <xsl:call-template name="TextRun-Normal">
1575 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1576 <xsl:with-param name="ParamCargo" select="$VarCargo" />
1577 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1578 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1579 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1580 <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1581 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1582 <xsl:with-param name="ParamRule" select="$VarRule" />
1583 <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1584 </xsl:call-template>
1585 </xsl:when>
1586
1587 <xsl:otherwise>
1588 <xsl:call-template name="TextRun-Normal">
1589 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1590 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1591 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1592 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1593 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1594 <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1595 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1596 <xsl:with-param name="ParamRule" select="$VarRule" />
1597 <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1598 </xsl:call-template>
1599 </xsl:otherwise>
1600 </xsl:choose>
1601 </xsl:otherwise>
1602 </xsl:choose>
1603 </xsl:if>
1604 </xsl:template>
1605
1606
1607 <xsl:template name="TextRun-PassThrough">
1608 <xsl:param name="ParamTextRun" />
1609
1610 <wwexsldoc:Text disable-output-escaping="yes">
1611 <xsl:for-each select="$ParamTextRun/wwdoc:Text">
1612 <xsl:variable name="VarText" select="." />
1613
1614 <xsl:value-of select="$VarText/@value" />
1615 </xsl:for-each>
1616 </wwexsldoc:Text>
1617 </xsl:template>
1618
1619
1620 <xsl:template name="TextRun-Normal">
1621 <xsl:param name="ParamSplits" />
1622 <xsl:param name="ParamCargo" />
1623 <xsl:param name="ParamLinks" />
1624 <xsl:param name="ParamSplit" />
1625 <xsl:param name="ParamParagraphID" />
1626 <xsl:param name="ParamUseCharacterStyles" />
1627 <xsl:param name="ParamTextRun" />
1628 <xsl:param name="ParamRule" />
1629 <xsl:param name="ParamPosition" />
1630
1631 <xsl:choose>
1632 <xsl:when test="($ParamUseCharacterStyles) and ((string-length($ParamTextRun/@stylename) > 0) or (count($ParamTextRun/wwdoc:Style) = 1))">
1633 <!-- Get override rule -->
1634 <!-- -->
1635 <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Character', $ParamTextRun/@stylename, $ParamSplit/@documentID, $ParamTextRun/@id)" />
1636
1637 <!-- Resolve project properties -->
1638 <!-- -->
1639 <xsl:variable name="VarResolvedPropertiesAsXML">
1640 <xsl:call-template name="Properties-ResolveOverrideRule">
1641 <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
1642 <xsl:with-param name="ParamContextStyle" select="$ParamTextRun/wwdoc:Style" />
1643 </xsl:call-template>
1644 </xsl:variable>
1645 <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
1646
1647 <!-- CSS properties -->
1648 <!-- -->
1649 <xsl:variable name="VarCSSPropertiesAsXML">
1650 <xsl:call-template name="CSS-TranslateProjectProperties">
1651 <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
1652 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
1653 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1654 </xsl:call-template>
1655 </xsl:variable>
1656 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
1657
1658 <!-- Abbreviation -->
1659 <!-- -->
1660 <xsl:variable name="VarAbbreviationTitle">
1661 <xsl:call-template name="Behaviors-Options-OptionMarker">
1662 <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1663 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1664 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1665 <xsl:with-param name="ParamRule" select="$ParamRule" />
1666 <xsl:with-param name="ParamOption" select="'abbreviation'" />
1667 </xsl:call-template>
1668 </xsl:variable>
1669
1670 <!-- Acronym -->
1671 <!-- -->
1672 <xsl:variable name="VarAcronymTitle">
1673 <xsl:call-template name="Behaviors-Options-OptionMarker">
1674 <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1675 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1676 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1677 <xsl:with-param name="ParamRule" select="$ParamRule" />
1678 <xsl:with-param name="ParamOption" select="'acronym'" />
1679 </xsl:call-template>
1680 </xsl:variable>
1681
1682 <!-- Citation -->
1683 <!-- -->
1684 <xsl:variable name="VarCitation">
1685 <xsl:call-template name="Behaviors-Options-OptionMarker">
1686 <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1687 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1688 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1689 <xsl:with-param name="ParamRule" select="$ParamRule" />
1690 <xsl:with-param name="ParamOption" select="'citation'" />
1691 </xsl:call-template>
1692 </xsl:variable>
1693
1694 <!-- Tag -->
1695 <!-- -->
1696 <xsl:variable name="VarTagProperty" select="$ParamRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
1697 <xsl:variable name="VarTag">
1698 <xsl:choose>
1699 <xsl:when test="string-length($VarAbbreviationTitle) > 0">
1700 <xsl:value-of select="'abbr'" />
1701 </xsl:when>
1702 <xsl:when test="string-length($VarAcronymTitle) > 0">
1703 <xsl:value-of select="'acronym'" />
1704 </xsl:when>
1705 <xsl:when test="string-length($VarCitation) > 0">
1706 <xsl:value-of select="'q'" />
1707 </xsl:when>
1708 <xsl:otherwise>
1709 <xsl:choose>
1710 <xsl:when test="string-length($VarTagProperty) > 0">
1711 <xsl:value-of select="$VarTagProperty" />
1712 </xsl:when>
1713
1714 <xsl:otherwise>
1715 <xsl:value-of select="'span'" />
1716 </xsl:otherwise>
1717 </xsl:choose>
1718 </xsl:otherwise>
1719 </xsl:choose>
1720 </xsl:variable>
1721
1722 <!-- Class attribute -->
1723 <!-- -->
1724 <xsl:variable name="VarClassAttribute">
1725 <xsl:choose>
1726 <xsl:when test="string-length($ParamCargo/wwproject:BulletProperties/wwproject:Property[@Name = 'bullet-style']/@Value) > 0">
1727 <xsl:value-of select="wwstring:CSSClassName($ParamCargo/wwproject:BulletProperties/wwproject:Property[@Name = 'bullet-style']/@Value)" />
1728 </xsl:when>
1729 <xsl:otherwise>
1730 <xsl:value-of select="wwstring:CSSClassName($ParamTextRun/@stylename)" />
1731 </xsl:otherwise>
1732 </xsl:choose>
1733 </xsl:variable>
1734
1735 <!-- Style attribute -->
1736 <!-- -->
1737 <xsl:variable name="VarStyleAttribute">
1738 <xsl:call-template name="CSS-InlineProperties">
1739 <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1740 </xsl:call-template>
1741 </xsl:variable>
1742
1743 <xsl:choose>
1744 <xsl:when test="(string-length($VarClassAttribute) > 0) or (string-length($VarStyleAttribute) > 0)">
1745 <!-- Character Style -->
1746 <!-- -->
1747 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1748 <xsl:if test="string-length($VarClassAttribute) > 0">
1749 <xsl:attribute name="class">
1750 <xsl:value-of select="$VarClassAttribute" />
1751 </xsl:attribute>
1752 </xsl:if>
1753 <xsl:if test="string-length($VarStyleAttribute) > 0">
1754 <xsl:attribute name="style">
1755 <xsl:value-of select="$VarStyleAttribute" />
1756 </xsl:attribute>
1757 </xsl:if>
1758
1759 <!-- Abbreviation title -->
1760 <!-- -->
1761 <xsl:if test="string-length($VarAbbreviationTitle) > 0">
1762 <xsl:attribute name="title">
1763 <xsl:value-of select="$VarAbbreviationTitle" />
1764 </xsl:attribute>
1765 </xsl:if>
1766
1767 <!-- Acronym title -->
1768 <!-- -->
1769 <xsl:if test="string-length($VarAcronymTitle) > 0">
1770 <xsl:attribute name="title">
1771 <xsl:value-of select="$VarAcronymTitle" />
1772 </xsl:attribute>
1773 </xsl:if>
1774
1775 <!-- Cite attribute -->
1776 <!-- -->
1777 <xsl:if test="string-length($VarCitation) > 0">
1778 <xsl:attribute name="cite">
1779 <xsl:value-of select="$VarCitation" />
1780 </xsl:attribute>
1781 </xsl:if>
1782
1783 <xsl:call-template name="TextRunChildren">
1784 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1785 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1786 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1787 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1788 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1789 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1790 <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1791 </xsl:call-template>
1792 </xsl:element>
1793 </xsl:when>
1794
1795 <xsl:otherwise>
1796 <!-- No style -->
1797 <!-- -->
1798 <xsl:call-template name="TextRunChildren">
1799 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1800 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1801 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1802 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1803 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1804 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1805 <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1806 </xsl:call-template>
1807 </xsl:otherwise>
1808 </xsl:choose>
1809 </xsl:when>
1810
1811 <xsl:otherwise>
1812 <!-- No style -->
1813 <!-- -->
1814 <xsl:call-template name="TextRunChildren">
1815 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1816 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1817 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1818 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1819 <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1820 <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1821 <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1822 </xsl:call-template>
1823 </xsl:otherwise>
1824 </xsl:choose>
1825 </xsl:template>
1826
1827
1828 <xsl:template name="TextRunChildren">
1829 <xsl:param name="ParamSplits" />
1830 <xsl:param name="ParamCargo" />
1831 <xsl:param name="ParamLinks" />
1832 <xsl:param name="ParamSplit" />
1833 <xsl:param name="ParamParagraphID" />
1834 <xsl:param name="ParamTextRun" />
1835 <xsl:param name="ParamPosition" />
1836
1837 <!-- Force anchor on same line as containing span -->
1838 <!-- -->
1839 <wwexsldoc:NoBreak />
1840
1841 <!-- Link? -->
1842 <!-- -->
1843 <xsl:variable name="VarLinkInfoAsXML">
1844 <xsl:call-template name="LinkInfo">
1845 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1846 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1847 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1848 <xsl:with-param name="ParamDocumentLink" select="$ParamTextRun/wwdoc:Link" />
1849 </xsl:call-template>
1850 </xsl:variable>
1851 <xsl:variable name="VarLinkInfo" select="msxsl:node-set($VarLinkInfoAsXML)/wwlinks:LinkInfo" />
1852
1853 <!-- Handle links and first textrun anchor -->
1854 <!-- -->
1855 <xsl:choose>
1856 <xsl:when test="string-length($ParamCargo/wwalinks:ALink[1]/@href) > 0">
1857 <html:a href="{$ParamCargo/wwalinks:ALink[1]/@href}" onClick="{$ParamCargo/wwalinks:ALink[1]/@onClick}">
1858 <xsl:if test="$ParamPosition = 1">
1859 <xsl:attribute name="name">
1860 <xsl:value-of select="$ParamParagraphID" />
1861 </xsl:attribute>
1862 </xsl:if>
1863
1864 <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1865 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1866 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1867 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1868 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1869 </xsl:apply-templates>
1870 </html:a>
1871 </xsl:when>
1872
1873 <xsl:when test="(string-length($VarLinkInfo/@href) > 0) or (string-length($VarLinkInfo/@onMouseOver) > 0)">
1874 <html:a>
1875 <xsl:if test="string-length($VarLinkInfo/@href) > 0">
1876 <xsl:attribute name="href">
1877 <xsl:value-of select="$VarLinkInfo/@href" />
1878 </xsl:attribute>
1879 </xsl:if>
1880 <xsl:if test="string-length($VarLinkInfo/@target) > 0">
1881 <xsl:attribute name="target">
1882 <xsl:value-of select="$VarLinkInfo/@target" />
1883 </xsl:attribute>
1884 </xsl:if>
1885 <xsl:if test="string-length($VarLinkInfo/@onMouseOver) > 0">
1886 <xsl:attribute name="onMouseOver">
1887 <xsl:value-of select="$VarLinkInfo/@onMouseOver" />
1888 </xsl:attribute>
1889 </xsl:if>
1890 <xsl:if test="string-length($VarLinkInfo/@onMouseOut) > 0">
1891 <xsl:attribute name="onMouseOut">
1892 <xsl:value-of select="$VarLinkInfo/@onMouseOut" />
1893 </xsl:attribute>
1894 </xsl:if>
1895 <xsl:if test="$ParamPosition = 1">
1896 <xsl:attribute name="name">
1897 <xsl:value-of select="$ParamParagraphID" />
1898 </xsl:attribute>
1899 </xsl:if>
1900
1901 <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1902 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1903 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1904 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1905 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1906 </xsl:apply-templates>
1907 </html:a>
1908 </xsl:when>
1909
1910 <xsl:when test="$ParamPosition = 1">
1911 <html:a name="{$ParamParagraphID}">
1912 <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1913 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1914 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1915 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1916 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1917 </xsl:apply-templates>
1918 </html:a>
1919 </xsl:when>
1920
1921 <xsl:otherwise>
1922 <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1923 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1924 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1925 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1926 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1927 </xsl:apply-templates>
1928 </xsl:otherwise>
1929 </xsl:choose>
1930
1931 <!-- Force anchor on same line as containing span -->
1932 <!-- -->
1933 <wwexsldoc:NoBreak />
1934 </xsl:template>
1935
1936
1937 <xsl:template match="wwdoc:Note" mode="wwmode:textrun">
1938 <xsl:param name="ParamSplits" />
1939 <xsl:param name="ParamCargo" />
1940 <xsl:param name="ParamLinks" />
1941 <xsl:param name="ParamSplit" />
1942
1943 <xsl:variable name="VarContext" select="." />
1944
1945 <!-- Implement notes -->
1946 <!-- -->
1947 <xsl:for-each select="$ParamCargo/wwnotes:NoteNumbering[1]">
1948 <xsl:variable name="VarNoteNumber" select="key('wwnotes-notes-by-id', $VarContext/@id)/@number" />
1949
1950 <!-- Force sup on same line as containing span -->
1951 <!-- -->
1952 <wwexsldoc:NoBreak />
1953
1954 <html:sup>
1955 <!-- Force anchor on same line as containing sup -->
1956 <!-- -->
1957 <wwexsldoc:NoBreak />
1958
1959 <html:a>
1960 <xsl:attribute name="name">
1961 <xsl:text>wwfootnote_inline_</xsl:text>
1962 <xsl:value-of select="$VarContext/@id" />
1963 </xsl:attribute>
1964 <xsl:attribute name="href">
1965 <xsl:text>#</xsl:text>
1966 <xsl:value-of select="$VarContext/@id" />
1967 </xsl:attribute>
1968
1969 <xsl:value-of select="$VarNoteNumber" />
1970 </html:a>
1971 </html:sup>
1972 </xsl:for-each>
1973 </xsl:template>
1974
1975
1976 <xsl:template match="wwdoc:LineBreak" mode="wwmode:textrun">
1977 <xsl:param name="ParamSplits" />
1978 <xsl:param name="ParamCargo" />
1979 <xsl:param name="ParamLinks" />
1980 <xsl:param name="ParamSplit" />
1981
1982 <html:br />
1983 </xsl:template>
1984
1985
1986 <xsl:template match="wwdoc:IndexMarker" mode="wwmode:textrun">
1987 <xsl:param name="ParamSplits" />
1988 <xsl:param name="ParamCargo" />
1989 <xsl:param name="ParamLinks" />
1990 <xsl:param name="ParamSplit" />
1991
1992 <!-- Ignore index markers -->
1993 <!-- -->
1994 </xsl:template>
1995
1996
1997 <xsl:template match="wwdoc:Marker" mode="wwmode:textrun">
1998 <xsl:param name="ParamSplits" />
1999 <xsl:param name="ParamCargo" />
2000 <xsl:param name="ParamLinks" />
2001 <xsl:param name="ParamSplit" />
2002
2003 <!-- Ignore markers -->
2004 <!-- -->
2005 </xsl:template>
2006
2007
2008 <xsl:template match="wwdoc:Text" mode="wwmode:textrun">
2009 <xsl:param name="ParamSplits" />
2010 <xsl:param name="ParamCargo" />
2011 <xsl:param name="ParamLinks" />
2012 <xsl:param name="ParamSplit" />
2013
2014 <xsl:value-of select="@value" />
2015 </xsl:template>
2016
2017
2018 <xsl:template match="wwdoc:Table" mode="wwmode:content">
2019 <xsl:param name="ParamSplits" />
2020 <xsl:param name="ParamCargo" />
2021 <xsl:param name="ParamLinks" />
2022 <xsl:param name="ParamTOCData" />
2023 <xsl:param name="ParamSplit" />
2024
2025 <xsl:variable name="VarTable" select="." />
2026
2027 <!-- Aborted? -->
2028 <!-- -->
2029 <xsl:if test="not(wwprogress:Abort())">
2030 <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Table', $VarTable/@stylename, $ParamSplit/@documentID, $VarTable/@id)" />
2031 <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2032 <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2033 <xsl:if test="$VarGenerateOutput">
2034
2035 <!-- Get behavior -->
2036 <!-- -->
2037 <xsl:for-each select="$ParamCargo/wwbehaviors:Behaviors[1]">
2038 <xsl:variable name="VarTableBehavior" select="key('wwbehaviors-tables-by-id', $VarTable/@id)[1]" />
2039
2040 <!-- Table -->
2041 <!-- -->
2042 <xsl:call-template name="Table">
2043 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2044 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2045 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2046 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2047 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2048 <xsl:with-param name="ParamTable" select="$VarTable" />
2049 <xsl:with-param name="ParamStyleName" select="$VarTable/@stylename" />
2050 <xsl:with-param name="ParamOverrideRule" select="$VarOverrideRule" />
2051 <xsl:with-param name="ParamTableBehavior" select="$VarTableBehavior" />
2052 </xsl:call-template>
2053 </xsl:for-each>
2054 </xsl:if>
2055 </xsl:if>
2056 </xsl:template>
2057
2058
2059 <xsl:template name="Table">
2060 <xsl:param name="ParamSplits" />
2061 <xsl:param name="ParamCargo" />
2062 <xsl:param name="ParamLinks" />
2063 <xsl:param name="ParamTOCData" />
2064 <xsl:param name="ParamSplit" />
2065 <xsl:param name="ParamTable" />
2066 <xsl:param name="ParamStyleName" />
2067 <xsl:param name="ParamOverrideRule" />
2068 <xsl:param name="ParamTableBehavior" />
2069
2070 <!-- Notes -->
2071 <!-- -->
2072 <xsl:variable name="VarNotes" select="$ParamTable//wwdoc:Note[not(ancestor::wwdoc:Frame)]" />
2073
2074 <!-- Note numbering -->
2075 <!-- -->
2076 <xsl:variable name="VarNoteNumberingAsXML">
2077 <xsl:call-template name="Notes-Number">
2078 <xsl:with-param name="ParamNotes" select="$VarNotes" />
2079 </xsl:call-template>
2080 </xsl:variable>
2081 <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2082
2083 <!-- Cargo for recursion -->
2084 <!-- -->
2085 <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2086
2087 <!-- Resolve project properties -->
2088 <!-- -->
2089 <xsl:variable name="VarResolvedPropertiesAsXML">
2090 <xsl:call-template name="Properties-ResolveOverrideRule">
2091 <xsl:with-param name="ParamProperties" select="$ParamOverrideRule/wwproject:Properties/wwproject:Property" />
2092 <xsl:with-param name="ParamContextStyle" select="$ParamTable/wwdoc:Style" />
2093 </xsl:call-template>
2094 </xsl:variable>
2095 <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2096
2097 <!-- CSS properties -->
2098 <!-- -->
2099 <xsl:variable name="VarCSSPropertiesAsXML">
2100 <xsl:call-template name="CSS-TranslateProjectProperties">
2101 <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
2102 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2103 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2104 </xsl:call-template>
2105 </xsl:variable>
2106 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2107
2108 <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Table', $ParamTable/@stylename, $ParamSplit/@documentID, $ParamTable/@id)" />
2109
2110 <!-- Resolve project properties -->
2111 <!-- -->
2112 <xsl:variable name="VarResolvedContextPropertiesAsXML">
2113 <xsl:call-template name="Properties-ResolveContextRule">
2114 <xsl:with-param name="ParamDocumentContext" select="$ParamTable" />
2115 <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
2116 <xsl:with-param name="ParamStyleName" select="$ParamTable/@stylename" />
2117 <xsl:with-param name="ParamStyleType" select="'Table'" />
2118 <xsl:with-param name="ParamContextStyle" select="$ParamTable/wwdoc:Style" />
2119 </xsl:call-template>
2120 </xsl:variable>
2121 <xsl:variable name="VarResolvedContextProperties" select="msxsl:node-set($VarResolvedContextPropertiesAsXML)/wwproject:Property" />
2122
2123 <!-- Table class -->
2124 <!-- -->
2125 <xsl:variable name="VarClassAttribute">
2126 <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
2127 </xsl:variable>
2128
2129 <!-- Style attribute -->
2130 <!-- -->
2131 <xsl:variable name="VarStyleAttribute">
2132 <xsl:call-template name="CSS-InlineProperties">
2133 <xsl:with-param name="ParamProperties" select="$VarCSSProperties[(@Name != 'vertical-align')]" />
2134 </xsl:call-template>
2135 </xsl:variable>
2136
2137 <!-- Cell spacing -->
2138 <!-- -->
2139 <xsl:variable name="VarTableCellSpacing">
2140 <xsl:variable name="VarCellSpacingHint" select="$VarResolvedContextProperties[@Name = 'cell-spacing']/@Value" />
2141
2142 <xsl:choose>
2143 <xsl:when test="string-length($VarCellSpacingHint) > 0">
2144 <!-- Normalize value for HTML attribute-->
2145 <!-- -->
2146 <xsl:variable name="VarValueToEmit">
2147 <xsl:variable name="VarUnitsSuffix" select="wwunits:UnitsSuffix($VarCellSpacingHint)" />
2148 <xsl:choose>
2149 <xsl:when test="string-length($VarUnitsSuffix) > 0">
2150 <xsl:variable name="VarNumPrefix" select="wwunits:NumericPrefix($VarCellSpacingHint)" />
2151 <xsl:value-of select="wwunits:Convert($VarNumPrefix, $VarUnitsSuffix, 'px')" />
2152 </xsl:when>
2153 <xsl:otherwise>
2154 <xsl:value-of select="$VarCellSpacingHint" />
2155 </xsl:otherwise>
2156 </xsl:choose>
2157 </xsl:variable>
2158
2159 <xsl:value-of select="$VarValueToEmit" />
2160 </xsl:when>
2161
2162 <xsl:otherwise>
2163 <xsl:value-of select="''" />
2164 </xsl:otherwise>
2165 </xsl:choose>
2166 </xsl:variable>
2167
2168 <!-- Table vertical alignment -->
2169 <!-- -->
2170 <xsl:variable name="VarTableVerticalAlignment">
2171 <xsl:variable name="VarTableVerticalAlignmentHint" select="$VarResolvedContextProperties[@Name = 'vertical-align']/@Value" />
2172 <xsl:choose>
2173 <xsl:when test="string-length($VarTableVerticalAlignmentHint) > 0">
2174 <xsl:value-of select="$VarTableVerticalAlignmentHint" />
2175 </xsl:when>
2176 <xsl:otherwise>
2177 <xsl:value-of select="''" />
2178 </xsl:otherwise>
2179 </xsl:choose>
2180 </xsl:variable>
2181
2182 <!-- Table summary -->
2183 <!-- -->
2184 <xsl:variable name="VarTableSummary">
2185 <xsl:call-template name="Tables-Summary">
2186 <xsl:with-param name="ParamTableBehavior" select="$ParamTableBehavior" />
2187 </xsl:call-template>
2188 </xsl:variable>
2189
2190 <!-- Caption Side -->
2191 <!-- -->
2192 <xsl:variable name="VarCaptionSide">
2193 <xsl:value-of select="$VarResolvedContextProperties[@Name = 'caption-side']/@Value" />
2194 </xsl:variable>
2195
2196 <!-- Determine table cell widths -->
2197 <!-- -->
2198 <xsl:variable name="VarTableCellWidthsAsXML">
2199 <xsl:variable name="VarEmitTableWidthsOption" select="$VarContextRule/wwproject:Options/wwproject:Option[@Name = 'table-use-document-cell-widths']/@Value" />
2200 <xsl:variable name="VarEmitTableWidths" select="$VarEmitTableWidthsOption = 'true'" />
2201
2202 <xsl:if test="$VarEmitTableWidths">
2203 <xsl:call-template name="Table-CellWidths">
2204 <xsl:with-param name="ParamTable" select="$ParamTable" />
2205 </xsl:call-template>
2206 </xsl:if>
2207 </xsl:variable>
2208 <xsl:variable name="VarTableCellWidths" select="msxsl:node-set($VarTableCellWidthsAsXML)/*" />
2209
2210 <!-- Emit <table> element with class, id, style, and summary attrs. -->
2211 <!-- -->
2212 <html:table id="{$ParamTable/@id}" class="{$VarClassAttribute}">
2213
2214 <!-- style attribute -->
2215 <!-- -->
2216 <xsl:if test="string-length($VarStyleAttribute) > 0">
2217 <xsl:attribute name="style">
2218 <xsl:value-of select="$VarStyleAttribute" />
2219 </xsl:attribute>
2220 </xsl:if>
2221
2222 <!-- cellspacing attribute -->
2223 <!-- -->
2224 <xsl:if test="string-length($VarTableCellSpacing) > 0">
2225 <xsl:attribute name="cellspacing">
2226 <xsl:value-of select="$VarTableCellSpacing" />
2227 </xsl:attribute>
2228 </xsl:if>
2229
2230 <!-- summary attribute -->
2231 <!-- -->
2232 <xsl:if test="string-length($VarTableSummary) > 0">
2233 <xsl:attribute name="summary">
2234 <xsl:value-of select="$VarTableSummary" />
2235 </xsl:attribute>
2236 </xsl:if>
2237
2238 <!-- Apply caption templates -->
2239 <!-- -->
2240 <xsl:for-each select="$ParamTable/wwdoc:Caption[1]">
2241 <html:caption>
2242
2243 <xsl:if test="string-length($VarCaptionSide) > 0">
2244 <xsl:attribute name="style">
2245 <xsl:value-of select="concat('caption-side: ', $VarCaptionSide)" />
2246 </xsl:attribute>
2247 </xsl:if>
2248
2249 <xsl:apply-templates select="./*" mode="wwmode:content">
2250 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2251 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2252 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2253 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2254 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2255 </xsl:apply-templates>
2256
2257 </html:caption>
2258 </xsl:for-each>
2259
2260 <xsl:for-each select="$ParamTable/wwdoc:TableHead|$ParamTable/wwdoc:TableBody|$ParamTable/wwdoc:TableFoot">
2261 <xsl:variable name="VarSection" select="." />
2262
2263 <!-- Resolve section properties -->
2264 <!-- -->
2265 <xsl:variable name="VarResolvedSectionPropertiesAsXML">
2266 <xsl:call-template name="Properties-Table-Section-ResolveContextRule">
2267 <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
2268 <xsl:with-param name="ParamDocumentContext" select="$ParamTable" />
2269 <xsl:with-param name="ParamTable" select="$ParamTable" />
2270 <xsl:with-param name="ParamSection" select="$VarSection" />
2271 </xsl:call-template>
2272 </xsl:variable>
2273 <xsl:variable name="VarResolvedSectionProperties" select="msxsl:node-set($VarResolvedSectionPropertiesAsXML)/wwproject:Property" />
2274
2275 <!-- Process section rows -->
2276 <!-- -->
2277 <xsl:for-each select="$VarSection/wwdoc:TableRow">
2278 <xsl:variable name="VarTableRow" select="." />
2279 <xsl:variable name="VarRowPosition" select="position()" />
2280
2281 <html:tr>
2282
2283 <!-- Handle table level vertical align at row level -->
2284 <!-- -->
2285 <xsl:if test="string-length($VarTableVerticalAlignment) > 0">
2286 <xsl:attribute name="style">
2287 <xsl:value-of select="concat('vertical-align: ', $VarTableVerticalAlignment, ';')" />
2288 </xsl:attribute>
2289 </xsl:if>
2290
2291 <xsl:for-each select="$VarTableRow/wwdoc:TableCell">
2292 <xsl:variable name="VarTableCell" select="." />
2293 <xsl:variable name="VarCellPosition" select="position()" />
2294
2295 <!-- Resolve cell properties -->
2296 <!-- -->
2297 <xsl:variable name="VarResolvedCellPropertiesAsXML">
2298 <xsl:call-template name="Properties-Table-Cell-ResolveProperties">
2299 <xsl:with-param name="ParamSectionProperties" select="$VarResolvedSectionProperties" />
2300 <xsl:with-param name="ParamCellStyle" select="$VarTableCell/wwdoc:Style" />
2301 <xsl:with-param name="ParamRowIndex" select="$VarRowPosition" />
2302 <xsl:with-param name="ParamColumnIndex" select="$VarCellPosition" />
2303 </xsl:call-template>
2304
2305 <!-- Width attribute -->
2306 <!-- -->
2307 <xsl:if test="$VarRowPosition = 1">
2308 <xsl:for-each select="$VarTableCellWidths[@id = $VarTableCell/@id][1]">
2309 <xsl:variable name="VarTableCellWidth" select="." />
2310
2311 <wwproject:Property Name="width" Value="{$VarTableCellWidth/@width}" />
2312 </xsl:for-each>
2313 </xsl:if>
2314 </xsl:variable>
2315 <xsl:variable name="VarResolvedCellProperties" select="msxsl:node-set($VarResolvedCellPropertiesAsXML)/wwproject:Property" />
2316
2317 <!-- Valid CSS properties -->
2318 <!-- -->
2319 <xsl:variable name="VarTableCellCSSPropertiesAsXML">
2320 <xsl:call-template name="CSS-TranslateProjectProperties">
2321 <xsl:with-param name="ParamProperties" select="$VarResolvedCellProperties" />
2322 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2323 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2324 </xsl:call-template>
2325 </xsl:variable>
2326 <xsl:variable name="VarTableCellCSSProperties" select="msxsl:node-set($VarTableCellCSSPropertiesAsXML)/wwproject:Property" />
2327
2328 <!-- Calculate row span -->
2329 <!-- -->
2330 <xsl:variable name="VarRowSpan">
2331 <xsl:variable name="VarRowSpanHint" select="$VarTableCell/wwdoc:Style/wwdoc:Attribute[@name = 'row-span']/@value" />
2332 <xsl:choose>
2333 <xsl:when test="string-length($VarRowSpanHint) > 0">
2334 <xsl:value-of select="$VarRowSpanHint" />
2335 </xsl:when>
2336 <xsl:otherwise>
2337 <xsl:value-of select="'0'" />
2338 </xsl:otherwise>
2339 </xsl:choose>
2340 </xsl:variable>
2341
2342 <!-- Calculate column span -->
2343 <!-- -->
2344 <xsl:variable name="VarColumnSpan">
2345 <xsl:variable name="VarColumnSpanHint" select="$VarTableCell/wwdoc:Style/wwdoc:Attribute[@name = 'column-span']/@value" />
2346 <xsl:choose>
2347 <xsl:when test="string-length($VarColumnSpanHint) > 0">
2348 <xsl:value-of select="$VarColumnSpanHint" />
2349 </xsl:when>
2350 <xsl:otherwise>
2351 <xsl:value-of select="'0'" />
2352 </xsl:otherwise>
2353 </xsl:choose>
2354 </xsl:variable>
2355
2356 <!-- Emit cell -->
2357 <!-- -->
2358 <html:td id="{@id}">
2359 <!-- Style attribute -->
2360 <!-- -->
2361 <xsl:if test="count($VarTableCellCSSProperties[1]) = 1">
2362 <xsl:attribute name="style">
2363 <xsl:call-template name="CSS-InlineProperties">
2364 <xsl:with-param name="ParamProperties" select="$VarTableCellCSSProperties" />
2365 </xsl:call-template>
2366 </xsl:attribute>
2367 </xsl:if>
2368
2369 <!-- Row span attribute -->
2370 <!-- -->
2371 <xsl:if test="number($VarRowSpan) > 0">
2372 <xsl:attribute name="rowspan">
2373 <xsl:value-of select="$VarRowSpan" />
2374 </xsl:attribute>
2375 </xsl:if>
2376
2377 <!-- Column span attribute -->
2378 <!-- -->
2379 <xsl:if test="number($VarColumnSpan) > 0">
2380 <xsl:attribute name="colspan">
2381 <xsl:value-of select="$VarColumnSpan" />
2382 </xsl:attribute>
2383 </xsl:if>
2384
2385 <!-- Recurse -->
2386 <!-- -->
2387 <xsl:apply-templates select="./*" mode="wwmode:content">
2388 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2389 <xsl:with-param name="ParamCargo" select="$VarCargo" />
2390 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2391 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2392 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2393 </xsl:apply-templates>
2394 </html:td>
2395 </xsl:for-each>
2396
2397 </html:tr>
2398 </xsl:for-each>
2399 </xsl:for-each>
2400
2401 </html:table>
2402
2403 <!-- Table Footnotes -->
2404 <!-- -->
2405 <xsl:call-template name="Content-Notes">
2406 <xsl:with-param name="ParamNotes" select="$VarNotes" />
2407 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2408 <xsl:with-param name="ParamCargo" select="$VarCargo" />
2409 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2410 <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2411 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2412 </xsl:call-template>
2413
2414 <!-- Dropdown End -->
2415 <!-- -->
2416 <xsl:if test="$ParamTableBehavior/@dropdown = 'end'">
2417 <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVClose();</html:script>
2418 </xsl:if>
2419 </xsl:template>
2420
2421
2422 <xsl:template match="wwdoc:Frame" mode="wwmode:content">
2423 <xsl:param name="ParamSplits" />
2424 <xsl:param name="ParamCargo" />
2425 <xsl:param name="ParamLinks" />
2426 <xsl:param name="ParamTOCData" />
2427 <xsl:param name="ParamSplit" />
2428
2429 <!-- Aborted? -->
2430 <!-- -->
2431 <xsl:if test="not(wwprogress:Abort())">
2432 <xsl:call-template name="Frame">
2433 <xsl:with-param name="ParamFrame" select="." />
2434 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2435 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2436 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2437 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2438 </xsl:call-template>
2439 </xsl:if>
2440 </xsl:template>
2441
2442
2443 <xsl:template match="wwdoc:Frame" mode="wwmode:textrun">
2444 <xsl:param name="ParamSplits" />
2445 <xsl:param name="ParamCargo" />
2446 <xsl:param name="ParamLinks" />
2447 <xsl:param name="ParamSplit" />
2448
2449 <xsl:call-template name="Frame">
2450 <xsl:with-param name="ParamFrame" select="." />
2451 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2452 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2453 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2454 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2455 </xsl:call-template>
2456 </xsl:template>
2457
2458
2459 <xsl:template name="Frame">
2460 <xsl:param name="ParamFrame" />
2461 <xsl:param name="ParamSplits" />
2462 <xsl:param name="ParamCargo" />
2463 <xsl:param name="ParamLinks" />
2464 <xsl:param name="ParamSplit" />
2465
2466 <!-- Get splits frame -->
2467 <!-- -->
2468 <xsl:for-each select="$ParamSplits[1]">
2469 <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2470
2471 <!-- Frame known? -->
2472 <!-- -->
2473 <xsl:if test="count($VarSplitsFrame) = 1">
2474 <!-- Thumbnail file exists for this frame? -->
2475 <!-- -->
2476 <xsl:for-each select="$GlobalFiles[1]">
2477 <xsl:variable name="VarThumbnailExists" select="count(key('wwfiles-files-by-path', $VarSplitsFrame/wwsplits:Thumbnail/@path)[1]) > 0" />
2478
2479 <xsl:choose>
2480 <xsl:when test="$VarThumbnailExists">
2481 <xsl:call-template name="Frame-Thumbnail">
2482 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2483 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2484 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2485 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2486 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2487 </xsl:call-template>
2488 </xsl:when>
2489
2490 <xsl:otherwise>
2491 <xsl:call-template name="Frame-FullSize">
2492 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2493 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2494 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2495 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2496 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2497 </xsl:call-template>
2498 </xsl:otherwise>
2499 </xsl:choose>
2500 </xsl:for-each>
2501 </xsl:if>
2502 </xsl:for-each>
2503 </xsl:template>
2504
2505
2506 <xsl:template name="Frame-Thumbnail">
2507 <xsl:param name="ParamFrame" />
2508 <xsl:param name="ParamSplits" />
2509 <xsl:param name="ParamCargo" />
2510 <xsl:param name="ParamLinks" />
2511 <xsl:param name="ParamSplit" />
2512
2513 <xsl:variable name="VarBehaviorFrame" select="$ParamCargo/wwbehaviors:Behaviors//wwbehaviors:Frame[@id = $ParamFrame/@id][1]" />
2514
2515 <!-- Notes -->
2516 <!-- -->
2517 <xsl:variable name="VarNotes" select="$ParamFrame//wwdoc:Note" />
2518
2519 <!-- Note numbering -->
2520 <!-- -->
2521 <xsl:variable name="VarNoteNumberingAsXML">
2522 <xsl:call-template name="Notes-Number">
2523 <xsl:with-param name="ParamNotes" select="$VarNotes" />
2524 </xsl:call-template>
2525 </xsl:variable>
2526 <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2527
2528 <!-- Frame cargo -->
2529 <!-- -->
2530 <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2531
2532 <!-- Get image path -->
2533 <!-- -->
2534 <xsl:for-each select="$ParamSplits[1]">
2535 <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2536
2537 <!-- Graphic Rule -->
2538 <!-- -->
2539 <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2540 <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2541 <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2542 <xsl:if test="$VarGenerateOutput">
2543 <!-- Resolve project properties -->
2544 <!-- -->
2545 <xsl:variable name="VarResolvedPropertiesAsXML">
2546 <xsl:call-template name="Properties-ResolveOverrideRule">
2547 <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
2548 <xsl:with-param name="ParamContextStyle" select="$ParamFrame" />
2549 </xsl:call-template>
2550 </xsl:variable>
2551 <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2552
2553 <!-- CSS properties -->
2554 <!-- -->
2555 <xsl:variable name="VarCSSPropertiesAsXML">
2556 <xsl:call-template name="CSS-TranslateProjectProperties">
2557 <xsl:with-param name="ParamProperties" select="$VarResolvedProperties[(@Name != 'width') and (@Name != 'height')]" />
2558 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2559 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2560 </xsl:call-template>
2561 </xsl:variable>
2562 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2563 <xsl:variable name="VarInlineCSSProperties">
2564 <xsl:call-template name="CSS-InlineProperties">
2565 <xsl:with-param name="ParamProperties" select="$VarCSSProperties[string-length(@Value) > 0]" />
2566 </xsl:call-template>
2567 </xsl:variable>
2568
2569 <!-- Width/Height -->
2570 <!-- -->
2571 <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarSplitsFrame/wwsplits:Thumbnail/@path)" />
2572 <xsl:variable name="VarWidth" select="number($VarImageInfo/@width)" />
2573 <xsl:variable name="VarHeight" select="number($VarImageInfo/@height)" />
2574
2575 <!-- Src -->
2576 <!-- -->
2577 <xsl:variable name="VarSrc" select="wwuri:GetRelativeTo($VarSplitsFrame/wwsplits:Thumbnail/@path, $ParamSplit/@path)" />
2578
2579 <!-- Define Use Map -->
2580 <!-- -->
2581 <xsl:variable name="VarUseMap">
2582 <xsl:text>#</xsl:text>
2583 <xsl:value-of select="$VarSplitsFrame/@documentID" />
2584 <xsl:text>_</xsl:text>
2585 <xsl:value-of select="$VarSplitsFrame/@id" />
2586 </xsl:variable>
2587
2588 <!-- Alt Text -->
2589 <!-- -->
2590 <xsl:variable name="VarAltText">
2591 <xsl:call-template name="Images-AltText">
2592 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2593 <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2594 </xsl:call-template>
2595 </xsl:variable>
2596
2597 <!-- Long Description -->
2598 <!-- -->
2599 <xsl:variable name="VarLongDescription">
2600 <xsl:call-template name="Images-LongDescription">
2601 <xsl:with-param name="ParamSplitsFrame" select="$VarSplitsFrame" />
2602 <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2603 </xsl:call-template>
2604 </xsl:variable>
2605
2606 <!-- Get rule -->
2607 <!-- -->
2608 <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2609
2610 <!-- Tag -->
2611 <!-- -->
2612 <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
2613 <xsl:variable name="VarTag">
2614 <xsl:choose>
2615 <xsl:when test="string-length($VarTagProperty) > 0">
2616 <xsl:value-of select="$VarTagProperty" />
2617 </xsl:when>
2618
2619 <xsl:otherwise>
2620 <xsl:value-of select="'img'" />
2621 </xsl:otherwise>
2622 </xsl:choose>
2623 </xsl:variable>
2624
2625 <!-- Graphic element -->
2626 <!-- -->
2627 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
2628 <!-- ID attribute -->
2629 <!-- -->
2630 <xsl:attribute name="id">
2631 <xsl:value-of select="$ParamFrame/@id" />
2632 </xsl:attribute>
2633
2634 <!-- Class attribute -->
2635 <!-- -->
2636 <xsl:attribute name="class">
2637 <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
2638 </xsl:attribute>
2639
2640 <!-- Src attribute -->
2641 <!-- -->
2642 <xsl:attribute name="src">
2643 <xsl:value-of select="$VarSrc" />
2644 </xsl:attribute>
2645
2646 <!-- Width attribute -->
2647 <!-- -->
2648 <xsl:if test="$VarWidth > 0">
2649 <xsl:attribute name="width">
2650 <xsl:value-of select="$VarWidth"/>
2651 </xsl:attribute>
2652 </xsl:if>
2653
2654 <!-- Height attribute -->
2655 <!-- -->
2656 <xsl:if test="$VarHeight > 0">
2657 <xsl:attribute name="height">
2658 <xsl:value-of select="$VarHeight"/>
2659 </xsl:attribute>
2660 </xsl:if>
2661
2662 <!-- Style attribute -->
2663 <!-- -->
2664 <xsl:if test="string-length($VarInlineCSSProperties) > 0">
2665 <xsl:attribute name="style">
2666 <xsl:value-of select="$VarInlineCSSProperties" />
2667 </xsl:attribute>
2668 </xsl:if>
2669
2670 <!-- Alt attribute -->
2671 <!-- -->
2672 <xsl:if test="string-length($VarAltText) > 0">
2673 <xsl:attribute name="alt">
2674 <xsl:value-of select="$VarAltText" />
2675 </xsl:attribute>
2676 </xsl:if>
2677
2678 <!-- Longdesc attribute -->
2679 <!-- -->
2680 <xsl:if test="string-length($VarLongDescription) > 0">
2681 <xsl:attribute name="longdesc">
2682 <xsl:value-of select="$VarLongDescription" />
2683 </xsl:attribute>
2684 </xsl:if>
2685
2686 <!-- Usemap attribute -->
2687 <!-- -->
2688 <xsl:attribute name="usemap">
2689 <xsl:value-of select="$VarUseMap" />
2690 </xsl:attribute>
2691 <xsl:attribute name="border">
2692 <xsl:value-of select="'0'" />
2693 </xsl:attribute>
2694 </xsl:element>
2695
2696 <!-- Generate D Links -->
2697 <!-- -->
2698 <xsl:variable name="VarGenerateDLinks" select="wwprojext:GetFormatSetting('accessibility-image-d-links', 'false')" />
2699 <xsl:if test="$VarGenerateDLinks = 'true'">
2700 <xsl:if test="string-length($VarLongDescription) > 0">
2701 <xsl:text> </xsl:text>
2702 <html:a href="{$VarLongDescription}" title="{concat('Description link for ', wwfilesystem:GetFileName($VarSplitsFrame/@path))}">[D]</html:a><html:br />
2703 </xsl:if>
2704 </xsl:if>
2705
2706 <!-- Image map -->
2707 <!-- -->
2708 <html:map name="{concat($VarSplitsFrame/@documentID, '_', $VarSplitsFrame/@id)}">
2709 <html:area coords="{concat('0,0,', $VarWidth, ',', $VarHeight)}" shape="rect" href="{wwuri:GetRelativeTo($VarSplitsFrame/wwsplits:Wrapper/@path, $ParamSplit/@path)}">
2710 <xsl:if test="string-length($VarAltText) > 0">
2711 <xsl:attribute name="alt">
2712 <xsl:value-of select="$VarAltText" />
2713 </xsl:attribute>
2714 </xsl:if>
2715 </html:area>
2716 </html:map>
2717 </xsl:if>
2718 </xsl:for-each>
2719 </xsl:template>
2720
2721
2722 <xsl:template name="Frame-FullSize">
2723 <xsl:param name="ParamFrame" />
2724 <xsl:param name="ParamSplits" />
2725 <xsl:param name="ParamCargo" />
2726 <xsl:param name="ParamLinks" />
2727 <xsl:param name="ParamSplit" />
2728
2729 <xsl:variable name="VarBehaviorFrame" select="$ParamCargo/wwbehaviors:Behaviors//wwbehaviors:Frame[@id = $ParamFrame/@id][1]" />
2730
2731 <!-- Notes -->
2732 <!-- -->
2733 <xsl:variable name="VarNotes" select="$ParamFrame//wwdoc:Note" />
2734
2735 <!-- Note numbering -->
2736 <!-- -->
2737 <xsl:variable name="VarNoteNumberingAsXML">
2738 <xsl:call-template name="Notes-Number">
2739 <xsl:with-param name="ParamNotes" select="$VarNotes" />
2740 </xsl:call-template>
2741 </xsl:variable>
2742 <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2743
2744 <!-- Frame cargo -->
2745 <!-- -->
2746 <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2747
2748 <!-- Get image path -->
2749 <!-- -->
2750 <xsl:for-each select="$ParamSplits[1]">
2751 <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2752
2753 <!-- Graphic Rule -->
2754 <!-- -->
2755 <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2756 <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2757 <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2758 <xsl:if test="$VarGenerateOutput">
2759 <!-- Resolve project properties -->
2760 <!-- -->
2761 <xsl:variable name="VarResolvedPropertiesAsXML">
2762 <xsl:call-template name="Properties-ResolveOverrideRule">
2763 <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
2764 <xsl:with-param name="ParamContextStyle" select="$ParamFrame" />
2765 </xsl:call-template>
2766 </xsl:variable>
2767 <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2768
2769 <!-- CSS properties -->
2770 <!-- -->
2771 <xsl:variable name="VarCSSPropertiesAsXML">
2772 <xsl:call-template name="CSS-TranslateProjectProperties">
2773 <xsl:with-param name="ParamProperties" select="$VarResolvedProperties[(@Name != 'width') and (@Name != 'height')]" />
2774 <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2775 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2776 </xsl:call-template>
2777 </xsl:variable>
2778 <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2779 <xsl:variable name="VarInlineCSSProperties">
2780 <xsl:call-template name="CSS-InlineProperties">
2781 <xsl:with-param name="ParamProperties" select="$VarCSSProperties[string-length(@Value) > 0]" />
2782 </xsl:call-template>
2783 </xsl:variable>
2784
2785 <!-- Width/Height -->
2786 <!-- -->
2787 <xsl:variable name="VarByReferenceGraphicsUseDocumentDimensionsOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'by-reference-use-document-dimensions']/@Value" />
2788 <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarSplitsFrame/@path)" />
2789 <xsl:variable name="VarWidth">
2790 <xsl:choose>
2791 <xsl:when test="((string-length($VarByReferenceGraphicsUseDocumentDimensionsOption) = 0) or ($VarByReferenceGraphicsUseDocumentDimensionsOption = 'true')) and ($VarSplitsFrame/@byref = 'true')">
2792 <xsl:variable name="VarByReferenceFrame" select="$ParamFrame//wwdoc:Facet[@type = 'by-reference'][1]/../.." />
2793
2794 <xsl:value-of select="floor(wwunits:Convert(wwunits:NumericPrefix($VarByReferenceFrame/wwdoc:Attribute[@name = 'width']/@value), 'pt', 'px'))" />
2795 </xsl:when>
2796
2797 <xsl:otherwise>
2798 <xsl:value-of select="number($VarImageInfo/@width)" />
2799 </xsl:otherwise>
2800 </xsl:choose>
2801 </xsl:variable>
2802 <xsl:variable name="VarHeight">
2803 <xsl:choose>
2804 <xsl:when test="((string-length($VarByReferenceGraphicsUseDocumentDimensionsOption) = 0) or ($VarByReferenceGraphicsUseDocumentDimensionsOption = 'true')) and ($VarSplitsFrame/@byref = 'true')">
2805 <xsl:variable name="VarByReferenceFrame" select="$ParamFrame//wwdoc:Facet[@type = 'by-reference'][1]/../.." />
2806
2807 <xsl:value-of select="floor(wwunits:Convert(wwunits:NumericPrefix($VarByReferenceFrame/wwdoc:Attribute[@name = 'height']/@value), 'pt', 'px'))" />
2808 </xsl:when>
2809
2810 <xsl:otherwise>
2811 <xsl:value-of select="number($VarImageInfo/@height)" />
2812 </xsl:otherwise>
2813 </xsl:choose>
2814 </xsl:variable>
2815
2816 <!-- Src -->
2817 <!-- -->
2818 <xsl:variable name="VarSrc" select="wwuri:GetRelativeTo($VarSplitsFrame/@path, $ParamSplit/@path)" />
2819
2820 <!-- Need to define usemap? -->
2821 <!-- -->
2822 <xsl:variable name="VarUseMap">
2823 <xsl:variable name="VarUseMapHint" select="count($ParamFrame//wwdoc:Link)" />
2824 <xsl:choose>
2825 <xsl:when test="$VarUseMapHint > 0">
2826 <xsl:text>#</xsl:text>
2827 <xsl:value-of select="$VarSplitsFrame/@documentID" />
2828 <xsl:text>_</xsl:text>
2829 <xsl:value-of select="$VarSplitsFrame/@id" />
2830 </xsl:when>
2831
2832 <xsl:otherwise>
2833 <xsl:value-of select="''" />
2834 </xsl:otherwise>
2835 </xsl:choose>
2836 </xsl:variable>
2837
2838 <!-- Alt Text -->
2839 <!-- -->
2840 <xsl:variable name="VarAltText">
2841 <xsl:call-template name="Images-AltText">
2842 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2843 <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2844 </xsl:call-template>
2845 </xsl:variable>
2846
2847 <!-- Long Description -->
2848 <!-- -->
2849 <xsl:variable name="VarLongDescription">
2850 <xsl:call-template name="Images-LongDescription">
2851 <xsl:with-param name="ParamSplitsFrame" select="$VarSplitsFrame" />
2852 <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2853 </xsl:call-template>
2854 </xsl:variable>
2855
2856 <!-- Get rule -->
2857 <!-- -->
2858 <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2859
2860 <!-- Tag -->
2861 <!-- -->
2862 <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
2863 <xsl:variable name="VarTag">
2864 <xsl:choose>
2865 <xsl:when test="string-length($VarTagProperty) > 0">
2866 <xsl:value-of select="$VarTagProperty" />
2867 </xsl:when>
2868
2869 <xsl:otherwise>
2870 <xsl:value-of select="'img'" />
2871 </xsl:otherwise>
2872 </xsl:choose>
2873 </xsl:variable>
2874
2875
2876 <!-- Generate the IMG tag or tags -->
2877 <!-- If class = "Default", use two tags to toggle imaged between reduced and full size -->
2878 <!-- Otherwise use standard WWH 5.0 processing (fixed size) -->
2879
2880 <xsl:choose>
2881 <xsl:when test="(wwstring:CSSClassName($ParamFrame/@stylename) = 'Default')">
2882
2883 <!-- First Graphic element (unexpanded) -->
2884 <!-- -->
2885 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
2886 <!-- ID attribute -->
2887 <!-- -->
2888 <xsl:attribute name="id">
2889 <xsl:value-of select="$ParamFrame/@id" />
2890 </xsl:attribute>
2891
2892 <!-- Class attribute -->
2893 <!-- -->
2894 <xsl:attribute name="class">
2895 <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
2896 </xsl:attribute>
2897
2898 <!-- Src attribute -->
2899 <!-- -->
2900 <xsl:attribute name="src">
2901 <xsl:value-of select="$VarSrc" />
2902 </xsl:attribute>
2903
2904 <!-- Width attribute -->
2905 <!-- -->
2906 <xsl:if test="$VarWidth > 0">
2907 <xsl:attribute name="width">
2908 <xsl:value-of select="$VarWidth"/>
2909 </xsl:attribute>
2910 </xsl:if>
2911
2912 <!-- Height attribute -->
2913 <!-- -->
2914 <xsl:if test="$VarHeight > 0">
2915 <xsl:attribute name="height">
2916 <xsl:value-of select="$VarHeight"/>
2917 </xsl:attribute>
2918 </xsl:if>
2919
2920 <!-- Style attribute -->
2921 <!-- -->
2922 <xsl:if test="string-length($VarInlineCSSProperties) > 0">
2923 <xsl:attribute name="style">
2924 <xsl:value-of select="$VarInlineCSSProperties" />
2925 </xsl:attribute>
2926 </xsl:if>
2927
2928 <!-- Alt attribute -->
2929 <!-- -->
2930 <xsl:choose>
2931 <xsl:when test="string-length($VarAltText) > 0">
2932 <xsl:attribute name="alt">
2933 <xsl:value-of select="$VarAltText" />
2934 </xsl:attribute>
2935 </xsl:when>
2936 <xsl:otherwise>
2937 <xsl:attribute name="alt">
2938 <xsl:value-of select="'Click to enlarge'" />
2939 </xsl:attribute>
2940 </xsl:otherwise>
2941 </xsl:choose>
2942
2943 <!-- Title attribute -->
2944 <!-- -->
2945 <xsl:attribute name="title">
2946 <xsl:value-of select="'Click to enlarge'" />
2947 </xsl:attribute>
2948
2949
2950 <!-- onclick Javascript attribute -->
2951 <!-- -->
2952 <xsl:attribute name="onclick">
2953 <xsl:value-of select="'javascript:document.getElementById('" />'<xsl:value-of select='$ParamFrame/@id' />').style.display='none';document.getElementById('<xsl:value-of select='$ParamFrame/@id' />a').style.display='block';</xsl:attribute>
2954
2955 <!-- Longdesc attribute -->
2956 <!-- -->
2957 <xsl:if test="string-length($VarLongDescription) > 0">
2958 <xsl:attribute name="longdesc">
2959 <xsl:value-of select="$VarLongDescription" />
2960 </xsl:attribute>
2961 </xsl:if>
2962
2963 <!-- Usemap attribute -->
2964 <!-- -->
2965 <xsl:if test="string-length($VarUseMap) > 0">
2966 <xsl:attribute name="usemap">
2967 <xsl:value-of select="$VarUseMap" />
2968 </xsl:attribute>
2969 <xsl:attribute name="border">
2970 <xsl:value-of select="'0'" />
2971 </xsl:attribute>
2972 </xsl:if>
2973 </xsl:element>
2974
2975
2976 <!-- Second Graphic element (expanded) -->
2977 <!-- -->
2978 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
2979 <!-- ID attribute -->
2980 <!-- -->
2981 <xsl:attribute name="id">
2982 <xsl:value-of select="$ParamFrame/@id" />a</xsl:attribute>
2983
2984 <!-- Class attribute -->
2985 <!-- -->
2986 <xsl:attribute name="class">
2987 <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
2988 </xsl:attribute>
2989
2990 <!-- Src attribute -->
2991 <!-- -->
2992 <xsl:attribute name="src">
2993 <xsl:value-of select="$VarSrc" />
2994 </xsl:attribute>
2995
2996 <!-- Style attribute: same as before except don't display it (assumes default display style is "block") -->
2997 <!-- -->
2998 <xsl:if test="string-length($VarInlineCSSProperties) > 0">
2999 <xsl:variable name="VarPrefix" select="substring-before($VarInlineCSSProperties, 'block')" />
3000 <xsl:variable name="VarSuffix" select="substring-after($VarInlineCSSProperties, 'block')" />
3001 <xsl:attribute name="style">
3002 <xsl:value-of select="concat($VarPrefix,'none',$VarSuffix)" />
3003 </xsl:attribute>
3004 </xsl:if>
3005
3006
3007 <!-- Alt attribute -->
3008 <!-- -->
3009 <xsl:choose>
3010 <xsl:when test="string-length($VarAltText) > 0">
3011 <xsl:attribute name="alt">
3012 <xsl:value-of select="$VarAltText" />
3013 </xsl:attribute>
3014 </xsl:when>
3015 <xsl:otherwise>
3016 <xsl:attribute name="alt">
3017 <xsl:value-of select="'Click to reduce'" />
3018 </xsl:attribute>
3019 </xsl:otherwise>
3020 </xsl:choose>
3021
3022 <!-- Title attribute -->
3023 <!-- -->
3024 <xsl:attribute name="title">
3025 <xsl:value-of select="'Click to reduce'" />
3026 </xsl:attribute>
3027
3028
3029 <!-- onclick Javascript attribute -->
3030 <!-- -->
3031 <xsl:attribute name="onclick">
3032 <xsl:value-of select="'javascript:document.getElementById('" />'<xsl:value-of select='$ParamFrame/@id' />').style.display='block';document.getElementById('<xsl:value-of select='$ParamFrame/@id' />a').style.display='none';</xsl:attribute>
3033
3034 <!-- Longdesc attribute -->
3035 <!-- -->
3036 <xsl:if test="string-length($VarLongDescription) > 0">
3037 <xsl:attribute name="longdesc">
3038 <xsl:value-of select="$VarLongDescription" />
3039 </xsl:attribute>
3040 </xsl:if>
3041
3042 <!-- Usemap attribute -->
3043 <!-- -->
3044 <xsl:if test="string-length($VarUseMap) > 0">
3045 <xsl:attribute name="usemap">
3046 <xsl:value-of select="$VarUseMap" />
3047 </xsl:attribute>
3048 <xsl:attribute name="border">
3049 <xsl:value-of select="'0'" />
3050 </xsl:attribute>
3051 </xsl:if>
3052 </xsl:element>
3053 </xsl:when>
3054
3055
3056 <xsl:otherwise>
3057 <!-- this is the original WWH 5.0 processing used to create the IMG tag -->
3058 <!-- Graphic element -->
3059 <!-- -->
3060 <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
3061 <!-- ID attribute -->
3062 <!-- -->
3063 <xsl:attribute name="id">
3064 <xsl:value-of select="$ParamFrame/@id" />
3065 </xsl:attribute>
3066
3067 <!-- Class attribute -->
3068 <!-- -->
3069 <xsl:attribute name="class">
3070 <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
3071 </xsl:attribute>
3072
3073 <!-- Src attribute -->
3074 <!-- -->
3075 <xsl:attribute name="src">
3076 <xsl:value-of select="$VarSrc" />
3077 </xsl:attribute>
3078
3079 <!-- Width attribute -->
3080 <!-- -->
3081 <xsl:if test="$VarWidth > 0">
3082 <xsl:attribute name="width">
3083 <xsl:value-of select="$VarWidth"/>
3084 </xsl:attribute>
3085 </xsl:if>
3086
3087 <!-- Height attribute -->
3088 <!-- -->
3089 <xsl:if test="$VarHeight > 0">
3090 <xsl:attribute name="height">
3091 <xsl:value-of select="$VarHeight"/>
3092 </xsl:attribute>
3093 </xsl:if>
3094
3095 <!-- Style attribute -->
3096 <!-- -->
3097 <xsl:if test="string-length($VarInlineCSSProperties) > 0">
3098 <xsl:attribute name="style">
3099 <xsl:value-of select="$VarInlineCSSProperties" />
3100 </xsl:attribute>
3101 </xsl:if>
3102
3103 <!-- Alt attribute -->
3104 <!-- -->
3105 <xsl:if test="string-length($VarAltText) > 0">
3106 <xsl:attribute name="alt">
3107 <xsl:value-of select="$VarAltText" />
3108 </xsl:attribute>
3109 </xsl:if>
3110
3111 <!-- Longdesc attribute -->
3112 <!-- -->
3113 <xsl:if test="string-length($VarLongDescription) > 0">
3114 <xsl:attribute name="longdesc">
3115 <xsl:value-of select="$VarLongDescription" />
3116 </xsl:attribute>
3117 </xsl:if>
3118
3119 <!-- Usemap attribute -->
3120 <!-- -->
3121 <xsl:if test="string-length($VarUseMap) > 0">
3122 <xsl:attribute name="usemap">
3123 <xsl:value-of select="$VarUseMap" />
3124 </xsl:attribute>
3125 <xsl:attribute name="border">
3126 <xsl:value-of select="'0'" />
3127 </xsl:attribute>
3128 </xsl:if>
3129 </xsl:element>
3130 </xsl:otherwise>
3131 </xsl:choose>
3132
3133
3134 <!-- Generate D Links -->
3135 <!-- -->
3136 <xsl:variable name="VarGenerateDLinks" select="wwprojext:GetFormatSetting('accessibility-image-d-links', 'false')" />
3137 <xsl:if test="$VarGenerateDLinks = 'true'">
3138 <xsl:if test="string-length($VarLongDescription) > 0">
3139 <xsl:text> </xsl:text>
3140 <html:a href="{$VarLongDescription}" title="{concat('Description link for ', wwfilesystem:GetFileName($VarSplitsFrame/@path))}">[D]</html:a><html:br />
3141 </xsl:if>
3142 </xsl:if>
3143
3144 <xsl:if test="string-length($VarUseMap) > 0">
3145 <html:map name="{concat($VarSplitsFrame/@documentID, '_', $VarSplitsFrame/@id)}">
3146 <xsl:call-template name="ImageMap">
3147 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
3148 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3149 <xsl:with-param name="ParamCargo" select="$VarCargo" />
3150 <xsl:with-param name="ParamParentBehavior" select="$VarBehaviorFrame" />
3151 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3152 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3153 </xsl:call-template>
3154 </html:map>
3155 </xsl:if>
3156 </xsl:if>
3157 </xsl:for-each>
3158
3159 <!-- Frame Footnotes -->
3160 <!-- -->
3161 <xsl:call-template name="Content-Notes">
3162 <xsl:with-param name="ParamNotes" select="$VarNotes" />
3163 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3164 <xsl:with-param name="ParamCargo" select="$VarCargo" />
3165 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3166 <xsl:with-param name="ParamTOCData" select="''" />
3167 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3168 </xsl:call-template>
3169 </xsl:template>
3170
3171
3172 <xsl:template name="ImageMap">
3173 <xsl:param name="ParamFrame" />
3174 <xsl:param name="ParamSplits" />
3175 <xsl:param name="ParamCargo" />
3176 <xsl:param name="ParamParentBehavior" />
3177 <xsl:param name="ParamLinks" />
3178 <xsl:param name="ParamSplit" />
3179
3180 <!-- Process child frames first -->
3181 <!-- -->
3182 <xsl:for-each select="$ParamFrame/wwdoc:Content//wwdoc:Frame[count($ParamFrame | ancestor::wwdoc:Frame[1]) = 1]">
3183 <xsl:call-template name="ImageMap">
3184 <xsl:with-param name="ParamFrame" select="." />
3185 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3186 <xsl:with-param name="ParamCargo" select="$ParamCargo" />
3187 <xsl:with-param name="ParamParentBehavior" select="$ParamParentBehavior" />
3188 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3189 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3190 </xsl:call-template>
3191 </xsl:for-each>
3192
3193 <!-- Get link -->
3194 <!-- -->
3195 <xsl:variable name="VarLinkInfoAsXML">
3196 <xsl:choose>
3197 <xsl:when test="count($ParamFrame/wwdoc:Link[1]) = 1">
3198 <xsl:call-template name="LinkInfo">
3199 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3200 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3201 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3202 <xsl:with-param name="ParamDocumentLink" select="$ParamFrame/wwdoc:Link" />
3203 </xsl:call-template>
3204 </xsl:when>
3205
3206 <xsl:otherwise>
3207 <xsl:variable name="VarChildLinks" select="$ParamFrame/wwdoc:Content//wwdoc:Link[count($ParamFrame | ancestor::wwdoc:Frame[1]) = 1]" />
3208 <xsl:variable name="VarChildLinksCount" select="count($VarChildLinks)" />
3209 <xsl:if test="$VarChildLinksCount > 0">
3210 <xsl:call-template name="LinkInfo">
3211 <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3212 <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3213 <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3214 <xsl:with-param name="ParamDocumentLink" select="$VarChildLinks[$VarChildLinksCount]" />
3215 </xsl:call-template>
3216 </xsl:if>
3217 </xsl:otherwise>
3218 </xsl:choose>
3219 </xsl:variable>
3220 <xsl:variable name="VarLinkInfo" select="msxsl:node-set($VarLinkInfoAsXML)/wwlinks:LinkInfo" />
3221
3222 <xsl:if test="(string-length($VarLinkInfo/@href) > 0) or (string-length($VarLinkInfo/@onMouseOver) > 0)">
3223 <!-- Get coords attribute -->
3224 <!-- -->
3225 <xsl:variable name="VarLeftAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'left']/@value), 'pt', 'px')))" />
3226 <xsl:variable name="VarTopAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'top']/@value), 'pt', 'px')))" />
3227 <xsl:variable name="VarWidthAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'width']/@value), 'pt', 'px')))" />
3228 <xsl:variable name="VarHeightAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'height']/@value), 'pt', 'px')))" />
3229
3230 <!-- coords -->
3231 <!-- -->
3232 <xsl:variable name="VarCoordsString">
3233 <xsl:choose>
3234 <xsl:when test="string-length($VarLeftAsPixels) > 0">
3235 <xsl:value-of select="$VarLeftAsPixels" />
3236 </xsl:when>
3237 <xsl:otherwise>
3238 <xsl:value-of select="'0'" />
3239 </xsl:otherwise>
3240 </xsl:choose>
3241
3242 <xsl:value-of select="','"/>
3243
3244 <xsl:choose>
3245 <xsl:when test="string-length($VarTopAsPixels) > 0">
3246 <xsl:value-of select="$VarTopAsPixels" />
3247 </xsl:when>
3248 <xsl:otherwise>
3249 <xsl:value-of select="'0'" />
3250 </xsl:otherwise>
3251 </xsl:choose>
3252
3253 <xsl:value-of select="','"/>
3254
3255 <xsl:choose>
3256 <xsl:when test="string-length($VarWidthAsPixels) > 0">
3257 <xsl:value-of select="string(number($VarWidthAsPixels) + number($VarLeftAsPixels))" />
3258 </xsl:when>
3259 <xsl:otherwise>
3260 <xsl:value-of select="'0'" />
3261 </xsl:otherwise>
3262 </xsl:choose>
3263
3264 <xsl:value-of select="','"/>
3265
3266 <xsl:choose>
3267 <xsl:when test="string-length($VarHeightAsPixels) > 0">
3268 <xsl:value-of select="string(number($VarHeightAsPixels) + number($VarTopAsPixels))" />
3269 </xsl:when>
3270 <xsl:otherwise>
3271 <xsl:value-of select="'0'" />
3272 </xsl:otherwise>
3273 </xsl:choose>
3274 </xsl:variable>
3275
3276 <!-- alt -->
3277 <!-- -->
3278 <xsl:variable name="VarAltText">
3279 <xsl:call-template name="Images-ImageAreaAltText">
3280 <xsl:with-param name="ParamParentBehavior" select="$ParamParentBehavior" />
3281 <xsl:with-param name="ParamFrame" select="$ParamFrame" />
3282 </xsl:call-template>
3283 </xsl:variable>
3284
3285 <!-- area -->
3286 <!-- -->
3287 <html:area href="{$VarLinkInfo/@href}" coords="{$VarCoordsString}" shape="rect">
3288 <!-- target -->
3289 <!-- -->
3290 <xsl:if test="string-length($VarLinkInfo/@target) > 0">
3291 <xsl:attribute name="target">
3292 <xsl:value-of select="$VarLinkInfo/@target" />
3293 </xsl:attribute>
3294 </xsl:if>
3295
3296 <!-- onMouseOver -->
3297 <!-- -->
3298 <xsl:if test="string-length($VarLinkInfo/@onMouseOver) > 0">
3299 <xsl:attribute name="onMouseOver">
3300 <xsl:value-of select="$VarLinkInfo/@onMouseOver" />
3301 </xsl:attribute>
3302 </xsl:if>
3303
3304 <!-- onMouseOut -->
3305 <!-- -->
3306 <xsl:if test="string-length($VarLinkInfo/@onMouseOut) > 0">
3307 <xsl:attribute name="onMouseOut">
3308 <xsl:value-of select="$VarLinkInfo/@onMouseOut" />
3309 </xsl:attribute>
3310 </xsl:if>
3311
3312 <!-- alt -->
3313 <!-- -->
3314 <xsl:if test="string-length($VarAltText) > 0">
3315 <xsl:attribute name="alt">
3316 <xsl:value-of select="$VarAltText" />
3317 </xsl:attribute>
3318 </xsl:if>
3319 </html:area>
3320 </xsl:if>
3321 </xsl:template>
3322 </xsl:stylesheet>
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.