web stats
Mirth Community - View Single Post - CSV to XML transformation - element namespaces stripped
View Single Post
  #1  
Old 11-29-2017, 05:35 AM
varunsingh85 varunsingh85 is offline
What's HL7?
 
Join Date: Oct 2017
Posts: 3
varunsingh85 is on a distinguished road
Default CSV to XML transformation - element namespaces stripped

I am transforming a CSV to XML by providing Inbound/Outbound message templates as sample CSV/XML files. I have correctly added the iterator and Message Builder steps also in the transformer.

In my Outbound Message Template XML, I have 2 sets of data, which has namespaces "typ:", "item:" added to the end-elements -

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/scm/productModel/catalogs/itemCatalogService/types/" xmlns:item="http://xmlns.oracle.com/apps/scm/productModel/catalogs/itemCatalogService/" xmlns:cat="http://xmlns.oracle.com/apps/scm/productModel/catalogs/flex/category/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">
<soapenv:Header/>
<soapenv:Body>
<typ:processCategory>
<typ:changeOperation>Create</typ:changeOperation>
<typ:category>
<item:CategoryName>TESTVS11291</item:CategoryName>
<item:CategoryCode>TESTVS11291</item:CategoryCode>
<item:Description>TESTVS11291</item:Description>
<item:CatalogCode>LS_Purchasing_Catalog</item:CatalogCode>
<item:StartDate>2017-11-29</item:StartDate>
</typ:category>
<typ:category>
<item:CategoryName>TESTVS11292</item:CategoryName>
<item:CategoryCode>TESTVS11292</item:CategoryCode>
<item:Description>TESTVS11292</item:Description>
<item:CatalogCode>LS_Purchasing_Catalog</item:CatalogCode>
<item:StartDate>2017-11-29</item:StartDate>
</typ:category>
<typ:processControl>
<typ1:partialFailureAllowed>false</typ1:partialFailureAllowed>
</typ:processControl>
</typ:processCategory>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------

In my program, I am providing a CSV file with 4 rows (for example), and each CSV column is mapped to above XML end-elements. The issue is, when the transformation completes, the XML it generates does not have namespaces "item:" and "type:" appended to end-elements. For some rows its coming, for some its stripped.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cat="http://xmlns.oracle.com/apps/scm/productModel/catalogs/flex/category/" xmlns:item="http://xmlns.oracle.com/apps/scm/productModel/catalogs/itemCatalogService/" xmlns:typ="http://xmlns.oracle.com/apps/scm/productModel/catalogs/itemCatalogService/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">
<soapenv:Header />
<soapenv:Body>
<typ:processCategory>
<typ:changeOperation>Create</typ:changeOperation>
<typ:processControl>
<typ1:partialFailureAllowed>false</typ1:partialFailureAllowed>
</typ:processControl>
<typ:category>
<CategoryName>TESTVS1</CategoryName>
<CategoryCode>TESTVS1</CategoryCode>
<Description>Test Category Upload</Description>
<CatalogCode>LS_Purchasing_Catalog</CatalogCode>
<StartDate>2017-11-28</StartDate>
</typ:category>
<typ:category>
<CategoryName>TESTVS2</CategoryName>
<CategoryCode>TESTVS2</CategoryCode>
<Description>Test Category Upload</Description>
<CatalogCode>LS_Purchasing_Catalog</CatalogCode>
<StartDate>2017-11-28</StartDate>
</typ:category>
<category>
<CategoryName>TESTVS3</CategoryName>
<CategoryCode>TESTVS3</CategoryCode>
<Description>Test Category Upload</Description>
<CatalogCode>LS_Purchasing_Catalog</CatalogCode>
<StartDate>2017-11-28</StartDate>
</category>
<category>
<CategoryName>TESTVS4</CategoryName>
<CategoryCode>TESTVS4</CategoryCode>
<Description>Test Category Upload</Description>
<CatalogCode>LS_Purchasing_Catalog</CatalogCode>
<StartDate>2017-11-28</StartDate>
</category>
</typ:processCategory>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------------

Does anyone have any idea what's causing it and how to resolve? "Strip Namespace" option is disabled at all levels.
Reply With Quote