Juan Sebastian Cadena created DAFFODIL-2137:
-----------------------------------------------

             Summary: Wrong structure for json infosets created from IBM4690 SA 
TLOGS
                 Key: DAFFODIL-2137
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2137
             Project: Daffodil
          Issue Type: Bug
          Components: CLI, DFDL Schemas
    Affects Versions: 2.3.0, 2.4.0
         Environment: mac
            Reporter: Juan Sebastian Cadena
         Attachments: EAMTRANA_2.DAT, tlog-a-2.json, tlogs-a-2.xml

IBM4690 SA TLOG infosets should be comprised of one *Transactions* element that 
contains many *Transaction* elements that in turn contain many 
*TransactionRecord*, but when the output format is *json*, the daffodil CLI 
creates one *Transactions* object that contains {color:#FF0000}one{color} 
*Transaction* array that contains all the *TransactionRecords* of the TLOG.

I get the correct structure when the infoset output is in XML. (I'm using the 
sample TLOG 
[EAMTRANA_2.DAT|https://github.com/DFDLSchemas/IBM4690-TLOG/blob/master/SA/TestData_SA/EAMTRANA_2.DAT]):

./daffodil parse --schema ~/IBM4690-TLOG/SA/TlogSA.xsd -I *xml* -o 
~/Downloads/tlog-a-2.xml ~/IBM4690-TLOG/SA/TestData_SA/EAMTRANA_2.DAT

<?xml version="1.0" encoding="UTF-8" ?>
*<sa:Transactions* xmlns:sa="http://www.ibm.com/dfdl/Tlog/SA";>
 *<sa:Transaction>*
 <TransactionRecord>
...
 </TransactionRecord>
 *</sa:Transaction>*
 *<sa:Transaction>*
...

...

*</sa:Transaction>*

...

*</sa:Transactions>***

{color:#FF0000}However, when the output format is json, I get the following 
invalid format:{color}

./daffodil parse --schema ~/IBM4690-TLOG/SA/TlogSA.xsd -I *xml* -o 
~/Downloads/tlog-a-2.xml ~/IBM4690-TLOG/SA/TestData_SA/EAMTRANA_2.DAT

{
 *"Transactions"*: {
 *"Transaction"*: [
 {
 "TransactionRecord": [
 {
 "TransactionRecord20_17": {
 "TerminalNumber": "0001",
 "TransactionNumber": "0001",
 "DateTime": "1010151416",
 "SubStringType": "17",
 "Indicat0": "2"
 }
 }
 ]
 },

 

] }}

I've tried this with the 2.3.0 and the master branch, using the DFDL from 
[https://github.com/DFDLSchemas/IBM4690-TLOG] . I've even tried with the schema 
in [https://github.com/DFDLSchemas/IBM4690-TLOG/pull/1]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to