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?

 采纳的回答

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.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Get Started with DDS Blockset 的更多信息

产品

版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by