Question
· Oct 4

Why is the XML export different when executed through various methods (VS Code, Studio, and the console)?

I have three different methods for exporting classes and projects as XML files, but each one produces slightly different output:

  1. 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.
  2. VS Code: This method only exports the classes, and it doesn't include the project in the XML file.
  3. 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."

Product version: IRIS 2023.3
Discussion (1)2
Log in or sign up to continue

Hi @Philippe Ebinger,

take a look into the %Studio.Project class, there is a method called Export, which gives you exactly what you need on the console like:

Set project = ##class(%Studio.Project).%OpenId("MyProject")
Do project.Export("MyProject.xml")
<Class name="MyProject.M">...</Class>
<Project name="MyProject"...</Project>
<Class name="MyProject.Pendenz">...</Class>
<Class name="MyProject.Protokoll">...</Class>