Introduction

This section is informative.

This document defines a standard for high-quality, cost efficient internationalization and localization of schemas and XML instances (both existing ones and new ones). On the one hand, the standard is defined conceptually through the notion of data categories. On the other hand, the standard defines implementations of these data categories as a set of elements and attributes called the Internationalization Tag Set (ITS). The document provides examples of how ITS can be used with existing popular markup schemes such as DocBook. Furthermore, the document provides implementations for three schema languages: XML DTD Extensible Markup Language (XML) 1.0 (Third Edition), XML Schema XML Schema Part 1: Structures Second Edition and RELAX NG RELAX NG Specification. Feedback related to this document is especially appreciated on the general concept of ITS and the mechanisms defined for the selection of ITS-specific information in documents, and on the design of the individual data categories.

Requirements for this document are formulated in Internationalization and Localization Markup Requirements. Not all of these requirements are addressed in this document, for example:

- R001 - Indicator of Constraints
- R005 - Handling Entities
- R023 - Linguistic Markup

The Working Group will cover some of the requirements in a separate document on techniques for internationalization and localization of schemas and XML instances documents.

Users and Usages of ITS

Potential Users of ITS

The ITS specification aims to provide different types of users with information about what markup should be supported to enable worldwide use and effective localization of content. The following paragraphs sketch these different types of users, and their usage of ITS.

- Schema developers who start a schema from ground up

This type of user will find proposals for attribute and element names to be included in their new schema (aka “host vocabulary”). Using the attribute and element names proposed in the ITS specification may be helpful because it leads to easier recognition of the concepts represented by both schema users and processors. It is perfectly possible, however, for a schema developer to develop his own set of attribute and element names. The specification sets out, first and foremost, to ensure the required markup is available, and that the behaviour of that markup meets established needs.

- Schema developers who work with an existing schema

This type of user will be working with schemas such as DocBook, DITA, or perhaps a proprietary schema.

The ITS Working Group has sought input from experts developing widely used formats such as the ones mentioned, and the ITS specification provides examples of how those formats (aka “host vocabulary”) could be used with ITS.

[^1]

Developers working on existing schemas should check whether their schemas support the markup proposed in this specification, and, where appropriate, add the markup proposed here to their schema.

In some cases, an existing schema may already contain markup equivalent to that recommended in ITS. In this case it is not necessary to add duplicate markup since ITS provides mechanisms for relating ITS markup with markup in the host vocabulary which serves a similar purpose (see Mapping of ITS Data Categories to Existing Markup). The developer should, however, check that the behaviour associated with the markup in their own schema is fully compatible with the expectations described in this specification.

- Vendors of content-related tools

This type of users encompasses companies which provide tools for authoring, translation or other flavours of content-related software solutions. It is important to ensure that such tools enable worldwide use and effective localization of content. For example, translation tools should prevent content marked up as not for translation from being changed or translated. It is hoped that the ITS specification will make the job of vendors easier by standardising the format and processing expectations of certain relevant markup items, and allowing them to more effectively identify how content should be handled.

- Content producers

This type of users comprises authors, translators and other types of content authors. The markup proposed in this specification may be used by them to mark up specific bits of content. Aside: The burden of inserting markup should be removed from content producers by relating the ITS information to relevant bits of content in a global manner (see global, rule-based approach) . This global work, however, may fall to information architects, rather than the content producers themselves.

[^1: The Working Group intends to cover the question “How use ITS with existing popular markup schemes?” in more detail in a separate document/note on “Modularizations for ITS”.]

In order to support all of these users, the information about what markup should be supported to enable worldwide use and effective localization of content is provided in this specification in two ways:

- abstract in the data category descriptions Description of Data Categories
- concrete in the ITS schemas Schemas for ITS

Ways to Use ITS

The ITS specification proposes several mechanisms for supporting worldwide use and effective localization of content. We will sketch them below by looking at from the perspectives of certain user types. For the purpose of illustration, we will answer the question, how ITS can indicate that certain parts of content should or should not be translated.

- A content author uses an attribute on a particular element to say that the text in the element should not be translated

Use of ITS by content author

&lt;book&gt;
 &lt;head&gt;...&lt;/head&gt; &lt;body&gt; ...  &lt;p&gt;And he said: you need a
 new &lt;quote its:translate="no"&gt;T-Model&lt;/quote&gt;&lt;/p&gt; ...
 &lt;/body&gt;
&lt;/book&gt;

- A content author or information architect uses markup at the top of the document to identify a particular type of element or context in which the content should not be translated.

Use of ITS by information architect

&lt;text&gt;
 &lt;head&gt;
 &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
  &lt;its:translateRule its:translate="no" its:selector="//dt"/&gt;
 &lt;its:rules&gt;
 &lt;/head&gt;
 &lt;body&gt; ...
  &lt;p&gt; ... &lt;dl&gt;&lt;dt&gt;...&lt;/dt&gt;&lt;dd&gt;...&lt;/dd&gt;&lt;/dl&gt;&lt;/p&gt;
 &lt;/body&gt;
&lt;/text&gt;

- A processor may inject markup at the top of the document which links to ITS information outside of the document.

Use of ITS by processor

&lt;text&gt;
 &lt;head&gt;
 &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xlink:href="myRules.xml"&gt;
  &lt;/its:rules&gt;
 &lt;/head&gt;
 &lt;body&gt; ...
  &lt;p&gt; ... &lt;dl&gt;&lt;dt&gt;...&lt;/dt&gt;&lt;dd&gt;...&lt;/dd&gt;&lt;/dl&gt;&lt;/p&gt;
 &lt;/body&gt;
&lt;/text&gt;

- A schema developer integrates ITS markup declarations in his schema to allow users to indicate that specific parts of the content should not be translated (see Modularizations of ITS with Existing Markup Schemes ).

The first two approaches above can be likened to the use of CSS in XHTML. Using a @style attribute, an XHTML content author may assign a colour to a particular paragraph. That author could also have used the <style> element at the top of the page to say that all paragraphs of a particular class or in a particular context would be coloured red.

Motivation for ITS

Content or software that is authored in one language (so-called source language) is often made available in additional languages or adapted with regard to other cultural aspects. This is done through a process called localization, where the original material is translated and adapted to the target audience.

In addition, document formats expressed by schemas may be used by people in different parts of the world, and these people may need special markup to support the local language or script. For example, people authoring in languages such as Arabic, Hebrew, Persian or Urdu need special markup to demarcate directionality in mixed direction text.

From the viewpoints of feasibility, cost, and efficiency, it is important that the original material should be suitable for localization. This is achieved by appropriate design and development, and the corresponding process is referred to as internationalization. For a detailed explanation of the terms "localization" and "internationalization", see Richard Ishida, Susan Miller. Localization vs. Internationalization. Article of….

The increasing usage of XML as a medium for documentation-related content (e.g. DocBook, and DITA as formats for writing structured documentation, well suited to computer hardware and software manuals) and software-related content (e.g. the eXtensible User Interface Language exTensible User Inferface Language) creates challenges and opportunities in the domain of XML internationalization and localization.

The following examples sketch one of the issues that currently hinder efficient XML-related localization: the lack of a standard, declarative mechanism which identifies which parts of an XML document need to be translated (the text in bold face shows the parts that need to be translated). Tools often cannot automatically do this identification.

Document with partially translatable content

<PhaseCode> should not be translated; the @title attribute sometimes has to be translated and sometimes must not be translated.

&lt;Manual&gt;
 &lt;Info&gt;
  &lt;PhaseCode&gt;Review Level&lt;/PhaseCode&gt;
  &lt;FormNo&gt;8U81-GS-52C&lt;/FormNo&gt;
  &lt;Name&gt;<hi rend="localizable">Owner's Manual</hi>&lt;/Name&gt;
  ...
 &lt;/Info&gt;
 &lt;Section id="0" title="#Introduction#"&gt;
  &lt;Ltitle id="005" title="#ZOOM#"&gt;
   &lt;Mtitle id="00501" title="<hi rend="localizable">Getting started</hi>" option="no" cols="1"&gt;
    &lt;MultiCol cols="1"&gt;
     &lt;Text&gt;<hi rend="localizable">Some text to localize</hi>&lt;/Text&gt;

    ...
    &lt;/Multicol&gt;
   &lt;/Mtitle&gt;
  &lt;/Ltitle&gt;...
&lt;/Manual&gt;

Document with partially translatable content

The first file name in the first <component> element would not be translated.

&lt;dialogue xml:lang="en-gb"&gt;
 &lt;rsrc id="123"&gt;
  &lt;component id="456" type="image"&gt;
   &lt;data type="text"&gt;images/cancel.gif&lt;/data&gt;
   &lt;data type="coordinates"&gt;12,20,50,14&lt;/data&gt;
  &lt;/component&gt;
  &lt;component id="789" type="caption"&gt;
   &lt;data type="text"&gt;<hi rend="localizable">Cancel</hi>&lt;/data&gt;
   &lt;data type="coordinates"&gt;12,34,50,14&lt;/data&gt;
  &lt;/component&gt;
 &lt;/rsrc&gt;
&lt;/dialogue&gt;

Document with partially translatable content

In the example below, there are no clear mechanisms allowing one to know which <string> element needs to be translated.

&lt;resources&gt;
 &lt;section id="Homepage"&gt;
  &lt;arguments&gt;
   &lt;string&gt;page&lt;/string&gt;
   &lt;string&gt;childlist&lt;/string&gt;
  &lt;/arguments&gt;
  &lt;variables&gt;
   &lt;string&gt;POLICY&lt;/string&gt;
   &lt;string&gt;<hi rend="localizable">Corporate Policy</hi>&lt;/string&gt;
  &lt;/variables&gt;
  &lt;keyvalue_pairs&gt;
   &lt;string&gt;Page&lt;/string&gt;
   &lt;string&gt;<hi rend="localizable">ABC Corporation - Policy Repository</hi>&lt;/string&gt;
   &lt;string&gt;Footer_Last&lt;/string&gt;
   &lt;string&gt;<hi rend="localizable">Pages</hi>&lt;/string&gt;
   &lt;string&gt;bgColor&lt;/string&gt;
   &lt;string&gt;NavajoWhite&lt;/string&gt;
   &lt;string&gt;title&lt;/string&gt;
   &lt;string&gt;<hi rend="localizable">List of Available Policies</hi>&lt;/string&gt;
  &lt;/keyvalue_pairs&gt;
 &lt;/section&gt;
&lt;/resources&gt;

Out of Scope

This standard does not exhaustively cover all mechanisms and data formats which might be needed for configuring localization workflows or tools to process a specific format. These mechanisms and data formats, sometimes called Localization Properties, however, possibly may be implemented by the framework put forth in this standard (see in particular SelectionProcessing of ITS information) documents.

[“XML localization properties” is a generic term to name the mechanisms and data formats that allows localization tools to be configured in order to process a specific XML format. Examples of "XML localization properties" are: the "Trados DTD Settings" file, and the SDLX "Analysis" file.]

Important Design Principles

[Attention: The design of the ITS schema in SelectionProcessing of ITS information and Description of Data Categories is still under development. Thus, the ITS schema structure may change. However, the Working Group does intend extensive changes to the element and attribute names and their functionality.]

Abstraction via data categories: ITS defines data categories as an abstract notion for information for internationalization and localization of XML schemas and documents. This abstraction is helpful in realizing independence from a particular implementation e.g. using an element or attribute. See Data category for a definition of the term data categories, Description of Data Categories for the definition of the various ITS data categories, and subsections in Description of Data Categories Markup Declarations for the data category implementations.

