]> git.stg.codes - stg.git/blob - doc/xslt/params/l10n.lang.value.rfc.compliant.xml
Added resetable utils for attributes.
[stg.git] / doc / xslt / params / l10n.lang.value.rfc.compliant.xml
1 <refentry xmlns="http://docbook.org/ns/docbook"
2           xmlns:xlink="http://www.w3.org/1999/xlink"
3           xmlns:xi="http://www.w3.org/2001/XInclude"
4           xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5           xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6           version="5.0" xml:id="l10n.lang.value.rfc.compliant">
7 <refmeta>
8 <refentrytitle>l10n.lang.value.rfc.compliant</refentrytitle>
9 <refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
10 </refmeta>
11 <refnamediv>
12 <refname>l10n.lang.value.rfc.compliant</refname>
13 <refpurpose>Make value of lang attribute RFC compliant?</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17 <src:fragment xml:id="l10n.lang.value.rfc.compliant.frag">
18 <xsl:param name="l10n.lang.value.rfc.compliant" select="1"/>
19 </src:fragment>
20 </refsynopsisdiv>
21
22 <refsection><info><title>Description</title></info>
23
24 <para>If non-zero, ensure that the values for all <tag class="attribute">lang</tag> attributes in HTML output are RFC
25 compliant<footnote><para>Section 8.1.1, <link xlink:href="http://www.w3.org/TR/REC-html40/struct/dirlang.html#h-8.1.1">Language Codes</link>, in the HTML 4.0 Recommendation states that:
26
27 <blockquote><para>[RFC1766] defines and explains the language codes
28 that must be used in HTML documents.</para>
29 <para>Briefly, language codes consist of a primary code and a possibly
30 empty series of subcodes:
31
32 <literallayout class="monospaced">language-code = primary-code ( "-" subcode )*</literallayout>
33 </para>
34 <para>And in RFC 1766, <link xlink:href="http://www.ietf.org/rfc/rfc1766.txt">Tags for the Identification
35 of Languages</link>, the EBNF for "language tag" is given as:
36
37 <literallayout class="monospaced">Language-Tag = Primary-tag *( "-" Subtag )
38 Primary-tag = 1*8ALPHA
39 Subtag = 1*8ALPHA</literallayout>
40 </para>
41 </blockquote>
42 </para></footnote>.
43
44 by taking any underscore characters in any <tag class="attribute">lang</tag> values found in source documents, and
45 replacing them with hyphen characters in output HTML files. For
46 example, <literal>zh_CN</literal> in a source document becomes
47 <literal>zh-CN</literal> in the HTML output form that source.
48
49 <note>
50 <para>This parameter does not cause any case change in <tag class="attribute">lang</tag> values, because RFC 1766
51 explicitly states that all "language tags" (as it calls them) "are
52 to be treated as case insensitive".</para>
53 </note>
54 </para>
55
56 </refsection>
57 </refentry>