<?xml version='1.0'?>
<!-- to do's and such:
      - use rules.n3 from http://infomesh.net/2001/05/rdflint/ to clean up missing definitions...
      that's not what it does...only looks for inconsistencies in the schema...none.
-->

<!-- command line: java org.apache.xalan.xslt.Process -IN earl1-schema.rdf -XSL earl-spec.xsl -OUT earl-spec.html -->

<!-- @@ todo:
22:07:52 <wendy> i'm using XSLT to generate parts of the EARL spec (from the schema), and I'm wondering why some classes are never explicitly declared.
22:08:03 <wendy> declared/defined (whatever the correct term is).
22:10:09 <wendy> e.g. testMode is a Property and TestMode is used to create types of testModes (e.g. Manual and Heuristic).
22:10:53 <wendy> testMode has range of TestMode ...which implies that TestMode is a class.
22:11:17 <wendy> perhaps that implication is all that is needed...?
22:12:20 <JibberJim> * JibberJim doesn't understand the question...
22:17:14 <wendy> in the schema, classes are defined using a statement like:
22:17:29 <wendy> <rdfs:Class rdf:about="http://www.w3.org/2001/03/earl/1.0-test#Tool">
22:17:29 <wendy>         <rdfs:comment>This is a tool; a bit of software, perhaps with a desc.</rdfs:comment>
22:17:29 <wendy>         <rdfs:label>Tool</rdfs:label>
22:17:36 <wendy> <rdfs:subClassOf rdf:resource="http://www.w3.org/2001/03/earl/1.0-test#TestSubject"/>
22:17:37 <wendy>     </rdfs:Class>
22:17:51 <wendy> properties are defined similarly, but with <rdf:Property...>
22:18:04 <JibberJim> Yep.
22:18:06 <wendy> however, there seem to be some classes that don't have a "formal" definition, but they are used.
22:18:08 <wendy> e.g.
22:18:57 <wendy> TestMode

00:19:59 <sbp> on #swhack...
00:20:00 <sbp> <sbp> FYI, <rdfs:range rdf:resource="http://www.w3.org/2001/03/earl/1.0-test#TestMode" />
00:20:00 <sbp> <sbp> the range of range is rdfs:Class
00:20:14 <sbp> work from the XML RDF version if that's easier for you
00:22:44 <sbp> you can get some of the "missing" triples from it by running rules.n3 over it
00:42:17 <wendy> ok. thx. i'll play with rules.n3
-->


<xsl:stylesheet version='1.0' 
   xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
   xmlns:earl="http://www.w3.org/2001/03/earl/1.0-test#">

