FIXTradingCommunity / fix-orchestra-protobuf

Translators from FIX Orchestra to the protobuf family of serializations
Apache License 2.0
14 stars 10 forks source link

Unexpected element exception from file geneated from playlist #16

Open dalcorta opened 1 year ago

dalcorta commented 1 year ago

I generated a orchestra file using the playlist app, and it contains a namespace that causes the generator to crash.

Exception in thread "main" java.lang.RuntimeException: XML Validation Exception: unexpected element (uri:"http://fixprotocol.io/2022/orchestra/appinfo/fixml", local:"FIXMLencodingType"). Expected elements are <{}text> at row: 19353 column: 51

The namespace is used in these structures for example:

`

Identifies beginning of new message and session protocol version by means of a session profile identifier (see FIX Session Layer for details). ALWAYS FIRST FIELD IN MESSAGE. (Always unencrypted). ` ` Required if NoUnderlyings(711) > 0. `
kleihan commented 1 year ago

@dalcorta the code to convert Orchestra to protobuf was written before FIX decided to use the appinfo element in Orchestra to add information required to create FIXML schema from Orchestra. The main information is whether an element is required for FIXML or not, e.g. repeating group counters (NoXXX fields) are never required for FIXML.

The Orchestra V1.0 standard defines appinfo with <xs:any processContents="lax"/>. The elements inside appinfo should hence be ignored and not validated.

You will not need these FIXML elements inside appinfo for protobuf. As a workaround, you can remove appinfo elements with purpose="FIXML" prior to converting the Orchestra file.