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) &gt; 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) &gt; 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) &gt; 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(&quot;</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>&quot;, &quot;</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>&quot;, &quot;</xsl:text>
 224 
 225         <!-- Link -->
 226         <!--      -->
 227         <xsl:value-of select="wwstring:JavaScriptEncoding($VarRelativePath)" />
 228         <xsl:if test="(string-length($VarRelatedTopicParagraph/wwdoc:Link/@anchor) &gt; 0) and (string-length($VarResolvedLinkInfo/@linkid) &gt; 0)">
 229          <xsl:text>#</xsl:text>
 230          <xsl:value-of select="wwstring:JavaScriptEncoding($VarResolvedLinkInfo/@linkid)" />
 231         </xsl:if>
 232         <xsl:text>&quot;</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 &gt;= $ParamSplit/@documentstartposition) and (@documentposition &lt;= $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 &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 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) &gt; 0) and (number($VarMiniTOCSubLevelsNumericPrefix) &gt; 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:div class="WebWorks_MiniTOC">
 549     <!-- Emit top-level entry? -->
 550     <!--                       -->
 551     <xsl:choose>
 552      <xsl:when test="$ParamEmitTOCEntry = true()">
 553       <html:div class="WebWorks_MiniTOC_Level1">
 554        <!-- Paragraph -->
 555        <!--           -->
 556        <xsl:call-template name="MiniTOCParagraph">
 557         <xsl:with-param name="ParamParagraph" select="$ParamTOCEntry/wwdoc:Paragraph" />
 558        </xsl:call-template>
 559       </html:div>
 560 
 561       <!-- Children -->
 562       <!--          -->
 563       <xsl:call-template name="MiniTOCEntries">
 564        <xsl:with-param name="ParamReferencePath" select="$ParamSplit/@path" />
 565        <xsl:with-param name="ParamParent" select="$ParamTOCEntry" />
 566        <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
 567        <xsl:with-param name="ParamLevel" select="2" />
 568       </xsl:call-template>
 569      </xsl:when>
 570 
 571      <xsl:otherwise>
 572       <!-- Children -->
 573       <!--          -->
 574       <xsl:call-template name="MiniTOCEntries">
 575        <xsl:with-param name="ParamReferencePath" select="$ParamSplit/@path" />
 576        <xsl:with-param name="ParamParent" select="$ParamTOCEntry" />
 577        <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
 578        <xsl:with-param name="ParamLevel" select="1" />
 579       </xsl:call-template>
 580      </xsl:otherwise>
 581     </xsl:choose>
 582    </html:div>
 583   </xsl:if>
 584  </xsl:template>
 585 
 586 
 587  <xsl:template name="MiniTOCEntries">
 588   <xsl:param name="ParamReferencePath" />
 589   <xsl:param name="ParamParent" />
 590   <xsl:param name="ParamMiniTOCSubLevels" />
 591   <xsl:param name="ParamLevel" />
 592 
 593   <xsl:variable name="VarSubEntries" select="$ParamParent/wwtoc:Entry" />
 594 
 595   <xsl:for-each select="$VarSubEntries[1]">
 596    <xsl:for-each select="$VarSubEntries">
 597     <xsl:variable name="VarEntry" select="." />
 598 
 599     <html:div>
 600      <xsl:attribute name="class">
 601       <xsl:text>WebWorks_MiniTOC_Level</xsl:text>
 602       <xsl:value-of select="$ParamLevel" />
 603      </xsl:attribute>
 604 
 605      <xsl:choose>
 606       <xsl:when test="string-length($VarEntry/@path) &gt; 0">
 607        <!-- Get link -->
 608        <!--          -->
 609        <xsl:variable name="VarRelativeLinkPath" select="wwuri:GetRelativeTo($VarEntry/@path, $ParamReferencePath)" />
 610 
 611        <html:a class="WebWorks_MiniTOC_Link" href="{$VarRelativeLinkPath}#{$VarEntry/@linkid}">
 612         <xsl:call-template name="MiniTOCParagraph">
 613          <xsl:with-param name="ParamParagraph" select="$VarEntry/wwdoc:Paragraph" />
 614         </xsl:call-template>
 615        </html:a>
 616       </xsl:when>
 617 
 618       <xsl:otherwise>
 619        <xsl:call-template name="MiniTOCParagraph">
 620         <xsl:with-param name="ParamParagraph" select="$VarEntry/wwdoc:Paragraph" />
 621        </xsl:call-template>
 622       </xsl:otherwise>
 623      </xsl:choose>
 624     </html:div>
 625 
 626     <!-- Recurse -->
 627     <!--         -->
 628     <xsl:choose>
 629      <xsl:when test="$ParamMiniTOCSubLevels = 'all'">
 630       <xsl:call-template name="MiniTOCEntries">
 631        <xsl:with-param name="ParamReferencePath" select="$ParamReferencePath" />
 632        <xsl:with-param name="ParamParent" select="$VarEntry" />
 633        <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels" />
 634        <xsl:with-param name="ParamLevel" select="$ParamLevel + 1" />
 635       </xsl:call-template>
 636      </xsl:when>
 637 
 638      <xsl:when test="($ParamMiniTOCSubLevels - 1) &gt; 0">
 639       <xsl:call-template name="MiniTOCEntries">
 640        <xsl:with-param name="ParamReferencePath" select="$ParamReferencePath" />
 641        <xsl:with-param name="ParamParent" select="$VarEntry" />
 642        <xsl:with-param name="ParamMiniTOCSubLevels" select="$ParamMiniTOCSubLevels - 1" />
 643        <xsl:with-param name="ParamLevel" select="$ParamLevel + 1" />
 644       </xsl:call-template>
 645      </xsl:when>
 646     </xsl:choose>
 647    </xsl:for-each>
 648   </xsl:for-each>
 649  </xsl:template>
 650 
 651 
 652  <xsl:template name="MiniTOCParagraph">
 653   <xsl:param name="ParamParagraph" />
 654 
 655   <xsl:for-each select="$ParamParagraph/wwdoc:Number/wwdoc:Text | $ParamParagraph/wwdoc:TextRun/wwdoc:Text">
 656    <xsl:value-of select="@value" />
 657   </xsl:for-each>
 658  </xsl:template>
 659 
 660 
 661  <xsl:template name="Paragraph">
 662   <xsl:param name="ParamSplits" />
 663   <xsl:param name="ParamCargo" />
 664   <xsl:param name="ParamLinks" />
 665   <xsl:param name="ParamSplit" />
 666   <xsl:param name="ParamParagraph" />
 667   <xsl:param name="ParamStyleName" />
 668   <xsl:param name="ParamOverrideRule" />
 669   <xsl:param name="ParamParagraphBehavior" />
 670 
 671   <!-- Preserve empty? -->
 672   <!--                 -->
 673   <xsl:variable name="VarPreserveEmptyOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'preserve-empty']/@Value" />
 674   <xsl:variable name="VarPreserveEmpty" select="(string-length($VarPreserveEmptyOption) = 0) or ($VarPreserveEmptyOption = 'true')" />
 675 
 676   <!-- Non-empty text runs -->
 677   <!--                     -->
 678   <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]) &gt; 0]" />
 679 
 680   <!-- Process this paragraph at all? -->
 681   <!--                                -->
 682   <xsl:if test="($VarPreserveEmpty) or (count($VarTextRuns[1]) = 1)">
 683    <!-- Pass-through? -->
 684    <!--               -->
 685    <xsl:variable name="VarPassThrough">
 686     <xsl:call-template name="Conditions-PassThrough">
 687      <xsl:with-param name="ParamConditions" select="$ParamParagraph/wwdoc:Conditions" />
 688     </xsl:call-template>
 689    </xsl:variable>
 690 
 691    <!-- A-Link? -->
 692    <!--         -->
 693    <xsl:variable name="VarALinkOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'alink']/@Value" />
 694    <xsl:variable name="VarALink" select="$VarALinkOption = 'true'" />
 695 
 696    <xsl:choose>
 697     <!-- Pass-through -->
 698     <!--              -->
 699     <xsl:when test="$VarPassThrough = 'true'">
 700      <xsl:call-template name="Paragraph-PassThrough">
 701       <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
 702      </xsl:call-template>
 703     </xsl:when>
 704 
 705     <!-- A-Link around whole paragraph -->
 706     <!--                               -->
 707     <xsl:when test="$VarALink">
 708      <!-- Update cargo -->
 709      <!--              -->
 710      <xsl:variable name="VarCargoALinkAsXML">
 711       <xsl:variable name="VarALinkEntries">
 712        <xsl:call-template name="ALinkEntries">
 713         <xsl:with-param name="ParamMarkers" select="$ParamParagraph/wwdoc:TextRun/wwdoc:Marker" />
 714        </xsl:call-template>
 715       </xsl:variable>
 716 
 717       <wwalinks:ALink>
 718        <xsl:attribute name="href">
 719         <xsl:value-of select="'javascript:WWHDoNothingHREF();'" />
 720        </xsl:attribute>
 721        <xsl:attribute name="onClick">
 722         <xsl:value-of select="concat('WWHShowALinksPopup(new Array(', $VarALinkEntries, '), (document.all||document.getElementById||document.layers)?event:null);')" />
 723        </xsl:attribute>
 724       </wwalinks:ALink>
 725      </xsl:variable>
 726      <xsl:variable name="VarCargoALink" select="msxsl:node-set($VarCargoALinkAsXML)" />
 727      <xsl:variable name="VarCargo" select="$ParamCargo/*/.. | $VarCargoALink" />
 728 
 729      <xsl:for-each select="$ParamSplits[1]">
 730       <!-- Determine image paths -->
 731       <!--                       -->
 732       <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)" />
 733       <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)" />
 734       <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)" />
 735       <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)" />
 736       <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)" />
 737 
 738       <html:table id="{concat('SummaryNotRequired_al', $ParamParagraph/@id)}" border="0" cellspacing="0" cellpadding="0" onClick="{$VarCargo/wwalinks:ALink[1]/@onClick}">
 739        <html:tr>
 740         <html:td height="2" colspan="4" bgcolor="#FFFFFF"></html:td>
 741         <html:td width="2" height="2" background="{$Var_seertup}"></html:td>
 742        </html:tr>
 743        <html:tr>
 744         <html:td width="2" height="2" bgcolor="#FFFFFF"></html:td>
 745         <html:td height="2" colspan="3" bgcolor="#EEEEEE"></html:td>
 746         <html:td width="2" height="2" background="{$Var_seeright}"></html:td>
 747        </html:tr>
 748        <html:tr>
 749         <html:td width="2" bgcolor="#FFFFFF"></html:td>
 750         <html:td width="2" bgcolor="#EEEEEE"></html:td>
 751         <html:td bgcolor="#EEEEEE">
 752 
 753          <xsl:call-template name="Paragraph-Normal">
 754           <xsl:with-param name="ParamSplits" select="$ParamSplits" />
 755           <xsl:with-param name="ParamCargo" select="$VarCargo" />
 756           <xsl:with-param name="ParamLinks" select="$ParamLinks" />
 757           <xsl:with-param name="ParamSplit" select="$ParamSplit" />
 758           <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
 759           <xsl:with-param name="ParamStyleName" select="$ParamStyleName" />
 760           <xsl:with-param name="ParamOverrideRule" select="$ParamOverrideRule" />
 761           <xsl:with-param name="ParamParagraphBehavior" select="$ParamParagraphBehavior" />
 762          </xsl:call-template>
 763 
 764         </html:td>
 765         <html:td width="2" bgcolor="#EEEEEE"></html:td>
 766         <html:td width="2" background="{$Var_seeright}"></html:td>
 767        </html:tr>
 768        <html:tr>
 769         <html:td width="2" height="2" bgcolor="#FFFFFF"></html:td>
 770         <html:td height="2" colspan="3" bgcolor="#EEEEEE"></html:td>
 771         <html:td width="2" height="2" background="{$Var_seeright}"></html:td>
 772        </html:tr>
 773        <html:tr>
 774         <html:td width="2" height="2" background="{$Var_seelflow}"></html:td>
 775         <html:td height="2" colspan="3" background="{$Var_seebttm}"></html:td>
 776         <html:td width="2" height="2" background="{$Var_seertlow}"></html:td>
 777        </html:tr>
 778       </html:table>
 779      </xsl:for-each>
 780     </xsl:when>
 781 
 782     <xsl:otherwise>
 783      <xsl:call-template name="Paragraph-Normal">
 784       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
 785       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
 786       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
 787       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
 788       <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
 789       <xsl:with-param name="ParamStyleName" select="$ParamStyleName" />
 790       <xsl:with-param name="ParamOverrideRule" select="$ParamOverrideRule" />
 791       <xsl:with-param name="ParamParagraphBehavior" select="$ParamParagraphBehavior" />
 792      </xsl:call-template>
 793     </xsl:otherwise>
 794    </xsl:choose>
 795   </xsl:if>
 796  </xsl:template>
 797 
 798 
 799  <xsl:template name="Paragraph-PassThrough">
 800   <xsl:param name="ParamParagraph" />
 801 
 802   <wwexsldoc:Text disable-output-escaping="yes">
 803    <xsl:for-each select="$ParamParagraph/wwdoc:TextRun/wwdoc:Text">
 804     <xsl:variable name="VarText" select="." />
 805 
 806     <xsl:value-of select="$VarText/@value" />
 807    </xsl:for-each>
 808   </wwexsldoc:Text>
 809  </xsl:template>
 810 
 811 
 812  <xsl:template name="Paragraph-Normal">
 813   <xsl:param name="ParamSplits" />
 814   <xsl:param name="ParamCargo" />
 815   <xsl:param name="ParamLinks" />
 816   <xsl:param name="ParamSplit" />
 817   <xsl:param name="ParamParagraph" />
 818   <xsl:param name="ParamStyleName" />
 819   <xsl:param name="ParamOverrideRule" />
 820   <xsl:param name="ParamParagraphBehavior" />
 821 
 822   <!-- Resolve project properties -->
 823   <!--                            -->
 824   <xsl:variable name="VarResolvedPropertiesAsXML">
 825    <xsl:call-template name="Properties-ResolveOverrideRule">
 826     <xsl:with-param name="ParamProperties" select="$ParamOverrideRule/wwproject:Properties/wwproject:Property" />
 827     <xsl:with-param name="ParamContextStyle" select="$ParamParagraph/wwdoc:Style" />
 828    </xsl:call-template>
 829   </xsl:variable>
 830   <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
 831 
 832   <!-- CSS properties -->
 833   <!--                -->
 834   <xsl:variable name="VarCSSPropertiesAsXML">
 835    <xsl:call-template name="CSS-TranslateProjectProperties">
 836     <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
 837     <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
 838     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
 839    </xsl:call-template>
 840   </xsl:variable>
 841   <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
 842 
 843   <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Paragraph', $ParamParagraph/@stylename, $ParamSplit/@documentID, $ParamParagraph/@id)" />
 844 
 845   <!-- Resolve project properties -->
 846   <!--                            -->
 847   <xsl:variable name="VarResolvedContextPropertiesAsXML">
 848    <xsl:call-template name="Properties-ResolveContextRule">
 849     <xsl:with-param name="ParamDocumentContext" select="$ParamParagraph" />
 850     <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
 851     <xsl:with-param name="ParamStyleName" select="$ParamParagraph/@stylename" />
 852     <xsl:with-param name="ParamStyleType" select="'Paragraph'" />
 853     <xsl:with-param name="ParamContextStyle" select="$ParamParagraph/wwdoc:Style" />
 854    </xsl:call-template>
 855   </xsl:variable>
 856   <xsl:variable name="VarResolvedContextProperties" select="msxsl:node-set($VarResolvedContextPropertiesAsXML)/wwproject:Property" />
 857 
 858   <!-- CSS properties -->
 859   <!--                -->
 860   <xsl:variable name="VarCSSContextPropertiesAsXML">
 861    <xsl:call-template name="CSS-TranslateProjectProperties">
 862     <xsl:with-param name="ParamProperties" select="$VarResolvedContextProperties" />
 863     <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
 864     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
 865    </xsl:call-template>
 866   </xsl:variable>
 867   <xsl:variable name="VarCSSContextProperties" select="msxsl:node-set($VarCSSContextPropertiesAsXML)/wwproject:Property" />
 868 
 869   <!-- Use numbering? -->
 870   <!--                -->
 871   <xsl:variable name="VarUseNumberingOption" select="$VarContextRule/wwproject:Options/wwproject:Option[@Name = 'use-numbering']/@Value" />
 872   <xsl:variable name="VarUseNumbering" select="(string-length($VarUseNumberingOption) = 0) or ($VarUseNumberingOption = 'true')" />
 873 
 874   <!-- Text Indent -->
 875   <!--             -->
 876   <xsl:variable name="VarTextIndent">
 877    <xsl:if test="$VarUseNumbering">
 878     <xsl:variable name="VarOverrideTextIndent" select="$VarCSSProperties[@Name = 'text-indent']/@Value" />
 879     <xsl:choose>
 880      <xsl:when test="string-length($VarOverrideTextIndent) &gt; 0">
 881       <xsl:value-of select="$VarOverrideTextIndent" />
 882      </xsl:when>
 883 
 884      <xsl:otherwise>
 885       <!-- Text indent defined? -->
 886       <!--                      -->
 887       <xsl:variable name="VarContextTextIndent" select="$VarCSSContextProperties[@Name = 'text-indent']/@Value" />
 888       <xsl:if test="string-length($VarContextTextIndent) &gt; 0">
 889        <xsl:value-of select="$VarContextTextIndent" />
 890       </xsl:if>
 891      </xsl:otherwise>
 892     </xsl:choose>
 893    </xsl:if>
 894   </xsl:variable>
 895 
 896   <xsl:variable name="VarTextIndentNumericPrefix" select="wwunits:NumericPrefix($VarTextIndent)" />
 897   <xsl:variable name="VarTextIndentLessThanZero" select="(string-length($VarTextIndentNumericPrefix) &gt; 0) and (number($VarTextIndentNumericPrefix) &lt; 0)" />
 898 
 899   <!-- Use bullet from UI? -->
 900   <!--                     -->
 901   <xsl:variable name="VarBulletCharacter" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-character']/@Value" />
 902   <xsl:variable name="VarBulletImage" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-image']/@Value" />
 903   <xsl:variable name="VarBulletSeparator" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-separator']/@Value" />
 904   <xsl:variable name="VarBulletStyle" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'bullet-style']/@Value" />
 905   <xsl:variable name="VarIgnoreDocumentNumber" select="(string-length($VarBulletCharacter) &gt; 0) or (string-length($VarBulletImage) &gt; 0) or (string-length($VarBulletSeparator) &gt; 0)" />
 906 
 907   <!-- Is numbered paragraph -->
 908   <!--                       -->
 909   <xsl:variable name="VarIsNumberedParagraph" select="($VarTextIndentLessThanZero = true()) and ((count($ParamParagraph/wwdoc:Number[1]) = 1) or (string-length($VarBulletCharacter) &gt; 0) or (string-length($VarBulletImage) &gt; 0) or (string-length($VarBulletSeparator) &gt; 0) or (string-length($VarBulletStyle) &gt; 0))" />
 910 
 911   <!-- Citation -->
 912   <!--          -->
 913   <xsl:variable name="VarCitation">
 914    <xsl:call-template name="Behaviors-Options-OptionMarker">
 915     <xsl:with-param name="ParamContainer" select="$ParamParagraph" />
 916     <xsl:with-param name="ParamCargo" select="$ParamCargo" />
 917     <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
 918     <xsl:with-param name="ParamRule" select="$VarContextRule" />
 919     <xsl:with-param name="ParamOption" select="'citation'" />
 920    </xsl:call-template>
 921   </xsl:variable>
 922 
 923   <!-- Tag -->
 924   <!--     -->
 925   <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
 926   <xsl:variable name="VarTag">
 927    <xsl:choose>
 928     <xsl:when test="string-length($VarTagProperty) &gt; 0">
 929      <xsl:value-of select="$VarTagProperty" />
 930     </xsl:when>
 931 
 932     <xsl:otherwise>
 933      <xsl:value-of select="'div'" />
 934     </xsl:otherwise>
 935    </xsl:choose>
 936   </xsl:variable>
 937 
 938   <!-- Use character styles? -->
 939   <!--                       -->
 940   <xsl:variable name="VarUseCharacterStylesOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'use-character-styles']/@Value" />
 941   <xsl:variable name="VarUseCharacterStyles" select="(string-length($VarUseCharacterStylesOption) = 0) or ($VarUseCharacterStylesOption = 'true')" />
 942 
 943   <!-- Preserve empty? -->
 944   <!--                 -->
 945   <xsl:variable name="VarPreserveEmptyOption" select="$ParamOverrideRule/wwproject:Options/wwproject:Option[@Name = 'preserve-empty']/@Value" />
 946   <xsl:variable name="VarPreserveEmpty" select="(string-length($VarPreserveEmptyOption) = 0) or ($VarPreserveEmptyOption = 'true')" />
 947 
 948   <!-- Begin paragraph emit -->
 949   <!--                      -->
 950   <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
 951    <!-- Class attribute -->
 952    <!--                 -->
 953    <xsl:attribute name="class">
 954     <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
 955     <xsl:if test="$VarIsNumberedParagraph = true()">
 956      <xsl:value-of select="'_outer'" />
 957     </xsl:if>
 958    </xsl:attribute>
 959 
 960    <!-- Style attribute -->
 961    <!--                 -->
 962    <xsl:choose>
 963     <xsl:when test="$VarIsNumberedParagraph = true()">
 964      <xsl:variable name="VarStyleAttributeOuter">
 965       <xsl:call-template name="CSS-InlinePropertiesOuter">
 966        <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
 967        <xsl:with-param name="ParamContextProperties" select="$VarCSSContextProperties" />
 968       </xsl:call-template>
 969      </xsl:variable>
 970 
 971      <xsl:if test="string-length($VarStyleAttributeOuter) &gt; 0">
 972       <xsl:attribute name="style">
 973        <xsl:value-of select="$VarStyleAttributeOuter" />
 974       </xsl:attribute>
 975      </xsl:if>
 976     </xsl:when>
 977 
 978     <xsl:otherwise>
 979      <xsl:variable name="VarStyleAttribute">
 980       <xsl:call-template name="CSS-InlineProperties">
 981        <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
 982       </xsl:call-template>
 983      </xsl:variable>
 984 
 985      <xsl:if test="string-length($VarStyleAttribute) &gt; 0">
 986       <xsl:attribute name="style">
 987        <xsl:value-of select="$VarStyleAttribute" />
 988       </xsl:attribute>
 989      </xsl:if>
 990     </xsl:otherwise>
 991    </xsl:choose>
 992 
 993    <!-- Cite attribute -->
 994    <!--                -->
 995    <xsl:if test="string-length($VarCitation) &gt; 0">
 996     <xsl:attribute name="cite">
 997      <xsl:value-of select="$VarCitation" />
 998     </xsl:attribute>
 999    </xsl:if>