Powerful selection mechanism: For ITS markup which appears in an XML instance, it has to be clearly defined to which XML nodes the ITS-related information pertains. Thus, ITS defines selection mechanisms to specify to what parts of an XML document an ITS data category and its values should be applied.

Content authors need for example a simple way to work with the translatability data category in order to express whether the content of an element or attribute should be translated or not. Localization coordinators, on the other hand, need an efficient way for managing translations of large document sets based on the same schema. This could by realized by a specification of defaults for translatability and exceptions from the defaults (e.g. all <p> elements should be translated, but not <p> elements inside of an <index> element).

This specification responds to these requirements by introducing mechanisms for specifying ITS information in XML documents or schemas, see SelectionProcessing of ITS information. These mechanisms also provide a means for specifying ITS information for attributes (a task for which no standard means yet exists). The ITS mechanisms for selection are:

- useable for both XML schemas and XML documents
- as for XML documents, usable local (at the XML node to which it pertains) or globally (not at the XML node to which it pertains)
- as for global usage: possibly in the target XML document or in a separate file

No dedicated extensibility: It may be useful or necessary to extend the set of information available for internationalization or localization purposes beyond what is provided by ITS. This specification does not define a dedicated extension mechanism, since ordinary XML mechanisms (e.g. XML Namespaces Namespaces in XML) may be used.

Ease of integration:

- ITS follows the example from section 4 of XML Linking Language 1.0, by providing mostly global attributes for the implementation of ITS data categories. Avoiding elements for ITS purposes as much as possible ensures ease of integration into existing markup schemes, see section 3.14 in Internationalization and Localization Markup Requirements. Only for some requirements additional child elements have to be used, see for example Ruby.
- ITS has no dependency on technologies which are still under development
- ITS fits with existing work in the W3C architecture (e.g. use of XPath XML Path Language (XPath) Version 1.0 for the selection mechanism)

Development of this Specification

This specification has been developed using the ODD (One Document Does it all) language of the Text Encoding Initiative (Text Encoding Initiative Guidelines development version (P5)). This is a literate programming language for writing XML schemas, with three characteristics:

- The element and attribute set is specified using an XML vocabulary which includes support for macros (like DTD entities, or schema patterns), a hierarchical class system for attributes and elements, and creation of modules.
- The content models for elements and attributes is written using embedded RELAX NG XML notation.
- Documentation for elements, attributes, value lists etc. is written inline, along with examples and other supporting material.

XSLT transform are provided by the TEI to extract documentation in HTML, XSL FO or LaTeX forms, and to generate RELAX NG documents and DTD. From the RELAX NG documents, James Clark's trang can be used to create XML Schema documents.

Basic Concepts

This section is informative.

Information (e.g. "translate this") captured by ITS markup (e.g. its:translate='yes') always pertains to one or more XML nodes (mainly element and attribute nodes). In a sense, ITS markup “selects” the XML node(s). Selection may be explicit or implicit. ITS distinguishes two approaches to selection: local, and with global rules.

The mechanisms defined for ITS selection resemble those defined in Cascading Style Sheets, level 2. The local approach can be compared to the @style attribute in CSS, and the approach with global rules is similar to the <style> element in CSS. In contrast to CSS, ITS uses XPath for identifying nodes. Thus, the

- local approach puts ITS markup in the relevant element of the host vocabulary (e.g. the <author> element in DocBook)
- the rule-based, global approach puts the ITS markup in elements defined by ITS itself (namely the <rules> element)

ITS markup can be used with XML documents (e.g. a DocBook article), or schemas (e.g. an XSD for a proprietary document format). Since each usage defines some specific requirements, ITS markup may take different shapes.

The following three two examples sketch the distinction between the local and global approaches, and the difference between ITS in XML instances and schemas.

ITS markup on elements in an XML document (local approach)

&lt;article xmlns="http://docbook.org/ns/docbook"
 xmlns:its="http://www.w3.org/2005/11/its"
 its:translate="yes"&gt;
 &lt;info&gt;
  &lt;title&gt;An example article&lt;/title&gt;
  &lt;author its:translate="no"&gt;
   &lt;personname&gt;
    &lt;firstname&gt;John&lt;/firstname&gt;
    &lt;surname&gt;Doe&lt;/surname&gt;
   &lt;/personname&gt;
   &lt;affiliation&gt;
    &lt;address&gt;&lt;email&gt;foo@example.com&lt;/email&gt;&lt;/address&gt;
   &lt;/affiliation&gt;
  &lt;/author&gt;
 &lt;/info&gt;
&lt;/article&gt;

The example above shows how a content author may use the ITS @translate attribute to indicate what text should be translated and what text should be protected from translation. Translation tools that are aware of the meaning of this attribute can then screen the relevant content from the translation process.

For this to work, the schema developer will need to add the @translate attribute to the schema as a common attribute or on all the relevant element definitions. Note how there is an expectation in this case that inheritance plays a part in identifying which content does have to be translated and which does not. Tools that process this content for translation will need to implement the expected inheritance.

ITS global markup in an XML document (rule-based approach)

&lt;topic id="myTopic" xml:lang="en-us"&gt;
 &lt;title&gt;Using ITS&lt;/title&gt;
 &lt;prolog&gt;
  &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
   &lt;its:translateRule its:selector="//term" its:translate="no" /&gt;
  &lt;/its:rules&gt;
 &lt;/prolog&gt;
 &lt;body&gt;
  &lt;p&gt;An &lt;term&gt;ITS namespace&lt;/term&gt; definition exists...&lt;/p&gt;
 &lt;/body&gt;
&lt;/topic&gt;

The example above shows a different approach to identifying non-translatable content, similar to that used with a <style> element in XHTML, but using an ITS-defined element called <rules>. It works as follows: A document can contain a <rules> element (it is recommended to use a “head” section), which contains one or more data category specific ITS elements (for example <translateRule>). Each of these specific elements contains a @selector attribute. As its name suggests, this attribute selects (or designates) the XML node or nodes to which a corresponding ITS information pertains. The values of ITS selector attributes are XPath absolute location paths. Information for the handling of namespaces in these path expressions is contained in the ITS element <ns> which is a child of <rules>.

For this to work, the schema developer needs to add the <rules> element and associated markup to the schema. In some cases this may allow the schema developer to avoid adding other ITS markup (such as an @translate attribute) to the elements in the schema. However, it is likely that authors will want to use attributes on markup from time to time to override the general rule. For specification of the translate information, the contents of the <rules> element would normally be designed by an information architect familiar with the document format and familiar with, or working with someone familiar with, the needs of the localization group.

The global, rule-based approach has the following benefits:

- Content authors do not have to concern themselves with creating additional markup or verifying that the markup was applied correctly. ITS data categories are associated with sets of XML nodes (for example all <p> elements in an XML instance)
- Changes can be done in a single location, rather than by searching and modifying the markup throughout a document (or documents, if the <rules> element is stored as an external entity)
- ITS data categories can designate attribute values as well as elements.
- It is possible to associate ITS markup with existing markup (for example the<term> element in DITA)

ITS markup on elements in an XML Schema

&lt;xs:schema&gt;
&lt;xs:element name="term"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule its:translate="no"/&gt;
   &lt;/xs:appinfo&gt;
  &lt;/xs:annotation&gt;
 &lt;/xs:element&gt; ...
&lt;/xs:schema&gt;

The commonality in all of the both examples above is the markup its:translate='no'. This piece of ITS markup can be interpreted as follows:

- it pertains to the data category translatability
- the ITS data category attribute @translate holds a value of "no"

To summarize: The examples with global and local usage of ITS markup show that ITS markup,data category attributes in some cases, appears in elements defined by ITS itself (the <translateRule> element (embedded within a <rules> element)) and in other cases appears in elements of the host vocabulary. , or the <schemaRule> element. It should come as no surprise that one difference between these two elements is where they are used:

- <rules>: may appear in XML instances and schemas
- <schemaRule>: may only appear in schemas

A less obvious, but important difference between <documentRule> and <schemaRule> is the following: i In addition to one or more ITS data category specific attributes, <translateRule> or other rule elements contains a corresponding @selector attribute. As their name suggests, a @selector selects (or designates) one or more XML nodes (namely those to which a corresponding ITS data category attribute pertains). The value of ITS selector attributes are XPath absolute location paths. Information for to the handling of namespaces in these path expression is contained in the ITS element <ns> which is a child of <rules>.

The ITS @selector attribute allows:

- ITS data category attributes to appear in global rules (even outside of an XML document or schema)
- ITS data categories attributes to pertain to sets of XML nodes (for example all <p> elements in an XML document)
- ITS markup to pertain to attributes
- ITS markup to map to existing markup (for example the term element in DITA)

The power of ITS selector attributes comes at a price: rules related to overriding/precedence, and inheritance, have to be established.

Overriding and Inheritance

&lt;text&gt;
 &lt;head&gt;
 &lt;its:rules&gt;
  &lt;its:translateRule its:translate="yes" its:selector="//p"/&gt;
 &lt;its:rules&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;p its:translate="no"&gt; ... &lt;dl&gt;&lt;dt&gt;...&lt;/dt&gt;&lt;dd&gt;...&lt;/dd&gt;&lt;/dl&gt;&lt;/p&gt;
 &lt;/body&gt;
&lt;/text&gt;

In this example, the ITS data category attribute @translate appears twice: in a <rules> element, and on a specific <p> element. Since the ITS @selector attribute in the <rules> element selects all <p> elements, a question arises: What is the value for the translate data category of the <p> element which has local markup? ITS provides precedence and inheritance rules which answer questions like this. In the example, the value is "no" (that is the content of the <p> element should not be translated).

Depending on the data category and its usage, there are additional attributes for adding information to the selected nodes, or for pointing to existing information in the document. For example, the data category localization information can be used for adding information to selected nodes, or for pointing to existing information in the document. For the former purpose, a <locInfo> element can be used. For the latter purpose, a @locInfoPointer attribute can be used.

The functionality of adding information to the selected nodes is available for each data category except language information. Pointing to existing information is not possible for data categories which express a closed set of values, that is: translatability, directionality and elements within text.

The functionalities of adding information and pointing to existing information are mutually exclusive. That is: attributes for pointing and adding must not appear at the same rule element.

Notation and Terminology

This section is normative.

Notation

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in S. Bradner. Key Words for use in RFCs to Indicate Requirement Levels. IETF RFC….

The namespace URI that must be used by implementations of this specification is:

http://www.w3.org/2005/11/its

The namespace prefix used in this specification for this URI is "its". It is recommended that implementations of this specification use this prefix.

In addition, the following namespaces are used in this document:

- http://www.w3.org/2001/XMLSchema for the XML Schema namespace, here used with the prefix "xs"
- http://relaxng.org/ns/structure/1.0 for the RELAX NG namespace, here used with the prefix "rng"

Schema Language and Schema Annotation

Schema language refers in this specification to an XML-related modelling or validation language such as XML DTD, XML Schema or RELAX NG.

Schema annotation is a schema language specific means to provide information about element, attribute, type etc. declarations. This information is not used by the schema processor, but for external, validation independent applications.

[This specification provides schemas in the format of XML DTD, XML Schema or RELAX NG. However, these schemas are only non-normative: conformance for ITS markup declarations defines only mandatory positions of ITS declarations in schemas. This makes it possible to use ITS with any schema language which allows for using these positions.]

Data category

ITS defines data category as an abstract concept for a particular type of information for internationalization and localization of XML schemas and documents. The concept of a data category is independent of its implementation in an XML environment (e.g. using an element or attribute).

