How can I import multiple XML files into a DDS Dictionary without missing structure variable fields using the DDS Blockset in MATLAB R2023b?

I'm having trouble importing XML files into a DDS Dictionary in DDS Blockset R2023b. I have common XML file "REF.xml" which defines enum types referenced by another XML file "TO_IMPORT.xml". "TO_IMPORT.xml" defines a structure, "struct", with fields referencing types defined in "REF.xml". I am currently including the "REF.xml" file in "TO_IMPORT.xml" using the following line:
<include file="REF.xml"/>
However, when I try to import "TO_IMPORT.xml" into my DDS Dictionary, the fields in "struct" are missing.
How do I import XML files when one of the XML files references types from the other XML file?

 Respuesta aceptada

To import XML files that include references to types defined in other XML files, it is not necessary to use an 'include' statement in your XML file. Instead, import each XML file individually using the following workflow:
  1. Remove the "include" statements from your XML files. This prevents Simulink from creating the same type definition multiple times when you try to import them.
  2. Import each file separately into the DDS SLDD. Make sure to import the XML files in an order so that no type definition references a type defined in another file before the other file has been imported. In the example above, this would mean importing "REF.xml" before "TO_IMPORT.xml". To accomplish this, use the workflow described in the MathWorks documentation on DDS Dictionary.
After following these steps, the imported definitions should contain the correct fields.

Más respuestas (0)

Categorías

Más información sobre Get Started with DDS Blockset en Centro de ayuda y File Exchange.

Productos

Versión

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by