Skip to content

XML Split

Methods

Warning

Since 6.10.11 p6.xmlsplit use is deprecated. Use p6.xml.split instead.

Binding name: p6.xmlsplit


transform

Deprecated since 6.10.11

Initialise and run an xmlsplit transformation, using the given configuration Map and notify closure (optional, set to null if not callback required).

Syntax

void p6.xml.split(Map<String, String> configuration, Closure mapNotify)
void p6.xmlsplit.transform(Map<String, String> configuration, Closure mapNotify)
Example
// Split a large batch of UBL invoices into individual documents
def config = [
    'xml.source': 'p6file://${P6_DATA}/resources/documents/batch-invoices.xml',
    'xml.target.folder': 'p6file://${P6_DATA}/resources/documents/split/',
    'xml.split.element': 'Invoice'
]

p6.xml.split(config) { result ->
    p6.log.debug 'Split document created: ' + result
}