Re: ITS and XHTML 1.0

One correction on the XHTML rules

<!-- Elements not to translate -->
 <its:translateRule its:selector="//h:del" its:translate="no"/>

Should go after the definition of the attributes to translate and we need one more rules to avoid translating attributes like alt
that are within elements inside a <del> (since the "cascading" affect only the elements content, not the attributes).

Which means that instead of this:

============================================================

 <!-- Elements not to translate -->
 <its:translateRule its:selector="//h:del" its:translate="no"/>
 <its:translateRule its:selector="//h:script" its:translate="no"/>
 <its:translateRule its:selector="//h:style" its:translate="no"/>

 <!-- Special attributes: Note that some choices are just guess based on personal experience, for example I think hidden <input>
fields are usually not transltable, but that may not be the case all the time. -->
 <its:translateRule its:selector="//h:*/@abbr" its:translate="yes"/>
 ...snip...
 <its:translateRule its:selector="//h:input[@type='hidden']/@value" its:translate="no"/>
 <!-- Often-used translatable meta content. -->
 <its:translateRule its:selector="//h:meta[@name='keywords']/@content" its:translate="yes"/>
 <its:translateRule its:selector="//h:meta[@name='description']/@content" its:translate="yes"/>

============================================================

We should use this:

============================================================

 <!-- Elements not to translate -->
 <its:translateRule its:selector="//h:script" its:translate="no"/>
 <its:translateRule its:selector="//h:style" its:translate="no"/>

 <!-- Special attributes: Note that some choices are just guess based on personal experience, for example I think hidden <input>
fields are usually not transltable, but that may not be the case all the time. -->
 <its:translateRule its:selector="//h:*/@abbr" its:translate="yes"/>
 ...snip...
 <its:translateRule its:selector="//h:input[@type='hidden']/@value" its:translate="no"/>
 <!-- Often-used translatable meta content. -->
 <its:translateRule its:selector="//h:meta[@name='keywords']/@content" its:translate="yes"/>
 <its:translateRule its:selector="//h:meta[@name='description']/@content" its:translate="yes"/>

 <!-- del case -->
 <its:translateRule its:selector="//h:del" its:translate="no"/>
 <its:translateRule its:selector="//h:del/descendants-or-self::*/@*" its:translate="no"/>

============================================================

Which leads to the general rule of thumb that one should define translatable attributes before non-translatable elements.

Kenavo,
-yves

Received on Wednesday, 15 March 2006 04:24:22 UTC