Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2137

Wrong structure for json infosets created from IBM4690 SA TLOGS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.3.0, 2.4.0
    • None
    • CLI, DFDL Schemas
    • None
    • mac

    Description

      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 one 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):

      ./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>**

      However, when the output format is json, I get the following invalid format:

      ./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

       

      Attachments

        1. tlogs-a-2.xml
          89 kB
          Juan Sebastian Cadena
        2. tlog-a-2.json
          77 kB
          Juan Sebastian Cadena
        3. EAMTRANA_2.DAT
          6 kB
          Juan Sebastian Cadena

        Activity

          People

            Unassigned Unassigned
            sebastiancadena Juan Sebastian Cadena
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: