- From: Yves Savourel <yves@opentag.com>
- Date: Sun, 26 Mar 2006 06:45:24 -0700
- To: <public-i18n-its@w3.org>
Hi Felix, all, > Inherited values have less priority than directly assigned > values. That is the reason why its:translate-global-4="no" > from /myDoc/body/p[2]/ does not overwrite > its:translate-global-1="yes" at /myDoc/body/p[2]/code/textInCode. > > would that resolve the problem? I'm afraid it would change nothing: If inherited values have less priority that directly assigned values it means its:translate doesn't win anymore, and therefore in: <p its:translate='no'>some text <code>code <textInCode>text in code</textInCode>code</code>.</p> (or <p trans='false'>some text <code>code <textInCode>text in code</textInCode>code</code>.</p> since in the example trans='false' is expected to behave like its:translate='no') The content of <textInCode> gets translated. I think that single paragraph is a good illustration of our needs: trans='false' should be able to overwrite <code> and <textInCode>, but <code> should not overwrite <textInCode>. <code> and <textinCode> should not overwrite each other since you cannot resolve all combinaitions by simply changing the order of these two rules. They have to be treated as equal. But trans='no' has to be treated as more important. So it's like saying the last rule should win, but not in all cases. Something like that, I think, can be expressed by setting a priority attribute: The rules with higher priority wins (including on children) over rules with lower priority, and when two rules have the same priority they don't overwrite each other. The process would be similar to the one you are using, except that when you apply a rule you go down through the children of the selected node overwriting any lower-priority rules and stopping when you find an equal or higher-priority rule. Our example would be something like this: <myDoc> <head> <its:documentRules xmlns:its="http://www.w3.org/2005/11/its"> <its:translateRule its:translate="yes" its:selector="//textInCode" its:priority='1'/> <its:translateRule its:translate="no" its:selector="//code" its:priority='1'/> <its:translateRule its:translate="yes" its:selector="//*[@trans='true']" its:priority='2'/> <its:translateRule its:translate="no" its:selector="//*[@trans='false']" its:priority='2'/> </its:documentRules> </head> <body> <p><code>code <textInCode>text in code <code>code in text</code></textInCode></code></p> <p trans="false">some text <code>code <textInCode>text in code</textInCode>code</code>.</p> <p><code trans="true">code <textInCode trans="false">text in code <code trans="true">code in text</code></textInCode></code></p> </body> </myDoc> And the order in which the rules are written would be irrelevant now (since the priority attribute would drive how things are inherited). I also think we need to describe how things work without showing or favoring a specific process, but describing the results. Just thinking... -yves
Received on Sunday, 26 March 2006 13:45:40 UTC