Re: New ITS syntax

Hi Yves,

Many thanks!

Yves Savourel wrote:
> Hi Felix, all,
> 
> Looking at 
> http://lists.w3.org/Archives/Public/public-i18n-its/2006JanMar/0301.html
> For tomorrow item #4 of the agenda.
> 
> Here are some comments:
> 
>> #About rubyRule:
>> ... 
>> <its:rubyRule its:selector="//span[class='ruby']"
>>  its:rubyBaseMap="span[class='rubyBase']"
>>  its:rubyTextMap="span[class='rubyText']"/>
> 
> Just a reminder: Don't forget the <rp> element that exists in the W3C ruby module.
> (And what about complex ruby constructs?)

thanks for the reminder. I have integreated
http://www.w3.org/TR/ruby/#abstract-def below. I used "xyzPointer", see
discussion at http://www.w3.org/Bugs/Public/show_bug.cgi?id=3017 .

I also created localRuby, see below.

> 
> 
>> #About langRule: The element langRule is used to express 
>> that a given piece of content (selected by the attribute langMap)
>> is used to express language information as defined by RFC 3066 
>> or its successor. Example:
>> <its:langRule its:selector="//p" its:langMap="@mylangattribute"/>
>> ...
>> #About localeRule: The element localeRule is used to express that
>> a given piece of content (selected by the attribute localeMap) is 
>> used to express locale information. Example: <its:localeRule 
>> its:selector="//p" its:langMap="@mylocaleattribute"/>.
> 
> Mmmm... I guess langMap and localeMap stay named like this while the other change to xyzPointer/PassThrough/Etc. 

no, I would change everything to "pointer", hence: its:langPointer .

One question: if
> the content of langMap is always an attribute, why the '@'? Is the value an XPath expression or the name of the equivalent
> attribute/element?

an XPath expression. It has the same meaning as all "pointer"
attributes: an XPath expression relative to the node(s) selected by
its:select, e.g.

<ns1:p myLangAtt=".."> ...

would be
<its:langRule its:select="//ns1:p" its:langPointer="//@myLangAtt"/>

> 
> Something tells me involving 'locale' before there is a clear consensus in the XML world on what is it and have a RFC3066-like
> reference for the values, is a bad idea.