1000 
1001    <!-- Dropdown -->
1002    <!--          -->
1003    <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1004     <xsl:attribute name="onclick">
1005      <xsl:value-of select="concat('WebWorks_ToggleDIV(WebWorksRootPath, &quot;wwdd', $ParamParagraph/@id, '&quot;);')" />
1006     </xsl:attribute>
1007    </xsl:if>
1008 
1009    <!-- Use numbering? -->
1010    <!--                -->
1011    <xsl:choose>
1012     <!-- Use Number -->
1013     <!--            -->
1014     <xsl:when test="$VarUseNumbering">
1015      <xsl:choose>
1016       <xsl:when test="(count($ParamParagraph/wwdoc:Number[1]) &gt; 0) or (string-length($VarBulletCharacter) &gt; 0) or  (string-length($VarBulletImage) &gt; 0) or (string-length($VarBulletSeparator) &gt; 0)">
1017        <xsl:choose>
1018         <xsl:when test="$VarTextIndentLessThanZero">
1019 
1020          <html:table border="0" cellspacing="0" cellpadding="0" id="{concat('SummaryNotRequired_np', $ParamParagraph/@id)}">
1021           <html:tr style="vertical-align: baseline;">
1022            <html:td>
1023             <!-- Emit number with inner class and specific number style attribute -->
1024             <!--                                                                  -->
1025             <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1026              <xsl:attribute name="class">
1027               <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
1028               <xsl:text>_inner</xsl:text>
1029              </xsl:attribute>
1030 
1031              <xsl:variable name="VarTextIndentNumberAsUnits" select="wwunits:NumericPrefix($VarTextIndent)" />
1032              <xsl:variable name="VarTextIndentUnits" select="wwunits:UnitsSuffix($VarTextIndent)" />
1033 
1034              <xsl:attribute name="style">
1035               <xsl:value-of select="concat('width: ', 0 - $VarTextIndentNumberAsUnits, $VarTextIndentUnits, '; white-space: nowrap;')" />
1036               <xsl:call-template name="CSS-InlinePropertiesInnerNumber">
1037                <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1038               </xsl:call-template>
1039              </xsl:attribute>
1040 
1041              <xsl:call-template name="Number">
1042               <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1043               <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1044               <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1045               <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1046               <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1047               <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1048               <xsl:with-param name="ParamIgnoreDocumentNumber" select="$VarIgnoreDocumentNumber" />
1049               <xsl:with-param name="ParamCharacter" select="$VarBulletCharacter" />
1050               <xsl:with-param name="ParamImage" select="$VarBulletImage" />
1051               <xsl:with-param name="ParamSeparator" select="$VarBulletSeparator" />
1052               <xsl:with-param name="ParamStyle" select="$VarBulletStyle" />
1053              </xsl:call-template>
1054             </xsl:element>
1055            </html:td>
1056 
1057            <!-- Force second cell to honor first cell width -->
1058            <!--                                             -->
1059            <html:td width="100%">
1060             <xsl:variable name="VarStyleAttributeInnerContent">
1061              <xsl:call-template name="CSS-InlinePropertiesInnerContent">
1062               <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1063              </xsl:call-template>
1064             </xsl:variable>
1065 
1066             <!-- Emit content -->
1067             <!--              -->
1068             <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1069              <xsl:attribute name="class">
1070               <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
1071               <xsl:text>_inner</xsl:text>
1072              </xsl:attribute>
1073              <xsl:if test="string-length($VarStyleAttributeInnerContent) &gt; 0">
1074               <xsl:attribute name="style">
1075                <xsl:value-of select="$VarStyleAttributeInnerContent" />
1076               </xsl:attribute>
1077              </xsl:if>
1078 
1079              <!-- Text Runs -->
1080              <!--           -->
1081              <xsl:call-template name="ParagraphTextRuns">
1082               <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1083               <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1084               <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1085               <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1086               <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1087               <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1088               <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1089              </xsl:call-template>
1090             </xsl:element>
1091            </html:td>
1092           </html:tr>
1093          </html:table>
1094         </xsl:when>
1095 
1096         <xsl:otherwise>
1097          <xsl:call-template name="Number">
1098           <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1099           <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1100           <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1101           <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1102           <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1103           <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1104           <xsl:with-param name="ParamIgnoreDocumentNumber" select="$VarIgnoreDocumentNumber" />
1105           <xsl:with-param name="ParamCharacter" select="$VarBulletCharacter" />
1106           <xsl:with-param name="ParamImage" select="$VarBulletImage" />
1107           <xsl:with-param name="ParamSeparator" select="$VarBulletSeparator" />
1108           <xsl:with-param name="ParamStyle" select="$VarBulletStyle" />
1109          </xsl:call-template>
1110 
1111          <!-- Text Runs -->
1112          <!--           -->
1113          <xsl:call-template name="ParagraphTextRuns">
1114           <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1115           <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1116           <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1117           <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1118           <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1119           <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1120           <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1121          </xsl:call-template>
1122         </xsl:otherwise>
1123        </xsl:choose>
1124       </xsl:when>
1125 
1126       <xsl:otherwise>
1127        <!-- Text Runs -->
1128        <!--           -->
1129        <xsl:call-template name="ParagraphTextRuns">
1130         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1131         <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1132         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1133         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1134         <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1135         <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1136         <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1137        </xsl:call-template>
1138       </xsl:otherwise>
1139      </xsl:choose>
1140     </xsl:when>
1141 
1142     <!-- Skip Number -->
1143     <!--             -->
1144     <xsl:otherwise>
1145      <!-- Text Runs -->
1146      <!--           -->
1147      <xsl:call-template name="ParagraphTextRuns">
1148       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1149       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1150       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1151       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1152       <xsl:with-param name="ParamPreserveEmpty" select="$VarPreserveEmpty" />
1153       <xsl:with-param name="ParamUseCharacterStyles" select="$VarUseCharacterStyles" />
1154       <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1155      </xsl:call-template>
1156     </xsl:otherwise>
1157    </xsl:choose>
1158 
1159    <!-- Dropdown Arrow -->
1160    <!--                -->
1161    <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1162     <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteArrow(WebWorksRootPath, &quot;<xsl:value-of select="concat('wwdd', $ParamParagraph/@id)" />&quot;, <xsl:value-of select="$ParamParagraphBehavior/@dropdown = 'start-open'" />);</html:script>
1163    </xsl:if>
1164 
1165   <!-- End paragraph emit -->
1166   <!--                    -->
1167   </xsl:element>
1168 
1169   <!-- Dropdown Start -->
1170   <!--                -->
1171   <xsl:if test="($ParamParagraphBehavior/@dropdown = 'start-open') or ($ParamParagraphBehavior/@dropdown = 'start-closed')">
1172    <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVOpen(&quot;<xsl:value-of select="concat('wwdd', $ParamParagraph/@id)" />&quot;, <xsl:value-of select="$ParamParagraphBehavior/@dropdown = 'start-open'" />);</html:script>
1173   </xsl:if>
1174 
1175   <!-- Dropdown End -->
1176   <!--              -->
1177   <xsl:if test="$ParamParagraphBehavior/@dropdown = 'end'">
1178    <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVClose();</html:script>
1179   </xsl:if>
1180  </xsl:template>
1181 
1182 
1183  <xsl:template name="Number">
1184   <xsl:param name="ParamSplits" />
1185   <xsl:param name="ParamCargo" />
1186   <xsl:param name="ParamLinks" />
1187   <xsl:param name="ParamSplit" />
1188   <xsl:param name="ParamParagraph" />
1189   <xsl:param name="ParamUseCharacterStyles" />
1190   <xsl:param name="ParamIgnoreDocumentNumber" />
1191   <xsl:param name="ParamCharacter" />
1192   <xsl:param name="ParamImage" />
1193   <xsl:param name="ParamSeparator" />
1194   <xsl:param name="ParamStyle" />
1195 
1196   <xsl:choose>
1197    <xsl:when test="$ParamIgnoreDocumentNumber">
1198     <xsl:call-template name="Content-Bullet">
1199      <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1200      <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1201      <xsl:with-param name="ParamParagraph" select="$ParamParagraph" />
1202      <xsl:with-param name="ParamCharacter" select="$ParamCharacter" />
1203      <xsl:with-param name="ParamImage" select="$ParamImage" />
1204      <xsl:with-param name="ParamSeparator" select="$ParamSeparator" />
1205      <xsl:with-param name="ParamStyle" select="$ParamStyle" />
1206     </xsl:call-template>
1207    </xsl:when>
1208 
1209    <xsl:otherwise>
1210     <xsl:variable name="VarBulletPropertiesAsXML">
1211      <wwproject:BulletProperties>
1212       <wwproject:Property Name="bullet-style" Value="{$ParamStyle}" />
1213      </wwproject:BulletProperties>
1214     </xsl:variable>
1215     <xsl:variable name="VarBulletProperties" select="msxsl:node-set($VarBulletPropertiesAsXML)" />
1216 
1217     <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'BulletProperties']/.. | $VarBulletProperties" />
1218 
1219     <xsl:call-template name="TextRun">
1220      <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1221      <xsl:with-param name="ParamCargo" select="$VarCargo" />
1222      <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1223      <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1224      <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
1225      <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1226      <xsl:with-param name="ParamTextRun" select="$ParamParagraph/wwdoc:Number[1]" />
1227      <xsl:with-param name="ParamPosition" select="0" />
1228     </xsl:call-template>
1229    </xsl:otherwise>
1230   </xsl:choose>
1231  </xsl:template>
1232 
1233 
1234  <xsl:template name="ParagraphTextRuns">
1235   <xsl:param name="ParamSplits" />
1236   <xsl:param name="ParamCargo" />
1237   <xsl:param name="ParamLinks" />
1238   <xsl:param name="ParamSplit" />
1239   <xsl:param name="ParamPreserveEmpty" />
1240   <xsl:param name="ParamUseCharacterStyles" />
1241   <xsl:param name="ParamParagraph" />
1242 
1243   <!-- Prevent whitespace issues with preformatted text blocks -->
1244   <!--                                                         -->
1245   <wwexsldoc:NoBreak />
1246 
1247   <!-- Non-empty text runs -->
1248   <!--                     -->
1249   <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]) &gt; 0]" />
1250 
1251   <!-- Check for empty paragraphs -->
1252   <!--                            -->
1253   <xsl:choose>
1254    <xsl:when test="count($VarTextRuns[1]) = 1">
1255     <!-- Paragraph has content -->
1256     <!--                       -->
1257     <xsl:for-each select="$VarTextRuns">
1258      <xsl:variable name="VarTextRun" select="." />
1259 
1260      <xsl:call-template name="TextRun">
1261       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1262       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1263       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1264       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1265       <xsl:with-param name="ParamParagraphID" select="$ParamParagraph/@id" />
1266       <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1267       <xsl:with-param name="ParamTextRun" select="$VarTextRun" />
1268       <xsl:with-param name="ParamPosition" select="position()" />
1269      </xsl:call-template>
1270     </xsl:for-each>
1271    </xsl:when>
1272 
1273    <xsl:otherwise>
1274     <!-- Empty paragraph! -->
1275     <!--                  -->
1276     <xsl:if test="$ParamPreserveEmpty">
1277      <html:a name="{$ParamParagraph/@id}">&#160;</html:a>
1278     </xsl:if>
1279    </xsl:otherwise>
1280   </xsl:choose>
1281  </xsl:template>
1282 
1283 
1284  <xsl:template name="SplitOnSemicolon">
1285   <xsl:param name="ParamString" />
1286 
1287   <xsl:choose>
1288    <xsl:when test="contains($ParamString, ';')">
1289     <xsl:variable name="VarPrefix" select="substring-before($ParamString, ';')" />
1290     <xsl:variable name="VarSuffix" select="substring-after($ParamString, ';')" />
1291 
1292     <xsl:call-template name="SplitOnSemicolon">
1293      <xsl:with-param name="ParamString" select="$VarPrefix" />
1294     </xsl:call-template>
1295     <xsl:call-template name="SplitOnSemicolon">
1296      <xsl:with-param name="ParamString" select="$VarSuffix" />
1297     </xsl:call-template>
1298    </xsl:when>
1299 
1300    <xsl:otherwise>
1301     <xsl:variable name="VarNormalizedString" select="normalize-space($ParamString)" />
1302 
1303     <xsl:if test="string-length($VarNormalizedString) &gt; 0">
1304      <wwdoc:Text value="{$VarNormalizedString}" />
1305     </xsl:if>
1306    </xsl:otherwise>
1307   </xsl:choose>
1308  </xsl:template>
1309 
1310 
1311  <xsl:template name="ALinkEntries">
1312   <xsl:param name="ParamMarkers" />
1313 
1314   <xsl:variable name="VarALinkKeywordsAsXML">
1315    <xsl:for-each select="$ParamMarkers">
1316     <xsl:variable name="VarMarker" select="." />
1317 
1318     <xsl:variable name="VarMarkerRule" select="wwprojext:GetRule('Marker', $VarMarker/@name)" />
1319     <xsl:variable name="VarMarkerType" select="$VarMarkerRule/wwproject:Options/wwproject:Option[@Name = 'marker-type']/@Value" />
1320 
1321     <xsl:if test="$VarMarkerType = 'alink-link-keywords'">
1322      <xsl:variable name="VarMarkerText">
1323       <xsl:for-each select="$VarMarker/wwdoc:TextRun/wwdoc:Text">
1324        <xsl:value-of select="@value" />
1325       </xsl:for-each>
1326      </xsl:variable>
1327 
1328      <xsl:call-template name="SplitOnSemicolon">
1329       <xsl:with-param name="ParamString" select="$VarMarkerText" />
1330      </xsl:call-template>
1331     </xsl:if>
1332    </xsl:for-each>
1333   </xsl:variable>
1334   <xsl:variable name="VarALinkKeywords" select="msxsl:node-set($VarALinkKeywordsAsXML)/*" />
1335 
1336   <xsl:variable name="VarALinkUniqueKeywordsAsXML">
1337    <xsl:for-each select="$VarALinkKeywords">
1338     <xsl:variable name="VarText" select="." />
1339 
1340     <xsl:if test="count($VarText | key('wwdoc-text-by-value', $VarText/@value)[1]) = 1">
1341      <xsl:copy-of select="$VarText" />
1342     </xsl:if>
1343    </xsl:for-each>
1344   </xsl:variable>
1345   <xsl:variable name="VarALinkUniqueKeywords" select="msxsl:node-set($VarALinkUniqueKeywordsAsXML)/*" />
1346 
1347   <xsl:for-each select="$VarALinkUniqueKeywords">
1348    <xsl:variable name="VarText" select="." />
1349 
1350    <xsl:value-of select="concat('&quot;', $VarText/@value, '&quot;')" />
1351    <xsl:if test="position() != last()">
1352     <xsl:value-of select="', '" />
1353    </xsl:if>
1354   </xsl:for-each>
1355  </xsl:template>
1356 
1357 
1358  <xsl:template name="LinkInfo">
1359   <xsl:param name="ParamSplits" />
1360   <xsl:param name="ParamLinks" />
1361   <xsl:param name="ParamSplit" />
1362   <xsl:param name="ParamDocumentLink" />
1363 
1364   <xsl:element name="LinkInfo" namespace="urn:WebWorks-Engine-Links-Schema">
1365    <xsl:if test="count($ParamDocumentLink) &gt; 0">
1366     <!-- Resolve link -->
1367     <!--              -->
1368     <xsl:variable name="VarResolvedLinkInfoAsXML">
1369      <xsl:call-template name="Links-Resolve">
1370       <xsl:with-param name="ParamAllowBaggage" select="$ParameterAllowBaggage" />
1371       <xsl:with-param name="ParamAllowGroupToGroup" select="$ParameterAllowGroupToGroup" />
1372       <xsl:with-param name="ParamAllowURL" select="$ParameterAllowURL" />
1373       <xsl:with-param name="ParamBaggageSplitFileType" select="$ParameterBaggageSplitFileType" />
1374       <xsl:with-param name="ParamProject" select="$GlobalProject" />
1375       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1376       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1377       <xsl:with-param name="ParamSplitGroupID" select="$ParamSplit/@groupID" />
1378       <xsl:with-param name="ParamSplitDocumentID" select="$ParamSplit/@documentID" />
1379       <xsl:with-param name="ParamDocumentLink" select="$ParamDocumentLink" />
1380      </xsl:call-template>
1381     </xsl:variable>
1382     <xsl:variable name="VarResolvedLinkInfo" select="msxsl:node-set($VarResolvedLinkInfoAsXML)/wwlinks:ResolvedLink" />
1383 
1384     <xsl:choose>
1385      <!-- Baggage -->
1386      <!--         -->
1387      <xsl:when test="$VarResolvedLinkInfo/@type = 'baggage'">
1388       <xsl:variable name="VarRelativePath" select="wwuri:GetRelativeTo($VarResolvedLinkInfo/@path, $ParamSplit/@path)" />
1389 
1390       <xsl:attribute name="href">
1391        <xsl:value-of select="$VarRelativePath" />
1392       </xsl:attribute>
1393 
1394       <xsl:variable name="VarTarget" select="wwprojext:GetFormatSetting('baggage-file-target', '_window')" />
1395 
1396       <xsl:if test="(string-length($VarTarget) &gt; 0) and ($VarTarget != 'none')">
1397        <xsl:attribute name="target">
1398         <xsl:value-of select="$VarTarget" />
1399        </xsl:attribute>
1400       </xsl:if>
1401      </xsl:when>
1402 
1403      <!-- Document -->
1404      <!--          -->
1405      <xsl:when test="($VarResolvedLinkInfo/@type = 'document') or ($VarResolvedLinkInfo/@type = 'group') or ($VarResolvedLinkInfo/@type = 'project')">
1406       <!-- Valid link -->
1407       <!--            -->
1408       <xsl:variable name="VarGroupName" select="wwprojext:GetGroupName($VarResolvedLinkInfo/@groupID)" />
1409       <xsl:variable name="VarOutputDirectoryPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), $VarGroupName)" />
1410       <xsl:variable name="VarLinkPath" select="wwuri:GetRelativeTo($VarResolvedLinkInfo/@path, wwfilesystem:Combine($VarOutputDirectoryPath, 'dummy.component'))" />
1411       <xsl:variable name="VarPopupPath">
1412        <xsl:for-each select="$GlobalProjectSplits[1]">
1413         <xsl:variable name="VarSplitsPopups" select="key('wwsplits-popups-by-id', $VarResolvedLinkInfo/@linkid)[@documentID = $VarResolvedLinkInfo/@documentID]" />
1414         <xsl:for-each select="$VarSplitsPopups[1]">
1415          <xsl:variable name="VarSplitsPopup" select="." />
1416 
1417          <xsl:value-of select="wwuri:GetRelativeTo($VarSplitsPopup/@path, wwfilesystem:Combine($VarOutputDirectoryPath, 'dummy.component'))" />
1418         </xsl:for-each>
1419        </xsl:for-each>
1420       </xsl:variable>
1421 
1422       <!-- Popup only? -->
1423       <!--             -->
1424 
1425       <xsl:attribute name="href">
1426        <!-- JavaScript Link -->
1427        <!--                 -->
1428        <xsl:text>javascript:WWHClickedPopup('</xsl:text>
1429 
1430        <!-- Context -->
1431        <!--         -->
1432        <xsl:call-template name="WWHelpContext">
1433         <xsl:with-param name="ParamProject" select="$GlobalProject" />
1434         <xsl:with-param name="ParamGroupID" select="$VarResolvedLinkInfo/@groupID" />
1435        </xsl:call-template>
1436        <xsl:text>', '</xsl:text>
1437 
1438        <!-- Link -->
1439        <!--      -->
1440        <xsl:if test="(string-length($VarResolvedLinkInfo/@popup-only) = 0) or ($VarResolvedLinkInfo/@popup-only != 'true')">
1441         <xsl:value-of select="wwstring:JavaScriptEncoding($VarLinkPath)" />
1442         <xsl:if test="(string-length($ParamDocumentLink/@anchor) &gt; 0) and (string-length($VarResolvedLinkInfo/@linkid) &gt; 0)">
1443          <xsl:text>#</xsl:text>
1444          <xsl:value-of select="wwstring:JavaScriptEncoding($VarResolvedLinkInfo/@linkid)" />
1445         </xsl:if>
1446        </xsl:if>
1447        <xsl:text>', '</xsl:text>
1448 
1449        <!-- Popup Link -->
1450        <!--            -->
1451        <xsl:value-of select="wwstring:JavaScriptEncoding($VarPopupPath)" />
1452        <xsl:text>');</xsl:text>
1453       </xsl:attribute>
1454 
1455       <!-- Popup -->
1456       <!--       -->
1457       <xsl:if test="$VarResolvedLinkInfo/@popup = 'true'">
1458 
1459        <!-- Custom Popup link override -->
1460        <!--                            -->
1461        <xsl:attribute name="class">
1462          <xsl:value-of select="wwstring:CSSClassName('Popup')" />
1463        </xsl:attribute>
1464        <!--                            -->
1465  
1466        <xsl:attribute name="onMouseOver">
1467         <!-- JavaScript Link -->
1468         <!--                 -->
1469         <xsl:text>javascript:WWHShowPopup('</xsl:text>
1470 
1471         <!-- Context -->
1472         <!--         -->
1473         <xsl:call-template name="WWHelpContext">
1474          <xsl:with-param name="ParamProject" select="$GlobalProject" />
1475          <xsl:with-param name="ParamGroupID" select="$VarResolvedLinkInfo/@groupID" />
1476         </xsl:call-template>
1477         <xsl:text>', '</xsl:text>
1478 
1479         <!-- Popup Link -->
1480         <!--            -->
1481         <xsl:value-of select="wwstring:JavaScriptEncoding($VarPopupPath)" />
1482         <xsl:text>', (document.all||document.getElementById||document.layers)?event:null);</xsl:text>
1483        </xsl:attribute>
1484 
1485        <xsl:attribute name="onMouseOut">
1486         <xsl:text>WWHHidePopup();</xsl:text>
1487        </xsl:attribute>
1488 
1489 
1490       </xsl:if>
1491      </xsl:when>
1492 
1493      <!-- URL -->
1494      <!--     -->
1495      <xsl:when test="$VarResolvedLinkInfo/@type = 'url'">
1496       <xsl:attribute name="href">
1497        <xsl:value-of select="$VarResolvedLinkInfo/@url" />
1498       </xsl:attribute>
1499 
1500       <!-- External URL Target -->
1501       <!--                     -->
1502       <xsl:if test="not(wwuri:IsFile($VarResolvedLinkInfo/@url))">
1503        <xsl:variable name="VarTarget" select="wwprojext:GetFormatSetting('external-url-target', '_window')" />
1504 
1505        <xsl:if test="(string-length($VarTarget) &gt; 0) and ($VarTarget != 'none')">
1506         <xsl:attribute name="target">
1507          <xsl:value-of select="$VarTarget" />
1508         </xsl:attribute>
1509        </xsl:if>
1510       </xsl:if>
1511      </xsl:when>
1512     </xsl:choose>
1513    </xsl:if>
1514   </xsl:element>
1515  </xsl:template>
1516 
1517 
1518  <xsl:template name="TextRun">
1519   <xsl:param name="ParamSplits" />
1520   <xsl:param name="ParamCargo" />
1521   <xsl:param name="ParamLinks" />
1522   <xsl:param name="ParamSplit" />
1523   <xsl:param name="ParamParagraphID" />
1524   <xsl:param name="ParamUseCharacterStyles" />
1525   <xsl:param name="ParamTextRun" />
1526   <xsl:param name="ParamPosition" />
1527 
1528   <!-- Get rule -->
1529   <!--          -->
1530   <xsl:variable name="VarRule" select="wwprojext:GetRule('Character', $ParamTextRun/@stylename)" />
1531 
1532   <!-- Generate output? -->
1533   <!---                 -->
1534   <xsl:variable name="VarGenerateOutputOption" select="$VarRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
1535   <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
1536   <xsl:if test="$VarGenerateOutput">
1537    <!-- Pass-through? -->
1538    <!--               -->
1539    <xsl:variable name="VarPassThrough">
1540     <xsl:call-template name="Conditions-PassThrough">
1541      <xsl:with-param name="ParamConditions" select="$ParamTextRun/wwdoc:Conditions" />
1542     </xsl:call-template>
1543    </xsl:variable>
1544 
1545    <xsl:choose>
1546     <xsl:when test="$VarPassThrough = 'true'">
1547      <xsl:call-template name="TextRun-PassThrough">
1548       <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1549      </xsl:call-template>
1550     </xsl:when>
1551 
1552     <xsl:otherwise>
1553      <!-- A-Link? -->
1554      <!--         -->
1555      <xsl:variable name="VarALinkOption" select="$VarRule/wwproject:Options/wwproject:Option[@Name = 'alink']/@Value" />
1556      <xsl:variable name="VarALink" select="$VarALinkOption = 'true'" />
1557 
1558      <xsl:choose>
1559       <!-- Handle A-Links -->
1560       <!--                -->
1561       <xsl:when test="(count($ParamCargo/wwalinks:ALink[1]) = 0) and ($VarALink)">
1562        <!-- Update cargo -->
1563        <!--              -->
1564        <xsl:variable name="VarCargoALinkAsXML">
1565         <xsl:variable name="VarALinkEntries">
1566          <xsl:call-template name="ALinkEntries">
1567           <xsl:with-param name="ParamMarkers" select="$ParamTextRun/wwdoc:Marker" />
1568          </xsl:call-template>
1569         </xsl:variable>
1570 
1571         <wwalinks:ALink>
1572          <xsl:attribute name="href">
1573           <xsl:value-of select="'javascript:WWHDoNothingHREF();'" />
1574          </xsl:attribute>
1575          <xsl:attribute name="onClick">
1576           <xsl:value-of select="concat('WWHShowALinksPopup(new Array(', $VarALinkEntries, '), (document.all||document.getElementById||document.layers)?event:null);')" />
1577          </xsl:attribute>
1578         </wwalinks:ALink>
1579        </xsl:variable>
1580        <xsl:variable name="VarCargoALink" select="msxsl:node-set($VarCargoALinkAsXML)" />
1581        <xsl:variable name="VarCargo" select="$ParamCargo/*/.. | $VarCargoALink" />
1582 
1583        <xsl:call-template name="TextRun-Normal">
1584         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1585         <xsl:with-param name="ParamCargo" select="$VarCargo" />
1586         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1587         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1588         <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1589         <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1590         <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1591         <xsl:with-param name="ParamRule" select="$VarRule" />
1592         <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1593        </xsl:call-template>
1594       </xsl:when>
1595 
1596       <xsl:otherwise>
1597        <xsl:call-template name="TextRun-Normal">
1598         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1599         <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1600         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1601         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1602         <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1603         <xsl:with-param name="ParamUseCharacterStyles" select="$ParamUseCharacterStyles" />
1604         <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1605         <xsl:with-param name="ParamRule" select="$VarRule" />
1606         <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1607        </xsl:call-template>
1608       </xsl:otherwise>
1609      </xsl:choose>
1610     </xsl:otherwise>
1611    </xsl:choose>
1612   </xsl:if>
1613  </xsl:template>
1614 
1615 
1616  <xsl:template name="TextRun-PassThrough">
1617   <xsl:param name="ParamTextRun" />
1618 
1619   <wwexsldoc:Text disable-output-escaping="yes">
1620    <xsl:for-each select="$ParamTextRun/wwdoc:Text">
1621     <xsl:variable name="VarText" select="." />
1622 
1623     <xsl:value-of select="$VarText/@value" />
1624    </xsl:for-each>
1625   </wwexsldoc:Text>
1626  </xsl:template>
1627 
1628 
1629  <xsl:template name="TextRun-Normal">
1630   <xsl:param name="ParamSplits" />
1631   <xsl:param name="ParamCargo" />
1632   <xsl:param name="ParamLinks" />
1633   <xsl:param name="ParamSplit" />
1634   <xsl:param name="ParamParagraphID" />
1635   <xsl:param name="ParamUseCharacterStyles" />
1636   <xsl:param name="ParamTextRun" />
1637   <xsl:param name="ParamRule" />
1638   <xsl:param name="ParamPosition" />
1639 
1640   <xsl:choose>
1641    <xsl:when test="($ParamUseCharacterStyles) and ((string-length($ParamTextRun/@stylename) &gt; 0) or (count($ParamTextRun/wwdoc:Style) = 1))">
1642     <!-- Get override rule -->
1643     <!--                   -->
1644     <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Character', $ParamTextRun/@stylename, $ParamSplit/@documentID, $ParamTextRun/@id)" />
1645 
1646     <!-- Resolve project properties -->
1647     <!--                            -->
1648     <xsl:variable name="VarResolvedPropertiesAsXML">
1649      <xsl:call-template name="Properties-ResolveOverrideRule">
1650       <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
1651       <xsl:with-param name="ParamContextStyle" select="$ParamTextRun/wwdoc:Style" />
1652      </xsl:call-template>
1653     </xsl:variable>
1654     <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
1655 
1656     <!-- CSS properties -->
1657     <!--                -->
1658     <xsl:variable name="VarCSSPropertiesAsXML">
1659      <xsl:call-template name="CSS-TranslateProjectProperties">
1660       <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
1661       <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
1662       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1663      </xsl:call-template>
1664     </xsl:variable>
1665     <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
1666 
1667     <!-- Abbreviation -->
1668     <!--              -->
1669     <xsl:variable name="VarAbbreviationTitle">
1670      <xsl:call-template name="Behaviors-Options-OptionMarker">
1671       <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1672       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1673       <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1674       <xsl:with-param name="ParamRule" select="$ParamRule" />
1675       <xsl:with-param name="ParamOption" select="'abbreviation'" />
1676      </xsl:call-template>
1677     </xsl:variable>
1678 
1679     <!-- Acronym -->
1680     <!--         -->
1681     <xsl:variable name="VarAcronymTitle">
1682      <xsl:call-template name="Behaviors-Options-OptionMarker">
1683       <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1684       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1685       <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1686       <xsl:with-param name="ParamRule" select="$ParamRule" />
1687       <xsl:with-param name="ParamOption" select="'acronym'" />
1688      </xsl:call-template>
1689     </xsl:variable>
1690 
1691     <!-- Citation -->
1692     <!--          -->
1693     <xsl:variable name="VarCitation">
1694      <xsl:call-template name="Behaviors-Options-OptionMarker">
1695       <xsl:with-param name="ParamContainer" select="$ParamTextRun" />
1696       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1697       <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1698       <xsl:with-param name="ParamRule" select="$ParamRule" />
1699       <xsl:with-param name="ParamOption" select="'citation'" />
1700      </xsl:call-template>
1701     </xsl:variable>
1702 
1703     <!-- Tag -->
1704     <!--     -->
1705     <xsl:variable name="VarTagProperty" select="$ParamRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
1706     <xsl:variable name="VarTag">
1707      <xsl:choose>
1708       <xsl:when test="string-length($VarAbbreviationTitle) &gt; 0">
1709        <xsl:value-of select="'abbr'" />
1710       </xsl:when>
1711       <xsl:when test="string-length($VarAcronymTitle) &gt; 0">
1712        <xsl:value-of select="'acronym'" />
1713       </xsl:when>
1714       <xsl:when test="string-length($VarCitation) &gt; 0">
1715        <xsl:value-of select="'q'" />
1716       </xsl:when>
1717       <xsl:otherwise>
1718        <xsl:choose>
1719         <xsl:when test="string-length($VarTagProperty) &gt; 0">
1720          <xsl:value-of select="$VarTagProperty" />
1721         </xsl:when>
1722 
1723         <xsl:otherwise>
1724          <xsl:value-of select="'span'" />
1725         </xsl:otherwise>
1726        </xsl:choose>
1727       </xsl:otherwise>
1728      </xsl:choose>
1729     </xsl:variable>
1730 
1731     <!-- Class attribute -->
1732     <!--                 -->
1733     <xsl:variable name="VarClassAttribute">
1734      <xsl:choose>
1735       <xsl:when test="string-length($ParamCargo/wwproject:BulletProperties/wwproject:Property[@Name = 'bullet-style']/@Value) &gt; 0">
1736        <xsl:value-of select="wwstring:CSSClassName($ParamCargo/wwproject:BulletProperties/wwproject:Property[@Name = 'bullet-style']/@Value)" />
1737       </xsl:when>
1738       <xsl:otherwise>
1739        <xsl:value-of select="wwstring:CSSClassName($ParamTextRun/@stylename)" />
1740       </xsl:otherwise>
1741      </xsl:choose>
1742     </xsl:variable>
1743 
1744     <!-- Style attribute -->
1745     <!--                 -->
1746     <xsl:variable name="VarStyleAttribute">
1747      <xsl:call-template name="CSS-InlineProperties">
1748       <xsl:with-param name="ParamProperties" select="$VarCSSProperties" />
1749      </xsl:call-template>
1750     </xsl:variable>
1751 
1752     <xsl:choose>
1753      <xsl:when test="(string-length($VarClassAttribute) &gt; 0) or (string-length($VarStyleAttribute) &gt; 0)">
1754       <!-- Character Style -->
1755       <!--                 -->
1756       <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
1757        <xsl:if test="string-length($VarClassAttribute) &gt; 0">
1758         <xsl:attribute name="class">
1759          <xsl:value-of select="$VarClassAttribute" />
1760         </xsl:attribute>
1761        </xsl:if>
1762        <xsl:if test="string-length($VarStyleAttribute) &gt; 0">
1763         <xsl:attribute name="style">
1764          <xsl:value-of select="$VarStyleAttribute" />
1765         </xsl:attribute>
1766        </xsl:if>
1767 
1768        <!-- Abbreviation title -->
1769        <!--                    -->
1770        <xsl:if test="string-length($VarAbbreviationTitle) &gt; 0">
1771         <xsl:attribute name="title">
1772          <xsl:value-of select="$VarAbbreviationTitle" />
1773         </xsl:attribute>
1774        </xsl:if>
1775 
1776        <!-- Acronym title -->
1777        <!--                    -->
1778        <xsl:if test="string-length($VarAcronymTitle) &gt; 0">
1779         <xsl:attribute name="title">
1780          <xsl:value-of select="$VarAcronymTitle" />
1781         </xsl:attribute>
1782        </xsl:if>
1783 
1784        <!-- Cite attribute -->
1785        <!--                -->
1786        <xsl:if test="string-length($VarCitation) &gt; 0">
1787         <xsl:attribute name="cite">
1788          <xsl:value-of select="$VarCitation" />
1789         </xsl:attribute>
1790        </xsl:if>
1791 
1792        <xsl:call-template name="TextRunChildren">
1793         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1794         <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1795         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1796         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1797         <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1798         <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1799         <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1800        </xsl:call-template>
1801       </xsl:element>
1802      </xsl:when>
1803 
1804      <xsl:otherwise>
1805       <!-- No style -->
1806       <!--          -->
1807       <xsl:call-template name="TextRunChildren">
1808        <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1809        <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1810        <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1811        <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1812        <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1813        <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1814        <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1815       </xsl:call-template>
1816      </xsl:otherwise>
1817     </xsl:choose>
1818    </xsl:when>
1819 
1820    <xsl:otherwise>
1821     <!-- No style -->
1822     <!--          -->
1823     <xsl:call-template name="TextRunChildren">
1824      <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1825      <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1826      <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1827      <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1828      <xsl:with-param name="ParamParagraphID" select="$ParamParagraphID" />
1829      <xsl:with-param name="ParamTextRun" select="$ParamTextRun" />
1830      <xsl:with-param name="ParamPosition" select="$ParamPosition" />
1831     </xsl:call-template>
1832    </xsl:otherwise>
1833   </xsl:choose>
1834  </xsl:template>
1835 
1836 
1837  <xsl:template name="TextRunChildren">
1838   <xsl:param name="ParamSplits" />
1839   <xsl:param name="ParamCargo" />
1840   <xsl:param name="ParamLinks" />
1841   <xsl:param name="ParamSplit" />
1842   <xsl:param name="ParamParagraphID" />
1843   <xsl:param name="ParamTextRun" />
1844   <xsl:param name="ParamPosition" />
1845 
1846   <!-- Force anchor on same line as containing span -->
1847   <!--                                              -->
1848   <wwexsldoc:NoBreak />
1849 
1850   <!-- Link? -->
1851   <!--       -->
1852   <xsl:variable name="VarLinkInfoAsXML">
1853    <xsl:call-template name="LinkInfo">
1854     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1855     <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1856     <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1857     <xsl:with-param name="ParamDocumentLink" select="$ParamTextRun/wwdoc:Link" />
1858    </xsl:call-template>
1859   </xsl:variable>
1860   <xsl:variable name="VarLinkInfo" select="msxsl:node-set($VarLinkInfoAsXML)/wwlinks:LinkInfo" />
1861 
1862   <!-- Handle links and first textrun anchor -->
1863   <!--                                       -->
1864   <xsl:choose>
1865    <xsl:when test="string-length($ParamCargo/wwalinks:ALink[1]/@href) &gt; 0">
1866     <html:a href="{$ParamCargo/wwalinks:ALink[1]/@href}" onClick="{$ParamCargo/wwalinks:ALink[1]/@onClick}">
1867      <xsl:if test="$ParamPosition = 1">
1868       <xsl:attribute name="name">
1869        <xsl:value-of select="$ParamParagraphID" />
1870       </xsl:attribute>
1871      </xsl:if>
1872 
1873      <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1874       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1875       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1876       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1877       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1878      </xsl:apply-templates>
1879     </html:a>
1880    </xsl:when>
1881 
1882    <xsl:when test="(string-length($VarLinkInfo/@href) &gt; 0) or (string-length($VarLinkInfo/@onMouseOver) &gt; 0)">
1883     <html:a>
1884 
1885      <!-- Custom Popup link override code -->
1886      <!--                                 -->
1887      <xsl:if test="string-length($VarLinkInfo/@class) &gt; 0">
1888       <xsl:attribute name="class">
1889        <xsl:value-of select="$VarLinkInfo/@class" />
1890       </xsl:attribute>
1891      </xsl:if>
1892      <!--                                 -->
1893  
1894      <xsl:if test="string-length($VarLinkInfo/@href) &gt; 0">
1895       <xsl:attribute name="href">
1896        <xsl:value-of select="$VarLinkInfo/@href" />
1897       </xsl:attribute>
1898      </xsl:if>
1899      <xsl:if test="string-length($VarLinkInfo/@target) &gt; 0">
1900       <xsl:attribute name="target">
1901        <xsl:value-of select="$VarLinkInfo/@target" />
1902       </xsl:attribute>
1903      </xsl:if>
1904      <xsl:if test="string-length($VarLinkInfo/@onMouseOver) &gt; 0">
1905       <xsl:attribute name="onMouseOver">
1906        <xsl:value-of select="$VarLinkInfo/@onMouseOver" />
1907       </xsl:attribute>
1908      </xsl:if>
1909      <xsl:if test="string-length($VarLinkInfo/@onMouseOut) &gt; 0">
1910       <xsl:attribute name="onMouseOut">
1911        <xsl:value-of select="$VarLinkInfo/@onMouseOut" />
1912       </xsl:attribute>
1913      </xsl:if>
1914  
1915      <xsl:if test="$ParamPosition = 1">
1916       <xsl:attribute name="name">
1917        <xsl:value-of select="$ParamParagraphID" />
1918       </xsl:attribute>
1919      </xsl:if>
1920 
1921      <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1922       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1923       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1924       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1925       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1926      </xsl:apply-templates>
1927     </html:a>
1928    </xsl:when>
1929 
1930    <xsl:when test="$ParamPosition = 1">
1931     <html:a name="{$ParamParagraphID}">
1932      <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1933       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1934       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1935       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1936       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1937      </xsl:apply-templates>
1938     </html:a>
1939    </xsl:when>
1940 
1941    <xsl:otherwise>
1942     <xsl:apply-templates select="$ParamTextRun/*" mode="wwmode:textrun">
1943      <xsl:with-param name="ParamSplits" select="$ParamSplits" />
1944      <xsl:with-param name="ParamCargo" select="$ParamCargo" />
1945      <xsl:with-param name="ParamLinks" select="$ParamLinks" />
1946      <xsl:with-param name="ParamSplit" select="$ParamSplit" />
1947     </xsl:apply-templates>
1948    </xsl:otherwise>
1949   </xsl:choose>
1950 
1951   <!-- Force anchor on same line as containing span -->
1952   <!--                                              -->
1953   <wwexsldoc:NoBreak />
1954  </xsl:template>
1955 
1956 
1957  <xsl:template match="wwdoc:Note" mode="wwmode:textrun">
1958   <xsl:param name="ParamSplits" />
1959   <xsl:param name="ParamCargo" />
1960   <xsl:param name="ParamLinks" />
1961   <xsl:param name="ParamSplit" />
1962 
1963   <xsl:variable name="VarContext" select="." />
1964 
1965   <!-- Implement notes -->
1966   <!--                 -->
1967   <xsl:for-each select="$ParamCargo/wwnotes:NoteNumbering[1]">
1968    <xsl:variable name="VarNoteNumber" select="key('wwnotes-notes-by-id', $VarContext/@id)/@number" />
1969 
1970    <!-- Force sup on same line as containing span -->
1971    <!--                                           -->
1972    <wwexsldoc:NoBreak />
1973 
1974    <html:sup>
1975     <!-- Force anchor on same line as containing sup -->
1976     <!--                                             -->
1977     <wwexsldoc:NoBreak />
1978 
1979     <html:a>
1980      <xsl:attribute name="name">
1981       <xsl:text>wwfootnote_inline_</xsl:text>
1982       <xsl:value-of select="$VarContext/@id" />
1983      </xsl:attribute>
1984      <xsl:attribute name="href">
1985       <xsl:text>#</xsl:text>
1986       <xsl:value-of select="$VarContext/@id" />
1987      </xsl:attribute>
1988 
1989      <xsl:value-of select="$VarNoteNumber" />
1990     </html:a>
1991    </html:sup>
1992   </xsl:for-each>
1993  </xsl:template>
1994 
1995 
1996  <xsl:template match="wwdoc:LineBreak" mode="wwmode:textrun">
1997   <xsl:param name="ParamSplits" />
1998   <xsl:param name="ParamCargo" />
1999   <xsl:param name="ParamLinks" />
2000   <xsl:param name="ParamSplit" />
2001 
2002   <html:br />
2003  </xsl:template>
2004 
2005 
2006  <xsl:template match="wwdoc:IndexMarker" mode="wwmode:textrun">
2007   <xsl:param name="ParamSplits" />
2008   <xsl:param name="ParamCargo" />
2009   <xsl:param name="ParamLinks" />
2010   <xsl:param name="ParamSplit" />
2011 
2012   <!-- Ignore index markers -->
2013   <!--                      -->
2014  </xsl:template>
2015 
2016 
2017  <xsl:template match="wwdoc:Marker" mode="wwmode:textrun">
2018   <xsl:param name="ParamSplits" />
2019   <xsl:param name="ParamCargo" />
2020   <xsl:param name="ParamLinks" />
2021   <xsl:param name="ParamSplit" />
2022 
2023   <!-- Ignore markers -->
2024   <!--                -->
2025  </xsl:template>
2026 
2027 
2028  <xsl:template match="wwdoc:Text" mode="wwmode:textrun">
2029   <xsl:param name="ParamSplits" />
2030   <xsl:param name="ParamCargo" />
2031   <xsl:param name="ParamLinks" />
2032   <xsl:param name="ParamSplit" />
2033 
2034   <xsl:value-of select="@value" />
2035  </xsl:template>
2036 
2037 
2038  <xsl:template match="wwdoc:Table" mode="wwmode:content">
2039   <xsl:param name="ParamSplits" />
2040   <xsl:param name="ParamCargo" />
2041   <xsl:param name="ParamLinks" />
2042   <xsl:param name="ParamTOCData" />
2043   <xsl:param name="ParamSplit" />
2044 
2045   <xsl:variable name="VarTable" select="." />
2046 
2047   <!-- Aborted? -->
2048   <!--          -->
2049   <xsl:if test="not(wwprogress:Abort())">
2050    <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Table', $VarTable/@stylename, $ParamSplit/@documentID, $VarTable/@id)" />
2051    <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2052    <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2053    <xsl:if test="$VarGenerateOutput">
2054 
2055     <!-- Get behavior -->
2056     <!--              -->
2057     <xsl:for-each select="$ParamCargo/wwbehaviors:Behaviors[1]">
2058      <xsl:variable name="VarTableBehavior" select="key('wwbehaviors-tables-by-id', $VarTable/@id)[1]" />
2059 
2060      <!-- Table -->
2061      <!--       -->
2062      <xsl:call-template name="Table">
2063       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2064       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2065       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2066       <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2067       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2068       <xsl:with-param name="ParamTable" select="$VarTable" />
2069       <xsl:with-param name="ParamStyleName" select="$VarTable/@stylename" />
2070       <xsl:with-param name="ParamOverrideRule" select="$VarOverrideRule" />
2071       <xsl:with-param name="ParamTableBehavior" select="$VarTableBehavior" />
2072      </xsl:call-template>
2073     </xsl:for-each>
2074    </xsl:if>
2075   </xsl:if>
2076  </xsl:template>
2077 
2078 
2079  <xsl:template name="Table">
2080   <xsl:param name="ParamSplits" />
2081   <xsl:param name="ParamCargo" />
2082   <xsl:param name="ParamLinks" />
2083   <xsl:param name="ParamTOCData" />
2084   <xsl:param name="ParamSplit" />
2085   <xsl:param name="ParamTable" />
2086   <xsl:param name="ParamStyleName" />
2087   <xsl:param name="ParamOverrideRule" />
2088   <xsl:param name="ParamTableBehavior" />
2089 
2090   <!-- Notes -->
2091   <!--       -->
2092   <xsl:variable name="VarNotes" select="$ParamTable//wwdoc:Note[not(ancestor::wwdoc:Frame)]" />
2093 
2094   <!-- Note numbering -->
2095   <!--                -->
2096   <xsl:variable name="VarNoteNumberingAsXML">
2097    <xsl:call-template name="Notes-Number">
2098     <xsl:with-param name="ParamNotes" select="$VarNotes" />
2099    </xsl:call-template>
2100   </xsl:variable>
2101   <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2102 
2103   <!-- Cargo for recursion -->
2104   <!--                     -->
2105   <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2106 
2107   <!-- Resolve project properties -->
2108   <!--                            -->
2109   <xsl:variable name="VarResolvedPropertiesAsXML">
2110    <xsl:call-template name="Properties-ResolveOverrideRule">
2111     <xsl:with-param name="ParamProperties" select="$ParamOverrideRule/wwproject:Properties/wwproject:Property" />
2112     <xsl:with-param name="ParamContextStyle" select="$ParamTable/wwdoc:Style" />
2113    </xsl:call-template>
2114   </xsl:variable>
2115   <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2116 
2117   <!-- CSS properties -->
2118   <!--                -->
2119   <xsl:variable name="VarCSSPropertiesAsXML">
2120    <xsl:call-template name="CSS-TranslateProjectProperties">
2121     <xsl:with-param name="ParamProperties" select="$VarResolvedProperties" />
2122     <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2123     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2124    </xsl:call-template>
2125   </xsl:variable>
2126   <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2127 
2128   <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Table', $ParamTable/@stylename, $ParamSplit/@documentID, $ParamTable/@id)" />
2129 
2130   <!-- Resolve project properties -->
2131   <!--                            -->
2132   <xsl:variable name="VarResolvedContextPropertiesAsXML">
2133    <xsl:call-template name="Properties-ResolveContextRule">
2134     <xsl:with-param name="ParamDocumentContext" select="$ParamTable" />
2135     <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
2136     <xsl:with-param name="ParamStyleName" select="$ParamTable/@stylename" />
2137     <xsl:with-param name="ParamStyleType" select="'Table'" />
2138     <xsl:with-param name="ParamContextStyle" select="$ParamTable/wwdoc:Style" />
2139    </xsl:call-template>
2140   </xsl:variable>
2141   <xsl:variable name="VarResolvedContextProperties" select="msxsl:node-set($VarResolvedContextPropertiesAsXML)/wwproject:Property" />
2142 
2143   <!-- Table class -->
2144   <!--             -->
2145   <xsl:variable name="VarClassAttribute">
2146    <xsl:value-of select="wwstring:CSSClassName($ParamStyleName)" />
2147   </xsl:variable>
2148 
2149   <!-- Style attribute -->
2150   <!--                 -->
2151   <xsl:variable name="VarStyleAttribute">
2152    <xsl:call-template name="CSS-InlineProperties">
2153     <xsl:with-param name="ParamProperties" select="$VarCSSProperties[(@Name != 'vertical-align')]" />
2154    </xsl:call-template>
2155   </xsl:variable>
2156 
2157   <!-- Cell spacing -->
2158   <!--              -->
2159   <xsl:variable name="VarTableCellSpacing">
2160    <xsl:variable name="VarCellSpacingHint" select="$VarResolvedContextProperties[@Name = 'cell-spacing']/@Value" />
2161 
2162    <xsl:choose>
2163     <xsl:when test="string-length($VarCellSpacingHint) &gt; 0">
2164      <!-- Normalize value for HTML attribute-->
2165      <!--                                   -->
2166      <xsl:variable name="VarValueToEmit">
2167       <xsl:variable name="VarUnitsSuffix" select="wwunits:UnitsSuffix($VarCellSpacingHint)" />
2168       <xsl:choose>
2169        <xsl:when test="string-length($VarUnitsSuffix) &gt; 0">
2170         <xsl:variable name="VarNumPrefix" select="wwunits:NumericPrefix($VarCellSpacingHint)" />
2171         <xsl:value-of select="wwunits:Convert($VarNumPrefix, $VarUnitsSuffix, 'px')" />
2172        </xsl:when>
2173        <xsl:otherwise>
2174         <xsl:value-of select="$VarCellSpacingHint" />
2175        </xsl:otherwise>
2176       </xsl:choose>
2177      </xsl:variable>
2178 
2179      <xsl:value-of select="$VarValueToEmit" />
2180     </xsl:when>
2181 
2182     <xsl:otherwise>
2183      <xsl:value-of select="''" />
2184     </xsl:otherwise>
2185    </xsl:choose>
2186   </xsl:variable>
2187 
2188   <!-- Table vertical alignment -->
2189   <!--                          -->
2190   <xsl:variable name="VarTableVerticalAlignment">
2191    <xsl:variable name="VarTableVerticalAlignmentHint" select="$VarResolvedContextProperties[@Name = 'vertical-align']/@Value" />
2192    <xsl:choose>
2193     <xsl:when test="string-length($VarTableVerticalAlignmentHint) &gt; 0">
2194      <xsl:value-of select="$VarTableVerticalAlignmentHint" />
2195     </xsl:when>
2196     <xsl:otherwise>
2197      <xsl:value-of select="''" />
2198     </xsl:otherwise>
2199    </xsl:choose>
2200   </xsl:variable>
2201 
2202   <!-- Table summary -->
2203   <!--               -->
2204   <xsl:variable name="VarTableSummary">
2205    <xsl:call-template name="Tables-Summary">
2206     <xsl:with-param name="ParamTableBehavior" select="$ParamTableBehavior" />
2207    </xsl:call-template>
2208   </xsl:variable>
2209 
2210   <!-- Caption Side -->
2211   <!--              -->
2212   <xsl:variable name="VarCaptionSide">
2213    <xsl:value-of select="$VarResolvedContextProperties[@Name = 'caption-side']/@Value" />
2214   </xsl:variable>
2215 
2216   <!-- Determine table cell widths -->
2217   <!--                             -->
2218   <xsl:variable name="VarTableCellWidthsAsXML">
2219    <xsl:variable name="VarEmitTableWidthsOption" select="$VarContextRule/wwproject:Options/wwproject:Option[@Name = 'table-use-document-cell-widths']/@Value" />
2220    <xsl:variable name="VarEmitTableWidths" select="$VarEmitTableWidthsOption = 'true'" />
2221 
2222    <xsl:if test="$VarEmitTableWidths">
2223     <xsl:call-template name="Table-CellWidths">
2224      <xsl:with-param name="ParamTable" select="$ParamTable" />
2225     </xsl:call-template>
2226    </xsl:if>
2227   </xsl:variable>
2228   <xsl:variable name="VarTableCellWidths" select="msxsl:node-set($VarTableCellWidthsAsXML)/*" />
2229 
2230   <!-- Emit <table> element with class, id, style, and summary attrs. -->
2231   <!--                                                                -->
2232   <html:table id="{$ParamTable/@id}" class="{$VarClassAttribute}">
2233 
2234    <!-- style attribute -->
2235    <!--                 -->
2236    <xsl:if test="string-length($VarStyleAttribute) &gt; 0">
2237     <xsl:attribute name="style">
2238      <xsl:value-of select="$VarStyleAttribute" />
2239     </xsl:attribute>
2240    </xsl:if>
2241 
2242    <!-- cellspacing attribute -->
2243    <!--                       -->
2244    <xsl:if test="string-length($VarTableCellSpacing) &gt; 0">
2245     <xsl:attribute name="cellspacing">
2246      <xsl:value-of select="$VarTableCellSpacing" />
2247     </xsl:attribute>
2248    </xsl:if>
2249 
2250    <!-- summary attribute -->
2251    <!--                   -->
2252    <xsl:if test="string-length($VarTableSummary) &gt; 0">
2253     <xsl:attribute name="summary">
2254      <xsl:value-of select="$VarTableSummary" />
2255     </xsl:attribute>
2256    </xsl:if>
2257 
2258    <!-- Apply caption templates -->
2259    <!--                         -->
2260    <xsl:for-each select="$ParamTable/wwdoc:Caption[1]">
2261     <html:caption>
2262 
2263      <xsl:if test="string-length($VarCaptionSide) &gt; 0">
2264       <xsl:attribute name="style">
2265        <xsl:value-of select="concat('caption-side: ', $VarCaptionSide)" />
2266       </xsl:attribute>
2267      </xsl:if>
2268 
2269      <xsl:apply-templates select="./*" mode="wwmode:content">
2270       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2271       <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2272       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2273       <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2274       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2275      </xsl:apply-templates>
2276 
2277     </html:caption>
2278    </xsl:for-each>
2279 
2280    <xsl:for-each select="$ParamTable/wwdoc:TableHead|$ParamTable/wwdoc:TableBody|$ParamTable/wwdoc:TableFoot">
2281     <xsl:variable name="VarSection" select="." />
2282 
2283     <!-- Resolve section properties -->
2284     <!--                            -->
2285     <xsl:variable name="VarResolvedSectionPropertiesAsXML">
2286      <xsl:call-template name="Properties-Table-Section-ResolveContextRule">
2287       <xsl:with-param name="ParamProperties" select="$VarContextRule/wwproject:Properties/wwproject:Property" />
2288       <xsl:with-param name="ParamDocumentContext" select="$ParamTable" />
2289       <xsl:with-param name="ParamTable" select="$ParamTable" />
2290       <xsl:with-param name="ParamSection" select="$VarSection" />
2291      </xsl:call-template>
2292     </xsl:variable>
2293     <xsl:variable name="VarResolvedSectionProperties" select="msxsl:node-set($VarResolvedSectionPropertiesAsXML)/wwproject:Property" />
2294 
2295     <!-- Process section rows -->
2296     <!--                      -->
2297     <xsl:for-each select="$VarSection/wwdoc:TableRow">
2298      <xsl:variable name="VarTableRow" select="." />
2299      <xsl:variable name="VarRowPosition" select="position()" />
2300 
2301      <html:tr>
2302 
2303       <!-- Handle table level vertical align at row level -->
2304       <!--                                                -->
2305       <xsl:if test="string-length($VarTableVerticalAlignment) &gt; 0">
2306        <xsl:attribute name="style">
2307         <xsl:value-of select="concat('vertical-align: ', $VarTableVerticalAlignment, ';')" />
2308        </xsl:attribute>
2309       </xsl:if>
2310 
2311       <xsl:for-each select="$VarTableRow/wwdoc:TableCell">
2312        <xsl:variable name="VarTableCell" select="." />
2313        <xsl:variable name="VarCellPosition" select="position()" />
2314 
2315        <!-- Resolve cell properties -->
2316        <!--                         -->
2317        <xsl:variable name="VarResolvedCellPropertiesAsXML">
2318         <xsl:call-template name="Properties-Table-Cell-ResolveProperties">
2319          <xsl:with-param name="ParamSectionProperties" select="$VarResolvedSectionProperties" />
2320          <xsl:with-param name="ParamCellStyle" select="$VarTableCell/wwdoc:Style" />
2321          <xsl:with-param name="ParamRowIndex" select="$VarRowPosition" />
2322          <xsl:with-param name="ParamColumnIndex" select="$VarCellPosition" />
2323         </xsl:call-template>
2324 
2325         <!-- Width attribute -->
2326         <!--                 -->
2327         <xsl:if test="$VarRowPosition = 1">
2328          <xsl:for-each select="$VarTableCellWidths[@id = $VarTableCell/@id][1]">
2329           <xsl:variable name="VarTableCellWidth" select="." />
2330 
2331           <wwproject:Property Name="width" Value="{$VarTableCellWidth/@width}" />
2332          </xsl:for-each>
2333         </xsl:if>
2334        </xsl:variable>
2335        <xsl:variable name="VarResolvedCellProperties" select="msxsl:node-set($VarResolvedCellPropertiesAsXML)/wwproject:Property" />
2336 
2337        <!-- Valid CSS properties -->
2338        <!--                      -->
2339        <xsl:variable name="VarTableCellCSSPropertiesAsXML">
2340         <xsl:call-template name="CSS-TranslateProjectProperties">
2341          <xsl:with-param name="ParamProperties" select="$VarResolvedCellProperties" />
2342          <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2343          <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2344         </xsl:call-template>
2345        </xsl:variable>
2346        <xsl:variable name="VarTableCellCSSProperties" select="msxsl:node-set($VarTableCellCSSPropertiesAsXML)/wwproject:Property" />
2347 
2348        <!-- Calculate row span -->
2349        <!--                    -->
2350        <xsl:variable name="VarRowSpan">
2351         <xsl:variable name="VarRowSpanHint" select="$VarTableCell/wwdoc:Style/wwdoc:Attribute[@name = 'row-span']/@value" />
2352         <xsl:choose>
2353          <xsl:when test="string-length($VarRowSpanHint) &gt; 0">
2354           <xsl:value-of select="$VarRowSpanHint" />
2355          </xsl:when>
2356          <xsl:otherwise>
2357           <xsl:value-of select="'0'" />
2358          </xsl:otherwise>
2359         </xsl:choose>
2360        </xsl:variable>
2361 
2362        <!-- Calculate column span -->
2363        <!--                       -->
2364        <xsl:variable name="VarColumnSpan">
2365         <xsl:variable name="VarColumnSpanHint" select="$VarTableCell/wwdoc:Style/wwdoc:Attribute[@name = 'column-span']/@value" />
2366         <xsl:choose>
2367          <xsl:when test="string-length($VarColumnSpanHint) &gt; 0">
2368           <xsl:value-of select="$VarColumnSpanHint" />
2369          </xsl:when>
2370          <xsl:otherwise>
2371           <xsl:value-of select="'0'" />
2372          </xsl:otherwise>
2373         </xsl:choose>
2374        </xsl:variable>
2375 
2376        <!-- Emit cell -->
2377        <!--           -->
2378        <html:td id="{@id}">
2379         <!-- Style attribute -->
2380         <!--                 -->
2381         <xsl:if test="count($VarTableCellCSSProperties[1]) = 1">
2382          <xsl:attribute name="style">
2383           <xsl:call-template name="CSS-InlineProperties">
2384            <xsl:with-param name="ParamProperties" select="$VarTableCellCSSProperties" />
2385           </xsl:call-template>
2386          </xsl:attribute>
2387         </xsl:if>
2388 
2389         <!-- Row span attribute -->
2390         <!--                    -->
2391         <xsl:if test="number($VarRowSpan) &gt; 0">
2392          <xsl:attribute name="rowspan">
2393           <xsl:value-of select="$VarRowSpan" />
2394          </xsl:attribute>
2395         </xsl:if>
2396 
2397         <!-- Column span attribute -->
2398         <!--                       -->
2399         <xsl:if test="number($VarColumnSpan) &gt; 0">
2400          <xsl:attribute name="colspan">
2401           <xsl:value-of select="$VarColumnSpan" />
2402          </xsl:attribute>
2403         </xsl:if>
2404 
2405         <!-- Recurse -->
2406         <!--         -->
2407         <xsl:apply-templates select="./*" mode="wwmode:content">
2408          <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2409          <xsl:with-param name="ParamCargo" select="$VarCargo" />
2410          <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2411          <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2412          <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2413         </xsl:apply-templates>
2414        </html:td>
2415       </xsl:for-each>
2416 
2417      </html:tr>
2418     </xsl:for-each>
2419    </xsl:for-each>
2420 
2421   </html:table>
2422 
2423   <!-- Table Footnotes -->
2424   <!--                 -->
2425   <xsl:call-template name="Content-Notes">
2426    <xsl:with-param name="ParamNotes" select="$VarNotes" />
2427    <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2428    <xsl:with-param name="ParamCargo" select="$VarCargo" />
2429    <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2430    <xsl:with-param name="ParamTOCData" select="$ParamTOCData" />
2431    <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2432   </xsl:call-template>
2433 
2434   <!-- Dropdown End -->
2435   <!--              -->
2436   <xsl:if test="$ParamTableBehavior/@dropdown = 'end'">
2437    <html:script type="text/javascript" language="JavaScript1.2">WebWorks_WriteDIVClose();</html:script>
2438   </xsl:if>
2439  </xsl:template>
2440 
2441 
2442  <xsl:template match="wwdoc:Frame" mode="wwmode:content">
2443   <xsl:param name="ParamSplits" />
2444   <xsl:param name="ParamCargo" />
2445   <xsl:param name="ParamLinks" />
2446   <xsl:param name="ParamTOCData" />
2447   <xsl:param name="ParamSplit" />
2448 
2449   <!-- Aborted? -->
2450   <!--          -->
2451   <xsl:if test="not(wwprogress:Abort())">
2452    <xsl:call-template name="Frame">
2453     <xsl:with-param name="ParamFrame" select="." />
2454     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2455     <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2456     <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2457     <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2458    </xsl:call-template>
2459   </xsl:if>
2460  </xsl:template>
2461 
2462 
2463  <xsl:template match="wwdoc:Frame" mode="wwmode:textrun">
2464   <xsl:param name="ParamSplits" />
2465   <xsl:param name="ParamCargo" />
2466   <xsl:param name="ParamLinks" />
2467   <xsl:param name="ParamSplit" />
2468 
2469   <xsl:call-template name="Frame">
2470    <xsl:with-param name="ParamFrame" select="." />
2471    <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2472    <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2473    <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2474    <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2475   </xsl:call-template>
2476  </xsl:template>
2477 
2478 
2479  <xsl:template name="Frame">
2480   <xsl:param name="ParamFrame" />
2481   <xsl:param name="ParamSplits" />
2482   <xsl:param name="ParamCargo" />
2483   <xsl:param name="ParamLinks" />
2484   <xsl:param name="ParamSplit" />
2485 
2486   <!-- Get splits frame -->
2487   <!--                  -->
2488   <xsl:for-each select="$ParamSplits[1]">
2489    <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2490 
2491    <!-- Frame known? -->
2492    <!--              -->
2493    <xsl:if test="count($VarSplitsFrame) = 1">
2494     <!-- Thumbnail file exists for this frame? -->
2495     <!--                                       -->
2496     <xsl:for-each select="$GlobalFiles[1]">
2497      <xsl:variable name="VarThumbnailExists" select="count(key('wwfiles-files-by-path', $VarSplitsFrame/wwsplits:Thumbnail/@path)[1]) &gt; 0" />
2498 
2499      <xsl:choose>
2500       <xsl:when test="$VarThumbnailExists">
2501        <xsl:call-template name="Frame-Thumbnail">
2502         <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2503         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2504         <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2505         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2506         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2507        </xsl:call-template>
2508       </xsl:when>
2509 
2510       <xsl:otherwise>
2511        <xsl:call-template name="Frame-FullSize">
2512         <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2513         <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2514         <xsl:with-param name="ParamCargo" select="$ParamCargo" />
2515         <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2516         <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2517        </xsl:call-template>
2518       </xsl:otherwise>
2519      </xsl:choose>
2520     </xsl:for-each>
2521    </xsl:if>
2522   </xsl:for-each>
2523  </xsl:template>
2524 
2525 
2526  <xsl:template name="Frame-Thumbnail">
2527   <xsl:param name="ParamFrame" />
2528   <xsl:param name="ParamSplits" />
2529   <xsl:param name="ParamCargo" />
2530   <xsl:param name="ParamLinks" />
2531   <xsl:param name="ParamSplit" />
2532 
2533   <xsl:variable name="VarBehaviorFrame" select="$ParamCargo/wwbehaviors:Behaviors//wwbehaviors:Frame[@id = $ParamFrame/@id][1]" />
2534 
2535   <!-- Notes -->
2536   <!--       -->
2537   <xsl:variable name="VarNotes" select="$ParamFrame//wwdoc:Note" />
2538 
2539   <!-- Note numbering -->
2540   <!--                -->
2541   <xsl:variable name="VarNoteNumberingAsXML">
2542    <xsl:call-template name="Notes-Number">
2543     <xsl:with-param name="ParamNotes" select="$VarNotes" />
2544    </xsl:call-template>
2545   </xsl:variable>
2546   <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2547 
2548   <!-- Frame cargo -->
2549   <!--             -->
2550   <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2551 
2552   <!-- Get image path -->
2553   <!--                -->
2554   <xsl:for-each select="$ParamSplits[1]">
2555    <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2556 
2557    <!-- Graphic Rule -->
2558    <!--              -->
2559    <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2560    <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2561    <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2562    <xsl:if test="$VarGenerateOutput">
2563     <!-- Resolve project properties -->
2564     <!--                            -->
2565     <xsl:variable name="VarResolvedPropertiesAsXML">
2566      <xsl:call-template name="Properties-ResolveOverrideRule">
2567       <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
2568       <xsl:with-param name="ParamContextStyle" select="$ParamFrame" />
2569      </xsl:call-template>
2570     </xsl:variable>
2571     <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2572 
2573     <!-- CSS properties -->
2574     <!--                -->
2575     <xsl:variable name="VarCSSPropertiesAsXML">
2576      <xsl:call-template name="CSS-TranslateProjectProperties">
2577       <xsl:with-param name="ParamProperties" select="$VarResolvedProperties[(@Name != 'width') and (@Name != 'height')]" />
2578       <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2579       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2580      </xsl:call-template>
2581     </xsl:variable>
2582     <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2583     <xsl:variable name="VarInlineCSSProperties">
2584      <xsl:call-template name="CSS-InlineProperties">
2585       <xsl:with-param name="ParamProperties" select="$VarCSSProperties[string-length(@Value) &gt; 0]" />
2586      </xsl:call-template>
2587     </xsl:variable>
2588 
2589     <!-- Width/Height -->
2590     <!--              -->
2591     <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarSplitsFrame/wwsplits:Thumbnail/@path)" />
2592     <xsl:variable name="VarWidth" select="number($VarImageInfo/@width)" />
2593     <xsl:variable name="VarHeight" select="number($VarImageInfo/@height)" />
2594 
2595     <!-- Src -->
2596     <!--      -->
2597     <xsl:variable name="VarSrc" select="wwuri:GetRelativeTo($VarSplitsFrame/wwsplits:Thumbnail/@path, $ParamSplit/@path)" />
2598 
2599     <!-- Define Use Map -->
2600     <!--                -->
2601     <xsl:variable name="VarUseMap">
2602      <xsl:text>#</xsl:text>
2603      <xsl:value-of select="$VarSplitsFrame/@documentID" />
2604      <xsl:text>_</xsl:text>
2605      <xsl:value-of select="$VarSplitsFrame/@id" />
2606     </xsl:variable>
2607 
2608     <!-- Alt Text -->
2609     <!--          -->
2610     <xsl:variable name="VarAltText">
2611      <xsl:call-template name="Images-AltText">
2612       <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2613       <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2614      </xsl:call-template>
2615     </xsl:variable>
2616 
2617     <!-- Long Description -->
2618     <!--                  -->
2619     <xsl:variable name="VarLongDescription">
2620      <xsl:call-template name="Images-LongDescription">
2621       <xsl:with-param name="ParamSplitsFrame" select="$VarSplitsFrame" />
2622       <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2623      </xsl:call-template>
2624     </xsl:variable>
2625 
2626     <!-- Get rule -->
2627     <!--          -->
2628     <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2629 
2630     <!-- Tag -->
2631     <!--     -->
2632     <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
2633     <xsl:variable name="VarTag">
2634      <xsl:choose>
2635       <xsl:when test="string-length($VarTagProperty) &gt; 0">
2636        <xsl:value-of select="$VarTagProperty" />
2637       </xsl:when>
2638 
2639       <xsl:otherwise>
2640        <xsl:value-of select="'img'" />
2641       </xsl:otherwise>
2642      </xsl:choose>
2643     </xsl:variable>
2644 
2645     <!-- Graphic element -->
2646     <!--                 -->
2647     <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
2648      <!-- ID attribute -->
2649      <!--              -->
2650      <xsl:attribute name="id">
2651       <xsl:value-of select="$ParamFrame/@id" />
2652      </xsl:attribute>
2653 
2654      <!-- Class attribute -->
2655      <!--                 -->
2656      <xsl:attribute name="class">
2657       <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
2658      </xsl:attribute>
2659 
2660      <!-- Src attribute -->
2661      <!--               -->
2662      <xsl:attribute name="src">
2663       <xsl:value-of select="$VarSrc" />
2664      </xsl:attribute>
2665 
2666      <!-- Width attribute -->
2667      <!--                 -->
2668      <xsl:if test="$VarWidth &gt; 0">
2669       <xsl:attribute name="width">
2670        <xsl:value-of select="$VarWidth"/>
2671       </xsl:attribute>
2672      </xsl:if>
2673 
2674      <!-- Height attribute -->
2675      <!--                  -->
2676      <xsl:if test="$VarHeight &gt; 0">
2677       <xsl:attribute name="height">
2678        <xsl:value-of select="$VarHeight"/>
2679       </xsl:attribute>
2680      </xsl:if>
2681 
2682      <!-- Style attribute -->
2683      <!--                 -->
2684      <xsl:if test="string-length($VarInlineCSSProperties) &gt; 0">
2685       <xsl:attribute name="style">
2686        <xsl:value-of select="$VarInlineCSSProperties" />
2687       </xsl:attribute>
2688      </xsl:if>
2689 
2690      <!-- Alt attribute -->
2691      <!--               -->
2692      <xsl:if test="string-length($VarAltText) &gt; 0">
2693       <xsl:attribute name="alt">
2694        <xsl:value-of select="$VarAltText" />
2695       </xsl:attribute>
2696      </xsl:if>
2697 
2698      <!-- Longdesc attribute -->
2699      <!--                    -->
2700      <xsl:if test="string-length($VarLongDescription) &gt; 0">
2701       <xsl:attribute name="longdesc">
2702        <xsl:value-of select="$VarLongDescription" />
2703       </xsl:attribute>
2704      </xsl:if>
2705 
2706      <!-- Usemap attribute -->
2707      <!--                  -->
2708      <xsl:attribute name="usemap">
2709       <xsl:value-of select="$VarUseMap" />
2710      </xsl:attribute>
2711      <xsl:attribute name="border">
2712       <xsl:value-of select="'0'" />
2713      </xsl:attribute>
2714     </xsl:element>
2715 
2716     <!-- Generate D Links -->
2717     <!--                  -->
2718     <xsl:variable name="VarGenerateDLinks" select="wwprojext:GetFormatSetting('accessibility-image-d-links', 'false')" />
2719     <xsl:if test="$VarGenerateDLinks = 'true'">
2720      <xsl:if test="string-length($VarLongDescription) &gt; 0">
2721       <xsl:text> </xsl:text>
2722       <html:a href="{$VarLongDescription}" title="{concat('Description link for ', wwfilesystem:GetFileName($VarSplitsFrame/@path))}">[D]</html:a><html:br />
2723      </xsl:if>
2724     </xsl:if>
2725 
2726     <!-- Image map -->
2727     <!--           -->
2728     <html:map name="{concat($VarSplitsFrame/@documentID, '_', $VarSplitsFrame/@id)}">
2729      <html:area coords="{concat('0,0,', $VarWidth, ',', $VarHeight)}" shape="rect" href="{wwuri:GetRelativeTo($VarSplitsFrame/wwsplits:Wrapper/@path, $ParamSplit/@path)}">
2730       <xsl:if test="string-length($VarAltText) &gt; 0">
2731        <xsl:attribute name="alt">
2732         <xsl:value-of select="$VarAltText" />
2733        </xsl:attribute>
2734       </xsl:if>
2735      </html:area>
2736     </html:map>
2737    </xsl:if>
2738   </xsl:for-each>
2739  </xsl:template>
2740 
2741 
2742  <xsl:template name="Frame-FullSize">
2743   <xsl:param name="ParamFrame" />
2744   <xsl:param name="ParamSplits" />
2745   <xsl:param name="ParamCargo" />
2746   <xsl:param name="ParamLinks" />
2747   <xsl:param name="ParamSplit" />
2748 
2749   <xsl:variable name="VarBehaviorFrame" select="$ParamCargo/wwbehaviors:Behaviors//wwbehaviors:Frame[@id = $ParamFrame/@id][1]" />
2750 
2751   <!-- Notes -->
2752   <!--       -->
2753   <xsl:variable name="VarNotes" select="$ParamFrame//wwdoc:Note" />
2754 
2755   <!-- Note numbering -->
2756   <!--                -->
2757   <xsl:variable name="VarNoteNumberingAsXML">
2758    <xsl:call-template name="Notes-Number">
2759     <xsl:with-param name="ParamNotes" select="$VarNotes" />
2760    </xsl:call-template>
2761   </xsl:variable>
2762   <xsl:variable name="VarNoteNumbering" select="msxsl:node-set($VarNoteNumberingAsXML)" />
2763 
2764   <!-- Frame cargo -->
2765   <!--             -->
2766   <xsl:variable name="VarCargo" select="$ParamCargo/*[local-name() != 'NoteNumbering']/.. | $VarNoteNumbering" />
2767 
2768   <!-- Get image path -->
2769   <!--                -->
2770   <xsl:for-each select="$ParamSplits[1]">
2771    <xsl:variable name="VarSplitsFrame" select="key('wwsplits-frames-by-id', $ParamFrame/@id)[@documentID = $ParamSplit/@documentID]" />
2772 
2773    <!-- Graphic Rule -->
2774    <!--              -->
2775    <xsl:variable name="VarOverrideRule" select="wwprojext:GetOverrideRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2776    <xsl:variable name="VarGenerateOutputOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'generate-output']/@Value" />
2777    <xsl:variable name="VarGenerateOutput" select="(string-length($VarGenerateOutputOption) = 0) or ($VarGenerateOutputOption != 'false')" />
2778    <xsl:if test="$VarGenerateOutput">
2779     <!-- Resolve project properties -->
2780     <!--                            -->
2781     <xsl:variable name="VarResolvedPropertiesAsXML">
2782      <xsl:call-template name="Properties-ResolveOverrideRule">
2783       <xsl:with-param name="ParamProperties" select="$VarOverrideRule/wwproject:Properties/wwproject:Property" />
2784       <xsl:with-param name="ParamContextStyle" select="$ParamFrame" />
2785      </xsl:call-template>
2786     </xsl:variable>
2787     <xsl:variable name="VarResolvedProperties" select="msxsl:node-set($VarResolvedPropertiesAsXML)/wwproject:Property" />
2788 
2789     <!-- CSS properties -->
2790     <!--                -->
2791     <xsl:variable name="VarCSSPropertiesAsXML">
2792      <xsl:call-template name="CSS-TranslateProjectProperties">
2793       <xsl:with-param name="ParamProperties" select="$VarResolvedProperties[(@Name != 'width') and (@Name != 'height')]" />
2794       <xsl:with-param name="ParamFromAbsoluteURI" select="$ParamSplit/@path" />
2795       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2796      </xsl:call-template>
2797     </xsl:variable>
2798     <xsl:variable name="VarCSSProperties" select="msxsl:node-set($VarCSSPropertiesAsXML)/wwproject:Property" />
2799     <xsl:variable name="VarInlineCSSProperties">
2800      <xsl:call-template name="CSS-InlineProperties">
2801       <xsl:with-param name="ParamProperties" select="$VarCSSProperties[string-length(@Value) &gt; 0]" />
2802      </xsl:call-template>
2803     </xsl:variable>
2804 
2805     <!-- Width/Height -->
2806     <!--              -->
2807     <xsl:variable name="VarByReferenceGraphicsUseDocumentDimensionsOption" select="$VarOverrideRule/wwproject:Options/wwproject:Option[@Name = 'by-reference-use-document-dimensions']/@Value" />
2808     <xsl:variable name="VarImageInfo" select="wwimaging:GetInfo($VarSplitsFrame/@path)" />
2809     <xsl:variable name="VarWidth">
2810      <xsl:choose>
2811       <xsl:when test="((string-length($VarByReferenceGraphicsUseDocumentDimensionsOption) = 0) or ($VarByReferenceGraphicsUseDocumentDimensionsOption = 'true')) and ($VarSplitsFrame/@byref = 'true')">
2812        <xsl:variable name="VarByReferenceFrame" select="$ParamFrame//wwdoc:Facet[@type = 'by-reference'][1]/../.." />
2813 
2814        <xsl:value-of select="floor(wwunits:Convert(wwunits:NumericPrefix($VarByReferenceFrame/wwdoc:Attribute[@name = 'width']/@value), 'pt', 'px'))" />
2815       </xsl:when>
2816 
2817       <xsl:otherwise>
2818        <xsl:value-of select="number($VarImageInfo/@width)" />
2819       </xsl:otherwise>
2820      </xsl:choose>
2821     </xsl:variable>
2822     <xsl:variable name="VarHeight">
2823      <xsl:choose>
2824       <xsl:when test="((string-length($VarByReferenceGraphicsUseDocumentDimensionsOption) = 0) or ($VarByReferenceGraphicsUseDocumentDimensionsOption = 'true')) and ($VarSplitsFrame/@byref = 'true')">
2825        <xsl:variable name="VarByReferenceFrame" select="$ParamFrame//wwdoc:Facet[@type = 'by-reference'][1]/../.." />
2826 
2827        <xsl:value-of select="floor(wwunits:Convert(wwunits:NumericPrefix($VarByReferenceFrame/wwdoc:Attribute[@name = 'height']/@value), 'pt', 'px'))" />
2828       </xsl:when>
2829 
2830       <xsl:otherwise>
2831        <xsl:value-of select="number($VarImageInfo/@height)" />
2832       </xsl:otherwise>
2833      </xsl:choose>
2834     </xsl:variable>
2835 
2836     <!-- Src -->
2837     <!--      -->
2838     <xsl:variable name="VarSrc" select="wwuri:GetRelativeTo($VarSplitsFrame/@path, $ParamSplit/@path)" />
2839 
2840     <!-- Need to define usemap? -->
2841     <!--                        -->
2842     <xsl:variable name="VarUseMap">
2843      <xsl:variable name="VarUseMapHint" select="count($ParamFrame//wwdoc:Link)" />
2844      <xsl:choose>
2845       <xsl:when test="$VarUseMapHint &gt; 0">
2846        <xsl:text>#</xsl:text>
2847        <xsl:value-of select="$VarSplitsFrame/@documentID" />
2848        <xsl:text>_</xsl:text>
2849        <xsl:value-of select="$VarSplitsFrame/@id" />
2850       </xsl:when>
2851 
2852       <xsl:otherwise>
2853        <xsl:value-of select="''" />
2854       </xsl:otherwise>
2855      </xsl:choose>
2856     </xsl:variable>
2857 
2858     <!-- Alt Text -->
2859     <!--          -->
2860     <xsl:variable name="VarAltText">
2861      <xsl:call-template name="Images-AltText">
2862       <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2863       <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2864      </xsl:call-template>
2865     </xsl:variable>
2866 
2867     <!-- Long Description -->
2868     <!--                  -->
2869     <xsl:variable name="VarLongDescription">
2870      <xsl:call-template name="Images-LongDescription">
2871       <xsl:with-param name="ParamSplitsFrame" select="$VarSplitsFrame" />
2872       <xsl:with-param name="ParamBehaviorFrame" select="$VarBehaviorFrame" />
2873      </xsl:call-template>
2874     </xsl:variable>
2875 
2876     <!-- Get rule -->
2877     <!--          -->
2878     <xsl:variable name="VarContextRule" select="wwprojext:GetContextRule('Graphic', $VarSplitsFrame/@stylename, $VarSplitsFrame/@documentID, $VarSplitsFrame/@id)" />
2879 
2880     <!-- Tag -->
2881     <!--     -->
2882     <xsl:variable name="VarTagProperty" select="$VarContextRule/wwproject:Properties/wwproject:Property[@Name = 'tag']/@Value" />
2883     <xsl:variable name="VarTag">
2884      <xsl:choose>
2885       <xsl:when test="string-length($VarTagProperty) &gt; 0">
2886        <xsl:value-of select="$VarTagProperty" />
2887       </xsl:when>
2888 
2889       <xsl:otherwise>
2890        <xsl:value-of select="'img'" />
2891       </xsl:otherwise>
2892      </xsl:choose>
2893     </xsl:variable>
2894 
2895     <!-- Graphic element -->
2896     <!--                 -->
2897     <xsl:element name="{$VarTag}" namespace="{$GlobalDefaultNamespace}">
2898      <!-- ID attribute -->
2899      <!--              -->
2900      <xsl:attribute name="id">
2901       <xsl:value-of select="$ParamFrame/@id" />
2902      </xsl:attribute>
2903 
2904      <!-- Class attribute -->
2905      <!--                 -->
2906      <xsl:attribute name="class">
2907       <xsl:value-of select="wwstring:CSSClassName($ParamFrame/@stylename)" />
2908      </xsl:attribute>
2909 
2910      <!-- Src attribute -->
2911      <!--               -->
2912      <xsl:attribute name="src">
2913       <xsl:value-of select="$VarSrc" />
2914      </xsl:attribute>
2915 
2916      <!-- Width attribute -->
2917      <!--                 -->
2918      <xsl:if test="$VarWidth &gt; 0">
2919       <xsl:attribute name="width">
2920        <xsl:value-of select="$VarWidth"/>
2921       </xsl:attribute>
2922      </xsl:if>
2923 
2924      <!-- Height attribute -->
2925      <!--                  -->
2926      <xsl:if test="$VarHeight &gt; 0">
2927       <xsl:attribute name="height">
2928        <xsl:value-of select="$VarHeight"/>
2929       </xsl:attribute>
2930      </xsl:if>
2931 
2932      <!-- Style attribute -->
2933      <!--                 -->
2934      <xsl:if test="string-length($VarInlineCSSProperties) &gt; 0">
2935       <xsl:attribute name="style">
2936        <xsl:value-of select="$VarInlineCSSProperties" />
2937       </xsl:attribute>
2938      </xsl:if>
2939 
2940      <!-- Alt attribute -->
2941      <!--               -->
2942      <xsl:if test="string-length($VarAltText) &gt; 0">
2943       <xsl:attribute name="alt">
2944        <xsl:value-of select="$VarAltText" />
2945       </xsl:attribute>
2946      </xsl:if>
2947 
2948      <!-- Longdesc attribute -->
2949      <!--                    -->
2950      <xsl:if test="string-length($VarLongDescription) &gt; 0">
2951       <xsl:attribute name="longdesc">
2952        <xsl:value-of select="$VarLongDescription" />
2953       </xsl:attribute>
2954      </xsl:if>
2955 
2956      <!-- Usemap attribute -->
2957      <!--                  -->
2958      <xsl:if test="string-length($VarUseMap) &gt; 0">
2959       <xsl:attribute name="usemap">
2960        <xsl:value-of select="$VarUseMap" />
2961       </xsl:attribute>
2962       <xsl:attribute name="border">
2963        <xsl:value-of select="'0'" />
2964       </xsl:attribute>
2965      </xsl:if>
2966     </xsl:element>
2967 
2968     <!-- Generate D Links -->
2969     <!--                  -->
2970     <xsl:variable name="VarGenerateDLinks" select="wwprojext:GetFormatSetting('accessibility-image-d-links', 'false')" />
2971     <xsl:if test="$VarGenerateDLinks = 'true'">
2972      <xsl:if test="string-length($VarLongDescription) &gt; 0">
2973       <xsl:text> </xsl:text>
2974       <html:a href="{$VarLongDescription}" title="{concat('Description link for ', wwfilesystem:GetFileName($VarSplitsFrame/@path))}">[D]</html:a><html:br />
2975      </xsl:if>
2976     </xsl:if>
2977 
2978     <xsl:if test="string-length($VarUseMap) &gt; 0">
2979      <html:map name="{concat($VarSplitsFrame/@documentID, '_', $VarSplitsFrame/@id)}">
2980       <xsl:call-template name="ImageMap">
2981        <xsl:with-param name="ParamFrame" select="$ParamFrame" />
2982        <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2983        <xsl:with-param name="ParamCargo" select="$VarCargo" />
2984        <xsl:with-param name="ParamParentBehavior" select="$VarBehaviorFrame" />
2985        <xsl:with-param name="ParamLinks" select="$ParamLinks" />
2986        <xsl:with-param name="ParamSplit" select="$ParamSplit" />
2987       </xsl:call-template>
2988      </html:map>
2989     </xsl:if>
2990    </xsl:if>
2991   </xsl:for-each>
2992 
2993   <!-- Frame Footnotes -->
2994   <!--                 -->
2995   <xsl:call-template name="Content-Notes">
2996    <xsl:with-param name="ParamNotes" select="$VarNotes" />
2997    <xsl:with-param name="ParamSplits" select="$ParamSplits" />
2998    <xsl:with-param name="ParamCargo" select="$VarCargo" />
2999    <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3000    <xsl:with-param name="ParamTOCData" select="''" />
3001    <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3002   </xsl:call-template>
3003  </xsl:template>
3004 
3005 
3006  <xsl:template name="ImageMap">
3007   <xsl:param name="ParamFrame" />
3008   <xsl:param name="ParamSplits" />
3009   <xsl:param name="ParamCargo" />
3010   <xsl:param name="ParamParentBehavior" />
3011   <xsl:param name="ParamLinks" />
3012   <xsl:param name="ParamSplit" />
3013 
3014   <!-- Process child frames first -->
3015   <!--                            -->
3016   <xsl:for-each select="$ParamFrame/wwdoc:Content//wwdoc:Frame[count($ParamFrame | ancestor::wwdoc:Frame[1]) = 1]">
3017    <xsl:call-template name="ImageMap">
3018     <xsl:with-param name="ParamFrame" select="." />
3019     <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3020     <xsl:with-param name="ParamCargo" select="$ParamCargo" />
3021     <xsl:with-param name="ParamParentBehavior" select="$ParamParentBehavior" />
3022     <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3023     <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3024    </xsl:call-template>
3025   </xsl:for-each>
3026 
3027   <!-- Get link -->
3028   <!--          -->
3029   <xsl:variable name="VarLinkInfoAsXML">
3030    <xsl:choose>
3031     <xsl:when test="count($ParamFrame/wwdoc:Link[1]) = 1">
3032      <xsl:call-template name="LinkInfo">
3033       <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3034       <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3035       <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3036       <xsl:with-param name="ParamDocumentLink" select="$ParamFrame/wwdoc:Link" />
3037      </xsl:call-template>
3038     </xsl:when>
3039 
3040     <xsl:otherwise>
3041      <xsl:variable name="VarChildLinks" select="$ParamFrame/wwdoc:Content//wwdoc:Link[count($ParamFrame | ancestor::wwdoc:Frame[1]) = 1]" />
3042      <xsl:variable name="VarChildLinksCount" select="count($VarChildLinks)" />
3043      <xsl:if test="$VarChildLinksCount &gt; 0">
3044       <xsl:call-template name="LinkInfo">
3045        <xsl:with-param name="ParamSplits" select="$ParamSplits" />
3046        <xsl:with-param name="ParamLinks" select="$ParamLinks" />
3047        <xsl:with-param name="ParamSplit" select="$ParamSplit" />
3048        <xsl:with-param name="ParamDocumentLink" select="$VarChildLinks[$VarChildLinksCount]" />
3049       </xsl:call-template>
3050      </xsl:if>
3051     </xsl:otherwise>
3052    </xsl:choose>
3053   </xsl:variable>
3054   <xsl:variable name="VarLinkInfo" select="msxsl:node-set($VarLinkInfoAsXML)/wwlinks:LinkInfo" />
3055 
3056   <xsl:if test="(string-length($VarLinkInfo/@href) &gt; 0) or (string-length($VarLinkInfo/@onMouseOver) &gt; 0)">
3057    <!-- Get coords attribute -->
3058    <!--                      -->
3059    <xsl:variable name="VarLeftAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'left']/@value), 'pt', 'px')))" />
3060    <xsl:variable name="VarTopAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'top']/@value), 'pt', 'px')))" />
3061    <xsl:variable name="VarWidthAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'width']/@value), 'pt', 'px')))" />
3062    <xsl:variable name="VarHeightAsPixels" select="string(floor(wwunits:Convert(wwunits:NumericPrefix($ParamFrame/wwdoc:Attribute[@name = 'height']/@value), 'pt', 'px')))" />
3063 
3064    <!-- coords -->
3065    <!--        -->
3066    <xsl:variable name="VarCoordsString">
3067     <xsl:choose>
3068      <xsl:when test="string-length($VarLeftAsPixels) &gt; 0">
3069       <xsl:value-of select="$VarLeftAsPixels" />
3070      </xsl:when>
3071      <xsl:otherwise>
3072       <xsl:value-of select="'0'" />
3073      </xsl:otherwise>
3074     </xsl:choose>
3075 
3076     <xsl:value-of select="','"/>
3077 
3078     <xsl:choose>
3079      <xsl:when test="string-length($VarTopAsPixels) &gt; 0">
3080       <xsl:value-of select="$VarTopAsPixels" />
3081      </xsl:when>
3082      <xsl:otherwise>
3083       <xsl:value-of select="'0'" />
3084      </xsl:otherwise>
3085     </xsl:choose>
3086 
3087     <xsl:value-of select="','"/>
3088 
3089     <xsl:choose>
3090      <xsl:when test="string-length($VarWidthAsPixels) &gt; 0">
3091       <xsl:value-of select="string(number($VarWidthAsPixels) + number($VarLeftAsPixels))" />
3092      </xsl:when>
3093      <xsl:otherwise>
3094       <xsl:value-of select="'0'" />
3095      </xsl:otherwise>
3096     </xsl:choose>
3097 
3098     <xsl:value-of select="','"/>
3099 
3100     <xsl:choose>
3101      <xsl:when test="string-length($VarHeightAsPixels) &gt; 0">
3102       <xsl:value-of select="string(number($VarHeightAsPixels) + number($VarTopAsPixels))" />
3103      </xsl:when>
3104      <xsl:otherwise>
3105       <xsl:value-of select="'0'" />
3106      </xsl:otherwise>
3107     </xsl:choose>
3108    </xsl:variable>
3109 
3110    <!-- alt -->
3111    <!--     -->
3112    <xsl:variable name="VarAltText">
3113     <xsl:call-template name="Images-ImageAreaAltText">
3114      <xsl:with-param name="ParamParentBehavior" select="$ParamParentBehavior" />
3115      <xsl:with-param name="ParamFrame" select="$ParamFrame" />
3116     </xsl:call-template>
3117    </xsl:variable>
3118 
3119    <!-- area -->
3120    <!--      -->
3121    <html:area href="{$VarLinkInfo/@href}" coords="{$VarCoordsString}" shape="rect">
3122     <!-- target -->
3123     <!--        -->
3124     <xsl:if test="string-length($VarLinkInfo/@target) &gt; 0">
3125      <xsl:attribute name="target">
3126       <xsl:value-of select="$VarLinkInfo/@target" />
3127      </xsl:attribute>
3128     </xsl:if>
3129 
3130     <!-- onMouseOver -->
3131     <!--             -->
3132     <xsl:if test="string-length($VarLinkInfo/@onMouseOver) &gt; 0">
3133      <xsl:attribute name="onMouseOver">
3134       <xsl:value-of select="$VarLinkInfo/@onMouseOver" />
3135      </xsl:attribute>
3136     </xsl:if>
3137 
3138     <!-- onMouseOut -->
3139     <!--            -->
3140     <xsl:if test="string-length($VarLinkInfo/@onMouseOut) &gt; 0">
3141      <xsl:attribute name="onMouseOut">
3142       <xsl:value-of select="$VarLinkInfo/@onMouseOut" />
3143      </xsl:attribute>
3144     </xsl:if>
3145 
3146     <!-- alt -->
3147     <!--     -->
3148     <xsl:if test="string-length($VarAltText) &gt; 0">
3149      <xsl:attribute name="alt">
3150       <xsl:value-of select="$VarAltText" />
3151      </xsl:attribute>
3152     </xsl:if>
3153    </html:area>
3154   </xsl:if>
3155  </xsl:template>
3156 </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.
  • [get | view] (2008-02-13 06:16:05, 132.2 KB) [[attachment:content.xsl]]
  • [get | view] (2008-02-13 06:16:05, 11.3 KB) [[attachment:popup.jpg]]
  • [get | view] (2008-02-13 06:16:05, 1.6 KB) [[attachment:webworks.css]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.