Re: Local Global rules issue

Philip,

After our discussion today. I have reran the parser and my output is the
same as the output for translate6xmloutput.xml. Felix is correct I built my
parser on the previous ITS 1.0 parser which used the same example and had
the same output (
http://www.w3.org/International/its/tests/expected/Translate5-result.xml -->
the original output from its 1.0). What I do know about the webinar code is
that it needed to be slightly expanded to use the translate data category
as the webinar code only worked with language information or something. In
this area there could be a slight error in your code in the
datacategories-definitions.xml file.

Maybe you could try this code here in that file and then try rerun it:

 <datacat name="translate">
        <defaults>
            <defaultsElements its:translate="yes"/>
            <defaultsAttributes its:translate="no"/>
        </defaults>
        <inheritance appliesTo="onlyElements"/>
        <rulesElement name="translateRule"/>
        <localAdding datcatSelector="*[@its:translate] |
its:span[@translate | its:translateRule]"
            addedMarkup="@its:translate | @translate[parent::its:span or
parent::its:translateRule]"
        />
    </datacat>

Any problem with this just email off the mailing list on finnle@tcd.ie.

Leroy


On 14 January 2013 18:46, Felix Sasaki <fsasaki@w3.org> wrote:

>  Hi Philip,
>
> the output you get is different from the expected output at
>
> https://github.com/finnle/ITS-2.0-Testsuite/blob/master/its2.0/expected/translate/xml/translate6xmloutput.txt
> I don't know in detail which XSLT Leroy is using (though some parts are
> based on an implementation I did IIRC). But at the end probably Leroy needs
> to take a look, or you use a different implementation (e.g. the OKAPI
> filters).
>
> Best,
>
> Felix
>
> Am 14.01.13 18:45, schrieb Philip:
>
> Hi All,
>     I'm using the webinar XSLs to apply the its rules, but when I do this
> to the translate xmls, it seems that the XSLs don't respect the local ITS
> rules, instead they just apply the global rules.
>
> *Translate6xml.xml below:*
> doc xmlns:its="http://www.w3.org/2005/11/its"<http://www.w3.org/2005/11/its>its:version="2.0">
>  <head>
>   <its:rules version="2.0">
>    <its:translateRule selector="//*" translate="no"/>
>    <its:translateRule selector="//p" translate="yes"/>
>   </its:rules>
>  </head>
>  <info>
>   <item type="title" its:translate="yes">The Life of a <b>Simple
> Man</b></item>   // Should end up with translate = yes
>   <!-- Note that the contents of <b> and <span> should end up
>        *not* translatable with these settings -->
>   <item type="date-main">Dec-05-2006</item>
>  </info>
>  <content>
>   <p>Everything started when Zebulon discovered that he had
>    a <span>doppelgänger</span> who was a
>    serious baseball <span>aficionado</span>.</p>
>  </content>
> </doc>
>
> *Below is the result I get from translate6:*
> /doc    translate="no"
> /doc/@its:version    translate="no"
> /doc/head[1]    translate="no"
> /doc/head[1]/its:rules[1]    translate="no"
> /doc/head[1]/its:rules[1]/@version    translate="no"
> /doc/head[1]/its:rules[1]/its:translateRule[1]    translate="no"
> /doc/head[1]/its:rules[1]/its:translateRule[1]/@selector    translate="no"
> /doc/head[1]/its:rules[1]/its:translateRule[1]/@translate    translate="no"
> /doc/head[1]/its:rules[1]/its:translateRule[2]
>  translate="no"                     // applies the global rule and not the
> local rule
> /doc/head[1]/its:rules[1]/its:translateRule[2]/@selector    translate="no"
> /doc/head[1]/its:rules[1]/its:translateRule[2]/@translate    translate="no"
> /doc/info[1]    translate="no"
> /doc/info[1]/item[1]    translate="no"
> /doc/info[1]/item[1]/@its:translate    translate="no"
> /doc/info[1]/item[1]/@type    translate="no"
> /doc/info[1]/item[1]/b[1]    translate="no"
> /doc/info[1]/item[2]    translate="no"
> /doc/info[1]/item[2]/@type    translate="no"
> /doc/content[1]    translate="no"
> /doc/content[1]/p[1]    translate="yes"
> /doc/content[1]/p[1]/span[1]    translate="no"
> /doc/content[1]/p[1]/span[2]    translate="no"
>
> Can you suggest a way to fix this?
> Thanks,
> Philip
>
>
>

Received on Thursday, 17 January 2013 16:24:26 UTC