Description
When officecli set modifies a xlsx cell that was originally stored as an inline string (<is><t>...</t></is> with t="str"), it writes the new value as <v>NEW</v> but does not:
- Remove the existing
<is> tag
- Update the cell's
t attribute
This results in a cell with both <v> and <is> present:
<!-- Before officecli set -->
<c r="A1" s="1" t="str">
<is><t>original text</t></is>
</c>
<!-- After officecli set A1 --prop value="new text" -->
<c r="A1" s="1" t="str">
<v>new text</v> ← new value written by officecli
<is><t>original text</t></is> ← old value, not cleared
</c>
Per the OpenXML standard (ECMA-376), a cell should contain either <v> (shared string index or numeric value) or <is> (inline string), never both. The t="str" attribute indicates the cell uses inline string mode, so Excel correctly ignores <v> and reads <is> — displaying the old value.
Expected behavior
officecli should either:
- Option A: Write as inline string — replace the content inside
<is><t>...</t></is> with the new value, or
- Option B: Convert to shared string — change
t to s, remove <is>, and add the value to the shared strings table
Actual behavior
officecli watch displays the new value (reads <v>)
- Excel and other tools display the old value (reads
<is>)
- The downloaded file silently shows stale content with no error or warning
Steps to reproduce
- Create an
.xlsx file with Excel containing a text cell (e.g., A1 = "hello"). Excel typically stores these as inline strings.
officecli open test.xlsx
officecli set test.xlsx '/Sheet1/A1' --prop value="world"
officecli close test.xlsx
- Open
test.xlsx in Excel — A1 still shows "hello"
Environment
- OfficeCLI version: 1.0.110
- OS: Linux
- File format: .xlsx (OpenXML)
Description
When
officecli setmodifies a xlsx cell that was originally stored as an inline string (<is><t>...</t></is>witht="str"), it writes the new value as<v>NEW</v>but does not:<is>tagtattributeThis results in a cell with both
<v>and<is>present:Per the OpenXML standard (ECMA-376), a cell should contain either
<v>(shared string index or numeric value) or<is>(inline string), never both. Thet="str"attribute indicates the cell uses inline string mode, so Excel correctly ignores<v>and reads<is>— displaying the old value.Expected behavior
officecli should either:
<is><t>...</t></is>with the new value, orttos, remove<is>, and add the value to the shared strings tableActual behavior
officecli watchdisplays the new value (reads<v>)<is>)Steps to reproduce
.xlsxfile with Excel containing a text cell (e.g.,A1= "hello"). Excel typically stores these as inline strings.officecli open test.xlsxofficecli set test.xlsx '/Sheet1/A1' --prop value="world"officecli close test.xlsxtest.xlsxin Excel —A1still shows "hello"Environment