Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Jul 2013 18:02:26 +0200
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        =?ISO-8859-1?Q?Ren=E9_Ladan?= <rene@freebsd.org>,  FBSD Doc project <doc@FreeBSD.org>
Subject:   Re: [CFT] merging projects/entities
Message-ID:  <51D83F92.7030808@FreeBSD.org>
In-Reply-To: <51D7F70B.8000206@freebsd.org>
References:  <51D7F70B.8000206@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Em 06-07-2013 12:52, René Ladan escreveu:
> To test, you can either check out doc/projects/entities or doc/head and
> apply the patch at [1]. After that, run 'make' in en_US.ISO8859-1/ or
> 'make WEB_ONLY=yes ENGLISH_ONLY=yes' in en_US.ISO8859-1/htdocs/ as usual.
>
> [1]ftp://rene-ladan.nl/pub/freebsd/entities-r42173.diff
> SHA256 = d6685fb654e9624f2e733fa7feb852515c2aed566150f588359fb89bbf72e2b3
> SIZE = 423519
There are indentation-only changes in share/xml/catalog.xml. These parts 
shouldn't be changed or at least not with other changes if you want to 
improve them. Also, the real changes seem to be a bit messy, there are 
duplicated entries and some commented out ones and all of this 
intermixed with indentation changes so it is hard to see the overall 
effect. This file should be reviewed.

As for the email element, it doesn't logically belong to HTML so it 
shouldn't have the XHTML namespace. Actually, it is borrowed from 
DocBook, which doesn't have a namespace up to version 4.5. In turn, 
DocBook 5.0 has its own namespace. So I suggest to leave the email 
element in the empty namespace for now and with the DB 5.0 migration it 
will go to the DocBook namespace. For this, you also need to modify 
share/xml/xhtml.xsl and remove the namespace prefix in the match attribute:

+  <xsl:template match="xhtml:email">
+    <xsl:text>&lt;</xsl:text>
+    <xsl:choose>
+      <xsl:when test="@role='nolink'">
+	<xsl:apply-templates />
+      </xsl:when>
+      <xsl:otherwise>
+	<a>
+	  <xsl:attribute name="href">
+	    <xsl:text>mailto:</xsl:text>
+	    <xsl:value-of select="." />
+	  </xsl:attribute>
+	  <xsl:apply-templates />
+	</a>
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:text>&gt;</xsl:text>
+  </xsl:template>

And with this change, this part becomes redundant:

--- share/xsl/freebsd-xhtml-common.xsl	(svn+ssh://svn.freebsd.org/doc/projects/entities)	(working copy)
+++ svn+ssh://svn.freebsd.org/doc/projects/entities	(revision 42173)
@@ -6,6 +6,7 @@
                  version='1.0'
                  xmlns="http://www.w3.org/TR/xhtml1/transitional"
  		xmlns:str="http://exslt.org/strings"
+		xmlns:xhtml="http://www.w3.org/1999/xhtml"
  		extension-element-prefixes="str"
                  exclude-result-prefixes="#default">
  
@@ -162,6 +163,27 @@
      <xsl:call-template name="svnref.genlink"/>
    </xsl:template>
  
+  <xsl:template match="xhtml:email">
+    <code class="email">
+      <xsl:text>&lt;</xsl:text>
+      <xsl:choose>
+	<xsl:when test="@role='nolink'">
+	  <xsl:apply-templates />
+	</xsl:when>
+	<xsl:otherwise>
+	  <a class="email">
+	    <xsl:attribute name="href">
+	      <xsl:text>mailto:</xsl:text>
+	      <xsl:value-of select="."/>
+	    </xsl:attribute>
+	    <xsl:apply-templates />
+	  </a>
+	</xsl:otherwise>
+      </xsl:choose>
+      <xsl:text>&gt;</xsl:text>
+    </code>
+  </xsl:template>

The rest looks fine, thanks for your work on this!

Gabor



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