Skip to content



Transforms a flat IDoc into XML IDoc or vice-versa. The DSL requires a parser definition file for the converted IDoc.


Binding name: p6.idoc

Method: void loadDefinition(String idocDef, boolean isCompiledXml)

Load the IDoc definition given as a String. The String can in a pre-compiled XML format or will be compiled and loaded.

Method: String exportDefinitionAsXml(IdocDefinition idocDefinition)

Exports a previously loaded IDoc definition in compiled XML format.

Method: String flatToXml(IdocDefinition idocDefinition, String flatIDOC)

Transform a flat IDoc to XML IDoc.

Method: String xmlToFlat(IdocDefinition idocDefinition, String xmlIDOC)

Transform an XML IOC to flat IDoc.


def definition = p6.resource.get("ORDERS")

def idocDef = p6.idoc.loadDefinition(definition, false)

def xmlIdoc = p6.idoc.flatToXml(idocDef, p6.resource.get("FlatOrder"))
println xmlIdoc

def flatIdoc = p6.idoc.xmlToFlat(idocDef, xmlIdoc)
println flatIdoc

idocDef = p6.idoc.loadDefinition(p6.resource.get("COMPILEDORDERS"), true)