While converting xml into csv (or any other delimiter based format) DataFormat activity doesn't insert the delimiters at the correct places.
book
Article ID: KB0090482
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks
-
Not Applicable
-
Description
Resolution: The DataFormat activity has a limitation of only one complex type at the root level and all the other elemets must be simpleTypes, they shouldn't be complexTypes. If any of the clildren elements are complex types then all the content of that complex type is clubbed as one element and delimiter will not separate the elements with in that complex type.
For example if you consider Schema 1 and Schema 2 below. When you try to convert the xml confirming to the Schema 1 DataFormat activity will not keep a delimiter between FirstName and LastName of Author element because these two are not directly childern of root element Book. Schema 1 has to be modified to Schema 2 format so that Author FirstName and Author Last name will be directly children of root element Book and hence DataFormat activity will be able to identify them as separate elements and insert a delimiter between them.
Schema 1 --------
<?xml version = "1.0" encoding = "UTF-8"?> <!--Generated by Turbo XML. Conforms to w3c http://www.w3.org/2001/XMLSchema--> <xsd:schema xmlns = "http://www.example.com/xsd/books" targetNamespace = "http://www.example.com/xsd/books" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "qualified"> <xsd:element name = "Book"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "Title"/> <xsd:element name = "Author" type = "xsd:string"/> <xsd:element name = "Author"> <xsd:complexType> <xsd:sequence> <xsd:element name = "FristName" type = "xsd:string"/> <xsd:element name = "LastName" type = "xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name = "Date" type = "xsd:string"/> <xsd:element name = "Publisher" type = "xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
Schema 2 ---------
<?xml version = "1.0" encoding = "UTF-8"?> <!--Generated by Turbo XML. Conforms to w3c http://www.w3.org/2001/XMLSchema--> <xsd:schema xmlns = "http://www.example.com/xsd/books" targetNamespace = "http://www.example.com/xsd/books" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "qualified"> <xsd:element name = "Book"> <xsd:complexType> <xsd:sequence> <xsd:element ref = "Title"/> <xsd:element name = "Author_FirstName" type = "xsd:string"/> <xsd:element name = "Author_LastName" type = "xsd:string"/> <xsd:element name = "Date" type = "xsd:string"/> <xsd:element name = "Publisher" type = "xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
KEYWORDS: DATAFORMAT CSV DELIMITER DATA FORMAT
Issue/Introduction
While converting xml into csv (or any other delimiter based format) DataFormat activity doesn't insert the delimiters at the correct places.