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: Split a complex XML structure. View details.

Include and Append Files.

These two options are not covered in the above examples because newer options such as Preserve Structure, Threshold Element 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.

A few definitions

Root: the root element of an XML document. There can be only one root element and it has a depth = 0. All other nodes are nested within the root as "child" nodes.
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.