You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In part \ppt\comment\modernComment... part is coded in the SDK metadata as p188:ext. This causes OpenXmlUnknownElement to be assigned as the child of p188:extLst.
<p188:extLst>
<p:extxmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"uri="{5BB2D875-25FF-4072-B9AC-8F64D62656EB}">
<p228:taskDetailsxmlns:p228="http://schemas.microsoft.com/office/powerpoint/2022/08/main">
<p228:history>
<p228:eventtime="2024-07-16T05:56:24.928"id="{22A90AAB-29DC-4F45-80B8-41660EB3CE91}">
<p228:atrbtnauthorId="{DDBD2B34-3E97-38F7-B7A9-5BD8D52D7288}"/>
<p228:anchr>
<p228:commentid="{C5BB4569-00FC-429B-B44C-282847B06E34}"/>
</p228:anchr>
<p228:add/>
This should be fixed on our schema processor.
To Reproduce
Create a presentation with a modern comment. Then inspect the \ppt\comment\modernCommentXXXX.xml part. The above shows p:ext and that is per the Office schemas.
However, when parsing in SDK code:
SlidePartsp=pd.PresentationPart.GetPartsOfType<SlidePart>().First();PowerPointCommentPartppcp=sp.GetPartsOfType<PowerPointCommentPart>().First();if(ppcp.RootElementisnull){thrownewInvalidDataException("no root element!");}CommentPropertiesExtensionListcpel=ppcp.RootElement.Descendants<CommentPropertiesExtensionList>().First();if(cpelisnull){thrownewInvalidDataException("Presentation modern comment part is missing p188:extlst");}CommentPropertiesExtensioncpe=cpel.ChildElements.First<CommentPropertiesExtension>();if(cpeisnull){// This line will throw because cpe is null due to the p:ext being wrapped by OpenXmlUnknownElement. // In our patched schemas we code this as p188:ext which is wrong. thrownewInvalidDataException("Presentation modern comment part is missing p188:ext");}
Steps to reproduce the behavior:
Use the code above to access the ext child element the extLst in a p188:cm block.
Observed behavior cpe is null.
Expected behavior
In the code above, cpe should be a valid CommentPropertiesExtension object wrapping the p:ext.
Desktop (please complete the following information):
OS: Windows
.NET Target: .Net 8.0
DocumentFormat.OpenXml Version: 3.0.2
The text was updated successfully, but these errors were encountered:
tomjebo
changed the title
Bug with Open XML SDK
Found OpenXmlUnknown CommentPropertiesExtension
Jul 19, 2024
tomjebo
changed the title
Found OpenXmlUnknown CommentPropertiesExtension
Found OpenXmlUnknownElement instead of CommentPropertiesExtension
Jul 19, 2024
Describe the bug
This should be fixed on our schema processor.
To Reproduce
Create a presentation with a modern comment. Then inspect the \ppt\comment\modernCommentXXXX.xml part. The above shows p:ext and that is per the Office schemas.
However, when parsing in SDK code:
Steps to reproduce the behavior:
Use the code above to access the ext child element the extLst in a p188:cm block.
Observed behavior
cpe
is null.Expected behavior
In the code above, cpe should be a valid CommentPropertiesExtension object wrapping the p:ext.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: