dotnet / Open-XML-SDK

Open XML SDK by Microsoft

Home Page:https://www.nuget.org/packages/DocumentFormat.OpenXml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in class DocumentFormat.OpenXml.Office2019.Drawing.Chart.BooleanFalse

skrabbe001 opened this issue · comments

The class DocumentFormat.OpenXml.Office2019.Drawing.Chart.BooleanFalse creates xml different from that created by PowerPoint

Observed behavior
When using the SDK, it generates xml that include the namespace as a prefix of the attribute val:

<c16r3:dispNaAsBlank c16r3:val="1" />

I'd assume this is the correct xml, but ...

Expected behavior
Here is the xml the PowerPoint application creates:

<c16r3:dispNaAsBlank val="1" />

It may be a bug in PowerPoint.

Context
Here is the context in which the class BooleanFalse is used to generate xml:

using C = DocumentFormat.OpenXml.Drawing.Charts;
using C16R3 = DocumentFormat.OpenXml.Office2019.Drawing.Chart;

// c:chart - c:extLst
var extLst = new C.ExtensionList();
chart.Append(extLst);

// c:chart - c:extLst - c:ext
var ext = new C.Extension() { Uri = "{56B9EC1D-385E-4148-901F-78D8002777C0}" };
ext.AddNamespaceDeclaration("c16r3", "http://schemas.microsoft.com/office/drawing/2017/03/chart");
extLst.Append(ext);

// c:chart - c:extLst - c:ext - c16r3:dataDisplayOptions16
var dataDisplayOptions16 = new C16R3.DataDisplayOptions16();
ext.Append(dataDisplayOptions16);

// c:chart - c:extLst - c:ext - c16r3:dataDisplayOptions16 - c16r3:dispNaAsBlank
var dispNaAsBlank = new C16R3.BooleanFalse() { Val = true };
dataDisplayOptions16.Append(dispNaAsBlank);

Notes
What is your opinion on this issue? Is it a bug in PowerPoint or the SDK? Or god forbid, did I make a mistake?

Desktop Information:

  • Windows 10
  • Microsoft® PowerPoint® for Microsoft 365 MSO (Version 2404 Build 16.0.17531.20190) 64-bit
  • .NET 8.0
  • DocumentFormat.OpenXml Version: 3.0.1