From: Michael Smith Date: Fri, 29 Feb 2008 12:41:18 +0000 (+0000) Subject: Added the man.charmap.subset.profile.english parameter and refined X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d01d475afd10129a9b5dc8339fefe30fa63b992;p=docbook-dsssl Added the man.charmap.subset.profile.english parameter and refined 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). --- diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index 38e61eda2..208dbd3e4 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -127,9 +127,23 @@ db:manvolnum + + + + + - + + + + + + + + + + diff --git a/xsl/manpages/param.ent b/xsl/manpages/param.ent index 7d6671918..87f5a442b 100644 --- a/xsl/manpages/param.ent +++ b/xsl/manpages/param.ent @@ -2,6 +2,7 @@ + diff --git a/xsl/manpages/param.xweb b/xsl/manpages/param.xweb index 184cda5f3..d297664a7 100644 --- a/xsl/manpages/param.xweb +++ b/xsl/manpages/param.xweb @@ -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; @@ -153,6 +154,7 @@ + diff --git a/xsl/params/man.charmap.enabled.xml b/xsl/params/man.charmap.enabled.xml index 02bb58738..cc6036663 100644 --- a/xsl/params/man.charmap.enabled.xml +++ b/xsl/params/man.charmap.enabled.xml @@ -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. -You can also use a subset of a character map. For details, see -the man.charmap.use.subset and -man.charmap.subset.profile parameters. +You can also use a subset of a character map. For details, +see the man.charmap.use.subset, +man.charmap.subset.profile +man.charmap.subset.profile.english +parameters. diff --git a/xsl/params/man.charmap.subset.profile.english.xml b/xsl/params/man.charmap.subset.profile.english.xml new file mode 100644 index 000000000..b154e64f7 --- /dev/null +++ b/xsl/params/man.charmap.subset.profile.english.xml @@ -0,0 +1,79 @@ + + +man.charmap.subset.profile.english +string + + +man.charmap.subset.profile.english +Profile of character map subset + + + + + +@*[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' + + + + +Description + +If the value of the + man.charmap.use.subset parameter is + non-zero, and your DocBook source is written in English (that + is, if its lang or xml:lang attribute has the value + en or if it has no lang or xml:lang), then the character-map + subset specified by the + man.charmap.subset.profile.english + 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 a value other + than en, then the character-map subset + specified by the + man.charmap.subset.profile parameter is + used instead of + man.charmap.subset.profile.english. + +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). + +The value of man.charmap.subset.profile.english +is a string representing an XPath expression that matches attribute +names and values for output-character elements in the character map. + +For other details, see the documentation for the +man.charmap.subset.profile.english and +man.charmap.use.subset parameters. + + + diff --git a/xsl/params/man.charmap.subset.profile.xml b/xsl/params/man.charmap.subset.profile.xml index 3830aa6d0..2f42e535e 100644 --- a/xsl/params/man.charmap.subset.profile.xml +++ b/xsl/params/man.charmap.subset.profile.xml @@ -43,13 +43,36 @@ or If the value of the man.charmap.use.subset parameter is non-zero, -The character-map subset specified by the -man.charmap.subset.profile parameter is used -instead of the full roff character map. +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, then the character-map + subset specified by the + man.charmap.subset.profile.english + parameter is used instead of + man.charmap.subset.profile.english. + +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). The value of man.charmap.subset.profile -is a string representating an XPath expression that matches attribute -names and values for output-character elements in the character map. +is a string representing an XPath expression that matches attribute +names and values for output-character +elements in the character map. The attributes supported in the standard roff character map included in the distribution are: @@ -101,7 +124,7 @@ names and values for ou string - a string representating an roff/groff escape-code (with + 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 @@ -124,7 +147,7 @@ characters to be converted into roff markup. Depending on which XSLT engine you use, either the EXSLT dyn:evaluate extension function (for xsltproc or -Xalan) or saxon:evaluate extensio function (for +Xalan) or saxon:evaluate extension function (for Saxon) are used to dynamically evaluate the value of man.charmap.subset.profile at run-time. If you don't use xsltproc, Saxon, Xalan -- or some other XSLT engine that diff --git a/xsl/params/man.charmap.use.subset.xml b/xsl/params/man.charmap.use.subset.xml index eae8d3def..615ac02d5 100644 --- a/xsl/params/man.charmap.use.subset.xml +++ b/xsl/params/man.charmap.use.subset.xml @@ -24,8 +24,12 @@ If the value of the man.charmap.use.subset 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 -man.charmap.subset.profile parameter. +character map. The profile of the subset used is determined either +by the value of the +man.charmap.subset.profile +parameter (if the source is not in English) or the +man.charmap.subset.profile parameter (if +the source is in English). You may want to experiment with setting a non-zero value of @@ -67,8 +71,9 @@ provided in the distribution. 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 -man.charmap.subset.profile parameter to tune -the profile of that subset to use. +man.charmap.subset.profile or +man.charmap.subset.profile.english +parameter to tune the profile of that subset to use.