For each data category, ITS distinguishes between the following:

- the prose description, see Description of Data Categories
- schema language independent formalization, see the "markup declarations" subsections in Description of Data Categories
- schema language specific implementations, see Schemas for ITS

A data category and its implementation

The data category translatability conveys information as to whether a piece of content should be translated or not.

The simplest formalization of this prose description on a schema language independent level is a @translate attribute with two possible values: "yes" and "no". An implementation on a schema language specific level would be the declaration of the @translate attribute in e.g. an XML DTD, an XML Schema document or an RELAX NG document.

An alternative formalization on a schema language independent level is a <schemaRule> element which conveys with a @translate attribute information about translatability. An implementation on a schema language specific level is the declaration of the <schemaRule> element.

Selection

selection encompasses mechanisms to specify to what parts of an XML document or schema an ITS data category and its values should be applied to. Selection is discussed in detail in SelectionProcessing of ITS information. Selection can be applied globally, see Global, Rule-based Selection, and locally, see Local Selection in an XML Document. As for global selection, ITS information can be added to the selected nodes, or it can point to existing information which is related to selected nodes.

Conformance

This section is normative.[^2]

[^2: The working group is looking for feedback on the feasibility of the ITS conformance clauses.]

The usage of the term conformance clause in this section is in compliance with QA Framework: Specification Guidelines.

This specification defines two types of conformance: conformance of 1) ITS markup declarations , and conformance of 2) processing expectations for ITS Markup. These conformance types are defined complementary. An implementation of this specification may use them together.

Conformance Type 1: ITS Markup Declarations

Description: ITS markup declarations encompass all declarations which are part of the Internationalization Tag Set. They do not concern the usage of the markup in XML documents. Such markup is subject to the conformance clauses in Conformance Type 2: The Processing Expectations for ITS Markup.

Definitions related to this conformance type: ITS markup declarations are defined in Markup Declarations various subsections in Description of Data Categories in a schema language independent manner, relying on the ODD language. Their occurrence in other sections of this document is typographically marked via bold face and color.

Who uses this conformance type: ITS markup declarations are to be integrated into an existing or new schema. All conformance clauses for this productconformance type concern the position of ITS markup declarations in that schema, and their status as mandatory or facultative.

Conformance clauses:

- 1-1: The <rules> element must be part of the content model of at least one element declared in the existing or new schema. It should be in a document model for meta information, if this is available in that schema (e.g. the <head> element in XHTML).
- 1-2: The <schemaRule> element may be used as part of a schema annotation for elements and attributes.
- 1-2: All local ITS attributes should be declared at all elements which are part of the existing or new schema.
- 1-3: The <ruby> element must be declared as an inline element (the definition of inline depends on the existing or new schema.)
- 1-4: The <span> element may be declared as an inline element (the definition of inline depends on the existing or new schema.).
- 1-4: The declarations of general datatypes should be taken into account.

Examples: Examples of the usage of ITS markup declarations in various existing schemas are given in Modularizations of ITS with Existing Markup Schemes.

[Since the definitions in Markup Declarations ITS markup declarations are schema language independent, each schema language can use its own, possibly multiple mechanisms to implement the conformance clauses for ITS markup declarations. For example, an XML DTD can use parameter entities to encapsulate the ITS local attributes, or declare them directly for each element. It depends on the design of the existing or new schema (e.g. whether it already has a customization layer which uses parameter entities) what is appropriate. The appropriate steps to integrate ITS into a schema depend on the design of this schema (e.g. whether it already has a customization layer which uses parameter entities). The ITS schemas in the format of XML DTD, XML Schema and RELAX NG in Schemas for ITS are only informative examples, it is not not feasible to integrate them into every existing or new schema.

ITS markup declarations are a set of elements and attributes, that have been designed using state of the art knowledge about internationalization and localization needs. Since the goal of the ITS Working Group is to deliver one set of declarations, the conformance clauses defined in this section do not allow an existing or new schema to use only parts of the ITS markup declarations. However, this concerns only the ITS markup declarations in a schema. As for the interpretation of ITS markup and the respective data categories, the product and conformance clauses defined in Conformance Type 2: The Processing Expectations for ITS Markup are relevant.]

Conformance Type 2: The Processing Expectations for ITS Markup

Description: The processing expectations for ITS markup define how ITS markup found in XML instance documents has to be interpreted by an application. The markup may be generated or validated relying on an existing or new schema which is conform to the conformance clauses in Conformance Type 1: ITS Markup Declarations.

Definitions related to this conformance type: The processing expectations for ITS markup make use of selection mechanisms defined in SelectionProcessing of ITS information. The individual data categories defined in Description of Data Categories have default selections, and allow for using ITS markup in various positions (schema, global and local). In addition, a set of processing expectations specific to the ruby data category and the directionality data category, refer to external specifications. In addition to selection related processing expectation, an additional set of expectations is described for the ruby data category and directionality data category, by normatively referencing external specifications.

Who uses this conformance type: Processing expectations for ITS markup are used by any application which needs to process the nodes (element and attribute nodes) which are captured by a data category for internationalization and localization.which needs to process for internationalization or localization the element or attribute nodes captured by a data category.

Conformance clauses:

- 2-1: If an application claims to process ITS markup for a given data category, it must process all positionsat least one of selection mechanism (schemaglobal or local).
- 2-2: If an application claims to process ITS markup for a given data category, it must take the default selections for the data category into account.
- 2-3: If an application claims to process ITS markup for a given data category, it must take the precedence definitions for selections defined in Precedence between Selections into account, for the type of selections it processes.
- 2-4: If an application claims to process ITS markup for a given data category in a global position, it may select nodes in the same or in a separate document.
- 2-5: If an application claims to process ITS markup for the ruby data category or the directionality data category, it must be compliant with the external specifications referenced for ruby or directionality.
- 2-6: If an application claims to process ITS markup for the global selection mechanism, it must process all of the XLink @href attributes found in the <rules> elements.

Examples: Examples of applications which are conform to the processing expectations for ITS markup will be given in a test suite, which will be developed for a subsequent version of this document.

[Applications which are conform to the clauses above can be, for example: ITS markup aware editors, or translation tools which make use of ITS markup to filter translatable text as an input to the localization process. Their only common property is that they are able to process ITS markup in the way described above. Further processing is not subject to this specification.

The processing expectations for ITS markup encompass knowledge about internationalization and localization needs. A key part of these needs is information about the relation between internationalization and localization data categories and nodes in an XML document. This information differs in a default case, for a specific node in a document, or globally. An example is the default that attribute content should not be translated, and local or global exceptions to this default. The product of processing expectations for ITS markup responds to such needs, by providing the respective mechanism.

Conformance clause 2-4 allows to reuse global ITS markup to select information from multiple documents, without the need to integrate the ITS markup itself into the documents. [TODO: to be able to fulfill conformance clause 2-4, we need to rewrite the section on <documentRules> in a schema.]]

SelectionProcessing of ITS information

This section is normative.

Locations of Data Categories and Selection Mechanisms

Selections of ITS Informationdata categories can appear in threetwo places:

- in a schema: ITS data categories are expressed as schema annotation, and the selection is the element or attribute declaration which is being annotated
- global rules: the selection is realized within a <rules> element. It contains rule elements for each data category. Each rule element has an @selector attribute and possibly other attributesas a selector attribute, which appears together with data category specific attributes. The @selector attribute contains an AbsoluteLocationPath as described in XML Path Language (XPath) Version 1.0.
- locally in an instance document: the selection is realized using ITS local attributes,a data category attribute, which are attached to the selected element node, or the <span> or <ruby> element. There is no additional @selector attribute. The default selection for each data category defines whether the selection covers attributes and child elements. See Position and Default Selections of Data Categories.

The two locationsselection mechanisms are defineddescribed in detail below.

Schema Annotation

In Schemas, selection of ITS information is realized with schema annotation. The selection for a data category depends on the position of the schema annotation. Since schema annotation mechanisms are schema language specific, the following definitions are made:

- selection of elements in XML Schema is expressed with an <xs:appinfo> element which is a direct child of the <xs:element> element and which contains a <schemaRule> element, which has one or more data category attributes.

Selection of elements in an XML Schema

&lt;xs:element name="p"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule its:translate="yes"/&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt; ...
&lt;/xs:element&gt;

- selection of attributes in XML Schema is expressed with an <xs:appinfo> element which is a direct child of the <xs:attribute> element and which contains a <schemaRule> element, which has one or more data category attributes.

Selection of attributes in an XML Schema

&lt;xs:attribute name="alt"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule its:translate="yes"/&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt; ...
&lt;/xs:attribute&gt;

- selection of elements in RELAX NG is expressed with a <schemaRule> element which is a direct child of the <rng:element> element, and which has one or more <data category attributes>.

Selection of elements in RELAX NG

&lt;element name="p"&gt;
 &lt;its:schemaRule its:translate="yes"/&gt; ...
&lt;/element&gt;

- selection of attributes in RELAX NG is expressed with a <schemaRule> element which is a direct child of the <rng:attribute> element, and which has one or more data category attributes.

Selection of attributes in RELAX NG

&lt;attribute name="p"&gt;
 &lt;its:schemaRule its:translate="yes"/&gt; ...
&lt;/attribute&gt;

As for XML DTD, this specification defines no selection mechanism within the DTD.

[To be able to select elements or attributes defined within a XML DTD, the mechanisms described in Global, Rule-based Selection can be used.]

Several data categories on the same element or attribute declaration should be expressed at the same <schemaRule> element.

Several data categories at the same element

&lt;its:schemaRule its:translate="yes" its:locInfo="This has to be handled carefully"
its:locInfoType="alert"/&gt;

Global, Rule-based Selection

Global, rule-based selection is implemented using the <rules> element. It contains one or more rule elements. Each rule element has a mandatory @selector attribute.

Depending on the data category and its usage, there are additional attributes for adding information to the selected nodes, or for pointing to existing information in the document. For example, the data category localization information can be used for adding information to selected nodes, or for pointing to existing information in the document. For the former purpose, an <locInfo> element can be used. For the latter purpose, an @locInfoPointer attribute can be used. element has one or more data category attributes, and for each data category attribute an selector attribute which expresses the selected information

The functionality of adding information to the selected nodes is available for each data category except language information. Pointing to existing information is not possible for data categories which express a closed set of values, that is: translatability, directionality and elements within text.

The functionalities of adding information and pointing to existing information are mutually exclusive. That is: markup for pointing and adding must not appear at the same rule element.

[^3]

[^3: The working group is looking for feedback on a proposal to group rule elements.]

The naming convention for the selector attributes is data category + Selector, e.g. @translateSelector. In ITS rules selections, tThe value of the @selectorattribute must be an XPath expression which starts with "/". That is, it must be an AbsoluteLocationPath as described in XML Path Language (XPath) Version 1.0. This ensures that the selection is not relative to a specific location.

As for data category specific attributes like @locInfoPointer which point to existing information in the document, a RelativeLocationPath as described in XML Path Language (XPath) Version 1.0 must be used. The XPath expression is evaluated relative to the nodes which are selected via the @selector attribute.

If namespaces Namespaces in XML are used in XPath expressions in the @selector attribute or the pointing attributes, the following rules must be applied while processing XPath:

- For each prefix, there must be an <ns> element as a child of the <rules> element. The <ns> element has two attributes @prefix (for the namespace prefix) and @uri (for the namespace URI).
- Element and attribute names without a prefix are interpreted as having no namespace.
- To avoid a conflict with rule 2., default namespaces must not be used in the XPath expressions.