<xsl:output method='html' indent='yes' doctype-public='-//W3C/DTD HTML 4.01 Final//EN'/>
  <!-- versioning variables -->
  <xsl:variable name="draftDate">24 May 2002</xsl:variable>
  <xsl:variable name="thisVersion">http://www.w3.org/WAI/ER/2002/05/earl1-0.html</xsl:variable>
  <xsl:variable name="previousVersion">xxx</xsl:variable>
  <xsl:variable name="latestVersion">http://www.w3.org/WAI/ER/EARL/</xsl:variable>

  <xsl:template match='/'>
      <html><head>
               <link rel="stylesheet" type="text/css" href="http://www.w3.org/WAI/style/waiwg.css"/>
               <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WD"/>
               <style>
                  .rule {background-color:  #ddeeff; color: black}
                  p {padding-left: 30px}
                  h4 {font-style: italic; padding-left: 10px}
               </style>
               <title>Evaluation and Report Language (EARL) 1.0</title>
            </head>
         <body>
            <div class="head">
            <p><a href="http://www.w3.org/">
            <img height="48" width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home" /></a>
            </p></div>
            
            <h1>Evaluation and Report Language (EARL) 1.0</h1>
            <h2>W3C Working Draft <xsl:value-of select="$draftDate"/></h2>
               <dl>
                  <dt>This version:</dt>
                  <dd><a href="{$thisVersion}"><xsl:value-of select="$thisVersion"/></a></dd>
                  <dt>Latest version:</dt>
                  <dd><a href="{$latestVersion}"><xsl:value-of select="$latestVersion"/></a></dd>
                  <dt>Previous version:</dt>
                  <dd><a href="{$previousVersion}"><xsl:value-of select="$previousVersion"/></a></dd>
                  <dt>Editors:</dt>
                  <dd>Wendy Chisholm, W3C<br />
                  Sean B. Palmer</dd>
               </dl>
               
               <div id="toc">
                 <h2><a name="contents" id="contents" accesskey="c">Table of Contents</a></h2>
                   <!-- ul>
                     <xsl:apply-templates select="*/category" mode="toc"/>
                   </ul -->
                </div>

            <h2>Classes</h2>
            <xsl:apply-templates select="*/rdfs:Class"/>
            
            <h2>Properties</h2>
            <xsl:apply-templates select="*/rdf:Property"/>
            
                     
            <hr/>
            <p class="copyright">
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright"> Copyright</a> 
            &#xA9; 2001-2002 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr>
            </a><sup>&#xAE;</sup> (<a href="http://www.lcs.mit.edu/"><abbr title="Massachusetts Institute 
            of Technology">MIT</abbr></a>, <a href="http://www.inria.fr/"><abbr xml:lang="fr" lang="fr" 
            title="Institut National de Recherche en Informatique et Automatique">INRIA</abbr></a>, 
            <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C 
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Legal_Disclaimer">liability</a>, 
            <a href="http://www.w3.org/Consortium/Legal/ipr-notice-20000612#W3C_Trademarks">trademark</a>, 
            <a href="http://www.w3.org/Consortium/Legal/copyright-documents-19990405">document use</a> and 
            <a href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">software licensing</a> 
            rules apply.</p>
         </body>
       </html>
  </xsl:template>
  
  <xsl:template match='rdfs:Class'>
      <h3><xsl:value-of select='./rdfs:label'/></h3>
      <xsl:apply-templates select="rdfs:comment"/>
 
      <xsl:variable name='class-instance' select='./rdfs:label'/>
      <h4>Instances of the <xsl:value-of select='$class-instance'/> class</h4>
      
      <ul>
        <xsl:for-each select="/rdf:RDF//earl:*[local-name()=$class-instance]/rdfs:label">
          <!-- @@ need a test here so that if the result nodeset is empty, it says "none" -->  
          <li>
            <xsl:value-of select="."/>
          </li>
        </xsl:for-each>
      </ul>
            
      <!-- @@find all Properties whose range and/or domain is this class? -->
         
   </xsl:template>
 
   <xsl:template match='earl:Validity'>
      <li><xsl:value-of select='./@rdf:about'/></li>
   </xsl:template>
   
   <xsl:template match='earl:TestMode'>
      <li><xsl:value-of select='./@rdf:about'/></li>
   </xsl:template>

   <xsl:template match='rdf:Property'>
      <h3><xsl:value-of select='./rdfs:label'/></h3>
      <xsl:apply-templates/>
   </xsl:template>
    
   <xsl:template match='rdfs:label'>
   </xsl:template>
   
   <xsl:template match='rdfs:comment'>
      <p><xsl:value-of select='.'/></p>
   </xsl:template>
  
  <xsl:template match='rdfs:domain'>
      <p>The domain of this property is: <xsl:value-of select='./@rdf:resource'/></p>
  </xsl:template>
  
  <xsl:template match='rdfs:range'>
      <p>The range for this property is: <xsl:value-of select='./@rdf:resource'/></p>
  </xsl:template>
  
  <xsl:template match='@rdf:about'>
      <p><xsl:value-of select='.'/></p>
  </xsl:template>


  <!-- when we meet div with id="toc", we include the toc -->
  <!-- we keep the id in it so we can keep doing this -->
  
<!-- xsl:template match="*/category" mode="toc">
      <li><a href="#{@id}"><xsl:value-of select="./@name"/></a></li>
</xsl:template -->

</xsl:stylesheet>
