<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp    "&#160;">
<!ENTITY lsaquo  "&#8249;">
<!ENTITY rsaquo  "&#8250;">
<!ENTITY laquo   "&#171;">
<!ENTITY raquo   "&#187;">
<!ENTITY copy    "&#169;">
<!ENTITY bull    "&#8226;"> <!-- Added 20150319. DJ -->
]>
<xsl:stylesheet version="3.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:ou="http://omniupdate.com/XSL/Variables"
  xmlns:fn="http://omniupdate.com/XSL/Functions"
  xmlns:ouc="http://omniupdate.com/XSL/Variables"
  exclude-result-prefixes="xsl xs ou fn ouc">

  <!--  Importing files to acquire their functionality of templates and parameters. All imported templates and parameters have lower priority. 
  This makes it possible to define templates or parameters with the same name/match conditions and redefine their functionality. -->
  <!-- IMPORTANT!!!! Change '[account]/[site]' in the following lines to the correct account and site name for your project. -->
  <xsl:import href="./_shared/template-matches.xsl" />
  <xsl:import href="./_shared/ouvariables.xsl" />
  <xsl:import href="./_shared/functions.xsl" />
  <xsl:import href="./_shared/breadcrumb.xsl"/>

  <xsl:output method="html" indent="yes" encoding="UTF-8" omit-xml-declaration="yes" />
  <!--<xsl:strip-space elements="*" />-->
  
  <xsl:template match="/document">
    <xsl:choose>
      <xsl:when test="$ou:action='pub'"> 
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%<xsl:text disable-output-escaping="yes">&gt;&#x0D;&#x0A;</xsl:text>
      </xsl:when>
    </xsl:choose>
        <xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">&gt;&#x0D;&#x0A;</xsl:text>
    <html lang="en">
      <head>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <!-- Get the right title for the rendered page. -->
        <xsl:choose>
          <xsl:when test="$pageType='home'">
            <title><xsl:value-of select="$pageTitle"/></title>    
          </xsl:when>
          <xsl:otherwise>
        <title><xsl:value-of select="concat($pageTitle, ' - SDCCD Campus Solutions HelpDesk')"/></title>
          </xsl:otherwise>
        </xsl:choose>
        
        <xsl:apply-templates select="/document/ouc:properties[@label='metadata']/meta[string-length(@content)>0]" mode="copy"/>
        <xsl:call-template name="common-headcode"/>
        <xsl:call-template name="template-headcode"/> <!-- each pagetype may have a version of this template -->
        <xsl:apply-templates select="headcode/node()" mode="copy"/> <!-- pcf -->
      </head>
      
      <body>
        <!--- Add the correct attributes for the page type -->
        <xsl:choose>
          <xsl:when test="$pageType='home'">
            <xsl:attribute name="class">home page page-template page-template-template-front-page-php</xsl:attribute>
          </xsl:when>
          <xsl:otherwise>
            <xsl:attribute name="data-spy">scroll</xsl:attribute>
			<xsl:attribute name="data-target">.navbar-collapse</xsl:attribute>
          </xsl:otherwise>
        </xsl:choose>
        
        <!-- This choose statement structure does not need to be retained in your final XSL file. This choose structure is only here 
        for the splash page. You only need to retain the "call-template" for the page-content template. However, if you wish to have 
        several different page types in your site, then this is a good example for your model. -->
        <!--<xsl:choose>-->
          <!-- If the file to be processed is the 'splash' page, then call the template to process the page. -->
          <!--<xsl:when test="$pageType='splash'">
            <xsl:call-template name="splashpage"/>
          </xsl:when>-->
          <!-- 'Normal' processing -->
          <!--<xsl:otherwise>-->
            <!-- Retain this call-template line. You can get rid of everything else within the chhose statement. -->
            <xsl:apply-templates select="bodycode/node()" mode="copy"/> <!-- pcf -->
            <xsl:call-template name="common-header"/>
            <xsl:call-template name="page-content"/>
            <xsl:call-template name="common-footer"/>
          <!--</xsl:otherwise>-->
        <!--</xsl:choose>-->
      </body>
    </html>
  </xsl:template>
   
  <xsl:template name="common-headcode">
    <xsl:choose>
      <xsl:when test="$ou:action='pub'">
        <xsl:copy-of select="ou:includeFile('/_resources/includes/comheadcode-promise.html')"/>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/headcode.html')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/comheadcode-promise.html')"/>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/headcode.html')"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <xsl:template name="common-header">
    <xsl:choose>
      <xsl:when test="$ou:action='pub'">
        <xsl:copy-of select="ou:includeFile('/_resources/includes/header.html')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/header.html')"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  <!-- Retain the follwoing line in your final common.xsl file. This is the defualt page content template. -->
  <xsl:template name="page-content"><p>common.xsl: No page content template defined.</p></xsl:template>
  
  <xsl:template name="common-footer">
    <xsl:choose>
      <xsl:when test="$ou:action='pub'">
        <xsl:copy-of select="ou:includeFile('/_resources/includes/footer.html')"/>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/footcode.html')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/footer.html')"/>
        <xsl:copy-of select="ou:includeFile('/_resources/includes/footcode.html')"/>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:apply-templates select="footcode/node()" mode="copy"/> <!-- pcf -->
    <xsl:text>&#x0A;</xsl:text>
    <!--<xsl:if test="$ouc:action='pub'">
      <xsl:if test="$ou:httproot = 'https://www.sdccd.edu/about/departments-and-offices/student-services-department/index.aspxcscenter/'">-->
        <!--<xsl:comment><xsl:value-of select="$ou:httproot"/></xsl:comment>-->
        <!-- Disabled during Implementation -->
        <!--<xsl:copy-of select="ou:includeFile('/_resources/includes/analytics.html')"/>-->
      <!--</xsl:if>
    </xsl:if>-->
    <!--<xsl:text>&#x0A;</xsl:text>-->
    <div id="hidden" style='display:none;'><ouc:ob></ouc:ob></div>
  </xsl:template>
  
  <xsl:template name="template-headcode"/>
  
  <!-- The following call includes the splashpage.xsl file. It can be removed from your final common.xsl file. -->
  <xsl:include href="splashpage.xsl" />
          
</xsl:stylesheet>