XPath expressions with namespaces and without namespaces

The term element from the TEI is in a namespace http://www.tei-c.org/ns/1.0. The <qterm> element from DocBook is in no namespace.

&lt;!-- Definitions for TEI --&gt;
&lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
 &lt;its:ns its:prefix="tei" its:uri="http://www.tei-c.org/ns/1.0"/&gt;
 &lt;termRule its:selector="//tei:term"/&gt;
&lt;/its:rules&gt;

&lt;!-- Definitions for DocBook --&gt;
&lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
 &lt;termRule its:selector="//qterm"/&gt;
&lt;/its:rules&gt;

[The usage of the <ns> element is inspired by Schematron - A Language for Making Assertions about… and compliant to the requirements on namespace bindings described in Using Qualified Names (QNames) as Identifiers in XML Content.]

SelectionGlobal rules can appear in a schema (e.g. as content of the <xs:appinfo> element), in the XML document they will be applied to, or in a separate XML document. The precedence of their processing of the selection information depends on these variations. See also Precedence between Selections.

[The difference between <schemaRule> and <documentRule> is that <schemaRule> has no selector attributes, e.g. no @translateSelector attribute. The reason is that <schemaRule> always refers to the element or attribute declaration of which it is part of. In contrast, <documentRule> can be used "globally", that is everywhere in a schema to express selection information. It is possible to use <schemaRule> and <documentRule> together in a schema.

Example for using <schemaRule> and <documentRules> together in a schema.

&lt;xs:schema&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:documentRules&gt;
    &lt;its:documentRule its:translate="no" its:translateSelector="//p[@editor='john']"/&gt;
&lt;!-- This rule holds for p elements which are edited by John. --&gt;
   &lt;/its:documentRules&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt;
 &lt;xs:element name="p"&gt;
  &lt;xs:annotation&gt;
   &lt;xs:appinfo&gt;
    &lt;its:schemaRule its:translate="yes"/&gt;
&lt;!-- This rule holds for all p elements --&gt;
    &lt;/xs:appinfo&gt;
   &lt;/xs:annotation&gt; ...
  &lt;/xs:element&gt; ...
 &lt;/xs:schema&gt;]

Markup for global, rule-based selection is defined as follows.

Having its-global as the entry point of the schema serves as a wrapper schema for an external rules file.

<rules>
@xmlns
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace
@xmlns:its
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace

att.xlink
@href

<ns>
An element to describe namespace URIs and prefixes within XPath expressions in <rules> elements.

att.nsident
@prefix
@uri

att.selector
@selector

Local Selection in an XML Document

Local selection of ITS information in XML documents is realized with local ITS attributes, the <ruby> element, or the <span> element. <span> serves just as a wrapper for the local ITS attributes and <ruby>.

It depends on the data category what is being selected. The necessary data category specific defaults are described in Position and Default Selections of Data Categories.

Defaults for various data categories

its:translate="no" at the <head> element means that the textual content of this element, including child elements and attributes, should not be translated. its:translate="yes" at the <body> element means that the textual content of this element, including child elements, but excluding attributes should be translated.its:translate="no" at the head element means that the textual content of this element, including child elements, should not be translated. its:translate="yes" at the body element means that the textual content of this element, including child elements, should be translated. Attribute values of the selected elements or their children's are not affected by local <translate> attributes. By default they are not translatable.

its:dir="ltr" at the <body> element means that the directionality of the textual content of this element, including child elements and attributes, is "left-to-right".

&lt;text&gt;
 &lt;head its:translate="no"&gt; ... &lt;/head&gt;
 &lt;body its:translate="yes" its:dir="ltr"&gt; ... &lt;/body&gt;
&lt;/text&gt;

Markup for local selection is defined as follows.

The <span> element can be used if a markup scheme has no element to which local ITS attributes can be attached. <span> contains these attributes and serves as a hook for using them in XML documents.

<span>

@xmlns
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace
@xmlns:its
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace

Link to External Rules

One way to associate a document with a set of external ITS rules is to use the optional XLink XML Linking Language 1.0@href attribute in the <rules> element. The referenced document must be a valid XML document containing at most one <rules> element. That <rules> element can be the root element or anywhere within the document tree (for example, the document could be an XML Schema).

The rules contained in the referenced document must be processed as if they were at the top of the <rules> element with the XLink @href attribute.

External file myRules.xml with global rules:

&lt;myFormatInfo&gt;
 &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
  &lt;its:translateRule its:selector="//header" its:translate="no"/&gt;
  &lt;its:translateRule its:selector="//term" its:translate="no"/&gt;
  &lt;its:termRule its:selector="//term"/&gt;
  &lt;its:withinText its:selector="//term | //b"/&gt;
 &lt;/its:rules&gt;
 ...
&lt;/myFormatInfo&gt;

Document with a link to myRules.xml

&lt;myDoc&gt;
 &lt;header&gt;
  &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xlink:href="myRules.xml"&gt;
   &lt;its:translateRule its:selector="//term" translate="yes"&gt;
  &lt;/its:rules&gt;
  &lt;author&gt;Theo Brumble&lt;/author&gt;
  &lt;lastUpdate&gt;Apr-01-2006&lt;/lastUpdate&gt;
 &lt;/header&gt;
 &lt;body&gt;
  &lt;p&gt;A &lt;term&gt;Palouse horse&lt;/term&gt; has a spotted coat.&lt;/p&gt;
 &lt;/body&gt;
&lt;/myDoc&gt;

The result of processing the two documents above is the same as processing the following document.

Document with identical rules as in the case of included rules

&lt;myDoc&gt;
 &lt;header&gt;
  &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
   &lt;its:translateRule its:selector="//header" its:translate="no"/&gt;
   &lt;its:translateRule its:selector="//term" its:translate="no"/&gt;
   &lt;its:termRule its:selector="//term"/&gt;
   &lt;its:withinText its:selector="//term | //b"/&gt;
   &lt;its:translateRule its:selector="//term" translate="yes"&gt;
  &lt;/its:rules&gt;
  &lt;author&gt;Theo Brumble&lt;/author&gt;
  &lt;lastUpdate&gt;Apr-01-2006&lt;/lastUpdate&gt;
 &lt;/header&gt;
 &lt;body&gt;
  &lt;p&gt;A &lt;term&gt;Palouse horse&lt;/term&gt; has a spotted coat.&lt;/p&gt;
 &lt;/body&gt;
&lt;/myDoc&gt;

Application processing global ITS markup must recognize the XLink @href attribute in the <rules> element; they must load the corresponding referenced document and process its rules element before processing the content of the <rules> element where the original XLink @href attribute is.

External rules may also have links to other external rules. The linking mechanism is recursive, the deepest rules being overridden by the top-most rules, if any.

Precedence between Selections

The following precedence order is defined for selections of ITS information in various positions (the first item in the list has the highest precedence):

- Implicit local selection in instance documents (ITS local attributes on a specific element)
- LocalGlobal selections in instance documents (using a <rules> element)
- Global selections in an external file (using a <rules> element), linked via the XLink @href attribute or a different mechanism
- Global selections in a schema, expressed with a <documentRules> element
- Selections expressed with <schemaRule> (See also the note in Global, Rule-based Selection)
- Selections via defaults for data categories, see Position and Default Selections of Data Categories

In case of conflicts between global selections via multiple rule elements, the last selector has higher precedence.

[The precedence order fulfills the same purpose as the built-in template rules of XSL Transformations (XSLT) Version 1.0.]

Conflicts between selections of ITS information which are resolved using the precedence order

Due to the rules described above, the local translatability information from the @translate attribute on the <p> element has precedence over the translatability information on the first <translateRule> element. A conflict occurs for <p> elements inside of <entry> elements, because of the two <translateRule> elements. This conflict is resolved via the order of the <translateRule> elements (the last one has higher precedence).

&lt;text&gt;
 &lt;head&gt;
 &lt;its:rules&gt;
  &lt;its:translateRule its:translate="yes" its:selector="//p"/&gt;
  &lt;its:translateRule its:translate="no" its:selector="//index/entry/p"/&gt;
 &lt;its:rules&gt;
 &lt;/head&gt;
 &lt;body&gt; ...
  &lt;p its:translate="no"&gt; ... &lt;/p&gt;
 &lt;/body&gt;
 &lt;back&gt;&lt;index&gt;
  &lt;entry&gt;&lt;p&gt; ... &lt;/p&gt;&lt;/entry&gt;
 &lt;/index&gt;&lt;/back&gt;
&lt;/text&gt;

Mapping of ITS Data Categories to Existing Markup

Some markup schemes provide markup which can be used to express ITS data categories. ITS data categories can be mapped to such existing markup, using the global selection mechanism described in Global, Rule-based Selection. In this way, there is no need to integrate ITS markup into documents.

Mapping of the ITS data categories translatability and terminology to OASIS DITA Architectural Specification Committee Draft 01 markup

&lt;topic id="myTopic"&gt;
 &lt;title&gt;The ITS Topic&lt;/title&gt;
 &lt;prolog&gt;
  &lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
   &lt;its:translateRule its:selector="//*[@translate='no']" its:translate="no"/&gt;
   &lt;its:translateRule its:selector="//*[@translate='yes']" its:translate="yes"/&gt;
   &lt;its:termRule its:selector="//term | //dt"/&gt;
   &lt;/its:rules&gt;
 &lt;/prolog&gt;
 &lt;body&gt;
  &lt;dl&gt;
   &lt;dlentry id="tDataCat"&gt;
 <hi rend="localizable">&lt;dt&gt;Data category&lt;/dt&gt;</hi>
    &lt;dd&gt;ITS defines <hi rend="localizable">&lt;term&gt;data category&lt;/term&gt;</hi> as an abstract concept for a particular
type of information for internationalization and localization of XML schemas
and documents.&lt;/dd&gt;
   &lt;/dlentry&gt;
  &lt;/dl&gt;
  &lt;p&gt;For the implementation of ITS, apply the rules in the order:&lt;/p&gt;
  &lt;ul&gt;
   &lt;li&gt;Default&lt;/li&gt;
   &lt;li&gt;Rules in the schema&lt;/li&gt;
   &lt;li&gt;Rules in the document instance&lt;/li&gt;
   &lt;li&gt;Local attributes&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p&gt;&lt;ph <hi rend="localizable">translate="no"</hi> xml:lang="fr"&gt;Et voilà !&lt;/ph&gt;.&lt;/p&gt;
 &lt;/body&gt;
&lt;/topic&gt;

Description of Data Categories

This section is normative.

Position and Default Selections of Data Categories

The following table summarizes the relations between data categories, location of their selection mechanisms, and default selections in XML documents.

Data category	Applicable in schema	Local Usage	Global, rule-based selection	Global adding of information	Global pointing to existing information	Default selection in instance document
Translatability	+	+	+	+	-	Textual content of element, including content of child elements, but excluding attributes
Localization information	+	+	+	+	+	Textual content of element, including content of child elements, but excluding attributes
Terminology	+	+	+	+	+	Textual content of element, including content of child elements, but excluding attributes
Directionality	-	+	+	+	-	Textual content of element, including attributes and child elements
Ruby	-	+	+	+	+	Textual content of element, including content of child elements, but excluding attributes
Language Information	-	-	+	-	+	Textual content of element, including attributes and child elements
Elements within Text	+	-	+	+	-	Textual content of element, including content of child elements, but excluding attributes

