Is 'choice' and 'group' in UNO possible?

Regina Henschel rb.henschel at t-online.de
Wed Apr 5 16:47:56 UTC 2023


Hi all,

In RELAX NG (used for ODF file format) the structure below is possible. 
Is something similar possible for to define an "enhanced-color" for API? 
I mean, to have two members, where the data type of the second depends 
on the value of the first.

Kind regards,
Regina

<rng:define name="style-enhanced-color">
   <rng:element name="style:enhanced-color">
     <rng:choice>
       <rng:group>
         <rng:attribute name="style:color-type">
            <rng:value>RGBHex</rng:value>
         </rng:attribute>
         <rng:attribute name="style:color-value">
           <rng:ref name="color"/> <!-- e.g. #af12e0-->
         </rng:attribute>
       </rng:group>
       <rng:group>
         <rng:attribute name="style:color-type">
           <rng:value>Scheme</rng:value>
         </rng:attribute>
         <rng:attribute name="style:color-value">
           <rng:choice>
             <rng:value>Dark1</rng:value>
             <rng:value>Light1</rng:value>
             <rng:value>Dark2</rng:value>
             <rng:value>Light2</rng:value>
             <!-- will finally be twelve values -->
           </rng:choice>
         </rng:attribute>
       </rng:group>
     </rng:choice>
     <rng:empty/>
   </rng:element>
</rng:define>


More information about the LibreOffice mailing list