2006/ws/policy xmlspec-policy-xsl1-0.xsl,1.1,1.2

Update of /sources/public/2006/ws/policy
In directory hutz:/tmp/cvs-serv24678/policy

Modified Files:
	xmlspec-policy-xsl1-0.xsl 
Log Message:
Aligned with latest version of xmlspec-policy.xsl

Index: xmlspec-policy-xsl1-0.xsl
===================================================================
RCS file: /sources/public/2006/ws/policy/xmlspec-policy-xsl1-0.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- xmlspec-policy-xsl1-0.xsl	4 Apr 2007 08:13:27 -0000	1.1
+++ xmlspec-policy-xsl1-0.xsl	1 Jun 2007 03:01:28 -0000	1.2
@@ -138,4 +138,336 @@
 <xsl:template match="code[@role='code-emph']">
 <code style="font-style: italic;"><xsl:value-of select="."/></code>
 </xsl:template>
+<!-- Template for Best practices output, used only for guidelines document.-->
+    <xsl:template match="p[@role='practice']">
+        <xsl:variable name="practicenumber">
+            <xsl:number count="p[@role='practice']" level="any"/>
+        </xsl:variable>
+        <div class="boxedtext">
+            <p>
+                <a name="{@id}" id="{@id}"/>
+                <span class="practicelab">
+                    <xsl:text>Best
+Practice </xsl:text>
+                    <xsl:value-of select="$practicenumber"/>
+                    <xsl:text>: </xsl:text>
+                    <xsl:value-of select="quote[1]"/>
+                </span>
+            </p>
+            <p class="practice">
+                <xsl:value-of select="quote[2]"/>
+            </p>
+        </div>
+    </xsl:template>
+    <xsl:template name="css">
+    <style type="text/css">
+      <xsl:text>
+code           { font-family: monospace; }
+
+div.constraint,
+div.issue,
+div.note,
+div.notice     { margin-left: 2em; }
+
+ol.enumar      { list-style-type: decimal; }
+ol.enumla      { list-style-type: lower-alpha; }
+ol.enumlr      { list-style-type: lower-roman; }
+ol.enumua      { list-style-type: upper-alpha; }
+ol.enumur      { list-style-type: upper-roman; }
+
+dt.label       { display: run-in; }
+
+li, p           { margin-top: 0.3em;
+                 margin-bottom: 0.3em; }
+
+.diff-chg	{ background-color: yellow; }
+.diff-del	{ background-color: red; text-decoration: line-through;}
+.diff-add	{ background-color: lime; }
+
+table          { empty-cells: show; }
+
+table caption {
+	font-weight: normal;
+	font-style: italic;
+	text-align: left;
+	margin-bottom: .5em;
+}
+
+div.issue {
+  color: red;
+}
+.rfc2119 {
+  font-variant: small-caps;
+}
+
+
+
+.boxedtext {
+   border: solid #bebebe 1px;
+   margin: 2em 1em 1em 2em;
+ }
+
+.principle, .practice, .constraint, .property, div.story {
+   margin: 1.5em 0.5em 1em 1em;
+ }
+
+.principlelab, .constraintlab,
+.propertylab, .practicelab,
+.storylab {
+   margin: 1.5em 0.5em 1em 1em;
+   font-weight: bold;
+   font-style: italic;
+ }
+
+.principlelab  { background: #f7ebd7 }
+.constraintlab { background: #becece }
+.propertylab   { background: #f7ebd7 }
+.practicelab   { background: #dfffff }
+.storylab      { background: #005a9c; color: #fff; }
+
+/* Make sure the relative spacing stuff only applies to 'screen'
+   because IE has bugs when it comes to printing relative things. */
+
+@media screen {
+
+.principle, .practice, .constraint, .property, div.story {
+   position: relative;
+   top: -2em;
+   padding: 0;
+   margin: 1.5em 0.5em -1em 1em;
+}
+
+.principlelab, .constraintlab,
+.propertylab, .practicelab,
+.storylab {
+   position: relative;
+   padding: 0 0.5em;
+   top: -1.5em;
+ }
+</xsl:text>
+      <xsl:if test="$tabular.examples = 0">
+        <xsl:text>
+div.exampleInner pre { margin-left: 1em;
+                       margin-top: 0em; margin-bottom: 0em}
+div.exampleOuter {border: 4px double gray;
+                  margin: 0em; padding: 0em}
+div.exampleInner { background-color: #d5dee3;
+                   border-top-width: 4px;
+                   border-top-style: double;
+                   border-top-color: #d3d3d3;
+                   border-bottom-width: 4px;
+                   border-bottom-style: double;
+                   border-bottom-color: #d3d3d3;
+                   padding: 4px; margin: 0em }
+div.exampleWrapper { margin: 4px }
+div.exampleHeader { font-weight: bold;
+                    margin: 4px}
+</xsl:text>
+      </xsl:if>
+      <xsl:value-of select="$additional.css"/>
+    </style>
+    <link rel="stylesheet" type="text/css">
+      <xsl:attribute name="href">
+        <xsl:text>http://www.w3.org/StyleSheets/TR/</xsl:text>
+        <xsl:choose>
+          <xsl:when test="/spec/@role='editors-copy'">base</xsl:when>
+          <xsl:otherwise>
+            <xsl:choose>
+	      <!-- Editor's review drafts are a special case. -->
+              <xsl:when test="/spec/@w3c-doctype='review'
+			      or contains(/spec/header/w3c-doctype, 'Editor')"
+			>base</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='wd'">W3C-WD</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='rec'">W3C-REC</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='pr'">W3C-PR</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='per'">W3C-PER</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='cr'">W3C-CR</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='note'">W3C-NOTE</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='wgnote'">W3C-WG-NOTE</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='memsub'">W3C-Member-SUBM</xsl:when>
+              <xsl:when test="/spec/@w3c-doctype='teamsub'">W3C-Team-SUBM</xsl:when>
+              <xsl:otherwise>base</xsl:otherwise>
+            </xsl:choose>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>.css</xsl:text>
+      </xsl:attribute>
+    </link>    
+  </xsl:template> 
+    
+    <!-- Necessary for guidelines document: BP numbering -->
+      <xsl:template mode="number" match="p[@role='practice']">
+    <xsl:number count="p[@role='practice']" level="any" format="1. "/>
+  </xsl:template>
+  <xsl:template match="specref">
+    <xsl:param name="target" select="key('ids', @ref)[1]"/>
+
+    <xsl:choose>
+      <xsl:when test="not($target)">
+	<xsl:message>
+	  <xsl:text>specref to non-existent ID: </xsl:text>
+	  <xsl:value-of select="@ref"/>
+	</xsl:message>
+      </xsl:when>
+        <xsl:when test="$target[local-name()='p' and @role='practice']">
+            <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <b>
+            <xsl:apply-templates select="id(@ref)" mode="number"/>
+            <xsl:apply-templates select="id(@ref)/quote[1]" mode="text"/>
+          </b>
+        </a>
+        </xsl:when>
+      <xsl:when test="local-name($target)='issue'">
+        <xsl:text>[</xsl:text>
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <b>
+            <xsl:text>Issue </xsl:text>
+            <xsl:apply-templates select="id(@ref)" mode="number"/>
+            <xsl:text>: </xsl:text>
+            <xsl:for-each select="id(@ref)/head">
+              <xsl:apply-templates/>
+            </xsl:for-each>
+          </b>
+        </a>
+        <xsl:text>]</xsl:text>
+      </xsl:when>
+      <xsl:when test="starts-with(local-name($target), 'div')">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <b>
+            <xsl:apply-templates select="id(@ref)" mode="divnum"/>
+            <xsl:apply-templates select="id(@ref)/head" mode="text"/>
+          </b>
+        </a>
+      </xsl:when>
+      <xsl:when test="starts-with(local-name($target), 'inform-div')">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+	  <b>
+            <xsl:apply-templates select="id(@ref)" mode="divnum"/>
+            <xsl:apply-templates select="id(@ref)/head" mode="text"/>
+          </b>
+        </a>
+      </xsl:when>
+      <xsl:when test="local-name($target) = 'vcnote'">
+        <b>
+          <xsl:text>[VC: </xsl:text>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="id(@ref)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:apply-templates select="id(@ref)/head" mode="text"/>
+          </a>
+          <xsl:text>]</xsl:text>
+        </b>
+      </xsl:when>
+      <xsl:when test="local-name($target) = 'prod'">
+        <b>
+          <xsl:text>[PROD: </xsl:text>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="id(@ref)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:apply-templates select="$target" mode="number-simple"/>
+          </a>
+          <xsl:text>]</xsl:text>
+        </b>
+      </xsl:when>
+      <xsl:when test="local-name($target) = 'label'">
+        <b>
+          <xsl:text>[</xsl:text>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="id(@ref)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:value-of select="$target"/>
+          </a>
+          <xsl:text>]</xsl:text>
+        </b>
+      </xsl:when>
+      <!-- MJH added table spec refs -->
+      <xsl:when test="local-name($target) = 'table'">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+	  <xsl:text>Table </xsl:text>
+	  <xsl:apply-templates select="id(@ref)/caption" mode="divnum"/>
+	  <!-- uncomment the following two line to add table captions to references -->
+	  <!--<xsl:text>, "</xsl:text>
+	  <xsl:apply-templates select="id(@ref)/caption" mode="text"/>
+	  <xsl:text>"</xsl:text>
+	  -->
+        </a>
+      </xsl:when>
+      <xsl:when test="local-name($target) = 'example'">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+	  <xsl:text>Example </xsl:text>
+	  <xsl:apply-templates select="id(@ref)/head" mode="divnum"/>
+        </a>
+      </xsl:when>
+      <xsl:when test="local-name($target) = 'graphic'">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="target" select="id(@ref)"/>
+            </xsl:call-template>
+          </xsl:attribute>
+	  <xsl:text>Figure </xsl:text>
+	  <xsl:apply-templates select="id(@ref)" mode="divnum"/>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:message>
+          <xsl:text>Unsupported specref to </xsl:text>
+          <xsl:value-of select="local-name($target)"/>
+          <xsl:text> [</xsl:text>
+          <xsl:value-of select="@ref"/>
+          <xsl:text>] </xsl:text>
+          <xsl:text> (Contact stylesheet maintainer).</xsl:text>
+        </xsl:message>
+        <b>
+          <a>
+            <xsl:attribute name="href">
+              <xsl:call-template name="href.target">
+                <xsl:with-param name="target" select="key('ids', @ref)"/>
+              </xsl:call-template>
+            </xsl:attribute>
+            <xsl:text>???</xsl:text>
+          </a>
+        </b>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
 </xsl:stylesheet>

Received on Friday, 1 June 2007 03:01:32 UTC