DR 17-0019 — SML: Order of Elements in schemeClr

Charlie Clark charlie.clark at clark-consulting.eu
Tue Nov 14 16:28:08 CET 2017


Am .11.2017, 13:43 Uhr, schrieb Francis Cave <francis at franciscave.com>:

>
> I have some sympathy with Charlie regarding this DR.

Hi to you all in Geneva,

sorry I couldn't answer this last week: I was fighting a cold.

I don't really think that this is an XML issue. The only question here  
would be why a choice and not a sequence was chosen for the group.

The real problem is interoperability. The schema is:

<xsd:group name="EG_ColorTransform">
     <xsd:choice>
         <xsd:element name="tint" type="CT_PositiveFixedPercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="shade" type="CT_PositiveFixedPercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="comp" type="CT_ComplementTransform"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="inv" type="CT_InverseTransform" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="gray" type="CT_GrayscaleTransform"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="alpha" type="CT_PositiveFixedPercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="alphaOff" type="CT_FixedPercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="alphaMod" type="CT_PositivePercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="hue" type="CT_PositiveFixedAngle" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="hueOff" type="CT_Angle" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="hueMod" type="CT_PositivePercentage"  
minOccurs="1" maxOccurs="1"/>
         <xsd:element name="sat" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="satOff" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="satMod" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="lum" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="lumOff" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="lumMod" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="red" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="redOff" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="redMod" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="green" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="greenOff" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="greenMod" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="blue" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="blueOff" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="blueMod" type="CT_Percentage" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="gamma" type="CT_GammaTransform" minOccurs="1"  
maxOccurs="1"/>
         <xsd:element name="invGamma" type="CT_InverseGammaTransform"  
minOccurs="1" maxOccurs="1"/>
     </xsd:choice>
</xsd:group>

But the implementers notes and the narrative specification and,  
apparently, Excel uses alphabetical order:

alpha (Alpha)
alphaMod (Alpha Modulation)
alphaOff (Alpha Offset)
blue (Blue)
blueMod (Blue Modification)
blueOff (Blue Offset)
comp (Complement)
gamma (Gamma)
gray (Gray)
green (Green)
greenMod (Green Modification)
greenOff (Green Offset)
hue (Hue)
hueMod (Hue Modulate)
hueOff (Hue Offset)
inv (Inverse)
invGamma (Inverse Gamma)
lum (Luminance)
lumMod (Luminance Modulation)
lumOff (Luminance Offset)
red (Red)
redMod (Red Modulation)
redOff (Red Offset)
sat (Saturation)
satMod (Saturation Modulation)
satOff (Saturation Offset)
shade (Shade)
tint (Tint)

This means that *Off elements need to follow their *Mod counterpart. I  
worked this out debugging a chart and it was the only significant element.  
The purpose of the specification is to try and make this kind of reverse  
engineering unnecessary. I'm enclosing two files with sample charts  
illustrating the difference. In chartlines_1.xlsx the chartlines are light  
grey but in chartlines_2.xlsx they are black. The order of the lumMod and  
lumOff elements is the only difference.

So, my preferred solution would have a sequence instead of a choice in the  
schema. I accept that there may be good reasons for not doing so. If this  
is not possible then I would suggest reordering the elements of the group  
so that the default order is the same as in the narrative documentation.  
The least viable solution would be to include a note to this effect in the  
narrative. It would, of course, be great to get Microsoft's take on this.

If, as Francis says, we can also include information about viable  
combinations then I'm all for it because this particularly element group  
is used in awful lot of places. I haven't come across the need to deal  
with this yet but it could be very useful.

Thank you all for your help.

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chartlines_1.xlsx
Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Size: 16057 bytes
Desc: not available
URL: <http://mailman.vse.cz/pipermail/sc34wg4/attachments/20171114/9d776e48/attachment-0002.xlsx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chartlines_2.xlsx
Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Size: 16055 bytes
Desc: not available
URL: <http://mailman.vse.cz/pipermail/sc34wg4/attachments/20171114/9d776e48/attachment-0003.xlsx>


More information about the sc34wg4 mailing list