you are right, I have dropped locale. Btw., Addison Philipps has given
me the same feedback :(

> 
> When you say "The value of @mylocaleattribute might be compliant to RFC 3066 bis, but this is not mandatory." then it means
> basically "use whatever value you want", and that makes it non-interoperable. I can understand <langRule> because it maps to
> XML/ITS-recommended way to specify language and there is value set define for it. But what is the use case for mapping a
> user-defined locale to ...nothing interoperable. Knowing the name of the attribute used for specifying the locale is not enough: one
> needs a defined set of values. To me, having localeMap may raise the false hope that ITS provides some kind of interoperable locale
> concept.
> 
> 
> Cheers,
> -yves
> 
> 

Below the corrected syntax. A question: What is the latest state for
withinTextRule?

cheers,

Felix


namespace its = "http://www.w3.org/2005/11/its"

# having itsGlobal as the entry point of the schema serves as a wrapper
schema
# for an external rules file.

start = itsGlobal

itsGlobal = element its:rules { ns*, rule+ }

ns = element its:ns { attribute its:prefix { xsd:NCName }, attribute
its:uri {
xsd:anyURI } }

selector = attribute its:selector { text }

rule = translateRule | locInfoRule | dirRule | termRule |
langRule | rubyRule | withinTextRule

translateRule = element its:translateRule { selector, attribute
its:translate {
"yes" | "no" } }

#About locInfoRule: At the locInfoRule element, there must be either a
#locInfo element [not attribute] or a locInfoRef attribute. If neither is
#present, there must be either a locInfoPointer attribute or a
locInfoRefPointer
#attribute. There is an optional locInfoType attribute.

locInfoRule = element its:locInfoRule { selector, attribute its:locInfoRef {
xsd:anyURI }?, attribute its:locInfoRefPointer { text }?, attribute
its:locInfoPointer {
text }?, attribute its:locInfoType { "alert" | "description" }?, element
locInfo { text }? }

dirRule = element its:dirRule { selector, attribute its:dir { "ltr" |
"rtl" |
"lro" | "rlo" } }

#About termRule: In an instance document, we would need an attribute
#term="yes" to indicate a term. In the global rule, "being" a term is
#expressed via the name of the element termRule, hence the attribute
#term="yes" is not necessary any more. The attributes termRef and
#termRefPointer are alternatives. It is an error if they occur at the same
#termRule element.

termRule = element its:termRule { selector, attribute its:termRef {
xsd:anyURI
}?, attribute its:termRefPointer { text } }

#About langRule: The element langRule is used to express that a given
#piece of content (selected by the attribute langPointer) is used to express
#language information as defined by RFC 3066 or its successor. Example:
#<its:langRule its:selector="//p" its:langPointer="@mylangattribute"/>
#expresses that all p elements (including attributes and textual content
#of child elements) have a language value conformant to RFC 3066 or its
#successor. The value is given by the @mylangattribute attached to the p
#elements.
langRule = element its:langRule { selector, attribute its:langPointer {
text } }


#About rubyRule: The element rubyRule is used (1) to map existing ruby
#"markup to ITS ruby, which itself is defind in terms of the W3C ruby
#specification, or (2) to add ruby text to attribute values. Example for
#(1): <its:rubyRule its:selector="//span[class='ruby']"
#its:rbPointer="span[class='rubyBase']"
#its:rtPointer="span[class='rubyText']"/> . Example for (2):
#<its:rubyRule its:selector="/body/img[1]/@alt" its:rbPointer="."
#its:rt="World Wide Web Consortium"/> . It is an error if both an
#its:rt attribute and an its:rtPointer attribute occur at the
#same <its:rubyRule> element.
rubyRule = element its:rubyRule { selector, attribute its:rubyPointer {
text }?,
attribute its:rbPointer { text }?, attribute its:rtPointer { text }?,
attribute its:rpPointer { text } ?,
attribute its:rbcPointer { text } ?, attribute its:rtcPointer { text }?,
attribute its:rubyText { text }? }



#About withinTextRule: withinTextRule is based on Yves / AZ proposal,
#see http://www.w3.org/Bugs/Public/show_bug.cgi?id=2878
withinTextRule = element its:withinTextRule { selector }

#locale usage of ITS are itsLocalAttributes, or ruby. Just for
#convinience, the span element contains the itsLocalAttributes.
itsLocal = element its:span { itsLocalAttributes, text } | rubyLocal

itsLocalAttributes = translateLocal | locInfoLocal | dirLocal | termLocal
translateLocal = attribute its:translate { "yes" | "no" }?

#About locInfoLocal: There must be either a a locInfo attribute or a
#locInfoRef attribute. There is an optional locInfoType attribute.
locInfoLocal =  attribute its:locInfo { text }?, attribute its:locInfoRef {
xsd:anyURI }?, attribute its:locInfoType { "alert" | "description" }

dirLocal = attribute its:dir { "ltr" | "rtl" | "lro" | "rlo" }?

#About termLocal: the attribute term is mandatory, the attribute termRef
#is optional.
termLocal =  attribute its:term { "yes" }?, attribute its:termRef {
xsd:anyURI }?

#On ruby: todo: still need to write the ruby content model, which is
#identical to w3c ruby, and global ruby rules.

# rubyLocal is defined in terms of
http://www.w3.org/TR/ruby/\#definition. The (rbc, rtc, rtc?) alternative
of the content model for the ruby element corresponds to complex ruby
markup. The minimal content model for the ruby element is (rb, (rt |
(rp, rt, rp))).
rubyLocal = element its:ruby { RubyCommonAtts, ((rb, (rt | (rp, rt,
rp))) | (rbc, rtc, rtc?)) }
rbc = element its:rbc { RubyCommonAtts, rb+ }
rtc = element its:rtc { RubyCommonAtts, rt+ }
rb = element its:rb { RubyCommonAtts, inline* }
rt = element its:rt { RubyCommonAtts, attribute its:rbspan { text },
inline* }
rp = element its:rp { RubyCommonAtts, text }
inline = text
RubyCommonAtts = itsLocalAttributes

Received on Wednesday, 29 March 2006 01:51:38 UTC