Xponent logo Xponent Software
Specialists in Large XML Documents Privacy Policy Contact

XmlSplit Examples

All examples follow these steps:
Example 1: Split every 10 elements at depth 1. View details.
Example 2: Split every 20 elements at depth 1. View details.
Example 3: Split every 20 elements and write header in each file. View details.
Example 4: Split upon change of tag name of Element at depth 1. View details.
Example 5: Split upon change of value of attribute "ID" in elements at depth 1. View details.
Example 6: Split every 10 elements at depth 2 and preserve XML hierarchy. View details.
Example 7: Create split files of a specified size. View details.

Include and Append Files.

These two options are not covered in the above examples because newer options such as Preserve Structure and Write Header made them largely obsolete. In the event they are needed, they do what their names imply. If an include file is specified it is inserted at the very beginning of each split file, while and append file is appended to the end. XmlSplit makes no attempt to verify if the include or append file is a well-formed XML file.

A few definitions

Root: the root element of an XML document. In the sample files, the ORDERS element is the root element.
Depth: the nesting level of an element in the XML hierarchy. The root element always has a depth of zero. End tags have the same depth as their start tag .

0           <ORDERS>
1               <ORDERS_HEADER>
2                 <O_DATE-RANGE>1990-1999</O_DATE-RANGE>
1               </ORDERS_HEADER>
1               <ORDER>
2                 <O_ORDERKEY>1</O_ORDERKEY>
2                 <O_CUSTKEY>370</O_CUSTKEY>
1               </ORDER>
0           </ORDERS>

Copyright Ⓒ 2008-2023. Xponent LLC. All rights reserved.