Create a Struct Golang from a XSD



I want to create a Struct Golang from a XSD(Structure XSD).


I've read the post generate Go structs from XSD which recommend using go-xsd, but I have downloaded go-xsd and installed xsd-makepkg and I can not generate my struct.


What I am doing?


xsd-makepkg -basepath="/Users/XSD_Access/" -goinst=false


-xsd-makepkg: it is the binary create from apart go-xsd-pkg

-basepath: Content the route where I have Structure XSD that I want to transform to Struct. -goinst : I do not have installed go-buildrun and I think it is no neccesary , for that reason is ser false


What is the result of the command ?


A folder($GOPATH/usr/Users/XSD_Access/) that conteints other folders with all followers XML wrappers



  • docbook.org

  • docs.oasis-open.org

  • kbcafe.com

  • khronos.org

  • schemas.opengis.net

  • thearchitect.co.uk

  • Users

  • www.w3.org


Structure XSD



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://ift.tt/tphNwY" elementFormDefault="qualified">
<xs:element name="Request" type="Request"/>
<xs:complexType name="Request">
<xs:annotation>
<xs:documentation xml:lang="sp"><![CDATA[
Comment xxxxx
]]></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="idOne" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation xml:lang="sp"><![CDATA[Comment xxxxx
]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="idTwo" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation xml:lang="sp"><![CDATA[Comment xxxxxx
]]></xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>


Someone can tell me what I am doing wrong or what step I had missed that it does not let me creating a Struct from my Structure XSD?


Thanks in Advance


No comments:

Post a Comment