Attachment 'nuan_files.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:proj_cache="http://tempuri.org/ProjectCache.xsd"
   5                               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   6                               xmlns:wwexec="urn:WebWorks-XSLT-Extension-Execute"
   7                               xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   8                               xmlns:wwtoc="urn:WebWorks-Engine-TOC-Schema"
   9                               xmlns:wwlinks="urn:WebWorks-Engine-Links-Schema"
  10                               xmlns:wwmode="urn:WebWorks-Engine-Mode"
  11                               xmlns:wwfiles="urn:WebWorks-Engine-Files-Schema"
  12                               xmlns:wwdoc="urn:WebWorks-Document-Schema"
  13                               xmlns:wwsplits="urn:WebWorks-Engine-Splits-Schema"
  14                               xmlns:wwproject="urn:WebWorks-Publish-Project"
  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 wwexec msxsl wwtoc wwlinks wwmode wwfiles wwdoc wwsplits wwproject wwprogress wwlog wwfilesystem wwuri wwstring wwfilesext wwprojext wwexsldoc"
  24 >
  25 <!--
  26     This transform is specific to Nuance Help
  27   -->
  28 
  29  <xsl:param name="GlobalInput" />
  30  <xsl:param name="GlobalProject" />
  31  <xsl:param name="GlobalPipelineName" />
  32  <xsl:param name="GlobalFiles" />
  33 
  34  <xsl:key name="wwfiles-files-by-type" match="wwfiles:File" use="@type" />
  35  <xsl:key name="wwsplits-split-by-documentid" match="wwsplits:Split" use="@documentID" />
  36 
  37 
  38  <xsl:variable name="GlobalActionChecksum">
  39   <xsl:variable name="VarTransformChecksums">
  40    <xsl:value-of select="concat(wwuri:AsFilePath('wwtransform:self'), ':', wwfilesystem:GetChecksum(wwuri:AsFilePath('wwtransform:self')))" />
  41   </xsl:variable>
  42   <xsl:value-of select="wwstring:MD5Checksum($VarTransformChecksums)" />
  43  </xsl:variable>
  44 
  45  <xsl:variable name="VarProjectChecksum" select="$GlobalProject/wwproject:Project/@ChangeID" />
  46 
  47 
  48  <!-- Main -->
  49  <!--      -->
  50  <xsl:template match="/">
  51   <wwfiles:Files version="1.0">
  52 
  53   <xsl:variable name="VarIgnore1Start" select="wwprogress:Start(1)" />
  54   <xsl:variable name="VarIgnore1Status" select="wwprogress:SetStatus('Generating Nuance files')" />
  55 
  56    <!-- Call directory copy -->
  57    <xsl:call-template name="CopyCustomFiles" />
  58 
  59    <xsl:variable name="VarIgnore1End" select="wwprogress:End()" />
  60 
  61    </wwfiles:Files>
  62  </xsl:template>
  63 
  64  <!-- Copy custom files -->
  65  <!--                        -->
  66  <xsl:template name="CopyCustomFiles">
  67 
  68    <xsl:variable name="VarProjectGroups" select="$GlobalProject/wwproject:Project/wwproject:Groups/wwproject:Group" />
  69    <xsl:for-each select="$VarProjectGroups">
  70      <xsl:variable name="VarProjectGroup" select="." />
  71 
  72      <!-- NOTE: Source is hard-coded -->
  73      <xsl:variable name="VarSourceDirectoryPath" select="'C:\_wwfiles\files'" />
  74      <xsl:variable name="VarOutputDirectoryPath" select="wwfilesystem:Combine(wwprojext:GetTargetOutputDirectoryPath(), wwprojext:GetGroupName($VarProjectGroup/@GroupID) )" />
  75 
  76      <xsl:if test="wwfilesystem:DirectoryExists($VarSourceDirectoryPath)" >
  77        <xsl:variable name="VarLogCopy" select="wwlog:Warning('[Custom] Copying files from ',$VarSourceDirectoryPath, ' to ', $VarOutputDirectoryPath)" />
  78        <xsl:variable name="VarCopiedFiles" select="wwfilesystem:CopyDirectoryFiles($VarSourceDirectoryPath,$VarOutputDirectoryPath)"  />
  79 
  80        <!-- Add them to the deploy list -->
  81        <xsl:for-each select="$VarCopiedFiles">
  82           <xsl:copy>
  83             <xsl:copy-of select="@*" />
  84               <xsl:attribute name="deploy">
  85                 <xsl:text>true</xsl:text>
  86              </xsl:attribute>
  87             <xsl:copy-of select="./*" />
  88           </xsl:copy>
  89        </xsl:for-each>
  90 
  91      </xsl:if>
  92    </xsl:for-each>
  93  </xsl:template>
  94 
  95 </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] (2011-06-15 00:29:14, 13.9 KB) [[attachment:Baggage Files.2011-06-14.zip]]
  • [get | view] (2011-06-14 15:37:58, 4.6 KB) [[attachment:nuan_files.xsl]]
 All files | Selected Files: delete move to page

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