This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Comparing XML Files from Models with Identical Names

You can compare XML text from files of the same name. To complete the operation, the XML comparison tool copies one of the models to a temporary folder, because Simulink® cannot have two models of the same name in memory at the same time. The XML comparison tool creates a read-only copy of one model named modelname_TEMPORARY_COPY, and compares the resulting XML files.

    Warning:   When you use reverse annotation from the report, one of the models displayed is a temporary copy with a new name. The temporary copy is read-only, to avoid making changes that can be lost.

Alternatively, you can run the comparison by renaming or copying one of the files.

All merge operations merge from left to right, so you cannot accidentally merge to a temporary copy. Merge operations on models with identical names copy changes from the left (temporary copy) model to the right model. If you swap sides, the report always places a new temporary copy on the left side of the report, so any merges change the original model file and never a temporary copy.

If one of the models is open when you try to compare XML files, a dialog box appears where you can click Yes to close the file and proceed, or No to abort. You must close open models before the XML comparison tool can compare XML files from two models with the same name. The problem requiring you to close the loaded model is called "shadowed files". In some cases, another model with the same name might be in memory, but not visible. See Shadowed Files (Simulink) for more information.

If you want to automatically close open models of the same name when comparing XML files and not see the dialog box again, run these commands:

opt = slxmlcomp.options
This is persistent across MATLAB® sessions. To revert to default behavior and be prompted whether or not to close the open model every time, enter:
opt = slxmlcomp.options

If you open a comparison report from Simulink Project (for example, using Compare to Revision), the project handles files of the same name and does not prompt you to close models.

Was this topic helpful?