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

Does not generate code #137

Open
kikohnl opened this issue Jun 4, 2021 · 1 comment
Open

Does not generate code #137

kikohnl opened this issue Jun 4, 2021 · 1 comment

Comments

@kikohnl
Copy link

kikohnl commented Jun 4, 2021

I have a large schema from a vendor, Cisco/Broadworks which I need to create API calls to build utilities from.

xdsparse has no problem with the xsd, but xsdgen creates an go file with no structures or code:

cat xsdgen_output.go
// Code generated by xsdgen. DO NOT EDIT.

package ws

I have attached the Schema.

Rel_21.sp1_1.551_OCISchemaAS.zip

@Lercher
Copy link

Lercher commented Nov 28, 2023

Did you try adding -ns "", assuming there is no particular target namespace in the xsd? I.e. xsdgen -pkg some -o some.go -ns "" some.xsd.

In my case it made the difference from

// Code generated by xsdgen. DO NOT EDIT.

package some

to

// Code generated by xsdgen. DO NOT EDIT.

package some

type Some1 struct {
	Some2 string  `xml:" some2"`
        ...
}
...

for an XSD that declares no namespace like this:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

<xsd:element name="some1">
...

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

2 participants