Re: Extended ODF schema

2023-02-13 Thread Laurent Balland

Hello Michael,

Le 13/02/2023 à 11:13, Michael Stahl a écrit :

On 10.02.23 19:23, Laurent Balland wrote:


Then I get the following errors:

- /tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,9446]: 
Error: tag name "number:text" is not allowed. Possible tag names are: 
,,,
number:text loext:blank-width-char=")"> 

  ^
/tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,10964]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,
number:text loext:blank-width-char=")"> 
<


i think the error is that there are 2 consecutive  
elements in , which is not allowed by the schema.


You are right. I modified number-text-with-fillchar to enable 
consecutive number:text and Jenkins is now happy


https://gerrit.libreoffice.org/c/core/+/146582

Best regards,

Laurent Balland





Re: Extended ODF schema

2023-02-13 Thread Michael Stahl

On 10.02.23 19:23, Laurent Balland wrote:


Then I get the following errors:

- /tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,9446]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,,,
number:text loext:blank-width-char=")"> 

  ^
/tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,10964]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,
number:text loext:blank-width-char=")"> 
<


i think the error is that there are 2 consecutive  elements 
in , which is not allowed by the schema.




Re: Extended ODF schema

2023-02-12 Thread laurent.balland
Thanks Regina for the hint. The problem should be in the code (and not in 
schema) as it should not generate any loext:blank-width-text=")" 
attribute.Envoyé depuis mon appareil Galaxy


Re: Extended ODF schema

2023-02-11 Thread Regina Henschel

Hi Laurent,


I see no problem in your new version below, but Michael is the expert 
for RELAX. Perhaps he knows a solution.


Here only some ideas, what you could do:
Do you have inspect the tmp file of the failing test, whether it really 
has the expected markup?
Do you have confirmed, that your  
element, which is added into the  element, is not inside 
another define-element by mistake.
Do you have tried, whether a combine="choice" works? Similar as for the 
loext:clear attribute of the text:line-break element?


Kind regards,
Regina

Laurent Balland schrieb am 10.02.2023 um 19:23:

Hello,

Le 08/02/2023 à 14:09, Michael Stahl a écrit :


if it should go on the numer:text element, it needs to be a child of 
its rng:element - currently it's not extensible (via "combine" feature):


  
    
  
    
  

so you have to override it - at the start of the libreoffice schema 
there is an rng:include, paste the above into this include element and 
adapt it - this will override what is in the included file.



Thanks for your feedback. I made some progress, but it does not yet work.

I added in rng:include

     
   
     
   
     
     
   

   

and define number-text-attlist outside rng:include

   
     
   
     
   
     
   
     
   

Then I get the following errors:

- /tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,9446]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,,,
number:text loext:blank-width-char=")"> 

  ^
/tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,10964]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,
number:text loext:blank-width-char=")"> 
<


I do not understand what I made wrong. Why validator is expecting 
loext:blank-width-char with other tags than number:text?


Best regards

Laurent Balland






Re: Extended ODF schema

2023-02-10 Thread Laurent Balland

Hi Regina,

Le 10/02/2023 à 20:21, Regina Henschel a écrit :

Hi Laurent,

can you please give examples, what markup you want to achieve in the 
document file.


Kind regards,
Regina


Here is an example of markup generated:

  
   number:min-decimal-places="2" number:min-integer-digits="2"/>

    
   fin
  

For code 00.00_M"fin"

The extension concerns only attribute loext:blank-width-char

Best regards

Laurent


Re: Extended ODF schema

2023-02-10 Thread Regina Henschel

Hi Laurent,

can you please give examples, what markup you want to achieve in the 
document file.


Kind regards,
Regina


Re: Extended ODF schema

2023-02-10 Thread Laurent Balland

Hello,

Le 08/02/2023 à 14:09, Michael Stahl a écrit :


if it should go on the numer:text element, it needs to be a child of 
its rng:element - currently it's not extensible (via "combine" feature):


  
    
  
    
  

so you have to override it - at the start of the libreoffice schema 
there is an rng:include, paste the above into this include element and 
adapt it - this will override what is in the included file.



Thanks for your feedback. I made some progress, but it does not yet work.

I added in rng:include

    
  
    
  
    
    
  

  

and define number-text-attlist outside rng:include

  
    
  
    
  
    
  
    
  

Then I get the following errors:

- /tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,9446]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,,,
number:text loext:blank-width-char=")"> 

 ^
/tmp/libtest_sc_sparkline_test.sorjp6.tmp/styles.xml[2,10964]: Error: 
tag name "number:text" is not allowed. Possible tag names are: 
,
number:text loext:blank-width-char=")"> 
<


I do not understand what I made wrong. Why validator is expecting 
loext:blank-width-char with other tags than number:text?


Best regards

Laurent Balland



Re: Extended ODF schema

2023-02-08 Thread Michael Stahl

On 07.02.23 23:39, Regina Henschel wrote:

Hi Laurent,

This is all without warranty, I am not an expert on rng.

Laurent Balland schrieb am 07.02.2023 um 21:50:

Hello,

I'm trying to modify 
schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng to add a 
new attribute to number:text


I added:

   
 
   

   
 
   
 
   
 
   
 
   

But I got the following error: 
.../schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng[7078,43]: Fatal:  is grouped and that group is repeated


The line number corresponds to nothing, and if I move the upper code 
on a different place in the file, the error is always at this unknown 
7078th line. >

Any idea about what I could try?


The line 7078 belongs to 
That can have several .
Such is in line 7427. It can have several .
Currently all together resolves to several name="number:text"> and  . So 
currently  element can have several child elements 
. That is no problem, because several child elements with 
the same name are possible.


