Example 7: Create split files of a specified size.

  • Creates split files that are as close to the specified size as possible and are well-formed XML.
Sample XML file widgets.xml containing 50 ORDER elements

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


After entering "3" in the input for the number of files, the program automatically fills in the bytes field by dividing the size of the XML document by 3. You may change the number of bytes and it will be used regardless of the value in the files input. The optional element name input may be typed or dragged and dropped from the XML Viewer.

The exact number of files created and their sizes depends on where the program can split and have all elements properly closed and nested as required for XML files. After the specified number of bytes have been read and written, the file is split at the next node that would result in a well-formed XML. That would be where an element with the specified name and depth occurs. If no element name is specified, the split will occur at the next element at the specified depth.

In this example, the ORDER element has a depth of 2 and in order to ensure the split files are properly structured, the Preserve Structure option is used.

Wizard Options

The only option specified is Preserve Structure which will ensure the elements are properly nested in each split file.