OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xliff message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [xliff] Validation and rule overriding


Still looking at the effect of overriding rules for validation.

 

My interpretation that overriding means 'replacing' has a side effect:

The output of the document after processing is different.

 

Initial document:

 

<file ...>

<val:validation>

<val:rule isPresent="rule1"/>

<val:rule isPresent="rule2"/>

</val:validation>

...

<unit ...>

<val:validation>

<val:rule isPresent="rule3"/>

<val:rule isPresent="rule2" occurs="10"/>

<val:rule isPresent="rule1" caseSensitive="no"/>

</val:validation>

 

Rules in memory for the unit BEFORE overriding is applied:

 

<val:rule isPresent="rule1"/> (inherited)

<val:rule isPresent="rule2"/> (inherited)

<val:rule isPresent="rule3"/>

<val:rule isPresent="rule2" occurs="10"/>

<val:rule isPresent="rule1" caseSensitive="no"/>

 

Now we can (result A) apply the overriding by replacing:

 

<val:rule isPresent="rule1" caseSensitive="no"/> (override)

<val:rule isPresent="rule2" occurs="10"/> (override)

<val:rule isPresent="rule3"/>

 

Or we can (result B) remove the inherited rules that are overridden and add the overriding rules:

 

<val:rule isPresent="rule3"/>

<val:rule isPresent="rule2" occurs="10"/>

<val:rule isPresent="rule1" caseSensitive="no"/>

 

Result A has the rules in the order they have been declared and overridden in the document.

But when writing back the document this will result in a different order than the initial for the unit rules.

 

Result B keeps the output identical for the unit, but it has an in-memory order that has the verification applies the rules in an order different from the order in which the rules were declared and overridden in the initial document.

 

As far as I can think, the only two ways to always ensure both in-memory initial order and un-modified output order in the unit would be:

 

1) To keep track of the rule order for re-write (that becomes ridiculously complicated)

 

2) To always declare overriding rules in the same order as the overridden rules were declared in the inherited sections, so, in this example to write the file as:

 

<file ...>

<val:validation>

<val:rule isPresent="rule1"/>

<val:rule isPresent="rule2"/>

</val:validation>

...

<unit ...>

<val:validation>

<val:rule isPresent="rule1" caseSensitive="no"/>

<val:rule isPresent="rule2" occurs="10"/>

<val:rule isPresent="rule3"/>

</val:validation>

 

But there is no PR or constraint on that (and such PR would be quite difficult to validate).

 

 

Note that there is no PR in the specification that says you cannot change the order of the rules. The PRs say you cannot change attributes and you cannot remove attributes or rules. But there is no prescription about order.

 

So applying overrides by 'replacing' (result B in memory, which result in a different order on output) is valid as far as I can tell. Note also that it results in an output that corresponds to solution #2: overriding rules being declared in the order the overridden rules appear in the document.

 

So I'll stick with that implementation for now.

 

Now I'm curious: how other implementers of the Validation implement this use case?

 

Thanks,

-yves

 

 

 

 

 

-----Original Message-----

From: xliff@lists.oasis-open.org [mailto:xliff@lists.oasis-open.org] On Behalf Of Yves Savourel

Sent: Sunday, June 15, 2014 5:48 AM

To: xliff@lists.oasis-open.org

Subject: RE: [xliff] Validation and rule overriding

 

And yet another question:

 

How is the overriding applied?

Is the old rule removed and the new one added or is the old rule replaced by the new one?

 

For example given:

 

<file ...>

<val:validation>

<val:rule isPresent="rule1"/>

<val:rule isPresent="rule2"/>

</val:validation>

...

<unit ...>

<val:validation>

<val:rule isPresent="rule3"/>

<val:rule isPresent="rule2" occurs="10"/>  <val:rule isPresent="rule1" caseSensitive="no"/> </val:validation>

 

Is the effective list of rules for the unit:

 

<val:rule isPresent="rule3"/>

<val:rule isPresent="rule2" occurs="10"/> <val:rule isPresent="rule1" caseSensitive="no"/>

 

Or

 

<val:rule isPresent="rule1" caseSensitive="no"/> <val:rule isPresent="rule2" occurs="10"/> <val:rule isPresent="rule3"/>

 

This matter because the resulting order is different and may lead to different results if you want to compare the errors returned by the processor.

 

My current interpretation is that 'overriding' means replace, so we end up with the second result.

Is that correct?

 

Thanks,

-yves

 

 

 

-----Original Message-----

From: xliff@lists.oasis-open.org [mailto:xliff@lists.oasis-open.org] On Behalf Of Yves Savourel

Sent: Sunday, June 15, 2014 5:12 AM

To: xliff@lists.oasis-open.org

Subject: [xliff] Validation and rule overriding

 

One more question about validation:

 

We have the following processing requirement:

 

[[

- When the <validation> element occurs at the <file> level, rules MUST be applied to all <target> elements within the scope of that <file> element, except where overrides are specified at the <group> or <unit> level.

 

- When <validation> occurs at the <group> level, rules MUST be applied to all <target> elements within the scope of that <group>, except where overrides are specified in a nested <group> element, or at the <unit> level.

 

- When <validation> occurs at the <unit> level, rules MUST be applied to all <target> elements within the scope of that <unit>.

]]

 

There is an example of overriding a rule in a few places, but what about rules within the same <validation> element?

 

Based on the PR above no overriding mechanism applies within the <validation> element, is that correct?

So for example if I have:

 

<unit ...>

<val:validation>

<val:rule isPresent="abc"/>

<val:rule isPresent="abc" caseSensitive="no"/>  <val:rule isPresent="abc" normalization="none"/> </val:validation>

 

I end up for that unit with 3 distinct rules and need to check for "abc" in target

- after normalizing to NFC and not in case-sensitive mode.

- after normalizing to NFC and in case-sensitive mode.

- after not normalizing and not in case-sensitive mode.

 

But if I have:

 

<file ...>

<val:validation>

<val:rule isPresent="abc"/>

<val:rule isPresent="abc" caseSensitive="no"/>  <val:rule isPresent="abc" normalization="none"/> </val:validation> ...

<unit ...>

<val:validation>

<val:rule isPresent="abc" normalization="NFD"/> </val:validation>

 

I end up for that unit with a single rule (or maybe three identical overridden rules):

- after normalizing to NFD and in cases-sensitive mode.

 

Is that correct?

 

Thanks,

-yves

 

 

 

 

---------------------------------------------------------------------

To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail.  Follow this link to all your TCs in OASIS

at:

https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

 

 

---------------------------------------------------------------------

To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail.  Follow this link to all your TCs in OASIS at:

https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]