You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<schemaxmlns="http://www.w3.org/2001/XMLSchema"targetNamespace="http://example.com/myschema"xmlns:xs="http://example.com/myschema"elementFormDefault="qualified">
<complexTypename="SomeComplexType">
<sequence>
<!-- First element appears with no issues -->
<elementname="FirstElement"type="int" />
<elementname="ElementWithSimpleType">
<simpleType>
<restrictionbase="string" />
</simpleType>
</element>
<!-- After the first SimpleType in ComplexType, the elements don't appear properly in the final struct -->
<elementname="OtherElementWithSimpleType">
<simpleType>
<restrictionbase="string" />
</simpleType>
</element>
<!-- Even the elements without SimpleType don't appear properly -->
<elementname="ElementWithoutSimpleType"type="int" />
</sequence>
</complexType>
</schema>
Might be related to #63 and #80. They use the simpleType in their XSD in the problematic chunk of code.
Steps to reproduce the issue:
Copy the above XSD to a blank file (minimal.xsd)
Run xgen -l Go -i minimal.xsd
Describe the results you received:
// Code generated by xgen. DO NOT EDIT.package schema
// SomeComplexType ...typeSomeComplexTypestruct {
FirstElementint`xml:"FirstElement"`ElementWithSimpleType*ElementWithSimpleType`xml:"ElementWithSimpleType"`
}
// ElementWithSimpleType ...typeElementWithSimpleType*ElementWithSimpleType// String ...typeStringstring// OtherElementWithSimpleType ...typeOtherElementWithSimpleType*OtherElementWithSimpleType// ElementWithoutSimpleType ...typeElementWithoutSimpleTypeint
Describe the results you expected:
// Code generated by xgen. DO NOT EDIT.package schema
// SomeComplexType ...typeSomeComplexTypestruct {
FirstElementint`xml:"FirstElement"`ElementWithSimpleTypestring`xml:"ElementWithSimpleType"`OtherElementWithSimpleTypestring`xml:"OtherElementWithSimpleType"`ElementWithoutSimpleTypeint`xml:"ElementWithoutSimpleType"`
}
Output of go version:
go version go1.24.0 linux/amd64
xgen version or commit ID:
xgen version: 0.1.0
The text was updated successfully, but these errors were encountered:
Description
Basically the title.
I've created the minimal XSD to get the issue:
Might be related to #63 and #80. They use the simpleType in their XSD in the problematic chunk of code.
Steps to reproduce the issue:
xgen -l Go -i minimal.xsd
Describe the results you received:
Describe the results you expected:
Output of
go version
:xgen version or commit ID:
The text was updated successfully, but these errors were encountered: