Open-XML-SDK icon indicating copy to clipboard operation
Open-XML-SDK copied to clipboard

c16:uniqueID element has wrong case

Open tomjebo opened this issue 1 year ago • 2 comments

Describe the bug When writing out the c16:uniqueId element using the UniqueID class

<c:ser>
    ...
    <c:extLst>
        <c:ext xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart"
               uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}">
            <c16:uniqueID val="{00000000-2153-43F5-A17B-C2679033F518}" />
        </c:ext>
    </c:extLst>
</c:ser>

Observed behavior c16:uniqueID is written

Expected behavior c16:uniqueId should be written

Desktop (please complete the following information):

  • DocumentFormat.OpenXml Version: 3.0.2

tomjebo avatar Jul 30 '24 18:07 tomjebo

There is actually a valid element child of CT_ChartDataPointUniqueIDMapEntry named uniqueID (with capital "D") in the Office xsds. That was mistakenly processed as the element name for both the above and the child of CT_ChartUniqueIDExt that should be uniqueId (lower case "d").

We hope to get a fix into the SDK soon.

tomjebo avatar Jul 30 '24 23:07 tomjebo

Update, turns out that there are two classes for the uniqueId element.

DocumentFormat.OpenXml.Office2016.Drawing.Charts.UniqueIdChartUniqueID writes c16:uniqueId DocumentFormat.OpenXml.Office2016.Drawing.Charts.UniqueID writes c16:uniqueID.

These are fine and if the correct one, UniqueIdChartUniqueID is used to append to the c:ext element in a (for example) LineSerExtension, then PowerPoint is happy.

There is a problem however, and that is the these are not added to the LineSerExtension (and other *SerExtension) classes in the SDK. So when reading the above construct in the original issue post, even with lowercase "d", the SDK will assign the class OpenXmlUnknownElement in the DOM.

This is what needs to be fixed.

tomjebo avatar Jul 31 '24 19:07 tomjebo

Closed by #1767

mikeebowen avatar Oct 15 '24 18:10 mikeebowen