Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Apr 2016 15:22:42 +0000 (UTC)
From:      Warren Block <wblock@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r48609 - head/en_US.ISO8859-1/htdocs/news/status
Message-ID:  <201604131522.u3DFMg0q088426@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: wblock
Date: Wed Apr 13 15:22:42 2016
New Revision: 48609
URL: https://svnweb.freebsd.org/changeset/doc/48609

Log:
  The stylesheet did not consider long, wrapped lines when generating IDs,
  and produced broken IDs with linefeeds and multiple dashes.  Fix that
  with numerous applications of normalize-space() before translating
  spaces into dashes.  This stylesheet is XSL 1.0. I don't know if there
  is a reason for that.  If it were XSL 2.0, we could define a single
  xsl:function to format IDs and factor out all these normalize-space()
  and translate(, ' ','-') functions into it.

Modified:
  head/en_US.ISO8859-1/htdocs/news/status/report.xsl

Modified: head/en_US.ISO8859-1/htdocs/news/status/report.xsl
==============================================================================
--- head/en_US.ISO8859-1/htdocs/news/status/report.xsl	Wed Apr 13 14:04:51 2016	(r48608)
+++ head/en_US.ISO8859-1/htdocs/news/status/report.xsl	Wed Apr 13 15:22:42 2016	(r48609)
@@ -30,14 +30,14 @@
 	<xsl:for-each select="report/category">
 	  <!-- category title and link -->
 	  <h3><a><xsl:attribute name="href">#<xsl:value-of
-	    select="translate(description,' ', '-')"/></xsl:attribute>
+	    select="translate(normalize-space(description),' ', '-')"/></xsl:attribute>
 	    <xsl:value-of select="description"/></a></h3>
 	  <xsl:variable name="cat-short" select="name"/>
 	  <ul>
 	    <xsl:for-each select="//project[@cat=$cat-short and @summary]">
   	      <xsl:sort select="translate(title, $lowercase, $uppercase)"/>
 	      <li><a><xsl:attribute name="href">#<xsl:value-of
-	      select="translate(title, ' ',
+	      select="translate(normalize-space(title), ' ',
 	      '-')"/></xsl:attribute><xsl:value-of select="title"/></a>
 	      </li>
 	    </xsl:for-each>
@@ -45,7 +45,7 @@
 	    <xsl:for-each select="//project[@cat=$cat-short and not(@summary)]">
   	      <xsl:sort select="translate(title, $lowercase, $uppercase)"/>
 	      <li><a><xsl:attribute name="href">#<xsl:value-of
-	      select="translate(title, ' ',
+	      select="translate(normalize-space(title), ' ',
 	      '-')"/></xsl:attribute><xsl:value-of select="title"/></a>
 	      </li>
 	    </xsl:for-each>
@@ -55,7 +55,7 @@
 	  <xsl:for-each select="//project[not(@cat)]">
   	    <xsl:sort select="translate(title, $lowercase, $uppercase)"/>
 	    <li><a><xsl:attribute name="href">#<xsl:value-of
-	    select="translate(title, ' ',
+	    select="translate(normalize-space(title), ' ',
 	    '-')"/></xsl:attribute><xsl:value-of select="title"/></a>
 	    </li>
 	  </xsl:for-each>
@@ -72,8 +72,8 @@
 
 		<!-- category title -->
 		<br/><h1><a>
-		  <xsl:attribute name="name"><xsl:value-of select="translate(description, ' ', '-')"/></xsl:attribute>
-		  <xsl:attribute name="href">#<xsl:value-of select="translate(description, ' ', '-')"/></xsl:attribute>
+		  <xsl:attribute name="name"><xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute>
+		  <xsl:attribute name="href">#<xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute>
 		  <xsl:value-of select="description"/></a></h1><br/>
 
 		<xsl:variable name="cat-short" select="name"/>
@@ -108,9 +108,9 @@
   <xsl:template match="project">
     <h2><a>
 	<xsl:attribute name="name"><xsl:value-of
-	  select="translate(title, ' ', '-')"/></xsl:attribute>
+	  select="translate(normalize-space(title), ' ', '-')"/></xsl:attribute>
 	  <xsl:attribute name="href">#<xsl:value-of
-	  select="translate(title, ' ', '-')"/></xsl:attribute>
+	  select="translate(normalize-space(title), ' ', '-')"/></xsl:attribute>
 	  <xsl:value-of select="title"/></a></h2>
 
     <xsl:apply-templates select="links"/>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604131522.u3DFMg0q088426>