Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

How to use this tool to generate go structs from xsd files #29

Open
RahulMetangale opened this issue May 30, 2017 · 1 comment
Open

Comments

@RahulMetangale
Copy link

Hello,

I am new to golang and i am not clear on how to setup this command line tool. Can you point me in right direction, i am using windows OS. I need help with following:

  1. Setup this project
  2. Use this to convert xsd files to go classes

Thanks,
Rahul

@emicklei
Copy link

i decided not to use the tool but the package directly

package main

import (
	"log"

	xsd "github.com/metaleap/go-xsd"
)

func main() {
	var (
		sd  *xsd.Schema
		err error
	)
	xsd.PkgGen.BaseCodePath = "/Users/myuser/go/src/myorganisation.com/myprogram"
	if sd, err = xsd.LoadSchema("my.xsd", true); err != nil {
		log.Fatal(err)
	}
	sd.MakeGoPkgSrcFile()
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants