Global Rule for Ruby

Hi everyone,

I had an action item to summarize the issues we have with the global rule of the Ruby data category.
http://www.w3.org/2006/09/13-i18nits-minutes.html#action05

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:

<ruby>
  <rb>WWW</rb>
  <rp>(</rp><rt>World Wide Web</rt><rp>)</rp>
</ruby>

<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">
  <rbc>
    <rb>斎</rb>
    <rb>藤</rb>
    <rb>信</rb>
    <rb>男</rb>
  </rbc>
  <rtc class="reading">
    <rt>さい</rt>
    <rt>とう</rt>
    <rt>のぶ</rt>
    <rt>お</rt>
  </rtc>
  <rtc class="annotation">
    <rt rbspan="4" xml:lang="en">W3C Associate Chairman</rt>
  </rtc>
</ruby>

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
notations.

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:

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


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.

Cheers,
-yves

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