Skip to content

[BUG] (minor) Cannot open an AASX after embeddedDataSpecifications was created because of encountered a self-closing element embeddedDataSpecifications #328

@STUBA-rupr

Description

@STUBA-rupr

Describe the bug
Once the reference is created the aaspe generates an empty dataSpecificationContent XML element . This cause an error while opening a AASX as:
Expected an XML element within the element dataSpecificationContent representing the property DataSpecificationContent of an instance of class EmbeddedDataSpecification, but encountered a self-closing element {elementName} at: submodels/*[0]/submodelElements/*[0]/embeddedDataSpecifications/*[0]

The aasx XML:

<embeddedDataSpecifications>
            <embeddedDataSpecification>
              <dataSpecification>
                <type>ModelReference</type>
                <keys>
                  <key>
                    <type>Submodel</type>
                    <value>submodel01</value>
                  </key>
                  <key>
                    <type>Referable</type>
                    <value>idShort</value>
                  </key>
                </keys>
              </dataSpecification>
 HERE:   <dataSpecificationContent />
            </embeddedDataSpecification>
          </embeddedDataSpecifications>

To Reproduce
Create a reference to Submodel and idShort.

Expected behavior
The action will not produce empty dataSpecificationContent element.

Screenshots
AASX structure:
Image

Additional context
The workaround is to Fix AASX in aaspe before exiting. It's annoying, because once you forget it, you need to investigate a bit what needs to be fixed in XML.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions