svn commit: r48609 - head/en_US.ISO8859-1/htdocs/news/status

Warren Block <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
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"/>
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.