Skip to content

Element of complex type is duplicated #134

@nettnikl

Description

@nettnikl

For this

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			xmlns:ak="http://example.com/schemas" targetNamespace="http://example.com/schemas"
			elementFormDefault="qualified" attributeFormDefault="qualified"
			version="1.0">
	<xsd:element name="AAA" type="ak:BBB"/>

	<xsd:complexType name="BBB">
		<xsd:sequence>
			<xsd:element name="CCC">
				<xsd:simpleType>
					<xsd:restriction base="xsd:string"/>
				</xsd:simpleType>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

I get:

// Code generated by https://github.com/gocomply/xsd2go; DO NOT EDIT.
// Models for http://example.com/schemas
package ak

import (
	"encoding/xml"
)

// Element
type Aaa struct {
	XMLName xml.Name `xml:"AAA"`

	Ccc string `xml:",any"`
}

// XSD ComplexType declarations

type Bbb struct {
	XMLName xml.Name

	Ccc string `xml:",any"`
}

// XSD SimpleType declarations

While I expect:

// Code generated by https://github.com/gocomply/xsd2go; DO NOT EDIT.
// Models for http://example.com/schemas
package ak

import (
	"encoding/xml"
)

// Element
type Aaa Bbb

// XSD ComplexType declarations

type Bbb struct {
	XMLName xml.Name

	Ccc string `xml:",any"`
}

// XSD SimpleType declarations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions