Skip to content

Go structs for the MESA International standards B2MML and BatchML. Ported from the C# B2MML.NET Library

License

Notifications You must be signed in to change notification settings

factrylabs/go-b2mml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-b2mml

A Go package contains structs for all the types defined in the MESA International standards B2MML and BatchML schemas. It is a port of the C# B2MML.NET package.

Example usage

package main

import (
	"encoding/xml"
	"fmt"
	"io/ioutil"

	b2mml "github.com/factrylabs/go-b2mml"
)

func main() {
	data, _ := ioutil.ReadFile("/path/to/materiallot.xml")
	ml := b2mml.MaterialLotType{}
	_ := xml.Unmarshal(data, &ml)
	fmt.Printf("Resulting B2MML struct:\n%+v\n", ml)
}

FAQ

Why not generate directly from the B2MML schema? For a project we had to unmarshal some B2MML messages to Go structs. There is no mature xsd code generator for Go (yet, according to our experience), and it seemed much easier to simply "translate" the C# code generated by the Microsoft (R) Xml Schemas/DataTypes support utility (xsd.exe) than to write an xsd generator ourselves.

Contributing

Feel free to open an issue or a to submit a pull request...

Credits

Thanks to jpdillingham for creating the C# version.

About

Go structs for the MESA International standards B2MML and BatchML. Ported from the C# B2MML.NET Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages