<?xml-stylesheet href="http://www.w3.org/StyleSheets/base.css" type="text/css"?><?xml-stylesheet href="http://www.w3.org/2002/02/style-xsl.css" type="text/css"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns="http://www.w3.org/1999/xhtml" 
  xmlns:html="http://www.w3.org/1999/xhtml" 
  exclude-result-prefixes="html rdf org contact k date"     
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     
  xmlns:contact="http://www.w3.org/2000/10/swap/pim/contact#"     
  xmlns:org="http://www.w3.org/2001/04/roadmap/org#"       
  xmlns:date="http://www.w3.org/2001/08/date-util.xslt"     
  xmlns:k="http://opencyc.sourceforge.net/daml/cyc.daml#">

<xsl:import href="http://www.w3.org/2001/08/date-util.xslt" />

<!-- Output method XML -->
<xsl:output method="xml" 
  indent="yes"
  omit-xml-declaration="no" 
  encoding="utf-8" 
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"  />


<!-- What's best? URI or text? using text for now...-->
<xsl:param name="activityId" select="substring-before(normalize-space(/html:html/html:head/html:title),' Statement')"/>


<xsl:variable name="activitiesData" select="document('../../../2000/04/mem-news/groups.rdf')/rdf:RDF"/>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="http://www.w3.org/StyleSheets/base"/>
    <title>Activity Statements processor</title>
  </head>
  <body>
    <div class='head'><a href="/"><img src="/Icons/w3c_home" alt="W3C"/></a></div>
    <h1>Activity Statements processor</h1>

    <p>This XSLT style sheet takes an activity statement and updates the navigation bar and structure information based on the <a href="/Member/Mail">W3C Groups and Activities Overview</a> (or rather its <a href="/2000/04/mem-news/groups.rdf">RDF version</a>).</p>

    <p class="copyright">Copyright &#169; 2015 <a href="http://www.w3.org/">World Wide Web Consortium</a>, (<a
href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of
Technology">M.I.T.</acronym></a>, <a
href="http://www.ercim.eu/"><acronym
title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a
href="http://www.keio.ac.jp/">Keio University</a>). All Rights
    Reserved. http://www.w3.org/Consortium/Legal/. W3C <a href="http://www.w3.org/Consortium/Legal/copyright-software">software licensing</a> rules apply.</p>
    <address><a href="http://www.w3.org/People/Dom/">Dominique Haza&#235;l-Massieux</a> - $Id: processActivityStatements.xsl,v 1.58 2014-12-30 15:08:54 ijacobs Exp $</address>
    </body>
</html>

<xsl:template match="html:h1">
  <xsl:if test="normalize-space(.)!=normalize-space(//html:title)">
    <xsl:message>
      Warning: title and h1 differ.
    </xsl:message>
  </xsl:if>
  <h1><xsl:value-of select="//html:title"/></h1>
</xsl:template>

<xsl:template match="html:ul[@id='Navigate']">
  <ul id="Navigate">
    <li>
      <a href="/">W3C Home</a>
      <ul class="nav">
        <li>
          <a href="/Consortium/">About W3C</a>
          <ul class="nav">
            <li>
              <a href="/Consortium/activities">W3C Activities</a>
              <ul class="nav">
                <li class="boldblack">
                  Activity Statements
                  <ul class="nav">
                    <xsl:for-each select="$activitiesData/*[rdf:type/@rdf:resource='http://www.w3.org/2001/04/roadmap/org#Activity' or local-name()='Activity'][org:statement/@rdf:resource]">
                      <xsl:sort select="org:name"/>
                      <xsl:choose>
                        <xsl:when test="not(normalize-space(org:name)=$activityId)">
                          <li><a href="{org:statement/@rdf:resource}" title="{org:name} Statement"><xsl:value-of select="substring-before(org:name,' Activity')"/></a></li>
                        </xsl:when>
                        <xsl:otherwise>
                          <li class="navcurrent"><xsl:value-of select="substring-before(org:name,' Activity')"/></li>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:for-each>
                  </ul>
                </li>
              </ul>
            </li>
          </ul>
        </li>
      </ul>
    </li>
  </ul>
</xsl:template>

