////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The Edi To XML transform converts EDI message text (conforming to the ISO 9735 standard) to generic XML.

= image:transforms/icons/edi2xml.svg[Edi to XML transform Icon, role="image-doc-icon"] Edi to XML

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The Edi To XML transform converts EDI message text (conforming to the ISO 9735 standard, https://en.wikipedia.org/wiki/EDIFACT[read more]) to generic XML.

The XML text is more accessible and allows for selective data extraction using XPath and the xref:pipeline/transforms/getdatafromxml.adoc[Get Data From XML] transform.

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Maybe Supported, 24]
!Flink! image:question_mark.svg[Maybe Supported, 24]
!Dataflow! image:question_mark.svg[Maybe Supported, 24]
!===
|===

== Options

The transform configuration requires the field name containing the EDI text, and an output field name for the XML text.
If the output field name is left empty, the EDI text is going to be replaced by the XML text.

The structure of the XML output follows the following pattern:

[source,xml]
----
<edifact>
	<SEGMENT>
		<element>
			<value></value>
			...
		</element>
		...
	</SEGMENT>
	...
</edifact>
----

The conversion rules are:

* the root of the document is the "edifact" tag
* each segment in the edifact message is converted to a tag, using the segment name as the tag name.
* each field within a segment is represented by an "element" tag
* each value within a field is represented by an "value" tag
