Attachment 'wwhelp_settings.xsl'

Download

   1 <?xml version="1.0" encoding="UTF-8"?>
   2 <xsl:stylesheet version="1.0" xmlns="urn:WebWorks-Help-Settings-Schema"
   3                               xmlns:wwhsettings="urn:WebWorks-Help-Settings-Schema"
   4                               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   5                               xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   6                               xmlns:wwtoc="urn:WebWorks-Engine-TOC-Schema"
   7                               xmlns:wwlinks="urn:WebWorks-Engine-Links-Schema"
   8                               xmlns:wwmode="urn:WebWorks-Engine-Mode"
   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:wwproject="urn:WebWorks-Publish-Project"
  13                               xmlns:wwpage="urn:WebWorks-Page-Template-Schema"
  14                               xmlns:wwlocale="urn:WebWorks-Locale-Schema"
  15                               xmlns:wwprogress="urn:WebWorks-XSLT-Extension-Progress"
  16                               xmlns:wwlog="urn:WebWorks-XSLT-Extension-Log"
  17                               xmlns:wwfilesystem="urn:WebWorks-XSLT-Extension-FileSystem"
  18                               xmlns:wwuri="urn:WebWorks-XSLT-Extension-URI"
  19                               xmlns:wwstring="urn:WebWorks-XSLT-Extension-StringUtilities"
  20                               xmlns:wwfilesext="urn:WebWorks-XSLT-Extension-Files"
  21                               xmlns:wwprojext="urn:WebWorks-XSLT-Extension-Project"
  22                               xmlns:wwexsldoc="urn:WebWorks-XSLT-Extension-Document"
  23                               exclude-result-prefixes="xsl msxsl wwtoc wwlinks wwmode wwfiles wwdoc wwsplits wwproject wwpage wwlocale wwprogress wwlog wwfilesystem wwuri wwstring wwfilesext wwprojext wwexsldoc"
  24 >
  25  <xsl:param name="GlobalInput" />
  26  <xsl:param name="GlobalPipelineName" />
  27  <xsl:param name="GlobalProject" />
  28  <xsl:param name="GlobalFiles" />
  29  <xsl:param name="ParameterType" />
  30  <xsl:param name="ParameterCategory" />
  31  <xsl:param name="ParameterUse" />
  32  <xsl:param name="ParameterDeploy" />
  33 
  34 
  35  <xsl:output encoding="UTF-8" indent="yes" />
  36  <xsl:namespace-alias stylesheet-prefix="wwhsettings" result-prefix="#default" />
  37  <xsl:strip-space elements="*" />
  38 
  39 
  40  <xsl:variable name="GlobalActionChecksum">
  41   <xsl:variable name="VarTransformChecksums">
  42    <xsl:value-of select="concat(wwuri:AsFilePath('wwtransform:self'), ':', wwfilesystem:GetChecksum(wwuri:AsFilePath('wwtransform:self')))" />
  43   </xsl:variable>
  44   <xsl:value-of select="wwstring:MD5Checksum($VarTransformChecksums)" />
  45  </xsl:variable>
  46 
  47 
  48  <xsl:variable name="GlobalSettingsTemplatePath">
  49   <xsl:variable name="VarSkinURISetting" select="concat('wwformat:Skins/', wwprojext:GetFormatSetting('wwhelp-skin', 'Lobby_Blue'), '/wwhelp_settings.xml')" />
  50   <xsl:value-of select="wwuri:AsFilePath($VarSkinURISetting)" />
  51  </xsl:variable>
  52 
  53 
  54  <xsl:template match="/">
  55   <wwfiles:Files version="1.0">
  56 
  57    <!-- Groups -->
  58    <!--        -->
  59    <xsl:variable name="VarProjectGroups" select="$GlobalProject/wwproject:Project/wwproject:Groups/wwproject:Group" />
  60    <xsl:variable name="VarIgnore1Start" select="wwprogress:Start(count($VarProjectGroups) + 1)" />
  61 
  62    <xsl:for-each select="$VarProjectGroups">
  63     <xsl:variable name="VarProjectGroup" select="." />
  64 
  65     <xsl:variable name="VarIgnore2Start" select="wwprogress:Start(1)" />
  66 
  67     <!-- Determine group output directory path -->
  68     <!--                                       -->
  69     <xsl:variable name="VarGroupOutputDirectoryPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), $VarProjectGroup/@Name)" />
  70 
  71     <xsl:variable name="VarPath" select="wwfilesystem:Combine($VarGroupOutputDirectoryPath, 'wwhelp/settings.xml')" />
  72 
  73     <!-- Transform -->
  74     <!--           -->
  75     <xsl:variable name="VarUpToDate" select="wwfilesext:UpToDate($VarPath, wwprojext:GetConfigurationChangeID(), $VarProjectGroup/@GroupID, '', $GlobalActionChecksum)" />
  76     <xsl:if test="not($VarUpToDate)">
  77      <xsl:variable name="VarResultAsXML">
  78       <xsl:variable name="VarSettingsTemplate" select="wwexsldoc:LoadXMLWithoutResolver($GlobalSettingsTemplatePath)" />
  79 
  80       <xsl:call-template name="Settings">
  81        <xsl:with-param name="ParamSettingsTemplate" select="$VarSettingsTemplate" />
  82        <xsl:with-param name="ParamProjectGroup" select="$VarProjectGroup" />
  83       </xsl:call-template>
  84      </xsl:variable>
  85      <xsl:variable name="VarResult" select="msxsl:node-set($VarResultAsXML)" />
  86      <xsl:variable name="VarWriteResult" select="wwexsldoc:Document($VarResult, $VarPath, 'utf-8', 'xml', '1.0', 'yes')" />
  87     </xsl:if>
  88 
  89     <!-- Report Files -->
  90     <!--              -->
  91     <wwfiles:File path="{$VarPath}" type="{$ParameterType}" checksum="{wwfilesystem:GetChecksum($VarPath)}" projectchecksum="{wwprojext:GetConfigurationChangeID()}" groupID="{$VarProjectGroup/@GroupID}" documentID="" actionchecksum="{$GlobalActionChecksum}" category="{$ParameterCategory}" use="{$ParameterUse}" deploy="{$ParameterDeploy}">
  92      <wwfiles:Depends path="{$GlobalSettingsTemplatePath}" checksum="{wwfilesystem:GetChecksum($GlobalSettingsTemplatePath)}" groupID="" documentID="" />
  93     </wwfiles:File>
  94 
  95     <xsl:variable name="VarIgnore2End" select="wwprogress:End()" />
  96    </xsl:for-each>
  97 
  98    <!-- Merge -->
  99    <!--       -->
 100    <xsl:variable name="VarIgnore3Start" select="wwprogress:Start(1)" />
 101    <xsl:if test="count($GlobalProject/wwproject:Project/wwproject:Groups/wwproject:Group) &gt; 1">
 102     <xsl:variable name="VarPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), 'wwhelp/settings.xml')" />
 103 
 104     <!-- Transform -->
 105     <!--           -->
 106     <xsl:variable name="VarUpToDate" select="wwfilesext:UpToDate($VarPath, wwprojext:GetConfigurationChangeID(), '', '', $GlobalActionChecksum)" />
 107     <xsl:if test="not($VarUpToDate)">
 108      <xsl:variable name="VarResult">
 109       <xsl:variable name="VarSettingsTemplate" select="wwexsldoc:LoadXMLWithoutResolver($GlobalSettingsTemplatePath)" />
 110 
 111       <xsl:call-template name="Settings">
 112        <xsl:with-param name="ParamSettingsTemplate" select="$VarSettingsTemplate" />
 113        <xsl:with-param name="ParamProjectGroup" select="$GlobalProject/wwproject:Project/wwproject:Groups/wwproject:Group[1]" />
 114       </xsl:call-template>
 115      </xsl:variable>
 116      <xsl:variable name="VarWriteResult" select="wwexsldoc:Document(msxsl:node-set($VarResult), $VarPath, 'utf-8', 'xml', '1.0', 'yes')" />
 117     </xsl:if>
 118 
 119     <!-- Report Files -->
 120     <!--              -->
 121     <wwfiles:File path="{$VarPath}" type="{$ParameterType}" checksum="{wwfilesystem:GetChecksum($VarPath)}" projectchecksum="{wwprojext:GetConfigurationChangeID()}" groupID="" documentID="" actionchecksum="{$GlobalActionChecksum}" category="{$ParameterCategory}" use="{$ParameterUse}" deploy="{$ParameterDeploy}">
 122      <wwfiles:Depends path="{$GlobalSettingsTemplatePath}" checksum="{wwfilesystem:GetChecksum($GlobalSettingsTemplatePath)}" groupID="" documentID="" />
 123     </wwfiles:File>
 124    </xsl:if>
 125    <xsl:variable name="VarIgnore3End" select="wwprogress:End()" />
 126 
 127    <xsl:variable name="VarIgnore1End" select="wwprogress:End()" />
 128 
 129   </wwfiles:Files>
 130  </xsl:template>
 131 
 132 
 133  <xsl:template name="Settings">
 134   <xsl:param name="ParamSettingsTemplate" />
 135   <xsl:param name="ParamProjectGroup" />
 136 
 137   <xsl:apply-templates select="$ParamSettingsTemplate" mode="wwmode:wwhsettings">
 138    <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 139   </xsl:apply-templates>
 140  </xsl:template>
 141 
 142 
 143  <xsl:template match="/" mode="wwmode:wwhsettings">
 144   <xsl:param name="ParamProjectGroup" />
 145 
 146   <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 147    <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 148   </xsl:apply-templates>
 149  </xsl:template>
 150 
 151 
 152  <xsl:template match="wwhsettings:Cookies" mode="wwmode:wwhsettings">
 153   <xsl:param name="ParamProjectGroup" />
 154 
 155   <xsl:copy>
 156    <xsl:copy-of select="@*[(local-name() != 'enable') and (local-name() != 'id') and  (local-name() != 'daystoexpire')]" />
 157    <xsl:attribute name="enable">
 158     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-cookies', 'true')" />
 159    </xsl:attribute>
 160    <xsl:attribute name="id">
 161     <xsl:variable name="VarCookiesIDSetting" select="wwprojext:GetFormatSetting('wwhelp-cookies-id')" />
 162     <xsl:choose>
 163      <xsl:when test="($VarCookiesIDSetting != 'automatic') and (string-length($VarCookiesIDSetting) &gt; 0)">
 164       <xsl:value-of select="$VarCookiesIDSetting" />
 165      </xsl:when>
 166  
 167      <xsl:otherwise>
 168       <xsl:value-of select="$ParamProjectGroup/@GroupID" />
 169      </xsl:otherwise>
 170     </xsl:choose>
 171    </xsl:attribute>
 172    <xsl:attribute name="daystoexpire">
 173     <xsl:variable name="VarDaysToExpireSetting" select="wwprojext:GetFormatSetting('wwhelp-cookies-daystoexpire')" />
 174     <xsl:choose>
 175      <xsl:when test="$VarDaysToExpireSetting &gt; 0">
 176       <xsl:value-of select="$VarDaysToExpireSetting" />
 177      </xsl:when>
 178      
 179      <xsl:otherwise>
 180       <xsl:value-of select="30" />
 181      </xsl:otherwise>
 182     </xsl:choose>
 183    </xsl:attribute>
 184    
 185    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 186     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 187    </xsl:apply-templates>
 188   </xsl:copy>
 189  </xsl:template>
 190 
 191 
 192  <xsl:template match="wwhsettings:Accessible" mode="wwmode:wwhsettings">
 193   <xsl:param name="ParamProjectGroup" />
 194 
 195   <xsl:copy>
 196    <xsl:copy-of select="@*[local-name() != 'value']" />
 197    <xsl:attribute name="value">
 198     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-accessibility', 'false')" />
 199    </xsl:attribute>
 200 
 201    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 202     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 203    </xsl:apply-templates>
 204   </xsl:copy>
 205  </xsl:template>
 206 
 207 
 208  <xsl:template match="wwhsettings:SyncContents" mode="wwmode:wwhsettings">
 209   <xsl:param name="ParamProjectGroup" />
 210 
 211   <xsl:copy>
 212    <xsl:copy-of select="@*[local-name() != 'enable']" />
 213    <xsl:attribute name="enable">
 214     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-sync-toc', 'true')" />
 215    </xsl:attribute>
 216 
 217    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 218     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 219    </xsl:apply-templates>
 220   </xsl:copy>
 221  </xsl:template>
 222 
 223 
 224  <xsl:template match="wwhsettings:Previous" mode="wwmode:wwhsettings">
 225   <xsl:param name="ParamProjectGroup" />
 226 
 227   <xsl:copy>
 228    <xsl:copy-of select="@*[local-name() != 'enable']" />
 229    <xsl:attribute name="enable">
 230     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-previous-next', 'true')" />
 231    </xsl:attribute>
 232 
 233    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 234     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 235    </xsl:apply-templates>
 236   </xsl:copy>
 237  </xsl:template>
 238 
 239 
 240  <xsl:template match="wwhsettings:Next" mode="wwmode:wwhsettings">
 241   <xsl:param name="ParamProjectGroup" />
 242 
 243   <xsl:copy>
 244    <xsl:copy-of select="@*[local-name() != 'enable']" />
 245    <xsl:attribute name="enable">
 246     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-previous-next', 'true')" />
 247    </xsl:attribute>
 248 
 249    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 250     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 251    </xsl:apply-templates>
 252   </xsl:copy>
 253  </xsl:template>
 254 
 255 
 256  <xsl:template match="wwhsettings:RelatedTopics" mode="wwmode:wwhsettings">
 257   <xsl:param name="ParamProjectGroup" />
 258 
 259   <xsl:copy>
 260    <xsl:copy-of select="@*[(local-name() != 'enableicon') and (local-name() != 'enableinline')]" />
 261    <xsl:attribute name="enableicon">
 262     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-related-topics-icon', 'true')" />
 263    </xsl:attribute>
 264    <xsl:attribute name="enableinline">
 265     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-related-topics-inline', 'true')" />
 266    </xsl:attribute>
 267 
 268    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 269     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 270    </xsl:apply-templates>
 271   </xsl:copy>
 272  </xsl:template>
 273 
 274 
 275  <xsl:template match="wwhsettings:Email" mode="wwmode:wwhsettings">
 276   <xsl:param name="ParamProjectGroup" />
 277 
 278   <xsl:variable name="VarEmailAddress" select="wwprojext:GetFormatSetting('company-email', '')" />
 279 
 280   <xsl:copy>
 281    <xsl:copy-of select="@*[(local-name() != 'enable') and (local-name() != 'address')]" />
 282    <xsl:attribute name="enable">
 283     <xsl:value-of select="string-length($VarEmailAddress) &gt; 0" />
 284    </xsl:attribute>
 285    <xsl:attribute name="address">
 286     <xsl:value-of select="$VarEmailAddress" />
 287    </xsl:attribute>
 288 
 289    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 290     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 291    </xsl:apply-templates>
 292   </xsl:copy>
 293  </xsl:template>
 294 
 295 
 296  <xsl:template match="wwhsettings:Print" mode="wwmode:wwhsettings">
 297   <xsl:param name="ParamProjectGroup" />
 298 
 299   <xsl:copy>
 300    <xsl:copy-of select="@*[local-name() != 'enable']" />
 301    <xsl:attribute name="enable">
 302     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-print', 'true')" />
 303    </xsl:attribute>
 304 
 305    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 306     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 307    </xsl:apply-templates>
 308   </xsl:copy>
 309  </xsl:template>
 310 
 311 
 312  <xsl:template match="wwhsettings:Bookmark" mode="wwmode:wwhsettings">
 313   <xsl:param name="ParamProjectGroup" />
 314 
 315   <xsl:copy>
 316    <xsl:copy-of select="@*[local-name() != 'enable']" />
 317    <xsl:attribute name="enable">
 318     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-bookmark', 'false')" />
 319    </xsl:attribute>
 320 
 321    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 322     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 323    </xsl:apply-templates>
 324   </xsl:copy>
 325  </xsl:template>
 326 
 327 
 328  <xsl:template match="wwhsettings:PDF" mode="wwmode:wwhsettings">
 329   <xsl:param name="ParamProjectGroup" />
 330 
 331   <xsl:copy>
 332    <xsl:copy-of select="@*[local-name() != 'enable']" />
 333    <xsl:attribute name="enable">
 334     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-pdf', 'false')" />
 335    </xsl:attribute>
 336 
 337    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 338     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 339    </xsl:apply-templates>
 340   </xsl:copy>
 341  </xsl:template>
 342 
 343 
 344  <xsl:template match="wwhsettings:Contents[not(ancestor::wwhsettings:JavaScript)]" mode="wwmode:wwhsettings">
 345   <xsl:param name="ParamProjectGroup" />
 346 
 347   <xsl:copy>
 348    <xsl:copy-of select="@*[local-name() != 'enable']" />
 349    <xsl:attribute name="enable">
 350     <xsl:value-of select="wwprojext:GetFormatSetting('toc-generate', 'true')" />
 351    </xsl:attribute>
 352 
 353    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 354     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 355    </xsl:apply-templates>
 356   </xsl:copy>
 357  </xsl:template>
 358 
 359 
 360  <xsl:template match="wwhsettings:Index[not(ancestor::wwhsettings:JavaScript)]" mode="wwmode:wwhsettings">
 361   <xsl:param name="ParamProjectGroup" />
 362 
 363   <xsl:copy>
 364    <xsl:copy-of select="@*[local-name() != 'enable']" />
 365    <xsl:attribute name="enable">
 366     <xsl:value-of select="wwprojext:GetFormatSetting('index-generate', 'true')" />
 367    </xsl:attribute>
 368 
 369    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 370     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 371    </xsl:apply-templates>
 372   </xsl:copy>
 373  </xsl:template>
 374 
 375 
 376  <xsl:template match="wwhsettings:Search[not(ancestor::wwhsettings:JavaScript)]" mode="wwmode:wwhsettings">
 377   <xsl:param name="ParamProjectGroup" />
 378 
 379   <xsl:copy>
 380    <xsl:copy-of select="@*[local-name() != 'enable']" />
 381    <xsl:attribute name="enable">
 382     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-search', 'true')" />
 383    </xsl:attribute>
 384 
 385    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 386     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 387    </xsl:apply-templates>
 388   </xsl:copy>
 389  </xsl:template>
 390 
 391 
 392  <xsl:template match="wwhsettings:Favorites[not(ancestor::wwhsettings:JavaScript)]" mode="wwmode:wwhsettings">
 393   <xsl:param name="ParamProjectGroup" />
 394 
 395   <xsl:copy>
 396    <xsl:copy-of select="@*[local-name() != 'enable']" />
 397    <xsl:attribute name="enable">
 398     <xsl:value-of select="wwprojext:GetFormatSetting('wwhelp-favorites', 'true')" />
 399    </xsl:attribute>
 400 
 401    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 402     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 403    </xsl:apply-templates>
 404   </xsl:copy>
 405  </xsl:template>
 406 
 407 
 408  <xsl:template match="wwhsettings:*" mode="wwmode:wwhsettings">
 409   <xsl:param name="ParamProjectGroup" />
 410 
 411   <xsl:copy>
 412    <xsl:copy-of select="@*" />
 413 
 414    <xsl:apply-templates select="*" mode="wwmode:wwhsettings">
 415     <xsl:with-param name="ParamProjectGroup" select="$ParamProjectGroup" />
 416    </xsl:apply-templates>
 417   </xsl:copy>
 418  </xsl:template>
 419 </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:07, 3.5 KB) [[attachment:wwhelp_settings.fti]]
  • [get | view] (2008-02-13 06:16:07, 17.1 KB) [[attachment:wwhelp_settings.xsl]]
  • [get | view] (2008-02-13 06:16:07, 64.7 KB) [[attachment:wwhelp_settings_fti.html]]
  • [get | view] (2008-02-13 06:16:07, 284.5 KB) [[attachment:wwhelp_settings_xsl.html]]
 All files | Selected Files: delete move to page

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