Example 6: Split every 10 elements at depth 2.

  • Uses the Preserve Structure Option.
  • Automatically ensures structure of each split file matches the original XML document.
Sample XML file widgets.xml containing 50 ORDER elements

Method A on the Methods Tab is used in this example with element name ORDER and depth 2.

example6
Five split files are created, each with ten ORDER elements. Each node that occurs in the source XML prior to the first ORDER element is written to the start of every split file. If any of these nodes are open elements, their corresponding end tags are written at the appropriate location in each split file such that all elements are closed and properly nested.

Note that no other optional items are specified. The root element is inserted automatically. Preserve Structure includes all XML node types that may occur. In the Options tab, clicking the Show button next to the Preserve Structure option opens a small form with a list of the XML nodes that this option writes to the start of each split file. Unwanted nodes may be deleted from the list and saved. Only the remaining nodes are written to the split files, but the source XML document is not changed.

Wizard Options For this example
example6

First two split files created are below:

Split file 1.

Split file 2.