Is the relationship from a Slide Part to a Custom XML Part not an explicit relationship instead of an implicit?

Viewed 128

If I want to associate a Custom XML Part to a Slide Part, the way I know of, is to add a custData element inside the Slide Part, and reference the relationship id of the Custom XML Part in the id attribute.

<p:custDataLst>
  <p:custData r:id="rId1" />
</p:custDataLst>

As I understand it, this is an explicit relationship, because the reference is via the relationship id.

However, ECMA-376 Part 1, fifth edition (Latest version currently), says that a Slide Part is only permitted to have an implicit relationship to a Custom XML Part (Section 13.3.8).

That doesn't really make sense to me. In practice, I see an explicit relationship, while the specification only allows for an implicit one.

This is also how PowerPoint do it if I use the VSTO object model. If I create a completely fresh VSTO project, and edit the startup method to be like this:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
    Application.AfterNewPresentation += pres =>
    {
        var firstSlide = pres.Slides[1];
        var customXmlPart = firstSlide.CustomerData.Add();
        customXmlPart.LoadXML("<test></test>");
    };
}

Then save the presentation and look at the package structure, PowerPoint did the exact same thing: Added a custData element to the slide, referencing the custom XML part using the relationship id. I.e. an explicit relationship.

I'm confident that the specification is correct, so what am I missing?

1 Answers

Okay, so it turns out that Office knowingly doesn't follow the specification to the letter. Luckily, Microsoft actually documents where they diverge from the standard. This documentation can be found at the Open Specifications website on MSDN. Diving into the documentation here, I found the page Word, Excel, and PowerPoint Standards Support, which has quite a few PDF documents that documents how the standard is implemented in Word, PowerPoint and Excel. Diving further into [MS-OE376]: Office Implementation Information for ECMA-376 Standards Support, section 2.1.23.e states:

The standard states that the Presentation part is permitted to have an implicit relationship to a Custom XML Data Storage part.

Office also allows for an explicit relationship between the Presentation part and a Custom XML Data Storage part.

The PDF document doesn't say anything about this for slides, but now I'm no longer unsure if I was interpreting the standard incorrectly or if PowerPoint just didn't follow the standard. It's pretty clear that PowerPoint in a lot of cases doesn't follow the standard, so the specific case I have with an explicit relationship between a Slide Part and a Custom XML Data Storage Part is probably just another case where PowerPoint doesn't follow the standard.

Related