<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp   "&#160;">
]>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='http://www.w3.org/TR/REC-html40' version='1.0'>
 <!-- Cut down from xmlschema by Kohsuke KAWAGUCHI for use with RELAX NG issue list. -->
 <!-- $Id: issues.xsl,v 1.14 2002-04-06 12:04:01-05 bear Exp bear $ -->
 <!-- Cut down from xmlschema by Henry S. Thompson for use with
   issues.xml,
   based on http://www.w3.org/1999/05/06-xmlschema-1/XMLspec-19990503.xsl
   and an original from Jonathan Marsh
   TOC modifications from Paul Biron, 1999-07-05 -->

  <xsl:template match='*'><SPAN STYLE='color:pink'><xsl:apply-templates/></SPAN></xsl:template>
  <xsl:output encoding="utf-8" />

  <xsl:template match='/'>
    <!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">-->
    <html>
      <head>
        <meta http-equiv='Content-type' content='text/html; charset=UTF-8'/>
        <title>RELAX NG Issues List</title>
       <style type='text/css'>
                        BODY {  margin: 2em 1em 2em 70px;
                                font-family: Arial, sans-serif;
                                color: black;
                                background-color: white;}
                        H1 {
                        	margin-left: -2em;
                        }
                        H2 {
                        	margin-left: -1.5em;
                        }
                        H3 {
                        	margin-left: -1em;
                        }
                        H4 {
                        	margin-left: -0.5em;
                        }
                        P {     margin-top: 0.6em;      
                                margin-bottom: 0.6em;}
                        PRE {   font-family: monospace 
                                margin-left: 2em }  
                        A:hover { background: #FFA }    

       </style>
      </head>
      <body>
       <h1>RELAX NG Issues List</h1>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>
	
	<xsl:template match='issues'>
		<h3>Version <xsl:value-of select='@version'/></h3>
		<xsl:call-template name='toc'/>
		<xsl:apply-templates select='header'/>
		<div style='background-color: #fff'>
			<h1>Issues</h1>
			<div>
				<xsl:apply-templates select='issue'/>
			</div>
		</div>
	</xsl:template>
	
	<xsl:template name='toc'>
		<h2>Table of Contents</h2>
		
		<xsl:for-each select="categoryDecl">
			<h3><xsl:value-of select="@title"/></h3>
			
			<xsl:call-template name="categoryTOC">
				<xsl:with-param name="category" select="@id"/>
			</xsl:call-template>
		</xsl:for-each>
		
		<h3>All Issues</h3>
		<xsl:for-each select='issue'>
			<xsl:call-template name="printTitle"/>
		</xsl:for-each>
	</xsl:template>

	<xsl:template name="categoryTOC">
		<xsl:param name="category"/>
		
		<xsl:for-each select="..">
			<!-- move the context node back to the parent -->
			
			<xsl:if test="issue[@status='open' and @category=$category]">
				<h4>Remaining Issues</h4>
				<xsl:for-each select='issue'>
					<xsl:if test='@status="open" and @category=$category'>
						<xsl:call-template name="printTitle"/>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
			
			<xsl:if test="issue[@status='proposed' and @category=$category]">
				<h4>Proposed Issues</h4>
		<!--		<p><small>These issues have to be discussed before it is considered as "open".</small></p>	-->
				<xsl:for-each select='issue'>
					<xsl:if test='@status="proposed" and @category=$category'>
						<xsl:call-template name="printTitle"/>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
			
			<xsl:if test="issue[@status='postponed' and @category=$category]">
				<h4>Postponed Issues</h4>
		<!--		<p><small>These issues will be decided after the public review period.</small></p>	-->
				<xsl:for-each select='issue'>
					<xsl:if test='@status="postponed" and @category=$category'>
						<xsl:call-template name="printTitle"/>
					</xsl:if>
				</xsl:for-each>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>

	<!-- produce the issue title name with a link to its body -->
	<xsl:template name="printTitle">
		<div><span>
			<xsl:value-of select="position()"/>
			<xsl:text>. </xsl:text>
			<a href='#{@keyword}'>
				<xsl:value-of select='title'/>
			</a>
		</span></div>
	</xsl:template>

 <xsl:template match='header'>
  <h3><a name='intro'/>Introduction</h3>
  <p><xsl:apply-templates/></p>
 </xsl:template>
  
	<xsl:template match='issue'>
		<div class='issue'>
			<a name='{@keyword}'/>
			<h2>
				<xsl:number format='1. '/>
				<a name="{@keyword}">
					<u>
						<xsl:value-of select='@keyword'/>
					</u>
					<xsl:text>:</xsl:text>
					<xsl:value-of select='title'/>
				</a>
			</h2>
			<small>
				<xsl:text>Originator: </xsl:text>
				<code><a href="mailto:{@originator}">
					<xsl:value-of select='@originator'/>
				</a></code>
				
				<xsl:text> Status: </xsl:text>
				<b>
					<xsl:value-of select='@status'/>
				</b>
				
				<xsl:text> Category: </xsl:text>
				<b>
					<xsl:value-of select='@category'/>
				</b>
				
				<xsl:if test='@source'> Source: <a><xsl:attribute name='href'><xsl:value-of select='@source'/></xsl:attribute><xsl:value-of select='@source'/></a></xsl:if>
			</small>
			<xsl:apply-templates/>
		</div>
  </xsl:template>
  
  <xsl:template match='title'/>
 
 <xsl:template match='description'>
  <h3>Description</h3>
  <div>
   <xsl:apply-templates/>
  </div>
 </xsl:template>
    
  <xsl:template match='p'><p><xsl:apply-templates/></p></xsl:template>


  <xsl:template match='code'>
   <code>
    <xsl:apply-templates/></code></xsl:template>
 
 <xsl:template match='maillink'>
  <a><xsl:attribute name='href'>http://lists.oasis-open.org/archives/relax-ng/<xsl:value-of select='@href' /></xsl:attribute>
    <xsl:apply-templates />
  </a>
 </xsl:template>
 
 <xsl:template match='link'>
  <a><xsl:if test='@href'><xsl:attribute name='href'><xsl:value-of select='@href'/></xsl:attribute></xsl:if>
  <xsl:if test='@name'><xsl:attribute name='name'><xsl:value-of select='@name'/></xsl:attribute></xsl:if><xsl:apply-templates/></a>
 </xsl:template>

 <xsl:template match='references'>
  <h3>Interactions and Input</h3>
  <div>
   <xsl:apply-templates/>
  </div>
 </xsl:template>
 
 <xsl:template match='interaction'>
  <p>Cf. <a><xsl:attribute name='href'>#<xsl:value-of select='@issue'/></xsl:attribute><xsl:value-of select='id(@issue)/title'/></a></p>
  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match='input'>
  <p><a><xsl:attribute name='href'><xsl:value-of select='@href'/></xsl:attribute>Input from </a>
  <xsl:value-of select='@author'/> obtains:</p>
  <div style='margin-left: 36pt'><xsl:apply-templates/></div>
 </xsl:template>
 
 <xsl:template match='proposal'>
  <h3>Proposed Resolution</h3>
  <div><xsl:apply-templates/></div>
 </xsl:template>
 
 <xsl:template match='circumstance'>
  <h3>Circumstance</h3>
  <div><xsl:apply-templates/></div>
 </xsl:template>
 
 <xsl:template match='resolution'>
  <h3>Actual Resolution</h3>
   <div><xsl:apply-templates/></div>
 </xsl:template>
 
  <xsl:template match='emph'>
   <i>
    <xsl:apply-templates/></i></xsl:template>
 <xsl:template match='b'>
  <b>
  <xsl:apply-templates/></b></xsl:template>

  <xsl:template match='pre'>
   <pre><xsl:copy-of select="*|text()" /></pre>
  </xsl:template>


        <xsl:template match='eg'>
        <div class='eg'>
        <table cellpadding='5' border='1' bgcolor='#80ffff' width='100%'>
        <tr>
         <td>
          <xsl:choose>
           <xsl:when test='@role="error"'>
            <pre style='color: red'><xsl:apply-templates/></pre>
           </xsl:when>
           <xsl:otherwise>
            <pre><xsl:apply-templates/></pre>
           </xsl:otherwise>
          </xsl:choose>
         </td>
        </tr>
        </table>
        </div>
        </xsl:template>

  <xsl:template match='olist'>
    <ol>
      <xsl:for-each select='item'>
        <li><xsl:apply-templates/></li>
      </xsl:for-each>
    </ol>
  </xsl:template>

  <xsl:template match='ulist'>
    <ul>
      <xsl:for-each select='item'>
        <li><xsl:apply-templates/></li>
      </xsl:for-each>
    </ul>
  </xsl:template>


</xsl:stylesheet>
