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

Multiple "xs:list" in "xs:complexType" Causing Error #30

Open
barnesew opened this issue Aug 24, 2021 · 1 comment
Open

Multiple "xs:list" in "xs:complexType" Causing Error #30

barnesew opened this issue Aug 24, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@barnesew
Copy link

Description

I am attempting to generate code based on some XSD files that utilize the "include" and "import" syntax. The problem is that I get the following error:

process error on schema/process/services/service/LibraryConfiguration.xsd: 14:7: expected 'IDENT', found '['

I did some investigating and discovered it happens when there are multiple xs:list types at the same level under an xs:complexType. When I comment out two of the three xs:element sections that contain the xs:list, the code can be successfully generated.

Example files used: process.zip

Steps to reproduce the issue:

  1. Using the files above, I run the following command on the process directory:
    xgen -i schema/process/ -p generatedxml -o output/ -l Go
  2. Get the following error:
    process error on schema/process/services/service/LibraryConfiguration.xsd: 14:7: expected 'IDENT', found '['

Steps to fix the example files:

  1. Comment out lines 17-32 of the "LibraryConfiguration.xsd" file (The second and third xs:element sections).
  2. With the modified files run:
    xgen -i schema/process/ -p generatedxml -o output/ -l Go
  3. Code generates successfully.

Output of go version:

go version go1.16.7 darwin/arm64

xgen version or commit ID:

xgen version: 0.1.0

Environment details (OS, physical, etc.):

  • MacBook Pro (M1 Architecture)
  • macOS 11.4 (20F71)

Output of go env:

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/barnesew/Library/Caches/go-build"
GOENV="/Users/barnesew/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/barnesew/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/barnesew/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16.7"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/barnesew/Documents/tms/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/y0/0w2cgh_s3ls1jbw51q6zrq4r0000gn/T/go-build3987189383=/tmp/go-build -gno-record-gcc-switches -fno-common"
@xuri xuri added the bug Something isn't working label Sep 12, 2021
@ndew623
Copy link

ndew623 commented Mar 30, 2022

Same problem, this works:

<xs:sequence>
            <xs:element name="element1" type="xs:int"></xs:element>
            <!--<xs:element name="element2">
                <xs:simpleType>
                    <xs:list itemType="Character">
                    </xs:list>
                </xs:simpleType>
            </xs:element> -->
            <xs:element name="element3" type="xs:double"></xs:element>
            <xs:element name="element4" type="Character"></xs:element>

            <xs:element name="element5" >
                <xs:simpleType>
                    <xs:list itemType="Character">
                    </xs:list>
                </xs:simpleType>
    
            </xs:element>
</xs:sequence>

But if I uncomment "element2" I get the expected 'IDENT', found '[' error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants