Skip to content

Commit 4ffb52e

Browse files
authored
Merge pull request #368 from gpmn/master
for xml charset and bug of "Incorrect NumInGroup"
2 parents 94cf531 + 09c8ece commit 4ffb52e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

datadictionary/datadictionary.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ func Parse(path string) (*DataDictionary, error) {
315315
func ParseSrc(xmlSrc io.Reader) (*DataDictionary, error) {
316316
doc := new(XMLDoc)
317317
decoder := xml.NewDecoder(xmlSrc)
318+
decoder.CharsetReader = func(encoding string, input io.Reader) (io.Reader, error) {
319+
return input, nil
320+
}
321+
318322
if err := decoder.Decode(doc); err != nil {
319323
return nil, errors.Wrapf(err, "problem parsing XML file")
320324
}

validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ func validateVisitGroupField(fieldDef *datadictionary.FieldDef, fieldStack []Tag
246246
if childDefs[0].Required() {
247247
return fieldStack, RequiredTagMissing(Tag(childDefs[0].Tag()))
248248
}
249+
fieldStack = fieldStack[1:]
249250
}
250251

251252
childDefs = childDefs[1:]

0 commit comments

Comments
 (0)