OASIS XLIFF Object Model and Other Serializations (XLIFF OMOS) TC

  • 1.  A more natural JSON encoding for originalData

    Posted 03-13-2017 18:09
    Currently we model originalData as an array of objects that represent an id and a corresponding data item:         "originalData": [             { "id": "d1", "data": "[C1/]" },             { "id": "d2", "data": "[C2]" },             { "id": "d3", "data": "[/C2]" }         ], This is following the XML representation, but originalData is really just a lookup table, a structure XML doesn't handle well.  However, JSON does, so for JLIFF we can use a more natural JSON representation by treating the id value as an object key:         "originalData": {             "d1": "[C1/]",             "d2": "[C2]",             "d3": "[/C2]"         }, This is more concise and also easier for a JLIFF consumer to work with. (Additional note, the value here would need to become an object to support the optional @dir or @xml:space metadata supported in XLIFF.)


  • 2.  Re: A more natural JSON encoding for originalData

    Posted 03-13-2017 18:23
    I've opened a pull request  containing these changes.  Robert, if you agree with this, go ahead and merge it. On Mon, Mar 13, 2017 at 11:08 AM, Chase Tingley < chase@spartansoftwareinc.com > wrote: Currently we model originalData as an array of objects that represent an id and a corresponding data item:         "originalData": [             { "id": "d1", "data": "[C1/]" },             { "id": "d2", "data": "[C2]" },             { "id": "d3", "data": "[/C2]" }         ], This is following the XML representation, but originalData is really just a lookup table, a structure XML doesn't handle well.  However, JSON does, so for JLIFF we can use a more natural JSON representation by treating the id value as an object key:         "originalData": {             "d1": "[C1/]",             "d2": "[C2]",             "d3": "[/C2]"         }, This is more concise and also easier for a JLIFF consumer to work with. (Additional note, the value here would need to become an object to support the optional @dir or @xml:space metadata supported in XLIFF.)