[The data categories differ with respect to defaults in the XML document for compatibility reasons with existing standards and practices. For example, the @dir attribute in XHTML™ 2.0 refers to the content of the element and all attributes and child elements. Hence, the data category of directionalty selects the same information as the default. On the other hand, it is common practice that information about translatability refers only to textual content of an element. Hence, the data category of translatability selects as a default the same information.]

Translatability

Definition

The data category translatability expresses information about whether the content of an element or attribute should be translated or not. The values of this data category are "yes" (translatable) or "no" (not translatable).

Implementation

Translatability can be expressed in a schema, with global rules, or locally on an individual element.

In a schema, translatability is expressed with a <schemaRule> element with a @translate attribute. The attribute has the values "yes" or "no".

Translatability expressed in a schema

&lt;xs:element name="p"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule its:translate="yes"/&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt; ...
&lt;/xs:element&gt;

As for global rules, translatability is expressed with a <translateRule> element with a @translate attribute. The attribute has the values "yes" or "no". In addition, a @selector attribute is required.

Translatability expressed globally

&lt;its:rules&gt;
 &lt;its:translateRule its:translate="yes" its:selector="//p"/&gt;
&lt;!-- All p elements should be translated--&gt;
&lt;/its:rules&gt;

Locally, translatability is expressed with a @translate attribute with the values "yes" or "no" The selection is the textual content of the element, including child elements, but excluding attributes.

Translatability expressed locally

In the <body> element, its textual content and the content of all elements should be translated. The content of the specified quote element, however, must not be translated.

&lt;book&gt;
 &lt;head&gt;...&lt;/head&gt; &lt;body its:translate="yes"&gt; ...
  &lt;p&gt;And he said: you need a new
  &lt;quote its:translate="no"&gt;motherboard&lt;/quote&gt;
 &lt;/p&gt; ...  &lt;/body&gt;
&lt;/book&gt;

Markup Declarations for Translatability

<translateRule>

att.translate
@translate
yes

Localization Information

Definition

The data category localization information is used to communicate information to localizers about a particular item of content.

This data category has several purposes:

- Tell the translator how to translate parts of the content
- Expand on the meaning or contextual usage of a specific element, such as what a variable refers to or how a string will be used on the user interface
- Clarify ambiguity and show relationships between items sufficiently to allow correct translation (e.g. in many languages it is impossible to translate the word “enabled” in isolation without knowing the gender, number and case of the thing it refers to.)
- Indicate why a piece of text is emphasized (important, sarcastic, etc.)

Two types of informative notes are needed:

- An alert contains information that the translator must read before translating a piece of text. Example: an instruction to the translator to leave parts of the text in the source language.
- A description provides useful background information that the translator will refer to only if they wish. Example: a clarification of ambiguity in the source text.

Implementation

Localization information can be expressed in a schema, with global rules, or locally on an individual element.

In a schema, localization information is expressed with a <schemaRule> element with a @locInfo attribute. The type of the localization information is expressed with a @locInfoType attribute with the values "alert" or "description".

Localization information expressed in a schema

&lt;xs:element name="p"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule
its:locInfo="This has to be handled carefully" its:locInfoType="alert"/&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt; ...
&lt;/xs:element&gt;

As for global rules, adding localization information to selected nodes is realized with a <locInfoRule> element, which contains a <locInfo> element or a @locInfoRef attribute. These two must not occur together. The attributes @locInfoType and @selector are mandatory.

Localization information expressed in rules

&lt;its:rules&gt;
 &lt;its:locInfoRule its:locInfoType="alert" its:selector="/body/p[1]"&gt;
  &lt;its:locInfo&gt;This p element has to be handled carefully"&lt;/its:locInfo&gt;
 &lt;/its:locInfoRule&gt;
&lt;/its:rules&gt;

The functionality of pointing to existing localization information is realized via a <locInfoRule> element with a @locInfoPointer attribute or a @locInfoRefPointer attribute. These two must not occur together. The @selector attribute is mandatory.

In an instanceLocally in a document, localization information is expressed with the attributes @locInfo or @locInfoRef, and @locInfoType. @locInfo and @locInfoRef must not occur together. If the @locInfoType attribute is not present, the type of localization information will be assumed as description. The selection is the textual content of element, including child elements, but excluding attributes.

Localization information expressed locally in an instance document

&lt;book&gt;
 &lt;head&gt;...&lt;/head&gt;
 &lt;body&gt; ...
  &lt;p its:locInfo="This p element has to be handled
   carefully" its:locInfoType="alert"&gt;And he said: you need a new
   &lt;quote&gt;motherboard&lt;/quote&gt;
  &lt;/p&gt; ...
 &lt;/body&gt;
&lt;/book&gt;

Identifying Existing Localization Information

To be able to identify globally existing localization information, the @locInfoContent attribute can be used. It must be accompaigned by a @locInfoType attribute.

To be able to differentiate the functionality of the @locInfoContent attribute from @locInfoSelector, these two attributes must not occur at the same <documentRule> element.

[An example of the usage of the @locInfoContent attribute is given in Relating ITS to Existing Markup in XML Spec.]

Markup Declarations for Localization Information

At the locInfoRule element, there must be either a locInfo element [not attribute] or a locInfoRef attribute. If neither is present, there must be either a locInfoPointer attribute or a locInfoRefPointer attribute. There is an optional locInfoType attribute.

<locInfoRule>

<locInfo>

About locInfoLocal: There must be either a a locInfo attribute or a locInfoRef attribute. There is an optional locInfoType attribute.

att.locInfo
@locInfo

att.locInfoPointer
@locInfoPointer

att.locInfoType
@locInfoType
alert

att.locInfoRef
@locInfoRef

att.locInfoRefPointer
@locInfoRefPointer

Terminology

Definition

The terminology data category is used to mark terms. This helps to increase consistency across different parts of the documentation. It is also helpful for translation.

Implementation

The terminology data category can be expressed in a schema, with global rules, or locally on an individual element.

In a schema, the terminology data category is expressed with a <schemaRule> element with a @term attribute, which has the value "yes".

The terminology data category expressed in a schema

&lt;xs:element name="span"&gt;
 &lt;xs:annotation&gt;
  &lt;xs:appinfo&gt;
   &lt;its:schemaRule its:term="yes"/&gt;
&lt;!-- All span elements are used to mark up terms--&gt;
  &lt;/xs:appinfo&gt;
 &lt;/xs:annotation&gt; ...
&lt;/xs:element&gt;

As for global rules, identifying terminology information at selected nodes is realized with a <termRule> element with a mandatory @selector attribute. In addition, an optional @termRef attribute can be used to refer to external information about the term. The datatype of @termRef is xs:anyURI. To point to existing term references, a @termRefPointer attribute can be used. @termRef and @termRefPointer must not be used together.

The terminology data category expressed in rules

&lt;its:rules&gt;
 &lt;its:termRule its:selector="/body/p[1]/span"
its:termRef="http://example.com/termdatabase/#x142539"/&gt;
&lt;/its:rules&gt;

In an instanceLocally in a document, the terminology data category is expressed with a @term attribute, which has the value "yes", and an optional @termRef attribute. The selection is the textual content of the element, including content of child elements, but excluding attributes.

The terminology data category expressed in an instance document

&lt;book&gt;
 &lt;head&gt;...&lt;/head&gt; &lt;body&gt; ...  &lt;p&gt;And he said: you need a
 new &lt;quote its:term="yes"&gt;motherboard&lt;/quote&gt;&lt;/p&gt; ...
 &lt;/body&gt;
&lt;/book&gt;

Markup Declarations for Terminology

In an instance document, an attribute term="yes" is used to indicate a term. In the global rule, "being" a term is expressed via the name of the element termRule, hence the attribute term="yes" is not necessary any more. The attributes termRef and termRefPointer are alternatives. It is an error if they occur at the same termRule element.

<termRule>

att.termRef
@termRef

att.termRefPointer
@termRefPointer

About term: the attribute term is mandatory, the attribute termRef is optional.

att.term
@term
yes

Directionality

Definition

This data category expresses the directionality of a piece of text. Its values are "ltr", "rtl", "lro" or "rlo". This definition is compliant with the dir attribute in XHTML™ 2.0, except that XHTML™ 2.0 does not allow for rule-based, global selection.

Implementation

The @dir attribute is used for the implementation of the directionality data category. It has the four values "ltr", "rtl", "lro" or "rlo".

Directionality can be expressed with global rules or locally on an individual element.

As for global rules, directionality is expressed in rules using a <dirRule> element with the @dir attribute. In addition, a @selector attribute is required.

Directionality expressed with global rules

&lt;its:rules&gt;
 &lt;its:dirRule its:dir="rtl" its:selector="/body/p[1]/quote[xml:lang='he']"/&gt;
&lt;!-- Some Hebrew quotation --&gt;
&lt;/its:rules&gt;

In an instanceLocally in a document, directionality is expressed with a @dir attribute. The selection is the textual content of the element, including all child elements and attributes.

Directionality expressed in an instance document

&lt;book&gt;
 &lt;head&gt;...&lt;/head&gt;
 &lt;body&gt; ...  &lt;p&gt;And he said: &lt;quote
 its:dir="rtl"&gt; ... a Hebrew quotation ... &lt;/quote&gt;&lt;/p&gt;
 ...  &lt;/body&gt;
&lt;/book&gt;

Markup Declarations for Directionality

TODO: comment?

<dirRule>

att.dir
@dir
ltr

Ruby

Definition

The data category ruby is used for a run of text that is associated with another run of text, referred to as the base text. Ruby text is used to provide a short annotation of the associated base text. It is most often used to provide a reading (pronunciation) guide.

Implementation

Ruby can be expressed locally in a n instance document or with global rules.

In an instanceLocally in a document, Ruby locally in an instance document is realized with a <ruby> element.

Ruby locally in a document in an instance document

&lt;text&gt;
 &lt;head&gt; ... &lt;/head&gt;
 &lt;body&gt;
  &lt;p&gt;This is about the
    &lt;its:ruby&gt;
     &lt;its:rb&gt;W3C&lt;/its:rubyBase&gt;
     &lt;its:rt&gt;World Wide Web Consortium&lt;/its:rubyText&gt;
    &lt;/its:ruby&gt;.
  &lt;/p&gt;
 &lt;/body&gt;
&lt;/text&gt;

The structure of the content model for the <ruby> element is identical with the structure of ruby markup as defined in Ruby Annotation.

[The structure of ruby defined in section 5.4 of OASIS Open Document Format for Office Applications… is compliant with ruby defined in this specification.]

The functionality of pointing to existing ruby markup is realized with various pointer attributes for ruby. There is a pointer attribute for the <ruby> element and each element within its content model.

Handling Legacy Content

In legacy situations, where one cannot change the element markup and there one wants to apply ruby text to an attribute or existing element content, then the following approach can be used.

A <rubyRule> element can be used with two attributes:

- A @rubyText attribute contains the ruby text (corresponding to the <rt> element in the case of no selections)
- A @selector attribute contains the selector. It selects the ruby base text, corresponding to the <rb> element in the case of no selection.

Adding ruby text with a <rubyRule> element

&lt;text ...&gt;
 &lt;head&gt; ... &lt;/head&gt;
  &lt;its:rules&gt;
   &lt;its:rubyRule its:rubyText="World Wide Web Consortium"
    its:selector="/body/img[1]/@alt"/&gt;
  &lt;/its:rules&gt;
 &lt;body&gt;
  &lt;img src="w3c_home.png" alt="W3C"/&gt; ...
 &lt;/body&gt;
&lt;/text&gt;

Markup Declarations for Ruby

