W3C home > Mailing lists > Public > public-i18n-its@w3.org > January to March 2006

Question about selector scope and rule order

From: Yves Savourel <yves@opentag.com>
Date: Sat, 11 Mar 2006 21:52:16 -0700
To: <public-i18n-its@w3.org>
Message-ID: <000301c64590$bcdfd270$0300a8c0@Breizh>

Hi all,

I'm running into a question about what exactly the scope of the selector is, and I can't find the answer in the specification. This
happens when you want to override rules.

<myDoc>
 <!-- all element not translatable except <text> -->
 ...
 <entry id="1">
  <text>TEXT <code>code</code> TEXT <code>code <sub>TEXT INSIDE CODE</sub> mode code</code> TEXT.</text>
 </entry>
 <entry id="2" localize="no">
  <text>TEXT <code>code</code> TEXT <code>code <sub>TEXT INSIDE CODE</sub> mode code</code> TEXT.</text>
 </entry>
</myDoc>

In the document above imagine that none of the elements are translatable except <text>, inside <text> the element <code> is not
translatable, inside <code> the element <sub> is translatable. This gives us:

<its:translateRule its:selector="//*" its:translate="no"/>
<its:translateRule its:selector="//text" its:translate="yes"/>
<its:translateRule its:selector="//code" its:translate="no"/>
<its:translateRule its:selector="//sub" its:translate="yes"/>

No problem so far.

Then I have to take in account a flag on the <text> element: if the attribute localize='no' then that <text> element is not
transltable. So can I do simply this:

<its:translateRule its:selector="//text" its:translate="yes"/>
<its:translateRule its:selector="//code" its:translate="no"/>
<its:translateRule its:selector="//sub" its:translate="yes"/>
<its:translateRule its:selector="//text[@localize='no']" its:translate="yes"/>

Or do I need to explicitely re-override all child elements of non-translatable <text> to be sure the <sub> elements do not get
translated in such <text>?

<its:translateRule its:selector="//text" its:translate="yes"/>
<its:translateRule its:selector="//code" its:translate="no"/>
<its:translateRule its:selector="//sub" its:translate="yes"/>
<its:translateRule its:selector="//text[@localize='no']" its:translate="yes"/>
<its:translateRule its:selector="//text[@localize='no']/*" its:translate="yes"/>

In other words: the selector points to one or more nodes, we apply the ITS property there. If there are already ITS properties
applied in some children of these nodes are they overriden or not?

In some other words: When you do a selection which has its default that include child elements (like translatability) does it
override any selection done before at the child elements level?

Is this the precedence problem you talked about at Mandelieu and for which there is the Proposal 09?

Cheers,
-yves
Received on Sunday, 12 March 2006 04:52:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:43:06 UTC