Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet_Data_Validation_Plugin - Use different separator than " , " #4117

Open
2 tasks done
Erivess opened this issue Nov 21, 2024 · 2 comments
Open
2 tasks done

Sheet_Data_Validation_Plugin - Use different separator than " , " #4117

Erivess opened this issue Nov 21, 2024 · 2 comments

Comments

@Erivess
Copy link

Erivess commented Nov 21, 2024

Initial checklist

  • Is this really a problem?
  • I have searched the Github Issues for similar issues, but did not find anything.

Problem

Currently the univer sheet plugin works with separating different dropdown options like "formula1":"Yes,No,Maybe"

Since "," is a common symbol in text, this leads to problems in data processing when users have dropdown options like "Yes, lets do xyz" "No, lets do abc" since this would be displayed as 4 options in universheet.

I use OpenXML for parsing excel to workbook json and the raw data validation output looks like

Validation XML:
<x:dataValidation type="list" allowBlank="1" showInputMessage="1" showErrorMessage="1" sqref="C10:C12" xr:uid="{69FA879E-BF58-CA46-AAF8-23AF4BAD3C8A}" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><mc:AlternateContent xmlns:x12ac="http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x12ac"><x12ac:list>"Yes,lets do xyz","No, I dont want"</x12ac:list></mc:Choice><mc:Fallback><x:formula1>"Yes,lets do xyz,No, I dont want"</x:formula1></mc:Fallback></mc:AlternateContent></x:dataValidation>

  • <x12ac:list>"Yes,lets do xyz","No, I dont want"</x12ac:list>

In Excel Desktop separator " ; " is used
Screenshot 2024-11-21 at 08 54 22

Proposal: Use different separator for dropdown options that's not a common symbol in text.

@Erivess Erivess added the feature request New feature or request label Nov 21, 2024
@weird94
Copy link
Contributor

weird94 commented Nov 22, 2024

In OOXML, the semicolon (;) is not a legal separator for list-type data validations according to the specification. The standard explicitly requires commas (,) as the separator for values in list-type data validation rules.

Why Semicolons Might Seem Relevant

1.	Regional Settings in Excel:
•	In some locales (e.g., many European countries), Excel uses semicolons (;) as separators in formulas and lists instead of commas due to differences in regional decimal separator conventions. For example:
•	Comma as the decimal separator: 1,5 (1.5 in English), so semicolons are used for separating items: Apple;Banana;Cherry.
•	However, this is a display behavior in the UI and not how the data is stored in OOXML. Internally, the OOXML file still uses commas (``,`).
2.	Strict OOXML Specification:
•	Regardless of locale, OOXML standardizes on commas (``,`), ensuring that the file format is consistent and unambiguous across different systems and regions.

Here is an example of a valid list data validation in OOXML:

<dataValidation type="list" allowBlank="1" showInputMessage="1" showErrorMessage="1">
  <formula1>"Apple,Banana,Cherry"</formula1>
</dataValidation>

@weird94
Copy link
Contributor

weird94 commented Nov 22, 2024

So, try to avoid using comma in list data validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants