Hi Laurent,

Laurent Balland schrieb am 08.07.2022 um 09:52:
Hello,

I'm trying to extend number format in Calc to get embedded text in decimal part [1]. ODF1.3 requires only positive position to have embedded text in integer part.

I need to modify schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng to have negative position.
[..]

So, in OpenDocument-v1.3+libreoffice-schema.rng, I added:

   <rng:define name="number-number" combine="choice">
     <rng:element name="number:number">
       <rng:zeroOrMore>
         <rng:ref name="loext-embedded-text-decimal"/>
       </rng:zeroOrMore>
     </rng:element>
   </rng:define>
   <rng:define name="loext-embedded-text-decimal">
     <rng:element name="loext:embedded-text-decimal">
       <rng:ref name="loext-embedded-text-decimal-attlist"/>
       <rng:text/>
     </rng:element>
   </rng:define>
   <rng:define name="loext-embedded-text-decimal-attlist">
     <rng:attribute name="loext:position">
       <rng:ref name="integer"/>
     </rng:attribute>
   </rng:define>

I have not tried it, but I think it would be sufficient to add an alternative attribute to number-embedded-text-attlist

  <rng:define name="number-embedded-text-attlist">
    <choice>
      <rng:attribute name="number:position">
        <rng:ref name="integer"/>
      </rng:attribute>
      <rng:attribute name="loext:position">
        <rng:ref name="integer"/>
      </rng:attribute>
    </choice>
  </rng:define>

But as I have said, I see no reason to do so.

And you never change /schema/odf1.3/OpenDocument-v1.3-schema.rng. That is the official ODF version, notice the license header. The parts from schema/libreoffice/OpenDocument-v1.3%252Blibreoffice-schema.rng are merged into it for validating ODF 1.3 extended.

Kind regards,
Regina

Reply via email to