This seems related to #8, but I dont need an enhancement in the xgen tool, just a way to solve the problem below.
I am having a similar problem when trying to use xgen on the Grobid xsd files: xgen -i ./grobid/grobid-home/schemas/xsd -o ./pkg/extraction/grobid -p grobid -l Go
It creates all the corresponding go files, albeit in a weird directory path (pkg/extraction/grobid/grobid/grobid-home/schemas/xsd/), but after moving the files to the expected path, the go compiler complains found packages schema (Grobid.xsd.go) and grobid (dcr.xsd.go). If I manually change the package from schema to grobid in Grobid.xsd.go I get a bunch of errors related to redeclared in this block. Is there any way to work around this issue?
Steps to reproduce the issue:
xgen -i ./grobid/grobid-home/schemas/xsd -o ./pkg/extraction/grobid -p grobid -l Go
pkg/extraction/extraction.go:25:2: found packages schema (Grobid.xsd.go) and grobid (dcr.xsd.go) in /Users/ojg/code/corpora/server/pkg/extraction/grobid```
Change package name to grobid in Grobid.xsd.go and build:
pkg/extraction/grobid/tei.xsd.go:10:6: P redeclared in this block
pkg/extraction/grobid/Grobid.xsd.go:2606:6: other declaration of P
pkg/extraction/grobid/tei.xsd.go:20:6: Hi redeclared in this block
pkg/extraction/grobid/Grobid.xsd.go:2616:6: other declaration of Hi
Describe the results you received:
The code did not compile compile - see output above.
Description
This seems related to #8, but I dont need an enhancement in the
xgen
tool, just a way to solve the problem below.I am having a similar problem when trying to use
xgen
on the Grobid xsd files:xgen -i ./grobid/grobid-home/schemas/xsd -o ./pkg/extraction/grobid -p grobid -l Go
It creates all the corresponding go files, albeit in a weird directory path (
pkg/extraction/grobid/grobid/grobid-home/schemas/xsd/
), but after moving the files to the expected path, the go compiler complainsfound packages schema (Grobid.xsd.go) and grobid (dcr.xsd.go)
. If I manually change the package fromschema
togrobid
inGrobid.xsd.go
I get a bunch of errors related toredeclared in this block
. Is there any way to work around this issue?Steps to reproduce the issue:
xgen -i ./grobid/grobid-home/schemas/xsd -o ./pkg/extraction/grobid -p grobid -l Go
mv pkg/extraction/grobid/grobid/grobid-home/schemas/xsd/* pkg/extraction/grobid && rm -rf pkg/extraction/grobid/grobid/grobid-home
grobid
inGrobid.xsd.go
and build:Describe the results you received:
The code did not compile compile - see output above.
Describe the results you expected:
The code to compile.
Output of
go version
:xgen version or commit ID:
Environment details (OS, physical, etc.):
macOS 14.4 on MacBook Pro with M2.