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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux