Ignore:
Timestamp:
2012-04-24T20:30:19+12:00 (12 years ago)
Author:
ak19
Message:
  1. ApplyXSLT takes an additional parameter: the Greenstone major version number, or sets this to 2 if none is provided. This is then passed onto the XSLT files. 2. generate-html.sh/bat will pass any commandline parameters on to ApplyXSLT.java. 3. Simplified the generate-html.bat file with a for loop to avoid code duplication. 4. The MajorVersion element will now be processed by processing/common.xsl: anything in a MajorVersion element whose number matches the Greenstone major version number specified to generate-html.sh/bat (or ApplyXSLT.java) will be output to html, if the MajorVersion number does not match, it won't be output.
Location:
documentation/trunk/tutorials/processing
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • documentation/trunk/tutorials/processing/common.xsl

    r13638 r25472  
    55  exclude-result-prefixes="dict">
    66
     7  <!--The following strips newlines introduced by elements, in particular introduced around the MajorVersion template match
     8      See http://stackoverflow.com/questions/3265244/removing-blank-lines-in-xslt
     9      and http://msdn.microsoft.com/en-us/library/ms256107.aspx -->
     10  <xsl:strip-space elements="*"/>
     11 
    712  <xsl:variable name="diction" select="dict:new('en')"/>
    813
     
    160165  </xsl:template>
    161166
     167  <!-- Do not process any elements marked with MajorVersion and whose version does not
     168       specifically match the requested greenstone major version (2 or 3) -->
     169  <!--To avoid multiple lines of whitespace around output, use
     170     <xsl:for-each select="node()"><xsl:apply-templates/></xsl:for-each>
     171     This outputs the contents on its own separate line.
     172     To avoid thinking about unnecessary newlines and to avoid omitting any sub-xml items
     173     that need to be processed, we can instead have the following at the top of the file:
     174     <xsl:strip-space elements="*"/> -->
     175  <xsl:template match="MajorVersion">
     176    <xsl:if test="$gs-major-version=@number">
     177      <xsl:apply-templates/>     
     178    </xsl:if>
     179  </xsl:template>
     180
    162181  <xsl:template name="SampleFiles">
    163182    <xsl:param name="mode">web</xsl:param>
  • documentation/trunk/tutorials/processing/xml-to-index.xsl

    r17494 r25472  
    44
    55  <xsl:output method="html"/>
     6  <xsl:param name="gs-major-version"/>
    67  <xsl:include href="common.xsl"/>
    78
  • documentation/trunk/tutorials/processing/xml-to-many-html.xsl

    r17494 r25472  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    44
     5  <xsl:param name="gs-major-version"/>
    56  <xsl:include href="common.xsl"/>
    67
  • documentation/trunk/tutorials/processing/xml-to-one-html.xsl

    r17494 r25472  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    44
     5  <xsl:param name="gs-major-version"/>
    56  <xsl:include href="common.xsl"/>
    67  <xsl:output method="html"/>
  • documentation/trunk/tutorials/processing/xml-to-one-workshop.xsl

    r17494 r25472  
    44  xmlns:xalan="http://xml.apache.org/xalan">
    55
     6  <xsl:param name="gs-major-version"/>
    67  <xsl:include href="common.xsl"/>
    78
  • documentation/trunk/tutorials/processing/xml-to-top-index.xsl

    r13638 r25472  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    44
     5  <xsl:param name="gs-major-version"/>
    56  <xsl:include href="common.xsl"/>
    67
  • documentation/trunk/tutorials/processing/xml-to-wiki-index.xsl

    r13638 r25472  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    44
     5  <xsl:param name="gs-major-version"/>
    56  <xsl:include href="common.xsl"/>
    67
  • documentation/trunk/tutorials/processing/xml-to-workshop.xsl

    r13638 r25472  
    44  xmlns:xalan="http://xml.apache.org/xalan">
    55
     6  <xsl:param name="gs-major-version"/>
    67  <xsl:include href="common.xsl"/>
    78
Note: See TracChangeset for help on using the changeset viewer.