Now you introduce an attribute into . That 
means, that when resolving it for  element this would 
get several attributes with the same name. And that is not possible.


You need to look, to which element your new attribute belongs.


if it should go on the numer:text element, it needs to be a child of its 
rng:element - currently it's not extensible (via "combine" feature):


  

  

  

so you have to override it - at the start of the libreoffice schema 
there is an rng:include, paste the above into this include element and 
adapt it - this will override what is in the included file.




Re: Extended ODF schema

2023-02-07 Thread Regina Henschel

Hi Laurent,

This is all without warranty, I am not an expert on rng.

Laurent Balland schrieb am 07.02.2023 um 21:50:

Hello,

I'm trying to modify 
schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng to add a new 
attribute to number:text


I added:

   
     
   

   
     
   
     
   
     
   
     
   

But I got the following error: 
.../schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng[7078,43]: Fatal: 
 is grouped and that group is repeated


The line number corresponds to nothing, and if I move the upper code on 
a different place in the file, the error is always at this unknown 
7078th line. >

Any idea about what I could try?


The line 7078 belongs to 
That can have several .
Such is in line 7427. It can have several .
Currently all together resolves to several name="number:text"> and  . So 
currently  element can have several child elements 
. That is no problem, because several child elements with 
the same name are possible.


Now you introduce an attribute into . That 
means, that when resolving it for  element this would 
get several attributes with the same name. And that is not possible.


You need to look, to which element your new attribute belongs.

Kind regards,
Regina



Extended ODF schema

2023-02-07 Thread Laurent Balland

Hello,

I'm trying to modify 
schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng to add a new 
attribute to number:text


I added:

  
    
  

  
    
  
    
  
    
  
    
  

But I got the following error: 
.../schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng[7078,43]: 
Fatal:  is grouped and that group is repeated


The line number corresponds to nothing, and if I move the upper code on 
a different place in the file, the error is always at this unknown 
7078th line.


Any idea about what I could try?

Best regards,

Laurent Balland


Re: Update of extended ODF schema

2022-07-08 Thread Regina Henschel

Hi Laurent,

Laurent Balland schrieb am 08.07.2022 um 17:36:
Thank you Regina for your advise. I will try it this week-end, or do 
without modifying v1.3+libreoffice-schema as you suggested.


But from my point of view, the v1.3-schema contains an error, as the 
OASIS text is the core rule, doesn't it?


The text should be consistent with the schema. So here is surely an 
error in the specification. But I will wait writing a bug report until 
the embedded text works with negative positions in LibreOffice. So that 
I can suggest to change the text. It is not urgent, the ODF TC is 
currently very busy anyway.


Some details need indeed the text and are not included in the schema, 
specifying default values for example.


Kind regards,
Regina


Re: Update of extended ODF schema

2022-07-08 Thread Laurent Balland
Thank you Regina for your advise. I will try it this week-end, or do 
without modifying v1.3+libreoffice-schema as you suggested.


But from my point of view, the v1.3-schema contains an error, as the 
OASIS text is the core rule, doesn't it?


Best regards,

Laurent





Re: Update of extended ODF schema

2022-07-08 Thread Regina Henschel

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:

   
     
   
     
   
     
   
   
     
   
   
     
   
   
     
   
     
   


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


  

  

  
  

  

  

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


Re: Update of extended ODF schema

2022-07-08 Thread Regina Henschel

Hi Laurent,

Laurent Balland schrieb am 08.07.2022 um 13:52:

Hi Regina,

Actually, ODF1.3 specifies only strictly positive number: "The index of 
a position starts with 1" [1] and Eike asked for a loext:position 
attribute if negative or null position. [2]


The text says "starts with 1" but the schema has "integer". So using 
negative values would require to change the text, not the schema.


If you add e.g.
 number:position="-3"> then the ODF validator 
[1] does not complain, try with attached file.

I think, the schema already allows it.

Perhaps ask Michael Stahl too.

[1] https://odfvalidator.org/

Kind regards,
Regina



withDecimalGap.ods
Description: application/vnd.oasis.opendocument.spreadsheet


Re: Update of extended ODF schema

2022-07-08 Thread Laurent Balland

Hi Regina,

Actually, ODF1.3 specifies only strictly positive number: "The index of 
a position starts with 1" [1] and Eike asked for a loext:position 
attribute if negative or null position. [2]


So I need a loext:position attribute, to support for negative index. But 
if there is only only negative positions, then number:embedded-text has 
no number:position and complains. That's why I created a new node 
loext:embedded-text-decimal. But I don't know how to correctly write 
OpenDocument-v1.3+libreoffice-schema.rng


Best regards,

Laurent Balland


[1] 
https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1417578_253892949


[2] 
https://gerrit.libreoffice.org/c/core/+/135918/4..8/xmloff/source/style/xmlnumfe.cxx#b605






Re: Update of extended ODF schema

2022-07-08 Thread Regina Henschel

Hi Laurent,

I do not understand your problem. The schema allows already negative 
values in attribute number:position. 'integer' includes negative values.


Could you please give an example of a number, which uses the desired 
number format?


Kind regards,
Regina


Update of extended ODF schema

2022-07-08 Thread Laurent Balland

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:

  
    
  
  
  
  
    
  
    
  
...

  
    
  
  
    
  
  
    
  
    
  

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

  
    
  
    
  
    
  
  
    
  
  
    
  
  
    
  
    
  

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: 
dded-text-decimal number:position="-4"> 


How to write correctly OpenDocument-v1.3+libreoffice-schema.rng ?


Thanks for your help.


Laurent Balland

[1] https://gerrit.libreoffice.org/c/core/+/135918