The XML data that defines the TOC, index, and HelpSet files can be localized as specified in the XML 1.0 specification (http://w3c.org/XML/). Both the character encoding and language can be set for these files.
Character encoding is an unambiguous mapping of the members of a character set (letters, ideographs, digits, symbols, or control functions) to specific numeric code values. The specified encoding applies to the entire file. Character encoding can be set for XML files using the following methods (listed in order of precedence):
If the XML file is provided by a server via the HTTP protocol, the server can specify the character set using the charset parameter in the HTTP Content-Type field.
Typically, the encoding attribute in the prolog to all of the XML metadata files is used to specify the encoding used for its character set. For example, the following prolog specifies the Latin-1 (ISO-8859-1) character set:
<?xml version='1.0' encoding='ISO-8859-1' standalone='yes' ?>
The language can be set for the XML files using the following methods (listed in order of precedence):
The language for any element (tag) in XML files can be set using the xml:lang attribute. For example:
<tocitem xml:lang="de" target="jde.intro">Homepage der JDE Online-Hilfe</tocitem>sets the language for that table of contents entry to German. Any elements (<tocitem> tags) nested within that tag automatically inherit that language.
The syntax of the lang attribute is:
lang | = language-code |
language-code | = primarycode ('-' subcode) |
primarycode | = ISO639 | IonaCode | UserCode |
ISO639 | = 2 alpha characters |
IonaCode | = (i | I) '-' (alpha characters) |
UserCode | = (x | X) '-' (alpha characters) |
subcode | = (alpha characters) |
For more information about the lang attribute, please refer to the XML recommendation at the World Wide Web Consortium web site (http://w3c.org/XML/).
If the XML file is provided by a server via the HTTP protocol, the server can specify the language for that file using the HTTP Content-Language header (for example, Content-Language:en-US).
See also: