Its0505LimitImpact

From W3C Wiki


ITS WG Collaborative editing page

Follow the conventions for editing this page.

Status: Working Draft

The original discussion is the feedback from Norm: [1]

Author: Yves Savourel

Limited Impact

Summary

[R014] All solutions proposed should be designed to have as little impact as possible on the tree structure of the original document and on the content models in the original schema.

Challenges

Inserting elements or attributes of a different namespace in an XML document can have side effects on various processing aspects. For example, the inserted nodes may:

  • Break the XPath expressions already in use to access part of the document.
  • Interfere with <xsl:value-of/> for extracting information.
  • Interfere with numbering and other aspects of styling the original document.

Solutions for any of the ITS requirements must take in account these potential drawbacks and offer implementations that have limited impact on the original document and on the content models in the original schema.

For instance:

  • Use attributes whenever possible (they have a lesser impact than elements). For example:


Using an extra attribute

<table translate="no">
 <tr>...
</table>


is better than:


Using an extra element

<notrans>
 <table>
  <tr>...
 </table>
</notrans>


  • Use data categories that already exist in the original markup by either mapping them to ITS concepts (see "[2]") or by using them to carry ITS attributes. For example:


Mapping concepts

<info>
 <mapping target='quote' its='notrans'/>
<info>
...
<para>The motto of Québec is:
 <quote>"je me souviens"</quote>.</para>


  • Group general ITS information in branches that are placed in locations where they have a minimal impact:


Information placement
<doc>
 <info>
 ...
 </info>
 <header>...
 <body>...


Notes

One possible solution which has to be discussed is whether ITS should encompass not only a tag set, but also a specification of processing steps for documents. One step then could be the separation of the document in namespace specific sections. This would limit the side effects mentioned above.

The Namespace Routing Language [NRL][3] could be used for this purpose. The "Part 4: Namespace-based Validation Dispatching Language — NVDL" [NVDL][4] of the ISO/IEC 19757 proposal "Document Schema Definition Languages (DSDL)" [DSDL][5] relies mainly on NRL. The following example NRL document can be applied to XML documents with markup from the xhtml namespace and a fictive ITS namespace. With the NRL document, the XML document are validated only against the XHTML scheme "xhtml.rng":


<rules startMode="root"
 xmlns="http://www.thaiopensource.com/validate/nrl">
 <mode name="root">
  <namespace ns="http://www.w3.org/1999/xhtml">
   <validate schema="xhtml.rng"
     useMode="xhtml"/>
   </namespace>
 </mode>
 <mode name="xhtml">
  <namespace ns="http://www.example.org/its">
      <unwrap/>
  </namespace>
  <namespace ns="http://www.w3.org/1999/xhtml">
    <attach/>
  </namespace>
 </mode>
</rules>


Quick Guidelines

The requirement in the Schema versus in the XML document are as follow:

In a schema, this requirement concerns the structure of content models. Problems can arise also if the schema has no namespace:


<(exclamation-point)ELEMENT text (div+>
<(exclamation-point)ELEMENT div (p | table | ...>


If an ITS span element should be used to indicate i18n and l10n related properties of the

element, the
element would disappear from the content model of the
element:


<!ELEMENT div (p | TheITSns:span | ...>
<!ELEMENT TheITSns:span (table | ...)>


Since there is no namespace for the original schema (i.e. the <text>,
,
or

elements), the Namespace Routing Language does not solve the conflicts between ITS elements and other elements.