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.
schema/odf1.3/OpenDocument-v1.3-schema.rng contains:
<rng:define name="number-number">
<rng:element name="number:number">
<rng:ref name="number-number-attlist"/>
<rng:ref name="common-decimal-places-attlist"/>
<rng:ref name="common-number-attlist"/>
<rng:zeroOrMore>
<rng:ref name="number-embedded-text"/>
</rng:zeroOrMore>
</rng:element>
</rng:define>
...
<rng:define name="number-embedded-text">
<rng:element name="number:embedded-text">
<rng:ref name="number-embedded-text-attlist"/>
<rng:text/>
</rng:element>
</rng:define>
<rng:define name="number-embedded-text-attlist">
<rng:attribute name="number:position">
<rng:ref name="integer"/>
</rng:attribute>
</rng:define>
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>
But in my unit test, when I open a file containing negative position of embedded text, I get an error:
-
/tmp/ScExportTest2__testEmbeddedTextInDecimal_1to7ov.tmp/styles.xml[2,3146]:
Error: tag name "loext:embedded-text-decimal" is not allowed.
Possible tag names are: <embedded-text>
dded-text-decimal number:position="-4">
</loext:embedded-text-decimal><loext:em
How to write correctly OpenDocument-v1.3+libreoffice-schema.rng ?
Thanks for your help.
Laurent Balland