droyo / go-xml

utility and code-generation libraries for XML
MIT License
300 stars 113 forks source link

feat: use pointer for optional structures #139

Open rrreeezzz opened 3 years ago

rrreeezzz commented 3 years ago

Following the revert https://github.com/droyo/go-xml/pull/102 and your comment on https://github.com/droyo/go-xml/issues/101, I applied it and it seems to work well. I found the original xsd that was causing issue in #101 (https://www.fpml.org/spec/fpml-5-9-3-wd-3/html/recordkeeping/schemaDocumentation/schemas/xmldsig-core-schema_xsd/schema-overview.html#a76), but there was still issues with ArrayType nodes. Not using pointers for ArrayType fixed these.

Not sure if using pointers for optional fields is still of interest though.

Thanks for your work !