Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types declared at the end of the XSD are not substituted into the generated code #44

Open
themaxi opened this issue Feb 17, 2022 · 0 comments

Comments

@themaxi
Copy link
Contributor

themaxi commented Feb 17, 2022

Description
Types declared at the end of the XSD are not substituted into the generated code.

XSD file:
XSD.txt

Generated file:
Gotype.txt

Describe the results you received:

type CField struct {
	Uid            *String36  `xml:"Uid"`
	Name           *String500 `xml:"Name"`
	YStart         int        `xml:"YStart"`
	YEnd           int        `xml:"YEnd"`
	IdCFieldType   int        `xml:"IdCFieldType"`
	IdCFieldStatus int        `xml:"IdCFieldStatus"`
	MaxCount       int        `xml:"MaxCount"`
	NAgree         int        `xml:"NAgree"`
	CDir           int        `xml:"CDir"`
	DateE          string     `xml:"DateE"`
	FormLst        *FormLst   `xml:"FormLst"`
	LevelLst       *LevelLst  `xml:"LevelLst"`
}

Describe the results you expected:

type CField struct {
	Uid            string    `xml:"Uid"`
	Name           string    `xml:"Name"`
	YStart         int       `xml:"YStart"`
	YEnd           int       `xml:"YEnd"`
	IdCFieldType   int       `xml:"IdCFieldType"`
	IdCFieldStatus int       `xml:"IdCFieldStatus"`
	MaxCount       int       `xml:"MaxCount"`
	NAgree         int       `xml:"NAgree"`
	CDir           int       `xml:"CDir"`
	DateE          string    `xml:"DateE"`
	FormLst        *FormLst  `xml:"FormLst"`
	LevelLst       *LevelLst `xml:"LevelLst"`
}

I have made a quick and dirty fix which works for my schemas:
themaxi@2691c98
Generated file:
GotypeFix.txt

But I think a more correct and more thoughtful solution should be implemented.

Output of go version:

go version go1.17.6 linux/amd64

xgen version or commit ID:

github.com/xuri/xgen v0.0.0-20220120053031-4e87e56e80f1

Environment details (OS, physical, etc.):
Ubuntu 20.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant