An open API service indexing awesome lists of open source software.

https://github.com/factrylabs/go-b2mml

Go structs for the MESA International standards B2MML and BatchML. Ported from the C# B2MML.NET Library
https://github.com/factrylabs/go-b2mml

b2mml b2mml-batchml go industry-40 isa-95 manufacturing mesa

Last synced: 5 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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](https://github.com/jpdillingham/B2MML.NET) package.

# Example usage

```go
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](https://github.com/jpdillingham) for creating the C# version.