I have three different methods for exporting classes and projects as XML files, but each one produces slightly different output:
- Studio (what I currently use for exporting): I export as a project (with the 'only project' option disabled). This generates all classes and the project in a single XML file.
- VS Code: This method only exports the classes, and it doesn't include the project in the XML file.
- Console export using %SYSTEM.OBJ.Export: I used the following command to attempt the same export as Studio:
do ##class(%SYSTEM.OBJ).Export("MyProject.Prj, MyProject.*.cls", "TempDir/MyProject.xml", "/exportselectivity=0", "", "utf-8")
This exports both the project and the classes, but with a slight difference. The order of the project and class entries is different compared to Studio.
In Studio, the project is positioned between class definitions, like this:
<Class name=MyProject.M...> ... </Class>
<Project name="MyProject">...</Project>
<Class name="MyProject.Pendenz">...</Class>
<Class name="MyProject.Protokoll">...</Class>
However, when exporting via the console, the project appears in a different place:
<Class name=MyProject.M...> ... </Class>
<Class name="MyProject.Pendenz">...</Class>
<Project name="MyProject">...</Project>
<Class name="MyProject.Protokoll">...</Class>
It seems the console export orders items alphabetically, which results in this difference."