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

Global Rule for Ruby

From: Yves Savourel <ysavourel@translate.com>
Date: Thu, 14 Sep 2006 08:41:13 -0600
To: <public-i18n-its@w3.org>
Message-ID: <001001c6d80b$d432b290$9b05a8c0@Breizh>

Hi everyone,

I had an action item to summarize the issues we have with the global rule of the Ruby data category.

Here is the summary:

The rubyRule has currently attributes that have duplicate functions.
See http://www.w3.org/International/its/itstagset/itstagset.html#ruby-implementation

For example: selector is said to select the base text and the example 36 shows its usage. But we have also an rbPointer that is
supposed to also select the base text. This is contradictory.

The first thought to fix this would be to remove the rbPointer since this is done by selector. This leads to doable, but a bit
strange pointers when associating the simple ruby structure:

  <rp>(</rp><rt>World Wide Web</rt><rp>)</rp>

<its:rubyRule selector="//rb" rubyPointer=".." rtPointer="../rt" rpPointer="../rp" />

Basically we have to go to the parent of the node pointed by selector and go to the different elements from there. Not very pretty
but (I think) working.

Things get a bit more hairy for complex ruby:

<ruby xml:lang="ja">
  <rtc class="reading">
  <rtc class="annotation">
    <rt rbspan="4" xml:lang="en">W3C Associate Chairman</rt>

We have to go to the grand-parent of the node pointed by selector (since selector would be the base text)

<its:rubyRule selector="//rbc/rb" rubyPointer="../.." rtPointer="../../rtc/rt" etc.. />

We also have to declare two rules (first for simple cases, then for complex) not just one, if we want to be able to address both

To make things a bit more simple, maybe another solution is to not have the selector to select the base text, but just (like other
data category) just the node(s) where the data category information should be applied.
This means we would have to make rbPointer required and change the example 28 to something like:

  xmlns:its="http://www.w3.org/2005/11/its" >
 <head> ... 
   <its:rubyRule selector="/text/body/img[1]" rbPointer="@alt">
    <its:rubyText>World Wide Web Consortium</its:rubyText>
  <img src="w3c_home.png" alt="W3C"/> ...

It seems the pointers for ruby in the global rule are not quite work-out yet. I'm no ruby specialist and I think we would gain a lot
from having this looked at once more by people who have more experience with it.

Note that I don't think we can leave thinsg as they are: selector and rbPointer are just contradictory, rbPointer is optional. The
minimum change I can think of would be to remove it (And that I think would not be a substantive change).
But as discussed above, maybe a more logical thing would be to change for both selector and rbPointer (and I don't know if that
would qualify as substantive...)

Any thoughts would be appreciated.

Received on Thursday, 14 September 2006 14:41:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:04:11 UTC