Originally posted by: Dary_Legen
Hi guys,
I am working on transforming a file from X12 (input) to XML(output). My output is required to have self closing XML tags (i.e. <element/>) when associated XML element is not evaluated. After doing dozens of research I found out that self-closing XML tags are not possible to output when using XML schema as the type tree. So, I instead, created a type tree by importing XML schema using classic validation. Using Empty property under Type Syntax, I was able to generate the self closing XML tags. However, I am running into a issue when XML tag is of complex type (when it has sub elements inside it - see below) and not of simple type.
...
<another_element></another_element>
<main_element>
<element_1></element_1>
<element_2></element_2>
...
</main_element>
Currently, it is outputting <main_element></main_element> when its subelements are evaluated to NONE. I want it to output with self closing tag like so <main_element/>.
Please note: that it is outputting self closing XML tags when element is a simple type (i.e. <another_element/>) but is not doing it for elements that have sub_elements. So, can anyone knows a solution or a workaround this issue? Much appreciated.
I am using the following edition of ITX:
Version: 9.0.0.3
Build id: 21
#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender#DataExchange