The element rubyRule is used (1) to map existing ruby "markup to ITS ruby, which itself is defind in terms of the W3C ruby specification, or (2) to add ruby text to attribute values. Example for (1): <its:rubyRule its:selector="//span[class='ruby']" its:rbPointer="span[class='rubyBase']" its:rtPointer="span[class='rubyText']"/> . Example for (2): <its:rubyRule its:selector="/body/img[1]/@alt" its:rbPointer="." its:rt="World Wide Web Consortium"/> . It is an error if both an its:rt attribute and an its:rtPointer attribute occur at the same <its:rubyRule> element.

<rubyRule>

rubyLocal is defined in terms of http://www.w3.org/TR/ruby/\#definition. The (rbc, rtc, rtc?) alternative of the content model for the ruby element corresponds to complex ruby markup. The minimal content model for the ruby element is (rb, (rt | (rp, rt, rp))).

att.rubyPointers
@rubyPointer

@rbPointer

@rtPointer

@rpPointer

@rbcPointer

@rtcPointer

att.rubyText
@rubyText

<ruby>

@xmlns
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace
@xmlns:its
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace

<rb>

<rt>

<rbc>

<rtc>

<rp>

Language Information

Definition

The element <langRule> is used to express that a given piece of content (selected by the attribute @langPointer) is used to express language information as defined by Tags for the Identification of Languages.

Pointing to language information via <langRule>

The following <langRule> element expresses that all <p> elements (including attributes and textual content of child elements) have a language value conformant to Tags for the Identification of Languages. The value is given by the @mylangattribute attached to the <p> elements.

&lt;its:langRule its:selector="//p" its:langPointer="@mylangattribute"/&gt;

Markup Declarations for Language Information

<langRule>

att.langPointer
@langPointer

Elements Within Text

Definition

The data category elements within text expresses information about whether an element is part of its parent text unit. The values of this data category are "yes" (the element and its immediate child text nodes are part of the text unit of its parent element) or "no" (the element is not within text or holds an independent text unit within a parent text unit). Elements not listed are considered to be not within text.

Implementation

This data category can be expressed only in a set of rules. It cannot be expressed as local markup on an individual element.

Element within text is expressed with a <withinTextRule> element with a @withinText attribute. The attribute has the values "yes" or "no". In addition, a @selector attribute is required.

Elements within text

&lt;its:rules&gt;
 &lt;its:withinTextRule its:withinText="yes" its:selector="//b | //em | //i"/&gt;
&lt;/its:rules&gt;

Markup Declarations for Elements within Text

<withinTextRule>

att.withinText
@withinText
yes

Modularizations of ITS with Existing Markup Schemes

This section is informative.

[The working group plans to publish a separate document out of this section.]

Two topics are covered in this section:

- How should ITS be integrated in specific markup schemes? For example, as for XHTML, it is helpful for the interoperability of ITS implementations to specify that the <rules> element will always be part of the content model of the <head> element.
- How should ITS data categories be related to existing markup declarations in a schema, which fulfill identical or overlapping purposes? For example, OASIS DITA Architectural Specification Committee Draft 01 already has an attribute to indicate translatability of text, but without a mechanism for selection of information in documents and schemas. See also Mapping of ITS Data Categories to Existing Markup.

ITS and XHTML 1.0

XHTML 1.0 XHTML™ 1.0 The Extensible HyperText Markup Language (Second… is a reformulation of the three HTML 4 document types as applications of XML 1.0. HTML is an SGML (Standard Generalized Markup Language) application conforming to International Standard ISO 8879, and is widely regarded as the standard publishing language of the World Wide Web.

Integration of ITS into XHTML

In XHTML 1.0, the XHTML namespace may be used with other XML namespaces as per Namespaces in XML, but such documents are not strictly conforming XHTML 1.0 documents in the sense of XHTML 1.0.

An example of such a non-conformant XHTML 1.0 document is as follow.

A non-conformant XHTML 1.0 document

&lt;html xmlns="http://www.w3.org/1999/xhtml"
 xmlns:its="http://www.w3.org/2005/11/its" lang="en" xml:lang="en"&gt;
 &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;meta name="keywords" content="ITS example, XHTML translation" /&gt;
  &lt;its:rules&gt;
   &lt;its:ns prefix="h" uri="http://www.w3.org/1999/xhtml" /&gt;
   &lt;its:translateRule its:selector="//h:meta[@name='keywords']/@content"
    its:translate="yes" /&gt;
   &lt;its:termRule its:selector="//h:span[@class='term']" /&gt;
  &lt;/its:rules&gt;
  &lt;title&gt;ITS Working Group&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h1&gt;Test of ITS on &lt;span class="term"&gt;XHTML&lt;/span&gt;&lt;/h1&gt;
 &lt;p&gt;Some text to translate.&lt;/p&gt;
 &lt;p its:translate="no"&gt;Some text not to translate.&lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;

The way to use ITS with XHTML and keep the XHTML document conformant is to use external ITS global rules. Even local information within the document that would be handled by ITS attributes can be set indirectly.

ITS external rules and corresponding XHTML document

&lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
 &lt;its:ns prefix="h" uri="http://www.w3.org/1999/xhtml" /&gt;
 &lt;its:translateRule its:selector="//h:meta[@name='keywords']/@content"
  its:translate="yes" /&gt;
 &lt;its:translateRule its:selector="//h:p[@class='notrans']"
  its:translate="no" /&gt;
 &lt;its:termRule its:selector="//h:span[@class='term']" /&gt;
&lt;/its:rules&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"&gt;
 &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;meta name="keywords" content="ITS example, XHTML translation" /&gt;
  &lt;title&gt;ITS Working Group&lt;/title&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h1&gt;Test of ITS on &lt;span class="term"&gt;XHTML&lt;/span&gt;&lt;/h1&gt;
 &lt;p&gt;Some text to translate.&lt;/p&gt;
 &lt;p class="notrans"&gt;Some text not to translate.&lt;/p&gt;
 &lt;/body&gt;
&lt;/html&gt;

Relating ITS to Existing Markup in XHTML

A number of XHTML constructs implement the same semantic as some of the ITS data categories. In addition, some of the attributes in XHTML are translatable which is not the default for XML documents according ITS defaults settings. These attributes need to be identified as translatable.

An external ITS <rules> element can summarize these relations. Because XHTML use is widespread and covers a large amount of legacy material the rules defined here may not be optimal for everyone.

ITS external rules and corresponding XHTML document

&lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
 &lt;its:ns its:prefix="h" its:uri="http://www.w3.org/1999/xhtml"/&gt;
 &lt;!-- special content. (See note 1) --&gt;
 &lt;its:translateRule its:selector="//h:script" its:translate="no"/&gt;
 &lt;its:translateRule its:selector="//h:style" its:translate="no"/&gt;

 &lt;!-- Normal translatable attributes --&gt;
 &lt;its:translateRule its:selector="//h:*/@abbr" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@accesskey" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@alt" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@prompt" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@standby" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@summary" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:*/@title" its:translate="yes"/&gt;

 &lt;!-- The input element (Important: See note 2) --&gt;
 &lt;its:translateRule its:selector="//h:input/@value" its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:input[@type='hidden']/@value" its:translate="no"/&gt;

 &lt;!-- Non-translatable element (See note 3) --&gt;
 &lt;its:translateRule its:selector="//h:del" its:translate="no"/&gt;
 &lt;its:translateRule its:selector="//h:del/descendant-or-self::*/@*" its:translate="no"/&gt;

 &lt;!-- Often-used translatable meta content. --&gt;
 &lt;its:translateRule its:selector="//h:meta[@name='keywords']/@content"
 its:translate="yes"/&gt;
 &lt;its:translateRule its:selector="//h:meta[@name='description']/@content"
 its:translate="yes"/&gt;

 &lt;!-- Possible term (Important: See note 4) --&gt;
 &lt;its:termRule its:selector="//h:dt" its:term="yes"/&gt;

 &lt;!-- Bidirectional information --&gt;
 &lt;its:dirRule its:selector="//h:*[@dir='ltr']" its:dir="ltr"/&gt;
 &lt;its:dirRule its:selector="//h:*[@dir='rtl']" its:dir="rtl"/&gt;
 &lt;its:dirRule its:selector="//h:bdo[@dir='ltr']" its:dir="lro"/&gt;
 &lt;its:dirRule its:selector="//h:bdo[@dir='rtl']" its:dir="rlo"/&gt;

 &lt;!-- Elements within text --&gt;
 &lt;its:withinTextRule its:withinText="yes"
  its:selector="//h:abbr | //h:acronym | //h:br | //h:cite | //h:code | //h:dfn
  | //h:kbd | //h:q | //h:samp | //h:span | //h:strong | //h:var | //h:b | //h:em
  | //h:big | //h:hr | //h:i | //h:small | //h:sub | //h:sup | //h:tt | //h:del
  | //h:ins | //h:bdo | //h:img | //h:a | //h:font | //h:center | //h:s | //h:strike
  | //h:u | //h:isindex" /&gt;

&lt;/its:rules&gt;

Additional notes on these rules:

- Note 1: The <script> and <style> elements may have translatable text, but their content needs to be parsed with respectively a script filter and a CSS filter. Depending on the capability of your translation tools you may want to leave these elements translatable.
- Note 2: The value attribute of the <input> element may or may not be translatable depending on the way the element is used. Selecting value as translatable or not needs to be decided depending on your own use.
- Note 3: The <del> element indicates removed text and therefore, most often, would not be translatable. Because this element may contain elements with translatable attributes such as <img> with alt, and because the scope of translatability does not include attributes, you need to: a) define this rule after the definition of the translatable attributes, and b) use the rules with its:selector="//h:del/descendant-or-self::*/@*" to overwrite any possible translatable attribute within a <del> element or any of its descendants.
- Note 4: The <dt> element is defined by HTML as a "definition term" and can therefore be seen as a candidate to be associated with the ITS Terminology data category. However, for historical reasons, this element has been used for many other purposes. Selecting <dt> as a term or not needs to be decided depending on your own use.

ITS and DocBook

TODO

ITS and Open Document Format 1.0

TODO

ITS and DITA 1.0

TODO

ITS and TEI

The TEI (Text Encoding Initiative Guidelines development version (P5)) is intended for literary and linguistic material, and is most often used for digital editions of existing printed material. It is also suitable, however, for general purpose writing. The P5 release of the TEI consists of 23 modules which can be combined together as needed.

Integration of ITS into TEI

The TEI is maintained as a single ODD document, and customizations of it are also written as ODD documents. These are processed using XSLT stylesheets to make a tailored user-level schema in XML DTD, XML Schema or RELAX NG.

The ITS additions involve two changes to TEI:

- Allowing <rules> to appear in the TEI metadata section (the <teiHeader>).
- Adding the ITS local attributes to the TEI global attribute set.

Both of these can be easily achieved using standard techniques in ODD.

The body of a TEI/ITS customization consists of a <schemaSpec> which lists the modules to be included (this example includes six common ones):

A <schemaSpec> element with modules to be included

&lt;schemaSpec ident="tei-its" start="TEI"&gt;
&lt;moduleRef key="header"/&gt;
&lt;moduleRef key="core"/&gt;
&lt;moduleRef key="tei"/&gt;
&lt;moduleRef key="textstructure"/&gt;
&lt;moduleRef key="namesdates"/&gt;
&lt;moduleRef key="msdescription"/&gt; ...

In addition, we load the ITS schema (in its RELAX NG XML format, the language used by the TEI for expressing content models), and overload the definition of the TEI content class model.headerPart to include the ITS <rules>:

Inclusion of ITS <rules> into the TEI schema