<xsl:template match="html:*[@id='Structure']">
  <xsl:variable name="groups" select="$activitiesData/*[normalize-space(org:name)=$activityId]/org:includes"/>
  <xsl:choose>
    <xsl:when test="count($groups) = 0">
      <p id="Structure">There are currently no open groups in this Activity.</p>
    </xsl:when>
    <xsl:otherwise>
      <xsl:comment>THIS TABLE GENERATED From Member/Mail</xsl:comment>
      <table id="Structure" summary="table of links to groups, Chairs, Team Contacts and charters for the {$activityId} Activity">
	<thead>
	  <tr>
	    <th scope="col">Group</th>
	    <th scope="col">Chair</th>
	    <th scope="col">Team Contact</th>
	    <th scope="col">Charter</th>
	  </tr>
	</thead>
	<tbody>
	  <xsl:for-each select="$groups">
	    <xsl:apply-templates select="$activitiesData/*[@rdf:nodeID=current()/@rdf:nodeID]"/>
	  </xsl:for-each>
	</tbody>
      </table>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template match="*[@rdf:nodeID]">
  <tr>
    <th scope="row">
      <xsl:choose>
        <xsl:when test="contact:homePage/@rdf:resource">
          <a href="{contact:homePage/@rdf:resource}"><xsl:value-of select="org:name"/></a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="org:name"/>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="org:membershipPage/@rdf:resource">
          <span class="partlink"> <br/>
          (<a title="Participants in the {org:name} [Member-only link]" href="{org:membershipPage/@rdf:resource}">participants</a>)</span>
     </xsl:if>
    </th>
    <td>
      <xsl:for-each select="org:chair[@rdf:nodeID]">
        <xsl:value-of select="/rdf:RDF/*[@rdf:nodeID=current()/@rdf:nodeID]/contact:fullName"/>
        <xsl:if test="not(position()=last())">
          <xsl:text>, </xsl:text>
        </xsl:if>
      </xsl:for-each>
    </td>
    <td>
      <xsl:for-each select="org:teamContact[@rdf:nodeID]">
        <xsl:value-of select="/rdf:RDF/*[@rdf:nodeID=current()/@rdf:nodeID]/contact:fullName"/>
        <xsl:if test="not(position()=last())">
          <xsl:text>, </xsl:text>
        </xsl:if>
      </xsl:for-each>
    </td>
    <td>
      <xsl:choose>
        <xsl:when test="org:charter/@rdf:resource">
          <a href="{org:charter/@rdf:resource}">Chartered</a>
        </xsl:when>
        <xsl:otherwise>
          <xsl:message><xsl:value-of select="org:name"/> doesn't have a link to a charter</xsl:message>
          <xsl:text>Chartered</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:text> until </xsl:text>
      <xsl:call-template name="date:makeDateFriendly">
        <xsl:with-param name="date" select="translate(k:endingDate,'-','')"/>
      </xsl:call-template>
    </td>
  </tr>
</xsl:template>

  <xsl:template match="html:body">
    <xsl:copy>
      <xsl:if test="not(normalize-space($activityId))">
        <xsl:message>Unable to identify the activity based on document title!</xsl:message>
        <p style='color:red'>The activity could not be identified while processing the document!</p>
      </xsl:if>
      <xsl:apply-templates select="*|@*|comment()|text()"/>
    </xsl:copy>
  </xsl:template>

 <xsl:template match="html:p[@id='about-ac-mtg']">
  <p id="about-ac-mtg">
    <xsl:comment>This paragraph will be updated automatically</xsl:comment>
    This Activity Statement was prepared for TPAC 2014 per <a
  href="/Consortium/Process/activities#Activities">section 5</a>
  of the <a href="/Consortium/Process/">W3C Process Document</a>.
  <a href="/2005/04/activity/processActivityStatements.xsl">Generated</a>
  from <a href="http://www.w3.org/2000/04/mem-news/public-groups.rdf">group data</a>.
  </p> 
 </xsl:template>

<xsl:template match="html:p[@id='Footer']">
<!-- Update annually -->
      <p id="Footer"><a href="/Consortium/Legal/ipr-notice#Copyright" rel="Copyright">Copyright</a> &#169; 2014 <a href="/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>&#174;</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
      <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C
      <a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
      <a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
      <a href="/Consortium/Legal/copyright-documents" rel="Copyright">document use</a> and <a href="/Consortium/Legal/copyright-software" rel="Copyright">software
	licensing</a> rules apply. Your interactions with this site are in
      accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy
      statements.</p>

</xsl:template>

<xsl:template match="@shape"/>

  <!-- default: Identity Transformation -->
  <xsl:template match="*|@*|comment()|text()">
    <xsl:copy>
      <xsl:apply-templates select="*|@*|comment()|text()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
