Format property links like in CSS specs.
authorCameron McCormack <cam@mcc.id.au>
Thu, 10 May 2012 10:18:07 +0200
changeset 14 ffa8aa425c77
parent 13 08efacece0d5
child 15 d4cbdb7dd22c
Format property links like in CSS specs.
publish.xsl
--- a/publish.xsl	Wed May 09 20:55:23 2012 +0200
+++ b/publish.xsl	Thu May 10 10:18:07 2012 +0200
@@ -955,7 +955,7 @@
     </xsl:if>
   </xsl:template>
 
-  <xsl:template match='span[tokenize(@class, " ") = ("element-name", "attr-name", "prop-name") and starts-with(., "&#39;") and ends-with(., "&#39;")]'>
+  <xsl:template match='span[tokenize(@class, " ") = ("element-name", "attr-name", "property") and starts-with(., "&#39;") and ends-with(., "&#39;")]'>
     <span>
       <xsl:copy-of select='@*[namespace-uri() = ""]'/>
       <xsl:value-of select='concat("‘", substring(., 2, string-length() - 2), "’")'/>
@@ -1517,7 +1517,7 @@
     <xsl:choose>
       <xsl:when test='$property'>
         <a href='{$property/@href}'>
-          <span class='prop-name'>
+          <span class='property'>
             <xsl:value-of select='concat("‘", $name, "’")'/>
           </span>
         </a>
@@ -1563,7 +1563,7 @@
     </xsl:choose>
   </xsl:function>
 
-  <xsl:function name='x:name-link' as='element()'>
+  <xsl:function name='x:name-link' as='node()*'>
     <xsl:param name='name'/>
     <xsl:param name='context-element'/>
     <xsl:param name='referencing-element'/>
@@ -1580,9 +1580,14 @@
         <xsl:message>Unknown name "<xsl:value-of select='$name'/>" at <xsl:value-of select="concat(base-uri($referencing-element), ' line ', saxon:line-number())"/>.</xsl:message>
         <a href='data:,' style='background: red; color: white'>@@ unknown name '<xsl:value-of select='$name'/>'</a>
       </xsl:when>
+      <xsl:when test='$property'>
+        <xsl:text>‘</xsl:text>
+        <a href='{$property/@href}'><code class='property'><xsl:value-of select='$name'/></code></a>
+        <xsl:text>’</xsl:text>
+      </xsl:when>
       <xsl:otherwise>
         <a href='{$all/@href}'>
-          <span class='{if ($element) then "element" else if ($attribute) then "attr" else "prop"}-name'>
+          <span class='{if ($element) then "element-name" else "attr-name"}'>
             <xsl:value-of select='concat("‘", $name, "’")'/>
           </span>
         </a>