Skip to content

Commit

Permalink
Merge pull request #368 from gpmn/master
Browse files Browse the repository at this point in the history
for xml charset and bug of "Incorrect NumInGroup"
  • Loading branch information
ackleymi authored Oct 27, 2023
2 parents 94cf531 + 09c8ece commit 4ffb52e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datadictionary/datadictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func Parse(path string) (*DataDictionary, error) {
func ParseSrc(xmlSrc io.Reader) (*DataDictionary, error) {
doc := new(XMLDoc)
decoder := xml.NewDecoder(xmlSrc)
decoder.CharsetReader = func(encoding string, input io.Reader) (io.Reader, error) {
return input, nil
}

if err := decoder.Decode(doc); err != nil {
return nil, errors.Wrapf(err, "problem parsing XML file")
}
Expand Down
1 change: 1 addition & 0 deletions validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func validateVisitGroupField(fieldDef *datadictionary.FieldDef, fieldStack []Tag
if childDefs[0].Required() {
return fieldStack, RequiredTagMissing(Tag(childDefs[0].Tag()))
}
fieldStack = fieldStack[1:]
}

childDefs = childDefs[1:]
Expand Down

0 comments on commit 4ffb52e

Please sign in to comment.