VSD to VSDX conversion has an invalid reference to a non-existent masters XML

Hi.

This issue is a follow up on issue
Issue ID(s): DIAGRAMNET-53660.

That fix works well, but I noticed it isn’t complete in matching the Open XML spec.
remove_masters_ref.zip (3.4 MB)

I’ve attached the Visio documents for your inspection. d16730231c143215v0.vsdx is the chart with the issue, and d16730231c143215v0_visio_save.vsdx is the fixed chart, which is produced by opening the first chart and saving it in Visio.

The required fix is to remove reference to masters.xml file in visio\_rels\document.xml.rels document, when masters.xml do not exist. In this case, as this chart do not use any master, it do not exist, so it shouldn’t have the reference to it.

<Relationship Id='rId1' Type='http://schemas.microsoft.com/visio/2010/relationships/masters' Target='masters/masters.xml'/>

(Remove the XML element with this target if masters do not exist)

Could you look into this?

Kind regards,
Swalih.

@SWALIH

It seems you are encountering an issue with the conversion of VSD to VSDX files, specifically regarding an invalid reference to a non-existent masters.xml file in the document.xml.rels file. This can occur when the diagram does not utilize any master shapes, and thus the reference to masters.xml should be removed.

To address this issue, you can manually edit the document.xml.rels file to remove the relationship element that points to masters.xml. The specific XML element to remove looks like this:

<Relationship Id='rId1' Type='http://schemas.microsoft.com/visio/2010/relationships/masters' Target='masters/masters.xml'/>

If you are using Aspose.Diagram for .NET, you may need to implement a check in your code to determine if any master shapes are present in the diagram before saving it. If no masters exist, you can skip adding this relationship.

Here’s a basic example of how you might approach this in your code:

using Aspose.Diagram;

public class ConvertVSDToVSDX
{
    public static void Run()
    {
        // Load the VSD diagram
        Diagram diagram = new Diagram("path_to_your_file.vsd");

        // Check if there are any masters
        if (diagram.Masters.Count == 0)
        {
            // Logic to remove the masters relationship if it exists
            // This part would require additional implementation
        }

        // Save the diagram as VSDX
        diagram.Save("output_file.vsdx", SaveFileFormat.VSDX);
    }
}

Make sure to replace "path_to_your_file.vsd" and "output_file.vsdx" with your actual file paths. This code snippet demonstrates how to load a VSD file and check for masters before saving it as a VSDX file.

If you need further assistance or a more detailed implementation, please let me know!

I would like this to be done under Aspose when you convert a VSD to VSDX, as it was done for the previous fix, if you can.

Thank you.

@SWALIH
Thanks for the template file.
We reproduced the problems you mentioned by converting your template vsd file to vsdx.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53705

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as DIAGRAMNET-53705) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou