ISSUE 16: parameters for rules

Hi all,

I have an action item to describe a bit more the possible "ITS parameters" requirement.

The idea is to have a mechanism in the ITS syntax that allows tools to pass parameters values to the ITS rules when processing those rules.

Jirka rightly pointed out that we should have some use cases for a feature.

So, here is one, that can serve as an example too:

In the case of a document with several language version of the same text, a variable could be used to provide a single rule that points to different nodes depending on its value. For example, in the following document:

<doc>
 <entry>
  <text lcid='1033'>An example</text>
  <text lcid='1036'>Un exemple</text>
  <text lcid='1044'>Et eksempel</text>
 </entry>
</doc>

The rules:

<its:rules version="2.0" xmlns:its="http://www.w3.org/2005/11/its">
 <its:translateRule selector="/doc" translate='no'/>
 <its:translateRule selector="//text[@lcid='$LCID']" translate='yes'/>
</its>

Would allow a caller tool to selectively pick the proper content based on the value of the variable $LCID. Such could could be called as the following example:

C:\>spellcheck myfile.xml -lang fr LCID=1033

I imagine with the wide range of data categories ITS 2.0 would include, such parameter mechanism could be useful for other use cases: allowing to specify different metadata for example.

Jirka has also provided some pointers for the potential syntax:
http://lists.w3.org/Archives/Public/public-multilingualweb-lt/2012Apr/0104.html

It would be nice to have more concrete use cases.

I assume we would have also some method to specify default values as well.

<its:rules version="2.0" xmlns:its="http://www.w3.org/2005/11/its">
 <its:param name="LCID">1033</its:param>
 <its:translateRule selector="/doc" translate='no'/>
 <its:translateRule selector="//text[@lcid='$LCID']" translate='yes'/>
</its>

A few notes:

-- This would not be a data category but a feature of the ITS syntax. I'm not sure if this is something only some tools (among the type of tools that process rules like <its:translateRule>) could implement and some other could not.

-- I don't think it would affect the ITS information when used as simple metadata annotations.

-- A tool cannot really implement this as an extension (i.e. like a data category could). It would make its ITS rules incompatible with 'normal' ITS processors.

-- While the implementation itself is relatively easy (just a substitution of the variables by the values before applying the rules), there is a burden of capturing the parameters values and passing them to the processor that may be trickier than doing the substitution. It's easy to do with a command-line tools, but probably more involved with UI-based or Web-based tools.


Cheers,
-yves

Received on Monday, 4 June 2012 04:51:32 UTC