RE: ACTION-233: Update quality issue example to use the solution (XML in "script" tag) for standoff markup

Hi all,

I've tried to implement the global rules in <script> as we discussed.

It is certainly looking like a hack, and I think to make it really work we'll have to have a few processing expectations. For example:

-- 1) As already mentioned: the type of the script would be set to the ITS MIME Type (application/its+xml)

-- 2) There should be only one root element in the script. That is we shouldn't have two <its:rules> element one after the other. It's too complicated to deal with more.
So if one wanted to have several its:rules, just use several <script> element.
Same for the stand-off localization quality issue (if we end up using that hack for that too).

-- 3) Someone very smart should come up with a description of how exactly the ITS markup MUST be encapsulated in the script content, so:
 a) it respects the restriction for content of script (http://dev.w3.org/html5/spec/single-page.html#restrictions-for-contents-of-script-elements)
 b) ITS tools can obtain the XML string out of that content in a unique and simple way.

I'm using comments to encapsulate the code for now, instead of escaping the content. I think this is where we need to have a single way to do things.

For the localization quality issues (if we use ,script> for that). I assume we could set the id of the script to the same id value defined in the <its:locQualityIssues> element, that way, the element referring to the stand-off markup could point directly to the proper script element.


If anyone wants to try it out (like with the example pasted at the end of this email), I've posted the latest snapshot of Okapi that implements this here: http://okapi.opentag.com/snapshots/
For the source code, look the compileRulesInScripts() method here:
http://code.google.com/p/okapi/source/browse/okapi/filters/its/src/main/java/org/w3c/its/ITSEngine.java?name=dev


cheers
-yves

--- example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Title</title>
    <script type="application/its+xml">
    <!--
<its:rules version="2.0" xmlns:its="http://www.w3.org/2005/11/its"
  xmlns:h="http://www.w3.org/1999/xhtml">
 <its:translateRule translate="no" selector="//h:code"/>
</its:rules>    
    -->
    </script>
    <script type="application/its+xml">
    <!--
<its:rules version="2.0" xmlns:its="http://www.w3.org/2005/11/its"
  xmlns:h="http://www.w3.org/1999/xhtml">
 <its:translateRule translate="yes" selector="//h:code"/>
 <its:translateRule translate="no" selector="//h:b"/>
</its:rules>    
    -->
    </script>
  </head>
  <body>
    <p>Text with <code>code</code> and <b>bold</b>.</p>
  </body>
</html>

Received on Tuesday, 9 October 2012 03:02:36 UTC