]> granicus.if.org Git - docbook-dsssl/commitdiff
Added the man.charmap.subset.profile.english parameter and refined
authorMichael Smith <xmldoc@users.sourceforge.net>
Fri, 29 Feb 2008 12:41:18 +0000 (12:41 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Fri, 29 Feb 2008 12:41:18 +0000 (12:41 +0000)
the handling of charmap subsets to differentiate between English
and non-English source.

This way charmap subsets are now handled is this:

If the value of the man.charmap.use.subset parameter is non-zero,
and your DocBook source is not written in English (that is, if its
lang or xml:lang attribute has a value other than en), then the
character-map subset specified by the man.charmap.subset.profile
parameter is used instead of the full roff character map.

Otherwise, if the lang or xml:lang attribute on the root element
in your DocBook source or on the first refentry element in your
source has the value en or if it has no lang or xml:lang
attribute, then the character-map subset specified by the
man.charmap.subset.profile.english parameter is used instead of
man.charmap.subset.profile.

The difference between the two subsets is that
man.charmap.subset.profile provides mappings for characters in
Western European languages that are not part of the Roman
(English) alphabet (ASCII character set).

xsl/manpages/other.xsl
xsl/manpages/param.ent
xsl/manpages/param.xweb
xsl/params/man.charmap.enabled.xml
xsl/params/man.charmap.subset.profile.english.xml [new file with mode: 0644]
xsl/params/man.charmap.subset.profile.xml
xsl/params/man.charmap.use.subset.xml

index 38e61eda28bb501fbb3ad3b2fcb79c2e58640ead..208dbd3e4b68bbe7553282b3ed357307b1d6ed67 100644 (file)
@@ -127,9 +127,23 @@ db:manvolnum
 
   <xsl:variable name="man.charmap.contents">
     <xsl:if test="$man.charmap.enabled != 0">
+      <xsl:variable name="lang">
+        <xsl:call-template name="l10n.language">
+          <xsl:with-param name="target" select="//refentry[1]"/>
+        </xsl:call-template>
+      </xsl:variable>
       <xsl:call-template name="read-character-map">
         <xsl:with-param name="use.subset" select="$man.charmap.use.subset"/>
-        <xsl:with-param name="subset.profile" select="$man.charmap.subset.profile"/>
+        <xsl:with-param name="subset.profile">
+          <xsl:choose>
+            <xsl:when test="$lang = 'en'">
+              <xsl:value-of select="$man.charmap.subset.profile.english"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$man.charmap.subset.profile"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:with-param>
         <xsl:with-param name="uri">
           <xsl:choose>
             <xsl:when test="$man.charmap.uri != ''">
index 7d66719181bb3e9ade46955dfb1b606f4af8889a..87f5a442be24fbf1637640960fd14aa3c5b8078a 100644 (file)
@@ -2,6 +2,7 @@
 <!ENTITY man.break.after.slash SYSTEM "../params/man.break.after.slash.xml">
 <!ENTITY man.charmap.enabled SYSTEM "../params/man.charmap.enabled.xml">
 <!ENTITY man.charmap.subset.profile SYSTEM "../params/man.charmap.subset.profile.xml">
+<!ENTITY man.charmap.subset.profile.english SYSTEM "../params/man.charmap.subset.profile.english.xml">
 <!ENTITY man.charmap.uri SYSTEM "../params/man.charmap.uri.xml">
 <!ENTITY man.charmap.use.subset SYSTEM "../params/man.charmap.use.subset.xml">
 <!ENTITY man.copyright.section.enabled SYSTEM "../params/man.copyright.section.enabled.xml">
index 184cda5f310c72c7e0c79bd469b67add104ad8cc..d297664a7ffdb4bcf79fa6db649a696ee3527e13 100644 (file)
@@ -80,6 +80,7 @@
 &man.charmap.uri;
 &man.charmap.use.subset;
 &man.charmap.subset.profile;
+&man.charmap.subset.profile.english;
 &man.string.subst.map.local.pre;
 &man.string.subst.map;
 &man.string.subst.map.local.post;
 <src:fragref linkend="man.break.after.slash.frag"/>
 <src:fragref linkend="man.charmap.enabled.frag"/>
 <src:fragref linkend="man.charmap.subset.profile.frag"/>
+<src:fragref linkend="man.charmap.subset.profile.english.frag"/>
 <src:fragref linkend="man.charmap.uri.frag"/>
 <src:fragref linkend="man.charmap.use.subset.frag"/>
 <src:fragref linkend="man.copyright.section.enabled.frag"/>
index 02bb587380bbf52a706562ebe82b59b12dd8e3b0..cc6036663b45e6fbeafab1da987770689d5e4d4d 100644 (file)
@@ -44,9 +44,11 @@ parameter to specify a URI for the location for an alternate roff
 character map to use in place of the standard roff character map
 provided in the distribution.</para>
 
-<para>You can also use a subset of a character map. For details, see
-the <parameter>man.charmap.use.subset</parameter> and
-<parameter>man.charmap.subset.profile</parameter> parameters.</para>
+<para>You can also use a subset of a character map. For details,
+see the <parameter>man.charmap.use.subset</parameter>,
+<parameter>man.charmap.subset.profile</parameter>
+<parameter>man.charmap.subset.profile.english</parameter>
+parameters.</para>
 
 </refsection>
 </refsection>
diff --git a/xsl/params/man.charmap.subset.profile.english.xml b/xsl/params/man.charmap.subset.profile.english.xml
new file mode 100644 (file)
index 0000000..b154e64
--- /dev/null
@@ -0,0 +1,79 @@
+<refentry xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude"
+          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
+          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+          version="5.0" xml:id="man.charmap.subset.profile.english">
+<refmeta>
+<refentrytitle>man.charmap.subset.profile.english</refentrytitle>
+<refmiscinfo class="other" otherclass="datatype">string</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>man.charmap.subset.profile.english</refname>
+<refpurpose>Profile of character map subset</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment xml:id="man.charmap.subset.profile.english.frag">
+<xsl:param name="man.charmap.subset.profile.english">
+@*[local-name() = 'block'] = 'Miscellaneous Technical' or
+(@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and
+ @*[local-name() = 'class'] = 'symbols')
+or
+(@*[local-name() = 'block'] = 'General Punctuation' and
+ (@*[local-name() = 'class'] = 'spaces' or
+  @*[local-name() = 'class'] = 'dashes' or
+  @*[local-name() = 'class'] = 'quotes' or
+  @*[local-name() = 'class'] = 'bullets'
+ )
+) or
+@*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or
+@*[local-name() = 'name'] = 'WORD JOINER' or
+@*[local-name() = 'name'] = 'SERVICE MARK' or
+@*[local-name() = 'name'] = 'TRADE MARK SIGN' or
+@*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE'
+</xsl:param>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsection><info><title>Description</title></info>
+
+<para>If the value of the
+  <parameter>man.charmap.use.subset</parameter> parameter is
+  non-zero, and your DocBook source is written in English (that
+  is, if its <tag class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag> attribute has the value
+  <literal>en</literal> or if it has no <tag
+    class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag>), then the character-map
+  subset specified by the
+  <parameter>man.charmap.subset.profile.english</parameter>
+  parameter is used instead of the full roff character map.</para>
+
+<para>Otherwise, if the <tag class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag> attribute
+  on the root element in your DocBook source or on the first
+  <tag>refentry</tag> element in your source has a value other
+  than <literal>en</literal>, then the character-map subset
+  specified by the
+  <parameter>man.charmap.subset.profile</parameter> parameter is
+  used instead of
+  <parameter>man.charmap.subset.profile.english</parameter>.</para>
+
+<para>The difference between the two subsets is that
+  <parameter>man.charmap.subset.profile</parameter> provides
+  mappings for characters in Western European languages that are
+  not part of the Roman (English) alphabet (ASCII character set).</para>
+
+<para>The value of <parameter>man.charmap.subset.profile.english</parameter>
+is a string representing an XPath expression that matches attribute
+names and values for <tag
+  namespace="http://docbook.sf.net/xmlns/unichar/1.0"
+  >output-character</tag> elements in the character map.</para>
+
+<para>For other details, see the documentation for the
+<parameter>man.charmap.subset.profile.english</parameter> and
+<parameter>man.charmap.use.subset</parameter> parameters.</para>
+
+</refsection>
+</refentry>
index 3830aa6d066edc08e1c5df7b57756138b4bd2b45..2f42e535e9c895cb89abab93944c1f9338ed815f 100644 (file)
@@ -43,13 +43,36 @@ or
 
 <para>If the value of the
 <parameter>man.charmap.use.subset</parameter> parameter is non-zero,
-The character-map subset specified by the
-<parameter>man.charmap.subset.profile</parameter> parameter is used
-instead of the full roff character map.</para>
+and your DocBook source is not written in English (that
+  is, if its <tag class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag> attribute has a value other
+  than <literal>en</literal>), then the character-map subset
+  specified by the
+  <parameter>man.charmap.subset.profile</parameter> parameter is
+  used instead of the full roff character map.</para>
+
+<para>Otherwise, if the <tag class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag> attribute on the root
+  element in your DocBook
+  source or on the first <tag>refentry</tag> element in your source
+  has the value <literal>en</literal> or if it has no <tag
+    class="attribute">lang</tag> or <tag
+    class="attribute">xml:lang</tag>, then the character-map
+  subset specified by the
+  <parameter>man.charmap.subset.profile.english</parameter>
+  parameter is used instead of
+  <parameter>man.charmap.subset.profile.english</parameter>.</para>
+
+<para>The difference between the two subsets is that
+  <parameter>man.charmap.subset.profile</parameter> provides
+  mappings for characters in Western European languages that are
+  not part of the Roman (English) alphabet (ASCII character set).</para>
 
 <para>The value of <parameter>man.charmap.subset.profile</parameter>
-is a string representating an XPath expression that matches attribute
-names and values for <tag namespace="http://docbook.sf.net/xmlns/unichar/1.0">output-character</tag> elements in the character map.</para>
+is a string representing an XPath expression that matches attribute
+names and values for <tag
+  namespace="http://docbook.sf.net/xmlns/unichar/1.0">output-character</tag>
+elements in the character map.</para>
 
 <para>The attributes supported in the <link xlink:href="http://docbook.sourceforge.net/snapshot/xsl/manpages/charmap.groff.xsl">standard roff character map included in the distribution</link> are:
 <variablelist>
@@ -101,7 +124,7 @@ names and values for <tag namespace="http://docbook.sf.net/xmlns/unichar/1.0">ou
   <varlistentry>
     <term>string</term>
     <listitem>
-      <simpara>a string representating an roff/groff escape-code (with
+      <simpara>a string representing an roff/groff escape-code (with
       "@esc@" used in place of the backslash), or a simple ASCII
       string; all characters in the roff character map have this
       attribute</simpara>
@@ -124,7 +147,7 @@ characters to be converted into roff markup. </para>
 <note>
 <para>Depending on which XSLT engine you use, either the EXSLT
 <function>dyn:evaluate</function> extension function (for xsltproc or
-Xalan) or <function>saxon:evaluate</function> extensio function (for
+Xalan) or <function>saxon:evaluate</function> extension function (for
 Saxon) are used to dynamically evaluate the value of
 <parameter>man.charmap.subset.profile</parameter> at run-time. If you
 don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that
index eae8d3def4660f36e077cd09284a900b236a7341..615ac02d549ce6b74dbdfa431dbddf6026cfa624 100644 (file)
 <para>If the value of the
 <parameter>man.charmap.use.subset</parameter> parameter is non-zero,
 a subset of the roff character map is used instead of the full roff
-character map. The profile of the subset used is specified by the
-<parameter>man.charmap.subset.profile</parameter> parameter.</para>
+character map. The profile of the subset used is determined either
+by the value of the
+<parameter>man.charmap.subset.profile</parameter>
+parameter (if the source is not in English) or the
+<parameter>man.charmap.subset.profile</parameter> parameter (if
+the source is in English).</para>
 
 <note>
   <para>You may want to experiment with setting a non-zero value of
@@ -67,8 +71,9 @@ provided in the distribution.</para>
 never necessary to use it in full -- the DocBook XSL Stylesheets
 support a mechanism for using, within any given character map, a
 subset of character mappings instead of the full set. You can use the
-<parameter>man.charmap.subset.profile</parameter> parameter to tune
-the profile of that subset to use.</para>
+<parameter>man.charmap.subset.profile</parameter> or
+<parameter>man.charmap.subset.profile.english</parameter>
+parameter to tune the profile of that subset to use.</para>
 
 </refsection>
 </refsection>