xuri / xgen

XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator
BSD 3-Clause "New" or "Revised" License
313 stars 74 forks source link

Added option to disable XML fields/import when using Go #60

Open SaschaMendel opened 1 year ago

SaschaMendel commented 1 year ago

Description

Generated structs are given an XMLName field + encoding/xml import.

XMLName          xml.Name          `json:"XMLName"

Sometimes you may not want this, for example when using an XSD just to generate structs for some other application than XML-parsing.

This feature adds a commandline option to omit those fields:

  --noxml       Don't generate XMLName fields on structs (Go)

Types of changes