From 3ce26af1676c6f9a71449300a60d35581bf7c37e Mon Sep 17 00:00:00 2001 From: gpmn Date: Fri, 22 Feb 2019 19:36:01 +0800 Subject: [PATCH 1/3] in progress --- datadictionary/datadictionary.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datadictionary/datadictionary.go b/datadictionary/datadictionary.go index 410ca8ee1..d051d4810 100644 --- a/datadictionary/datadictionary.go +++ b/datadictionary/datadictionary.go @@ -3,6 +3,7 @@ package datadictionary import ( "encoding/xml" + "io" "os" ) @@ -326,6 +327,9 @@ func Parse(path string) (*DataDictionary, error) { doc := new(XMLDoc) decoder := xml.NewDecoder(xmlFile) + decoder.CharsetReader = func(encoding string, input io.Reader) (io.Reader, error) { + return input, nil + } if err := decoder.Decode(doc); err != nil { return nil, err } From 07bfa3c02bd94cdc0d9a0f52876ddfd10fe1fd42 Mon Sep 17 00:00:00 2001 From: gpmn Date: Sat, 2 Mar 2019 00:53:36 +0800 Subject: [PATCH 2/3] https://github.com/quickfixgo/quickfix/issues/366 for Incorrect NumInGroup --- validation.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/validation.go b/validation.go index 6e28b8cd0..0c2167b56 100644 --- a/validation.go +++ b/validation.go @@ -10,15 +10,14 @@ type validator interface { type validatorSettings struct { CheckFieldsOutOfOrder bool - RejectInvalidMessage bool - + RejectInvalidMessage bool } //Default configuration for message validation. //See http://www.quickfixengine.org/quickfix/doc/html/configuration.html. var defaultValidatorSettings = validatorSettings{ CheckFieldsOutOfOrder: true, - RejectInvalidMessage: true, + RejectInvalidMessage: true, } type fixValidator struct { @@ -87,8 +86,6 @@ func validateFIX(d *datadictionary.DataDictionary, settings validatorSettings, m } } - - return nil } @@ -212,6 +209,7 @@ func validateVisitGroupField(fieldDef *datadictionary.FieldDef, fieldStack []Tag return fieldStack, err } } else { + fieldStack = fieldStack[1:] if childDefs[0].Required() { return fieldStack, RequiredTagMissing(Tag(childDefs[0].Tag())) } From dbd1cd31486be22bc1cae2b61ae85155e2410c28 Mon Sep 17 00:00:00 2001 From: gpmn Date: Sat, 2 Mar 2019 11:03:37 +0800 Subject: [PATCH 3/3] move down iteration operation --- validation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.go b/validation.go index 0c2167b56..7520d4b32 100644 --- a/validation.go +++ b/validation.go @@ -209,10 +209,10 @@ func validateVisitGroupField(fieldDef *datadictionary.FieldDef, fieldStack []Tag return fieldStack, err } } else { - fieldStack = fieldStack[1:] if childDefs[0].Required() { return fieldStack, RequiredTagMissing(Tag(childDefs[0].Tag())) } + fieldStack = fieldStack[1:] } childDefs = childDefs[1:]