&lt;moduleRef url="its.rng"&gt;
 &lt;content&gt;
 &lt;rng:define name="model.headerPart" combine="choice"&gt;
  &lt;rng:ref name="rules"/&gt;
 &lt;/rng:define&gt;
 &lt;/content&gt;
&lt;/moduleRef&gt;

The content class determines which elements are allowed as children of <teiHeader>. Lastly, we change the definition of the global attribute class att.global to reference the ITS local attributes (available from the ITS schema we loaded earlier):

Addition of the ITS local attributes to the global attributes

&lt;classSpec ident="att.global" type="atts" mode="change"&gt;
  &lt;attList&gt;
   &lt;attRef name="span.attributes"/&gt;
  &lt;/attList&gt;
 &lt;/classSpec&gt;
... &lt;/schemaSpec&gt;

When processing, this customization produces a schema which permits markup like this:

Document which is valid against a schema TEI+ITS

&lt;TEI
 xmlns:its="http://www.w3.org/2005/11/its"
 xmlns="http://www.tei-c.org/ns/1.0"&gt;
 &lt;teiHeader&gt;
  &lt;fileDesc&gt;
&lt;!-- details of the file --&gt;
  &lt;/fileDesc&gt;
  &lt;rules xmlns="http://www.w3.org/2005/11/its"&gt;
   &lt;ns its:prefix="t" its:uri="http://www.tei-c.org/ns/1.0"/&gt;
   &lt;translateRule its:translate="no"
     its:selector="//t:body/t:p/@*"/&gt;
   &lt;translateRule its:translate="yes"
     its:selector="//t:body/t:p"/&gt;
  &lt;/rules&gt;
 &lt;/teiHeader&gt;
 &lt;text&gt;
  &lt;body&gt;
   &lt;p rend="normal"&gt;Hello  &lt;hi&gt;world&lt;/hi&gt;&lt;/p&gt;
   &lt;p rend="special"&gt;Goodbye&lt;/p&gt;
   &lt;p its:translate="no"&gt;This must not be translated&lt;/p&gt;
  &lt;/body&gt;
 &lt;/text&gt;
&lt;/TEI&gt;

In this example, a set of rule elements are provided in the header to provide rules, and the body of the text performs a specific override.

ITS and XML Spec

The XML Spec Schema and Stylesheets is intended for W3C working drafts, notes, recommendations, and all other document types that fall under the category of technical reports. XML Spec is available in the formats of XML DTD, XML Schema and RELAX NG.

Integration of ITS into XML Spec

ITS has been integrated into xmlspec-i18n.dtd. This is a version of the XML DTD version 2.9 of XML Spec which already supplies various internationalization and localization related features. For example, there is an attribute @translate in xmlspec-i18n.dtd, which can be used for the same purposes as the ITS @translate attribute. To be able to separate them from original XML Spec declarations, all additions are stored in two separate files i18n-extensions.mod and i18n-elements.mod. Xmlspec-i18n.dtd is used within the W3C Internationalization Activity for the creation of technical reports.

For the integration of ITS, the following modifications to the xmlspec-i18n.dtd have been made:

- A new entity <!ENTITY % its SYSTEM "its.dtd"> and the entity call %its; have been added to xmlspec-i18n.dtd.
- The existing XML Spec entity %common.att; has been modified . The ITS entities %att.translate.attributes;, %att.locInfo.attributes;, %att.locInfoType.attributes;, %att.locInfoRef.attributes;, %att.term.attributes;, %att.termRef.attributes; and %att.dir.attributes; have been added to %common.att;. In this way, the local attributes can be used at any element defined in the XML Spec DTD.
- The XML Spec entity %header.mdl; contains the content model of the <header> element. The ITS element <rules> has been added as the last element to this content model. In this way, <rules> can be used inside an XML Spec document. The <header> element of the XML Spec DTD has been chosen as the place for <rules>, to avoid the impact of ITS markup on XML Spec markup.
- The ITS element <ruby> has been added to the XML Spec entity %p.pcd.mix;. In this way it is possible to use <ruby> as an inline element.

Relating ITS to Existing Markup in XML Spec

As mentioned before, xmlspec-i18n.dtd has its own existing markup declarations for various internationalization and localization related purposes. In the original XML Spec 2.9 DTD, there is a term element which fulfills the same purpose as the ITS @term attribute.

To relate such existing XML Spec and xmlspec-i18n.dtd related markup to ITS markup (see Mapping of ITS Data Categories to Existing Markup), the following <rules> element has been created.[^4].

[^4: This is not an exhaustive list of mappings yet, but only a first attempt]

Mapping ITS markup to XML Spec and xmlspec-i18n.dtd markup

&lt;its:rules xmlns:its="http://www.w3.org/2005/11/its"&gt;
 &lt;!--The following rules are for xmlspec-i18n.dtd--&gt;
 &lt;its:termRule its:term="yes" its:selector="//qterm"/&gt;
 &lt;its:dirRule its:dir="ltr" its:selector="//*[@dir='ltr']"/&gt;
 &lt;its:dirRule its:dir="rtl" its:selector="//*[@dir='rtl']"/&gt;
 &lt;its:dirRule its:dir="lro" its:selector="//*[@dir='lro']"/&gt;
 &lt;its:dirRule its:dir="rlo" its:selector="//*[@dir='rlo']"/&gt;
 &lt;its:locInfoRule its:locInfoType="alert"
   its:locInfoPointer="@locn-alert" its:selector="//*"/&gt;
 &lt;its:locInfoRule its:locInfoType="description"
   its:locInfoPointer="//@locn-note" its:selector="//*"/&gt;
 &lt;its:translateRule its:translate="yes"
   its:selector="//*[@translate='yes']"/&gt;
 &lt;its:translateRule its:translate="no"
   its:selector="//*[@translate='no']"/&gt;
 &lt;!--This rule is for the original XML Spec DTD--&gt;
 &lt;its:termRule its:selector="//term"/&gt;
&lt;/its:rules&gt;

Since both XML Spec and xmlspec-i18n.dtd do not define a namespace, the mappings use XPath expressions with unqualified element and attribute names.

Markup Declarations

This section is normative.

Declaration of the Span Element

The ITS Span Element

The <span> element can be used if a markup scheme has no element to which data category attributes can be attached. <span> contains these attributes and serves as a hook for using them in XML documents.

Using the <span> element

&lt;text&gt;
 &lt;head&gt;[...]&lt;/head&gt;
 &lt;body&gt; ...
  &lt;its:span its:translate="no"&gt; ... &lt;/its:span&gt;
 &lt;/body&gt;
&lt;/text&gt;

The <span> element contains the data category attributes.

<span>
An element used as a general container for ITS data category attributes.

Declarations of General Datatypes

A data type data.selector is defined for selector attributes. Its value is an XPath expression XML Path Language (XPath) Version 1.0. A data type itsBoolean is defined for boolean values, e.g. to express @translatability. The data type dirValues is used for the data category attribute @dir. The data type locInfoType is used to express the type of the @locInfo attribute. The data type itsBooleanTrue is used for the @term attribute.

data.selector

data.itsBoolean
yes

data.dirValues
ltr

data.locInfoType
alert

data.itsBooleanTrue
yes

Declarations of Data Categories

The attribute group att.datacats is used to express the ITS data categories. It makes use of the data type data.itsBoolean.

att.datacats
@translate
@locInfo

@locInfoType
@term
Applicable in a schema, global, and local.
@termRef
@dir
@rubyText

@xmlns
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace

att.any

The elements <ruby>, <rubyBase> and <rubyText> are used for the implementation of the Ruby data category. If a change of the element markup in an XML document is not possible, the @rubyText and @rubySelector attributes should be used.

<rubyBase>

<ruby>

<rubyText>

Declaration of Selector Attributes

The attribute group att.selector is used at the <documentRule> element to express applicability of ITS information. It must not be used in other positions, e.g. individual elements. It makes use of the data type data.selector.

att.selector
@translateSelector
@locInfoSelector
@locInfoContent
@termSelector
@dirSelector
@rubySelector

Declarations of the SchemaRule and DocumentRules Elements

The <schemaRule> element contains rules for ITS information, to be used as schema annotation. It uses attributes from the ITS data categories.

<schemaRule>
A rule to express ITS information about the element declaration to which the <schemaRule> element is attached as schema annotation.

The <documentRules> element contains zero or more <ns> elements, followed by one or more <documentRule> elements. The <documentRule> element contains attributes from the data category attributes, and the selector attributes.

<documentRules>
This element contains rules for ITS information, to be used in documents.

@xmlns:its
The ITS namespace

http://www.w3.org/2005/11/its A valid XML namespace

<its:documentRules xml:id="rule001">
  <its:documentRule translate="yes" translateSelector="//p"/>
<!-- all p elements will be translated -->
  <its:documentRule translate="yes" translateSelector="//p/*@[not(name()='id')]"/>
<!-- attributes at the p elements will also be translated-->
</its:documentRules>

<ns>
An element to describe namespace URIs and prefixes within XPath expressions in the <selector attributes> and data category specific attributes for pointing to existing information.

att.nsident
@prefix
@uri

<documentRule>
A rule to express ITS information and select parts of a document respectively. <documentRule> is to be used in a in rule context only.

Conformance

This section is normative.

Conformance to ITS falls into two categories: conformance to the ITS data categories (cf. Description of Data Categories, including data category specific default selections) and conformance to selection mechanisms (cf. SelectionProcessing of ITS information).

Conformance to the ITS Data Categories and Data Category Specific Default Selection Mechanisms

[We still have to add conformance information for ruby, and possibly for directionality.]

An implementation of the ITS data categories is conformant if it supplies a schema which adopts the ITS data categories, with the following constraints:

- The schema must allow the usage of the attribute group att.datacats at every element which is declared in the schema.
- The interpretation of data category attributes in instance documents must be conformant to the data category specific default selections described in Position and Default Selections of Data Categories.
- The schema should allow the usage of the <documentRules> element at one or more elements in the schema.

The <schemaRule> element is to be used as schema annotations. It is the responsibility of the schema processor to allow for such annotations.

A schema which is conformant to the ITS data categories

&lt;xs:schema xmlns:myns="http://example.com/mySchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:its="http://www.w3.org/2005/11/its"
targetNamespace="http://example.com/mySchema" elementFormDefault="qualified"
attributeFormDefault="unqualified"&gt;
 &lt;xs:import namespace="http://www.w3.org/2005/11/its" schemaLocation="its.xsd"/&gt;
 &lt;xs:element name="document"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:sequence&gt;
     &lt;xs:element ref="myns:head"/&gt;
     &lt;xs:element ref="myns:body"/&gt;
   &lt;/xs:sequence&gt;
   &lt;xs:attributeGroup ref="myns:commonAtts"/&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
 &lt;xs:attributeGroup name="commonAtts"&gt;
  &lt;xs:attributeGroup ref="its:att.datacats.attributes"/&gt;
  &lt;xs:attributeGroup ref="its:att.selector.attributes"/&gt;
 &lt;/xs:attributeGroup&gt;
 &lt;xs:element name="head"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
     &lt;xs:element ref="its:documentRules"/&gt;
     &lt;xs:element ref="its:documentRule"/&gt;
   &lt;/xs:choice&gt;
   &lt;xs:attributeGroup ref="myns:commonAtts"/&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
 &lt;xs:element name="body"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:sequence&gt;
    &lt;xs:element ref="myns:para" maxOccurs="unbounded"/&gt;
   &lt;/xs:sequence&gt;
   &lt;xs:attributeGroup ref="myns:commonAtts"/&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
 &lt;xs:element name="para"&gt;
  &lt;xs:complexType mixed="true"&gt;
   &lt;xs:attributeGroup ref="myns:commonAtts"/&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
