<?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="str" xmlns:str="http://www.w3.org/2001/10/str-util.xsl">

  <xsl:import href="http://www.w3.org/2001/10/str-util.xsl" />

<!-- 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"  />


<!-- useful for tools based on the XSLT servlet -->
  <xsl:param name="xmlfile"/>
  <xsl:variable name="doc_uri">
    <xsl:choose>
      <xsl:when test="starts-with($xmlfile,'http://cgi.w3.org/cgi-bin/tidy-if?docAddr=')">
        <xsl:value-of select="substring-after($xmlfile,'http://cgi.w3.org/cgi-bin/tidy-if?docAddr=')"/>
      </xsl:when>
      <xsl:when test="starts-with($xmlfile,'http://cgi.w3.org/cgi-bin/tidy?docAddr=')">
        <xsl:value-of select="substring-after($xmlfile,'http://cgi.w3.org/cgi-bin/tidy?docAddr=')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$xmlfile"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

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

    <p>This XSLT compares the entries in the given document glossary (identified by a <code>&lt;dl class='glossary'&gt;</code> with the <a href="/QA/glossary">QA Glossary entries</a> and reports discrepancies.</p>

    <form action="http://www.w3.org/2002/08/xslt4html" method="get">
      <div>
        <input type="hidden" name="xslfile" value="http://www.w3.org/QA/WG/2004/11/compare-glossary" /><input type="hidden" name="auth" value="proxy" />
        <p><label>URI of the document: <input type="text" name="xmlfile" value="http://www.w3.org/" /></label></p>
        <p><input type="submit" value="Process" /><input type="reset" /></p>
      </div>
    </form>


    <p class="copyright">Copyright &#169; 1994-2004 <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.org/"><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: compare-glossary.xsl,v 1.9 2005/04/28 11:03:50 dom Exp $</address>
    </body>
</html>

<xsl:variable name="qaglossary" select="document('http://www.w3.org/QA/glossary')/html:html/html:body/html:div[@id='Content']"/>

<xsl:template match="/">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="http://www.w3.org/StyleSheets/base"/>
    <link rel="stylesheet" href="http://www.w3.org/2001/11/results"/>
    <title>Glossaries comparison for <xsl:value-of select="/html:html/html:head/html:title" /></title>
  </head>
  <body>
    <div class='head'><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C"/></a></div>
    <h1>Glossaries comparison for <a href="{$doc_uri}"><xsl:value-of select="/html:html/html:head/html:title" /></a></h1>
    <dl>
  <xsl:for-each select="/html:html/html:body//html:dl[@class='glossary']/html:dt">
    <dt><xsl:value-of select="."/></dt>
    <dd>
      <xsl:choose>
        <xsl:when test="not($qaglossary//html:dt[translate(normalize-space(),$str:uc,$str:lc)=translate(normalize-space(current()),$str:uc,$str:lc)])">
          <span class="no">not defined in QA Glossary</span>: needs synchronization
        </xsl:when>
        <xsl:when test="not(normalize-space(translate($qaglossary//html:dt[normalize-space()=normalize-space(current())]/following-sibling::html:dd[1],$str:uc,$str:lc))=normalize-space(translate(following-sibling::html:dd[1],$str:uc,$str:lc)))">
          <span class="no">definitions don't match</span>: needs sync
        </xsl:when>
        <xsl:otherwise>
          <span class="yes">ok</span>
        </xsl:otherwise>
      </xsl:choose>
    </dd>
  </xsl:for-each>
    </dl>
    <address><a href="http://www.w3.org/People/Dom/">Dominique Haza&#235;l-Massieux</a> - Produced by $Id: compare-glossary.xsl,v 1.9 2005/04/28 11:03:50 dom Exp $</address>

  </body>
  </html>
</xsl:template>

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

</xsl:stylesheet>
