# Export XML file for each diagram

**URL:** <https://forums.visual-paradigm.com/t/export-xml-file-for-each-diagram/14467>\
**Category:** General Questions/Discussions\
**Tags:** export\
**Created:** [September 4, 2018, 2:28pm UTC](https://forums.visual-paradigm.com/t/export-xml-file-for-each-diagram/14467 "2018-09-04T14:28:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_Tom](https://avatars.discourse-cdn.com/v2/letter/_/dec6dc/32.png) [@\_Tom](https://forums.visual-paradigm.com/u/_Tom)\
**Post date:** [September 4, 2018, 2:28pm UTC](https://forums.visual-paradigm.com/t/export-xml-file-for-each-diagram/14467/1 "2018-09-04T14:28:43Z")

</div>

Hi,

I am trying to export a project to XML with one XML file for each diagram via command prompt. The ExportXML script exports the given diagrams to one single XML, so i tried to generate a batch file which calls the script for every diagram. This works so far, but it seems to export the diagrams with the option “export sub-diagram when export parents” enabled and because of this it is really slow, and there is no parameter in the ExportXML script to turn it off…

Is there any possibility to get a single XML for each diagram or to turn off the sub-diagram export in cmd?

Best regards,  
Tom

---

<div class="post-metadata">

**Author:** ![peter.wong](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/peter.wong/32/3250_2.png) [@peter.wong](https://forums.visual-paradigm.com/u/peter.wong)\
**Post date:** [September 6, 2018, 10:20am UTC](https://forums.visual-paradigm.com/t/export-xml-file-for-each-diagram/14467/2 "2018-09-06T10:20:02Z")

</div>

Hi Tom,

Your sub-diagrams are included in the XML does not related to “Export sub-diagram when export parents” option.  
For Example:

 ![ExportPeer](https://forums.visual-paradigm.com/uploads/default/original/2X/5/5660ed024b5f4b2e104d01bc78359cc8b7d9f360.png)  
When you select _D1_ to export, the _D1a_ must be included in the exported XML.  
We now have no option to exclude that.

Sorry about that, at this moment, we have no plan to support excluding sub-diagrams.  
I don’t prefer supporting it, because, the _sub-diagram (or children)_ of a element, should be the _content_ of the element (a part of the element), so, should be included.

* * *

On another hand, seems the real problem you faced is **Slow** on exporting.  
I just tested on a simple project. It used 6 sec. on 1 exporting, where,

- 4 secs is used in startup & open project;
- 2 secs is used in export XML;

for example, export 10 diagrams used `(4 x 10) + (2 x 10) = 60 secs`.

This problem can be fixed by supporting a new command line option (such as _-DiagramPerFile_), that, will start & open project 1 time, and export all diagrams into different xml files.

means, export 10 diagrams will use `(4 x 1) + (2 x 10) = 24 secs`.

Do you think the new option can help you? If yes, I think we will support it in these few days. (I think…)