&lt;/xs:schema&gt;

Conformance to Selection Mechanisms

Conformance to Selection Mechanisms encompasses conformance to the ITS data categories and data category specific default selection mechanisms, with the following changes:

- The schema must allow the usage of the <documentRules> element in at least one element in the schema
- An application which processes ITS elements and attributes must process the selection mechanisms described in Precedence between Selections

A mandatory part of this conformance criterion is the usage of XPath. An application which processes ITS selection rules must be able to process XPath in version 1.0 or higher. It is not required to support a specific host language of XPath, like for example XSL Transformations (XSLT) Version 1.0.

Schemas for ITS

This section is informative.

The following schemas are provided:

- DTD for ITS

- XML Schema document for ITS

- RELAX NG compact syntax document for ITS

- RELAX NG XML syntax document for ITS

Alphabetic List of ITS Elements and Attributes

[^5]The description of ITS elements describes what attributes and child elements the contain and in which element they can occur. The description of ITS attributes describes with what other attributes they are used together, and at which elements they can occur. All these informal descriptions are linked to the formal characterization in the normative parts of this document.

[^5: TODO: not written yet, but maybe useful for navigation in the document.]

@dir attribute

- Definition: TODO: link to global usage and local usage.
- Required additional attribute: @dirSelector (only in global usage, at the <documentRule> element)
- Element which can contain this attribute: <documentRule> (only in global usage), or any element in an XML document (in local usage).

References

Karl Dubost, Lynne Rosental, Dominique Hazaël-Massieux, Lofton Henderson. QA Framework: Specification Guidelines. W3C Recommendation 17 August 2005. Available at http://www.w3.org/TR/2005/REC-qaframe-spec-20050817/. The latest version of QAFRAMEWORK is available at http://www.w3.org/TR/qaframe-spec/.
James Clark, Makoto Murata. RELAX NG Specification . OASIS Committee Specification 3 December 2001. Available at http://www.oasis-open.org/committees/relax-ng/spec-20011203.html. The latest version of RELAX NG is available at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=relax-ng.
S. Bradner. Key Words for use in RFCs to Indicate Requirement Levels. IETF RFC 2119. Available at http://www.ietf.org/rfc/rfc2119.txt.
Addison Phillips, Mark Davis. Tags for the Identification of Languages . IETF Internet-Draft, October 2005. See http://www.ietf.org/internet-drafts/draft-ietf-ltru-registry-14.txt.
Marcin Sawicki (until 10 October, 1999), Michel Suignard, Masayasu Ishikawa (石川 雅康), Martin Dürst, Tex Texin, Ruby Annotation . W3C Recommendation 31 May 2001. Available at http://www.w3.org/TR/2001/REC-ruby-20010531/ . The latest version of Ruby Annotation is available at http://www.w3.org/TR/ruby/.
Jonny Axelsson, Mark Birbeck, Micah Dubinko, Beth Epperson, Masayasu Ishikawa, Shane McCarron, Ann Navarro, Steven Pemperton. XHTML™ 2.0 . W3C Working Draft 27 May 2005. Available at http://www.w3.org/TR/2005/WD-xhtml2-20050527/. The latest version of XHTML 2.0 is available at http://www.w3.org/TR/xhtml2.
Steve DeRose, Eve Maler, David Orchard. XML Linking Language 1.0. W3C Recommendation 27 June 2001. Available at http://www.w3.org/TR/2001/REC-xlink-20010627/. The latest version of XLink 1.0 is available at http://www.w3.org/TR/xlink/.
Steve DeRose, Eve Maler, David Orchard, Norman Walsh. XML Linking Language (XLink) Version 1.1 . W3C Working Draft 7 July 2005. Available at http://www.w3.org/TR/2005/WD-xlink11-20050707/. The latest version of XLink 1.1 is available at http://www.w3.org/TR/xlink11/.
Tim Bray, Jean Paoli, C.M. Sperberg-McQueen, et al., editors. Extensible Markup Language (XML) 1.0 (Third Edition) , W3C Recommendation 04 February 2004. Available at http://www.w3.org/TR/2004/REC-xml-20040204/. The latest version of XML 1.0 is available at http://www.w3.org/TR/REC-xml/.
Tim Bray, Dave Hollander, Andrew Layman. Namespaces in XML . W3C Recommendation 14 January 1999. Available at http://www.w3.org/TR/1999/REC-xml-names-19990114/. The latest version of XML Names is available at http://www.w3.org/TR/REC-xml-names/.
Henry S. Thompson, David Beech, Murray Maloney, Noah Mendelsohn. XML Schema Part 1: Structures Second Edition . W3C Recommendation 28 October 2004. Available at http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/. The latest version of XML Schema is available at http://www.w3.org/TR/xmlschema-1/.
James Clark. XML Path Language (XPath) Version 1.0 . W3C Recommendation 16 November 1999. Available at http://www.w3.org/TR/1999/REC-xpath-19991116. The latest version of XPath 1.0 is available at http://www.w3.org/TR/xpath.

References

Cascading Style Sheets, level 2. W3C Recommendation 12 May 1998. Available at http://www.w3.org/TR/1998/REC-CSS2-19980512. The latest version of CSS2 is available at http://www.w3.org/TR/REC-CSS2/.
OASIS DITA Architectural Specification Committee Draft 01 . Oasis Committee Specification 3 May 2005. Available at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dita.
Norman Walsh and Leonard Muellner. DocBook: The Definitive Guide . Available at http://www.docbook.org/.
Richard Ishida, Susan Miller. Localization vs. Internationalization. Article of the W3C Internationalization Activity, January 2006.
Yves Savourel. Internationalization and Localization Markup Requirements . W3C Working Draft 5 August 2005. Available at http://www.w3.org/TR/2005/WD-itsreq-20050805/. The latest version of ITS REQ is available at http://www.w3.org/TR/itsreq/.
Michael Brauer et al. OASIS Open Document Format for Office Applications (OpenDocument). . Oasis Standard 1 May 2005. Available at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office. The latest version of OpenDocument is available at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office.
Schematron - A Language for Making Assertions about Patterns Found in XML Documents . Available at http://www.schematron.com/.
Norman Walsh. Using Qualified Names (QNames) as Identifiers in XML Content . TAG Finding 17 March 2004. Available at http://www.w3.org/2001/tag/doc/qnameids.html.
Lou Burnard and Syd Bauman (eds). Text Encoding Initiative Guidelines development version (P5) . TEI Consortium, Charlottesville, Virginia, USA, Text Encoding Initiative.
Steven Pemperton et al. XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition) . W3C Recommendation 26 January 2000, revised 1 August 2002. Available at http://www.w3.org/TR/2002/REC-xhtml1-20020801/. The latest version of XHTML 1.0 is available at http://www.w3.org/TR/xhtml1/.
Steve DeRose, Eve Maler, David Orchard, Norman Walsh. XML Linking Language (XLink) Version 1.1 . W3C Working Draft 7 July 2005. Available at http://www.w3.org/TR/2005/WD-xlink11-20050707/. The latest version of XLink 1.1 is available at http://www.w3.org/TR/xlink11/.
The XML Spec Schema and Stylesheets . Available at http://www.w3.org/2002/xmlspec/.
James Clark. XSL Transformations (XSLT) Version 1.0 . W3C Recommendation 16 November 1999. Available at http://www.w3.org/TR/1999/REC-xslt-19991116. The latest version of XSLT 1.0 is available at http://www.w3.org/TR/xslt.
exTensible User Inferface Language . Available at http://www.xulplanet.com/.

Revision Log

ThisThe following log records major changes that have been made to this document since the previous publication in November 2005(November 2005).

- A section about basic concepts of ITS has been created.
- Terminology has been modified: the terms for position of ITS information in situ versus dislocated have been replaced by selection in an instance document versus global, rule-based selection.
- The definition of the directionality data category has been changed, to be compliant to various other specifications. See the comment on bidirectionality for further information.
- Terminology within the text of this document and within the markup declarations has been modified: scope of ITS information has been replaced with selection of ITS information.
- The schemaRules element has been removed. For ITS information as schema annotation, where is now only a <schemaRule> element.
- All ITS attributes are now defined as qualified attributes. This leads to changes in the generated ITS schemas, for example the generation of parameter entities for prefixes in the XML DTD. This allows for easy changing of prefixes in element or attribute names.
- The possibility of selector attributes in instance documents (in the previous draft this was called scope in an instance document) has been removed. Local selection in an instance document now relies only on default selections of data categories. Due to this change, the definition of precedence between selections and conformance criteria have been simplified, and the issue on namespace requirements and selector values could be resolved.
- Definitions of default selections of data categories have been modified.
- An <ns> element has been added to the <rules> element to allow for specifying namespace bindings.
- The implementation of the ruby data category has been modified, to reflect the removal of selector attributes in instance documents.
- A section on mapping of ITS data categories to existing markup has been created.
- Examples of integrating ITS markup into a TEI schema and into XML Spec have been created.
- A <span> element has been created.
- The examples have been modified to reflect changes mentioned above.
- For clarity, various sections have been reworded and re-structured, and the visualization of ITS markup within the text of this document has been modified.
- Tracking of issues is now handled via Bugzilla.
- A revision log has been added.

The following log records major changes that have been made to this document since the publication in February 2006.

- The <schemaRule> element, and the notion of schema annotation which was connected to it, have been abandoned.
- The section on conformance has been rewritten and placed at the beginning of the document.
- In global rules, the <documentRule> element has been replaced with elements which have data category specific names. This eases the creation and validation of global rules.
- In global rules, instead of rule specific attributes for selection, there is now just one @selector attribute.
- In global rules, the <documentRules> element has been renamed to <rules>.
- In global rules, in addition to the existing functionality of adding ITS information to selected nodes, a new functionality of pointing to information in an XML document has been created.
- An XLink @href attribute has been added to the <rules> element to allow for links to external rules. The precedence between selections has been modified to reflect this change.
- Two new data categories language information and elements within text have been defined.
- The data category ruby has been redefined, to be conform to Ruby Annotation.
- The declarations for ITS markup have been rewritten, to adopt the changes mentioned above.
- The declarations for ITS markup (formally all assembled in a single section) have been separated and placed in the sections there they are discribed.
- A modularization of ITS and XHTML 1.0 has been created.
- The informative Introduction and Basic Concepts have been rewritten.
- Examples and the modularizations of ITS with existing markup schemes have been changed to reflect the modifications mentioned above.

Acknowledgements

This document has been developed with contributions by the ITS Working Group. At the date of publication, the members of the Working Group were: Damien Donlon (Sun Microsystems), Martin Dürst (Invited Expert), Richard Ishida (W3C), Masaki Itagaki (Invited Expert), Christian Lieske (SAP AG), Naoyuki Nomura (Ricoh), Sebastian Rahtz (Invited Expert), François Richard (HP), Goutam Saha (CDAC), Felix Sasaki (W3C), Yves Savourel (ENLASO), Dianne Stoick (Boeing), Najib Tounsi (Ecole Mohammadia d'Ingénieurs Rabat (EMI)) and Andrzej Zydroń (Invited Expert).

A special thanks goes to Sebastian Rahtz who introduced us to the ODD language, which was used to create this document, and who provided the stylesheets to generate schemas and the XHTML version out of an ODD document. The generation of XHTML from ODD takes an intermediate step through the xmlspec-i18n.dtd, see ITS and XML Spec.